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

List:       kde-bugs-dist
Subject:    Bug#10450: main imagemap for www.nytimes.com is screwed up
From:       Dirk Mueller <mueller () kde ! org>
Date:       2000-09-13 20:30:45
[Download RAW message or body]

On Mit, 13 Sep 2000, Kurt Granroth wrote:

> This is a tricky one. 

not really. ;-)

> Comments on how to proceed?

I suggest the following patch. If you would review && test it please :)


Dirk

["patch.tolength" (text/plain)]

Index: dom_stringimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_stringimpl.cpp,v
retrieving revision 1.22
diff -u -2 -d -p -b -r1.22 dom_stringimpl.cpp
--- dom_stringimpl.cpp	2000/08/18 09:35:57	1.22
+++ dom_stringimpl.cpp	2000/09/13 20:30:38
@@ -209,9 +209,12 @@ QList<Length> *DOMStringImpl::toLengthLi
     int pos = 0;
     int pos2;
-    str.replace(QRegExp(" "),"");
+    QChar space(' ');
+    for(int i = 0; i < l; i++)
+        if(str[i].latin1() == ',') str[i] = space;
+    str.simplifyWhiteSpace();
 
     QList<Length> *list = new QList<Length>;
     list->setAutoDelete(true);
-    while((pos2 = str.find(',', pos)) != -1)
+    while((pos2 = str.find(' ', pos)) != -1)
     {
         Length *l = new Length(parseLength((QChar *) str.unicode()+pos, pos2-pos));


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

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