r15785 by fschmid - Fixed Bug #9406: "Options in render frames aren't saved during copy/paste or close/reopen operations"

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 6 10:57:10 CET 2010


Author: fschmid
Date: Sat Nov  6 09:57:10 2010
New Revision: 15785

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15785
Log:
Fixed Bug #9406: "Options in render frames aren't saved during copy/paste or close/reopen operations"

Modified:
    trunk/Scribus/scribus/pageitem_desaxe.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp

Modified: trunk/Scribus/scribus/pageitem_desaxe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15785&path=/trunk/Scribus/scribus/pageitem_desaxe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_desaxe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_desaxe.cpp Sat Nov  6 09:57:10 2010
@@ -1006,6 +1006,26 @@
 struct  LatexParams : public MakeAction<LatexParams_body> 
 {};
 
+class LatexParamsExtra_body : public Action_body
+{
+	void begin (const Xml_string& tagName, Xml_attr attr)
+	{
+		if (tagName=="property")
+		{
+			if (this->dig->top<PageItem>()->realItemType() == PageItem::LatexFrame)
+			{
+				PageItem_LatexFrame* obj = dynamic_cast<PageItem_LatexFrame *> (this->dig->top<PageItem>());
+				QString name  = attr["name"];
+				QString value = attr["value"];
+				obj->editorProperties[name] = value;
+			}
+		}
+	}
+};
+
+class LatexParamsExtra : public MakeAction<LatexParamsExtra_body>
+{};
+
 
 #ifdef HAVE_OSG
 class OSGParams_body : public Action_body
@@ -1182,6 +1202,10 @@
 	ruleset.addRule(itemPrefix, SetAttribute<PageItem,QString>( & PageItem::setFileIconRollover, "icon-rollover-file" ));
 	ruleset.addRule("latex-source", LatexSource());
 	ruleset.addRule(itemPrefix, LatexParams());
+	LatexParamsExtra laExtra;
+	Xml_string latexPrefixMG(Digester::concat(itemPrefix, "latex-source"));
+	ruleset.addRule(latexPrefixMG, laExtra);
+	ruleset.addRule(Digester::concat(latexPrefixMG, "property"), laExtra);
 #ifdef HAVE_OSG
 	ruleset.addRule(itemPrefix, OSGParams());
 	OSGViews osgViewset;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15785&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 Sat Nov  6 09:57:10 2010
@@ -3005,7 +3005,7 @@
 			break;
 		if (reader.isCharacters())
 			formula += reader.text().toString();
-		if (reader.isStartDocument() && reader.name() == "PROPERTY")
+		if (reader.isStartElement() && reader.name() == "PROPERTY")
 		{
 			ScXmlStreamAttributes tAtt = reader.scAttributes();
 			QString name  = tAtt.valueAsString("name");

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15785&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sat Nov  6 09:57:10 2010
@@ -1744,12 +1744,12 @@
 	docu.writeAttribute("TransBlend", item->fillBlendmode());
 	docu.writeAttribute("TransBlendS", item->lineBlendmode());
 	docu.writeAttribute("isTableItem", static_cast<int>(item->isTableItem));
-	docu.writeAttribute("TopLine", static_cast<int>(item->TopLine));
-	docu.writeAttribute("LeftLine", static_cast<int>(item->LeftLine));
-	docu.writeAttribute("RightLine", static_cast<int>(item->RightLine));
-	docu.writeAttribute("BottomLine", static_cast<int>(item->BottomLine));
 	if (item->isTableItem)
 	{
+		docu.writeAttribute("TopLine", static_cast<int>(item->TopLine));
+		docu.writeAttribute("LeftLine", static_cast<int>(item->LeftLine));
+		docu.writeAttribute("RightLine", static_cast<int>(item->RightLine));
+		docu.writeAttribute("BottomLine", static_cast<int>(item->BottomLine));
 		if (item->TopLink != 0)
 			docu.writeAttribute("TopLINK", item->TopLink->ItemNr);
 		else
@@ -1805,8 +1805,11 @@
 	docu.writeAttribute("GROUPS", glp);
 	if ( ! item->itemText.defaultStyle().charStyle().isInhLanguage())
 		docu.writeAttribute("LANGUAGE", item->itemText.defaultStyle().charStyle().language());
-	docu.writeAttribute("startArrowIndex", item->startArrowIndex());
-	docu.writeAttribute("endArrowIndex", item->endArrowIndex());
-	docu.writeAttribute("startArrowScale", item->startArrowScale());
-	docu.writeAttribute("endArrowScale", item->endArrowScale());
-}
+	if (item->asLine() || item->asPolyLine())
+	{
+		docu.writeAttribute("startArrowIndex", item->startArrowIndex());
+		docu.writeAttribute("endArrowIndex", item->endArrowIndex());
+		docu.writeAttribute("startArrowScale", item->startArrowScale());
+		docu.writeAttribute("endArrowScale", item->endArrowScale());
+	}
+}




More information about the scribus-commit mailing list