From kde-commits Tue Feb 28 23:35:23 2006 From: Sandro Giessl Date: Tue, 28 Feb 2006 23:35:23 +0000 To: kde-commits Subject: branches/work/kde4/playground/artwork/cokoon/lib Message-Id: <1141169723.570448.27946.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=114119260709369 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;