r16531 by jghali - #9884: Character styles not working

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 27 19:21:31 CEST 2011


Author: jghali
Date: Sun Mar 27 17:21:31 2011
New Revision: 16531

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16531
Log:
#9884: Character styles not working

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16531&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sun Mar 27 17:21:31 2011
@@ -320,16 +320,17 @@
 		}
 		if (tagName == "STYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			readParagraphStyle(m_Doc, reader, vg);
 			StyleSet<ParagraphStyle>tmp;
 			tmp.create(vg);
 			m_Doc->redefineStyles(tmp, false);
 		}
 		if (tagName == "CHARSTYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			CharStyle cstyle;
+			readNamedCharacterStyleAttrs(m_Doc, reader.scAttributes(), cstyle);
 			StyleSet<CharStyle> temp;
-			temp.create(vg.charStyle());
+			temp.create(cstyle);
 			m_Doc->redefineCharStyles(temp, false);
 		}
 		if (tagName == "JAVA")
@@ -1225,7 +1226,7 @@
 	readCharacterStyleAttrs(doc, attrs, newStyle);
 }
 
-void Scribus134Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle, SCFonts &fonts)
+void Scribus134Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle)
 {
 	ScXmlStreamAttributes attrs = reader.scAttributes();
 
@@ -1873,7 +1874,7 @@
 			newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::PARSEP);
 			ParagraphStyle newStyle;
 			PrefsManager* prefsManager = PrefsManager::instance();
-			readParagraphStyle(doc, reader, newStyle, prefsManager->appPrefs.fontPrefs.AvailFonts);
+			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length()-1, newStyle);
 			newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, lastStyle->Style);
 		}
@@ -1881,7 +1882,7 @@
 		{
 			ParagraphStyle newStyle;
 			PrefsManager* prefsManager = PrefsManager::instance();
-			readParagraphStyle(doc, reader, newStyle, prefsManager->appPrefs.fontPrefs.AvailFonts);
+			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length(), newStyle);
 		}
 		else if (tName == "tab")
@@ -3367,7 +3368,7 @@
 	QString tmpf, tmV;
 	const StyleSet<ParagraphStyle> * docParagraphStyles = tempStyles? tempStyles : & doc->paragraphStyles();
 	PrefsManager* prefsManager = PrefsManager::instance();
-	readParagraphStyle(doc, reader, style, prefsManager->appPrefs.fontPrefs.AvailFonts);
+	readParagraphStyle(doc, reader, style);
 	for (int xx=0; xx<docParagraphStyles->count(); ++xx)
 	{
 		if (style.name() == (*docParagraphStyles)[xx].name())

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16531&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h Sun Mar 27 17:21:31 2011
@@ -104,7 +104,7 @@
 		bool readPage(ScribusDoc* doc, ScXmlStreamReader& reader);
 		bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader);
 		bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader);
-		void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle, SCFonts &fonts);
+		void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle);
 		bool readPattern(ScribusDoc* doc, ScXmlStreamReader& reader, const QString& baseDir);
 		bool readPDFOptions(ScribusDoc* doc, ScXmlStreamReader& reader);
 		bool readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16531&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Mar 27 17:21:31 2011
@@ -266,14 +266,14 @@
 		}
 		if (tagName == "STYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			readParagraphStyle(m_Doc, reader, vg);
 			StyleSet<ParagraphStyle>tmp;
 			tmp.create(vg);
 			m_Doc->redefineStyles(tmp, false);
 		}
 		if (tagName == "CHARSTYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			readParagraphStyle(m_Doc, reader, vg);
 			StyleSet<CharStyle> temp;
 			temp.create(vg.charStyle());
 			m_Doc->redefineCharStyles(temp, false);
@@ -1071,16 +1071,17 @@
 		}
 		if (tagName == "STYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			readParagraphStyle(m_Doc, reader, vg);
 			StyleSet<ParagraphStyle>tmp;
 			tmp.create(vg);
 			m_Doc->redefineStyles(tmp, false);
 		}
 		if (tagName == "CHARSTYLE")
 		{
-			readParagraphStyle(m_Doc, reader, vg, *m_AvailableFonts);
+			CharStyle cstyle;
+			readNamedCharacterStyleAttrs(m_Doc, reader.scAttributes(), cstyle);
 			StyleSet<CharStyle> temp;
-			temp.create(vg.charStyle());
+			temp.create(cstyle);
 			m_Doc->redefineCharStyles(temp, false);
 		}
 		if (tagName == "JAVA")
@@ -2014,7 +2015,7 @@
 	readCharacterStyleAttrs(doc, attrs, newStyle);
 }
 
-void Scribus150Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle, SCFonts &fonts)
+void Scribus150Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle)
 {
 	ScXmlStreamAttributes attrs = reader.scAttributes();
 
@@ -2696,7 +2697,7 @@
 			newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::PARSEP);
 			ParagraphStyle newStyle;
 			PrefsManager* prefsManager = PrefsManager::instance();
-			readParagraphStyle(doc, reader, newStyle, prefsManager->appPrefs.fontPrefs.AvailFonts);
+			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length()-1, newStyle);
 			newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, lastStyle->Style);
 		}
@@ -2704,7 +2705,7 @@
 		{
 			ParagraphStyle newStyle;
 			PrefsManager* prefsManager = PrefsManager::instance();
-			readParagraphStyle(doc, reader, newStyle, prefsManager->appPrefs.fontPrefs.AvailFonts);
+			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length(), newStyle);
 		}
 		else if (tName == "tab")
@@ -4391,7 +4392,7 @@
 	QString tmpf, tmV;
 	const StyleSet<ParagraphStyle> * docParagraphStyles = tempStyles? tempStyles : & doc->paragraphStyles();
 	PrefsManager* prefsManager = PrefsManager::instance();
-	readParagraphStyle(doc, reader, style, prefsManager->appPrefs.fontPrefs.AvailFonts);
+	readParagraphStyle(doc, reader, style);
 	for (int xx=0; xx<docParagraphStyles->count(); ++xx)
 	{
 		if (style.name() == (*docParagraphStyles)[xx].name())

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16531&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h Sun Mar 27 17:21:31 2011
@@ -112,7 +112,7 @@
 		bool readPage(ScribusDoc* doc, ScXmlStreamReader& reader);
 		bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader);
 		bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader);
-		void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle, SCFonts &fonts);
+		void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle);
 		bool readPattern(ScribusDoc* doc, ScXmlStreamReader& reader, const QString& baseDir);
 		bool readPDFOptions(ScribusDoc* doc, ScXmlStreamReader& reader);
 		bool readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader);




More information about the scribus-commit mailing list