[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml/rendering
From:       Maks Orlovich <maksim () kde ! org>
Date:       2010-04-04 22:02:31
Message-ID: 20100404220231.22E34AC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1111135 by orlovich:

Better whitespace handling in <option> display. Not perfect, but better. (And I want \
to fix an another bug in the neighborhood)


 M  +14 -5     render_form.cpp  


--- trunk/KDE/kdelibs/khtml/rendering/render_form.cpp #1111134:1111135
@@ -1712,6 +1712,8 @@
                 if (text.isNull())
                     text = "";
 
+                text = text.implementation()->collapseWhiteSpace(false, false);
+
                 if(m_useListBox) {
                     QListWidgetItem *item = new \
QListWidgetItem(QString(text.implementation()->s, text.implementation()->l));  \
static_cast<KListWidget*>(m_widget) @@ -1731,14 +1733,21 @@
             }
             else if (listItems[listIndex]->id() == ID_OPTION) {
                 HTMLOptionElementImpl* optElem = \
                static_cast<HTMLOptionElementImpl*>(listItems[listIndex]);
-                QString text = optElem->text().string();
-                if (optElem->parentNode()->id() == ID_OPTGROUP)
-                {
+                
+                DOMString domText = optElem->text();
+                QString   text;
+                
+                if (optElem->parentNode()->id() == ID_OPTGROUP) {
                     // Prefer label if set
                     DOMString label = optElem->getAttribute(ATTR_LABEL);
                     if (!label.isEmpty())
-                        text = label.string();
-                    text = QLatin1String("    ")+text;
+                        domText = label.string();
+                    domText = domText.implementation()->collapseWhiteSpace(false, \
false); +                        
+                    text = QLatin1String("    ") + domText.string();
+                } else {
+                    domText = domText.implementation()->collapseWhiteSpace(false, \
false); +                    text = domText.string();
                 }
 
                 if(m_useListBox) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic