r18868 by fschmid - ODG-Importer: fixed incorrect reading of formatted text.

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 3 20:08:03 UTC 2014


Author: fschmid
Date: Mon Mar  3 20:08:02 2014
New Revision: 18868

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18868
Log:
ODG-Importer: fixed incorrect reading of formatted text.

Modified:
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18868&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp Mon Mar  3 20:08:02 2014
@@ -20,6 +20,8 @@
 #include <QRegExp>
 #include <QStack>
 #include <QUrl>
+#include <QXmlInputSource>
+#include <QXmlSimpleReader>
 #include <QDebug>
 
 #if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
@@ -384,10 +386,14 @@
 	QDomDocument designMapDom;
 	if (!uz->read(designMap, f))
 		return false;
+	QXmlInputSource xmlSource;
+	xmlSource.setData(f);
+	QXmlSimpleReader xmlReader;
+	xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
 	QString errorMsg = "";
 	int errorLine = 0;
 	int errorColumn = 0;
-	if (!designMapDom.setContent(f, &errorMsg, &errorLine, &errorColumn))
+	if (!designMapDom.setContent(&xmlSource, &xmlReader, &errorMsg, &errorLine, &errorColumn))
 	{
 		qDebug() << "Error loading File" << errorMsg << "at Line" << errorLine << "Column" << errorColumn;
 		return false;
@@ -475,10 +481,14 @@
 	QDomDocument designMapDom;
 	if (!uz->read(designMap, f))
 		return false;
+	QXmlInputSource xmlSource;
+	xmlSource.setData(f);
+	QXmlSimpleReader xmlReader;
+	xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
 	QString errorMsg = "";
 	int errorLine = 0;
 	int errorColumn = 0;
-	if (!designMapDom.setContent(f, &errorMsg, &errorLine, &errorColumn))
+	if (!designMapDom.setContent(&xmlSource, &xmlReader, &errorMsg, &errorLine, &errorColumn))
 	{
 		qDebug() << "Error loading File" << errorMsg << "at Line" << errorLine << "Column" << errorColumn;
 		return false;




More information about the scribus-commit mailing list