Bug 74511 - The attribute tree view get's very large when it encounters a long tag
Summary: The attribute tree view get's very large when it encounters a long tag
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-07 20:16 UTC by dpavlotzky
Modified: 2004-02-07 21:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dpavlotzky 2004-02-07 20:16:39 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
Compiler:          gcc 3.2.3 
OS:          Linux

test case:

but this in your document:

<a href="weweweojwefojweojfojwjliwjeflnwlefnilinwelfnlwihfilwhefliwhefliwliebflwiebflib"></a>

then place your cursor right behind the a and press delete, so you get:

<ahref="weweweojwefojweojfojwjliwjeflnwlefnilinwelfnlwihfilwhefliwhefliwliebflwiebflib"></a>

the attribute tree tries to display the above behind "Current tag" which makes it very large
Comment 1 dpavlotzky 2004-02-07 20:17:28 UTC
s/but/put/
Comment 2 András Manţia 2004-02-07 21:17:30 UTC
Subject: kdewebdev/quanta

CVS commit by amantia: 

Strip the attribute name if it's too long, so the attribute tree does not grow. Fixes #74511. 
 
CCMAIL: 74511-done@bugs.kde.org 


  M +1 -0      ChangeLog   1.212
  M +9 -1      treeviews/tagattributetree.cpp   1.37


--- kdewebdev/quanta/ChangeLog  #1.211:1.212
@@ -12,4 +12,5 @@
         - fix crash when clicking on an item of the structure tree which point to an included file
         - always enable the Open and Open Project buttons
+        - don't let the attribute tree to grow if 
         - various parsing fixes        
         - report bugs for "quanta" module, not for "quanta_be"        

--- kdewebdev/quanta/treeviews/tagattributetree.cpp  #1.36:1.37
@@ -26,4 +26,5 @@
 #include <klocale.h>
 #include <kpushbutton.h>
+#include <kstringhandler.h>
 #include <kdebug.h>
 #include <kiconloader.h>
@@ -577,5 +578,12 @@ void EnhancedTagAttributeTree::showCapti
     if(curNode->tag->type == Tag::XmlTag || curNode->tag->type == Tag::XmlTagEnd ||
       curNode->tag->type == Tag::ScriptTag)
-      nodeName->setText(i18n("Current Tag : <b>%1</b>").arg(curNode->tag->name));
+#if KDE_IS_VERSION(3,1,90)      
+    {
+      QString s = i18n("Current Tag : <b>%1</b>").arg(curNode->tag->name);
+      nodeName->setText(KStringHandler::rPixelSqueeze(s, nodeName->fontMetrics(), attrTree->width()- 50));
+    }
+#else
+      nodeName->setText(i18n("Current Tag : <b>%1</b>").arg(KStringHandler::rsqueeze(curNode->tag->name, 30)));
+#endif      
     else if(curNode->tag->type == Tag::Text)
       nodeName->setText(i18n("Current Tag : <b>text</b>"));