r14654 by jghali - #8779 : imported styles are incorrect

scribus-commit scribus-commit at lists.scribus.net
Sun Feb 7 13:00:39 CET 2010


Revision: 14654
Author: jghali
Date: 2010-02-07T11:56:37.812278Z
Commit message: #8779 : imported styles are incorrect

Changeset: 
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp

Diffs:
Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14653)
+++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14654)
@@ -1715,7 +1715,7 @@
 */
 bool Scribus12Format::readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles)
 {
-	ParagraphStyle vg;
+	ParagraphStyle pstyle;
 	QDomDocument docu("scridoc");
 	QString tmpf, tmf;
 // 	DoFonts.clear();
@@ -1736,7 +1736,10 @@
 		{
 			QDomElement pg=PAGE.toElement();
 			if(pg.tagName()=="STYLE")
-				GetStyle(&pg, &vg, &docParagraphStyles, doc, false);
+			{
+				pstyle.erase();
+				GetStyle(&pg, &pstyle, &docParagraphStyles, doc, false);
+			}
 			PAGE=PAGE.nextSibling();
 		}
 		DOC=DOC.nextSibling();
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14653)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14654)
@@ -3102,9 +3102,8 @@
 
 bool Scribus13Format::readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles)
 {
-	ParagraphStyle vg;
+	ParagraphStyle pstyle;
 	QDomDocument docu("scridoc");
-	QString tmpf, tmf;
 	QString f (readSLA(fileName));
 	if (f.isEmpty())
 		return false;
@@ -3122,7 +3121,10 @@
 		{
 			QDomElement pg=PAGE.toElement();
 			if(pg.tagName()=="STYLE")
-				GetStyle(&pg, &vg, &docParagraphStyles, doc, false);
+			{
+				pstyle.erase();
+				GetStyle(&pg, &pstyle, &docParagraphStyles, doc, false);
+			}
 			PAGE=PAGE.nextSibling();
 		}
 		DOC=DOC.nextSibling();
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14653)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14654)
@@ -3355,8 +3355,7 @@
 
 bool Scribus150Format::readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles)
 {
-	ParagraphStyle vg;
-	QString tmpf;
+	ParagraphStyle pstyle;
 	QString f (readSLA(fileName));
 	if (f.isEmpty())
 		return false;
@@ -3384,7 +3383,8 @@
 		}
 		if (tagName == "STYLE")
 		{
-			getStyle(vg, reader, &docParagraphStyles, doc, false);
+			pstyle.erase();
+			getStyle(pstyle, reader, &docParagraphStyles, doc, false);
 		}
 	}
 	return success;
@@ -3419,6 +3419,7 @@
 		}
 		if (tagName == "CHARSTYLE")
 		{
+			cstyle.erase();
 			readCharacterStyleAttrs(doc, attrs, cstyle);
 			docCharStyles.create(cstyle);
 		}
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14653)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14654)
@@ -3335,8 +3335,7 @@
 
 bool Scribus134Format::readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles)
 {
-	ParagraphStyle vg;
-	QString tmpf;
+	ParagraphStyle pstyle;
 	QString f (readSLA(fileName));
 	if (f.isEmpty())
 		return false;
@@ -3364,7 +3363,8 @@
 		}
 		if (tagName == "STYLE")
 		{
-			getStyle(vg, reader, &docParagraphStyles, doc, false);
+			pstyle.erase();
+			getStyle(pstyle, reader, &docParagraphStyles, doc, false);
 		}
 	}
 	return success;
@@ -3399,6 +3399,7 @@
 		}
 		if (tagName == "CHARSTYLE")
 		{
+			cstyle.erase();
 			readCharacterStyleAttrs(doc, attrs, cstyle);
 			docCharStyles.create(cstyle);
 		}




More information about the scribus-commit mailing list