r19448 by fschmid - Added some more known extensions for PageMaker documents.

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 26 08:57:33 UTC 2014


Author: fschmid
Date: Tue Aug 26 08:57:33 2014
New Revision: 19448

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19448
Log:
Added some more known extensions for PageMaker documents.

Modified:
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
    trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp
    trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19448&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 Tue Aug 26 08:57:33 2014
@@ -368,17 +368,34 @@
 		if (!uz->open(fn))
 		{
 			delete uz;
-			if (progressDialog)
-				progressDialog->close();
-			return false;
-		}
-		retVal = false;
-		if (uz->contains("styles.xml"))
-			retVal = parseStyleSheets("styles.xml");
-		if (uz->contains("content.xml"))
-			retVal = parseDocReference("content.xml");
-		uz->close();
-		delete uz;
+			QByteArray f;
+			loadRawText(fn, f);
+			QDomDocument designMapDom;
+			QString errorMsg = "";
+			int errorLine = 0;
+			int errorColumn = 0;
+			if (designMapDom.setContent(f, &errorMsg, &errorLine, &errorColumn))
+			{
+				retVal = parseDocReferenceXML(designMapDom);
+			}
+			else
+			{
+				qDebug() << "Error loading File" << errorMsg << "at Line" << errorLine << "Column" << errorColumn;
+				if (progressDialog)
+					progressDialog->close();
+				return false;
+			}
+		}
+		else
+		{
+			retVal = false;
+			if (uz->contains("styles.xml"))
+				retVal = parseStyleSheets("styles.xml");
+			if (uz->contains("content.xml"))
+				retVal = parseDocReference("content.xml");
+			uz->close();
+			delete uz;
+		}
 	}
 	if (progressDialog)
 		progressDialog->close();
@@ -2568,11 +2585,26 @@
 		if (actStyle.shadowY.valid)
 			tmpOStyle.shadowY = parseUnit(actStyle.shadowY.value);
 		if (actStyle.shadowTrans.valid)
-			tmpOStyle.shadowTrans = 1.0 - parseUnit(actStyle.shadowTrans.value);
+		{
+			double transVal = parseUnit(actStyle.shadowTrans.value);
+			if (transVal > 1.0)
+				transVal /= 100.0;
+			tmpOStyle.shadowTrans = 1.0 - transVal;
+		}
 		if (actStyle.fillOpacity.valid)
-			tmpOStyle.fillOpacity = 1.0 - parseUnit(actStyle.fillOpacity.value);
+		{
+			double transVal = parseUnit(actStyle.fillOpacity.value);
+			if (transVal > 1.0)
+				transVal /= 100.0;
+			tmpOStyle.fillOpacity = 1.0 - transVal;
+		}
 		if (actStyle.strokeOpacity.valid)
-			tmpOStyle.strokeOpacity = 1.0 - parseUnit(actStyle.strokeOpacity.value);
+		{
+			double transVal = parseUnit(actStyle.strokeOpacity.value);
+			if (transVal > 1.0)
+				transVal /= 100.0;
+			tmpOStyle.strokeOpacity = 1.0 - transVal;
+		}
 		if (actStyle.LineW.valid)
 			tmpOStyle.LineW = parseUnit(actStyle.LineW.value);
 		if (actStyle.fontName.valid)

Modified: trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19448&path=/trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp Tue Aug 26 08:57:33 2014
@@ -53,7 +53,7 @@
 	importAction->setText( tr("Import Pagemaker..."));
 	FileFormat* fmt = getFormatByExt("pmd");
 	fmt->trName = tr("Pagemaker");
-	fmt->filter = tr("Pagemaker (*.pmd *.PMD)");
+	fmt->filter = tr("Pagemaker (*.pmd *.PMD *.pm5 *.PM5 *.p65 *.P65)");
 }
 
 ImportPmPlugin::~ImportPmPlugin()
@@ -88,9 +88,9 @@
 {
 	FileFormat fmt(this);
 	fmt.trName = tr("Pagemaker");
-	fmt.filter = tr("Pagemaker (*.pmd *.PMD)");
+	fmt.filter = tr("Pagemaker (*.pmd *.PMD *.pm5 *.PM5 *.p65 *.P65)");
 	fmt.formatId = 0;
-	fmt.fileExtensions = QStringList() << "pmd";
+	fmt.fileExtensions = QStringList() << "pmd" << "pm5" << "p65";
 	fmt.load = true;
 	fmt.save = false;
 	fmt.thumb = true;
@@ -120,7 +120,7 @@
 		flags |= lfInteractive;
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("importpm");
 		QString wdir = prefs->get("wdir", ".");
-		CustomFDialog diaf(ScCore->primaryMainWindow(), wdir, QObject::tr("Open"), tr("All Supported Formats")+" (*.pmd *.PMD);;All Files (*)");
+		CustomFDialog diaf(ScCore->primaryMainWindow(), wdir, QObject::tr("Open"), tr("All Supported Formats")+" (*.pmd *.PMD *.pm5 *.PM5 *.p65 *.P65);;All Files (*)");
 		if (diaf.exec())
 		{
 			fileName = diaf.selectedFile();

Modified: trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19448&path=/trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp Tue Aug 26 08:57:33 2014
@@ -296,6 +296,25 @@
 {
 	if (!doProcessing)
 		return;
+	CurrColorFill = "Black";
+	CurrFillShade = 100.0;
+	CurrColorStroke = "Black";
+	CurrStrokeShade = 100.0;
+	CurrStrokeTrans = 0.0;
+	CurrFillTrans = 0.0;
+	Coords.resize(0);
+	Coords.svgInit();
+	LineW = 1.0;
+	lineJoin = Qt::MiterJoin;
+	lineEnd = Qt::FlatCap;
+	fillrule = true;
+	gradientAngle = 0.0;
+	isGradient = false;
+	lineSpSet = false;
+	currentGradient = VGradient(VGradient::linear);
+	currentGradient.clearStops();
+	currentGradient.setRepeatMethod( VGradient::none );
+	dashArray.clear();
 	m_style.clear();
 	m_style = propList;
 	isGradient = false;
@@ -476,7 +495,8 @@
 		return;
 	if (propList["svg:x"] && propList["svg:y"] && propList["svg:width"] && propList["svg:height"])
 	{
-		setStyle(propList);
+		if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+			setStyle(propList);
 		double x = valueAsPoint(propList["svg:x"]);
 		double y = valueAsPoint(propList["svg:y"]);
 		double w = valueAsPoint(propList["svg:width"]);
@@ -496,7 +516,8 @@
 		return;
 	if (propList["svg:x"] && propList["svg:y"] && propList["svg:width"] && propList["svg:height"])
 	{
-		setStyle(propList);
+		if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+			setStyle(propList);
 		double x = valueAsPoint(propList["svg:x"]);
 		double y = valueAsPoint(propList["svg:y"]);
 		double w = valueAsPoint(propList["svg:width"]);
@@ -517,7 +538,8 @@
 	librevenge::RVNGPropertyListVector vertices = *propList.child("svg:points");
 	if(vertices.count() < 2)
 		return;
-	setStyle(propList);
+	if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+		setStyle(propList);
 	Coords.resize(0);
 	Coords.svgInit();
 	PageItem *ite;
@@ -543,7 +565,8 @@
 	librevenge::RVNGPropertyListVector vertices = *propList.child("svg:points");
 	if(vertices.count() < 2)
 		return;
-	setStyle(propList);
+	if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+		setStyle(propList);
 	Coords.resize(0);
 	Coords.svgInit();
 	PageItem *ite;
@@ -673,7 +696,8 @@
 {
 	if (!doProcessing)
 		return;
-	setStyle(propList);
+	if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+		setStyle(propList);
 	librevenge::RVNGPropertyListVector path = *propList.child("svg:d");
 	bool isClosed = false;
 	QString svgString = "";
@@ -832,7 +856,8 @@
 		return;
 	if (!propList["office:binary-data"])
 		return;
-	setStyle(propList);
+	if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+		setStyle(propList);
 	if (propList["svg:x"] && propList["svg:y"] && propList["svg:width"] && propList["svg:height"])
 	{
 		PageItem *ite;
@@ -951,7 +976,8 @@
 	actTextItem = NULL;
 	lineSpSet = false;
 	lineSpIsPT = false;
-	setStyle(propList);
+	if ((fileType == "pmd") || (fileType == "pm5") || (fileType == "p65"))
+		setStyle(propList);
 	if (propList["svg:x"] && propList["svg:y"] && propList["svg:width"] && propList["svg:height"])
 	{
 		double x = valueAsPoint(propList["svg:x"]);




More information about the scribus-commit mailing list