File kdegraphics3-correct-svg-namespace.patch of Package kdegraphics3

diff -Naru kdegraphics-3.5.10_orig/ksvg/core/KSVGReader.cc kdegraphics-3.5.10/ksvg/core/KSVGReader.cc
--- kdegraphics-3.5.10_orig/ksvg/core/KSVGReader.cc	2005-10-10 23:56:46.000000000 +0900
+++ kdegraphics-3.5.10/ksvg/core/KSVGReader.cc	2024-10-31 14:28:36.916361310 +0900
@@ -278,7 +278,14 @@
 			return false;
 		}
 
-		DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI, qName);
+		QString namespaceURI_fixed;
+		if (namespaceURI.length() > 0) {
+			namespaceURI_fixed = namespaceURI;
+		} else {
+			// fill SVG namespace URI if null
+			namespaceURI_fixed = "http://www.w3.org/2000/svg";
+		}
+		DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI_fixed, qName);
 		newElement = SVGDocumentImpl::createElement(qName, impl, Helper::self()->doc());
 
 		// m_currentNode == 0 if we are dynamically extending the dom (parsexml...)
openSUSE Build Service is sponsored by