r22109 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 15 20:40:10 UTC 2017


Author: jghali
Date: Sat Jul 15 20:40:10 2017
New Revision: 22109

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22109
Log:
#14914: Document Setup>Item Tools>Columns and Text Distances not saved

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

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22109&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 Jul 15 20:40:10 2017
@@ -2201,6 +2201,9 @@
 
 void Scribus150Format::readToolSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
 {
+	PrefsManager* prefsManager = PrefsManager::instance();
+	const ItemToolPrefs& defToolPrefs = prefsManager->appPrefs.itemToolPrefs;
+
 	QString textFont = attrs.valueAsString("DFONT");
 	m_AvailableFonts->findFont(textFont, doc);
 
@@ -2208,6 +2211,12 @@
 	doc->itemToolPrefs().textSize = qRound(attrs.valueAsDouble("DSIZE", 12.0) * 10);
 	doc->itemToolPrefs().textColumns   = attrs.valueAsInt("DCOL", 1);
 	doc->itemToolPrefs().textColumnGap    = attrs.valueAsDouble("DGAP", 0.0);
+
+	const MarginStruct& defDistances = defToolPrefs.textDistances;
+	doc->itemToolPrefs().textDistances.setLeft(attrs.valueAsDouble("TextDistLeft", defDistances.left()));
+	doc->itemToolPrefs().textDistances.setRight(attrs.valueAsDouble("TextDistRight", defDistances.right()));
+	doc->itemToolPrefs().textDistances.setBottom(attrs.valueAsDouble("TextDistBottom", defDistances.bottom()));
+	doc->itemToolPrefs().textDistances.setTop(attrs.valueAsDouble("TextDistTop", defDistances.top()));
 
 	doc->itemToolPrefs().polyCorners      = attrs.valueAsInt("POLYC", 4);
 	doc->itemToolPrefs().polyFactor = attrs.valueAsDouble("POLYF", 0.5);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22109&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 Jul 15 20:40:10 2017
@@ -230,18 +230,22 @@
 	docu.writeAttribute("BOOK"        , m_Doc->pagePositioning());
 	if (m_Doc->usesAutomaticTextFrames())
 		docu.writeAttribute("AUTOTEXT", 1);
-	docu.writeAttribute("AUTOSPALTEN" ,m_Doc->PageSp);
-	docu.writeAttribute("ABSTSPALTEN" ,m_Doc->PageSpa);
+	docu.writeAttribute("AUTOSPALTEN" , m_Doc->PageSp);
+	docu.writeAttribute("ABSTSPALTEN" , m_Doc->PageSpa);
 	docu.writeAttribute("UNITS"       , m_Doc->unitIndex());
-	docu.writeAttribute("DFONT"       ,m_Doc->itemToolPrefs().textFont);
-	docu.writeAttribute("DSIZE"       ,m_Doc->itemToolPrefs().textSize / 10.0);
-	docu.writeAttribute("DCOL"        ,m_Doc->itemToolPrefs().textColumns);
-	docu.writeAttribute("DGAP"        ,m_Doc->itemToolPrefs().textColumnGap);
-	docu.writeAttribute("TabFill"     ,m_Doc->itemToolPrefs().textTabFillChar);
-	docu.writeAttribute("TabWidth"    ,m_Doc->itemToolPrefs().textTabWidth);
-	docu.writeAttribute("AUTHOR"      ,m_Doc->documentInfo().author());
-	docu.writeAttribute("COMMENTS"    ,m_Doc->documentInfo().comments());
-	docu.writeAttribute("KEYWORDS"    ,m_Doc->documentInfo().keywords());
+	docu.writeAttribute("DFONT"       , m_Doc->itemToolPrefs().textFont);
+	docu.writeAttribute("DSIZE"       , m_Doc->itemToolPrefs().textSize / 10.0);
+	docu.writeAttribute("DCOL"        , m_Doc->itemToolPrefs().textColumns);
+	docu.writeAttribute("DGAP"        , m_Doc->itemToolPrefs().textColumnGap);
+	docu.writeAttribute("TabFill"     , m_Doc->itemToolPrefs().textTabFillChar);
+	docu.writeAttribute("TabWidth"    , m_Doc->itemToolPrefs().textTabWidth);
+	docu.writeAttribute("TextDistLeft", m_Doc->itemToolPrefs().textDistances.left());
+	docu.writeAttribute("TextDistRight", m_Doc->itemToolPrefs().textDistances.right());
+	docu.writeAttribute("TextDistBottom", m_Doc->itemToolPrefs().textDistances.bottom());
+	docu.writeAttribute("TextDistTop" , m_Doc->itemToolPrefs().textDistances.top());
+	docu.writeAttribute("AUTHOR"      , m_Doc->documentInfo().author());
+	docu.writeAttribute("COMMENTS"    , m_Doc->documentInfo().comments());
+	docu.writeAttribute("KEYWORDS"    , m_Doc->documentInfo().keywords());
 	docu.writeAttribute("PUBLISHER",m_Doc->documentInfo().publisher());
 	docu.writeAttribute("DOCDATE",m_Doc->documentInfo().date());
 	docu.writeAttribute("DOCTYPE",m_Doc->documentInfo().type());




More information about the scribus-commit mailing list