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

List:       kde-commits
Subject:    branches/work/kde4/playground/artwork/cokoon/lib
From:       Sandro Giessl <sgiessl () gmail ! com>
Date:       2006-02-28 23:35:23
Message-ID: 1141169723.570448.27946.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 514666 by giessl:

fix style attribute replacement: parameter values can also end with " instead of ; \
when they are at the end of the parameter list

 M  +12 -2     tilesource.cpp  


--- branches/work/kde4/playground/artwork/cokoon/lib/tilesource.cpp #514665:514666
@@ -173,8 +173,18 @@
                 while (!endReplacement && i < max && m_svgData.at(i)!='>') {
                     if (m_svgData.at(i) == s.at(0) &&
                         m_svgData.mid(i, s.length()) == s ) {
-                        int attrValStart = m_svgData.indexOf(":", i) + 1;
-                        int attrValEnd = m_svgData.indexOf(";", attrValStart);
+                        const int attrValStart = m_svgData.indexOf(":", i) + 1;
+                        const int end1 = m_svgData.indexOf(";", attrValStart);
+                        const int end2 = m_svgData.indexOf("\"", attrValStart);
+                        int attrValEnd;
+                        if (end1 != -1 && end2 != -1) {
+                            attrValEnd = qMin(end1, end2);
+                        } else if (end1 != -1) {
+                            attrValEnd = end1;
+                        } else {
+                            attrValEnd = end2;
+                        }
+                        qDebug() << "start:" << attrValStart << " end:" << \
attrValEnd;  if (attrValStart != -1 && attrValEnd != -1) {
                             int l = attrValEnd-attrValStart;
 //                             qDebug() << "replace" << (attrValStart) << (l) << \
m_svgData.mid(attrValStart, l) << "width" << newValString;


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

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