r18315 by jghali - #11587: incorrect measurement unit in guide prefs

scribus-commit scribus-commit at lists.scribus.net
Thu Jun 13 21:58:15 UTC 2013


Author: jghali
Date: Thu Jun 13 21:58:15 2013
New Revision: 18315

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18315
Log:
#11587: incorrect measurement unit in guide prefs

Modified:
    branches/Version14x/Scribus/scribus/prefs.cpp
    branches/Version14x/Scribus/scribus/reformdoc.cpp
    branches/Version14x/Scribus/scribus/tabguides.cpp
    branches/Version14x/Scribus/scribus/tabguides.h
    branches/Version14x/Scribus/scribus/tabpdfoptions.cpp
    branches/Version14x/Scribus/scribus/tabpdfoptions.h
    branches/Version14x/Scribus/scribus/tabprinter.cpp
    branches/Version14x/Scribus/scribus/tabprinter.h

Modified: branches/Version14x/Scribus/scribus/prefs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/prefs.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/prefs.cpp (original)
+++ branches/Version14x/Scribus/scribus/prefs.cpp Thu Jun 13 21:58:15 2013
@@ -305,11 +305,11 @@
 	double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
 	
 	tabDocument->unitChange();
-	tabGuides->unitChange(suffix, docUnitIndex, invUnitConversion);
+	tabGuides->unitChange(docUnitIndex);
 	tabView->unitChange(docUnitIndex);
 	tabTools->unitChange(docUnitIndex);
-	tabPDF->unitChange(suffix, docUnitIndex, invUnitConversion);
-	tabPrinter->unitChange(suffix, docUnitIndex, invUnitConversion);
+	tabPDF->unitChange(docUnitIndex);
+	tabPrinter->unitChange(docUnitIndex);
 }
 
 

Modified: branches/Version14x/Scribus/scribus/reformdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/reformdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/reformdoc.cpp (original)
+++ branches/Version14x/Scribus/scribus/reformdoc.cpp Thu Jun 13 21:58:15 2013
@@ -172,10 +172,10 @@
 	QString suffix = unitGetSuffixFromIndex(docUnitIndex);
 	double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
 	tabPage->unitChange();
-	tabGuides->unitChange(suffix, docUnitIndex, invUnitConversion);
+	tabGuides->unitChange(docUnitIndex);
 	tabView->unitChange(docUnitIndex);
 	tabTools->unitChange(docUnitIndex);
-	tabPDF->unitChange(suffix, docUnitIndex, invUnitConversion);
+	tabPDF->unitChange(docUnitIndex);
 }
 
 void ReformDoc::setDS(int layout)

Modified: branches/Version14x/Scribus/scribus/tabguides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabguides.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/tabguides.cpp (original)
+++ branches/Version14x/Scribus/scribus/tabguides.cpp Thu Jun 13 21:58:15 2013
@@ -346,17 +346,8 @@
 	}
 }
 
-void TabGuides::unitChange(QString unit, int docUnitIndex, double invUnitConversion)
-{
-	double oldMin, oldMax, val;
-	int decimalsOld;
-	int decimal = unitGetPrecisionFromIndex(docUnitIndex);
-
-	minorSpace->setSuffix(unit);
-	majorSpace->setSuffix(unit);
-	
-	minorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
-	minorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimal, val * invUnitConversion);
-	majorSpace->getValues(&oldMin, &oldMax, &decimalsOld, &val);
-	majorSpace->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimal, val * invUnitConversion);
-}
+void TabGuides::unitChange(int docUnitIndex)
+{
+	minorSpace->setNewUnit(docUnitIndex);
+	majorSpace->setNewUnit(docUnitIndex);
+}

Modified: branches/Version14x/Scribus/scribus/tabguides.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabguides.h
==============================================================================
--- branches/Version14x/Scribus/scribus/tabguides.h (original)
+++ branches/Version14x/Scribus/scribus/tabguides.h Thu Jun 13 21:58:15 2013
@@ -30,7 +30,7 @@
 	TabGuides( QWidget* parent, struct guidesPrefs *prefsData, struct typoPrefs *prefsData2, int unitIndex);
 	~TabGuides() {};
 	void restoreDefaults(struct guidesPrefs *prefsData, struct typoPrefs *prefsData2, int unitIndex);
-	void unitChange(QString unit, int docUnitIndex, double invUnitConversion);
+	void unitChange(int docUnitIndex);
 
 	ScrSpinBox* majorSpace;
 	ScrSpinBox* minorSpace;

Modified: branches/Version14x/Scribus/scribus/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabpdfoptions.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/tabpdfoptions.cpp (original)
+++ branches/Version14x/Scribus/scribus/tabpdfoptions.cpp Thu Jun 13 21:58:15 2013
@@ -2331,7 +2331,7 @@
 	}
 }
 
-void TabPDFOptions::unitChange(QString unit, int docUnitIndex, double invUnitConversion)
+void TabPDFOptions::unitChange(int docUnitIndex)
 {
 	BleedBottom->setNewUnit(docUnitIndex);
 	BleedTop->setNewUnit(docUnitIndex);

Modified: branches/Version14x/Scribus/scribus/tabpdfoptions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabpdfoptions.h
==============================================================================
--- branches/Version14x/Scribus/scribus/tabpdfoptions.h (original)
+++ branches/Version14x/Scribus/scribus/tabpdfoptions.h Thu Jun 13 21:58:15 2013
@@ -60,7 +60,7 @@
 	// Specifically to update doc settings from doc prefs
 	void updateDocumentSettings(ScribusDoc *doc);
 
-	void unitChange(QString unit, int docUnitIndex, double invUnitConversion);
+	void unitChange(int docUnitIndex);
 
 	// GUI member pointers
 	// Remember to initialize these in the initializer list of the ctor when

Modified: branches/Version14x/Scribus/scribus/tabprinter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabprinter.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/tabprinter.cpp (original)
+++ branches/Version14x/Scribus/scribus/tabprinter.cpp Thu Jun 13 21:58:15 2013
@@ -169,11 +169,11 @@
 	}
 }
 
-void TabPrinter::unitChange(QString unit, int docUnitIx, double invUnitConversion)
+void TabPrinter::unitChange(int docUnitIndex)
 {
-	bleedTop->setNewUnit(docUnitIx);
-	bleedBottom->setNewUnit(docUnitIx);
-	bleedLeft->setNewUnit(docUnitIx);
-	bleedRight->setNewUnit(docUnitIx);
-	offsetValue->setNewUnit(docUnitIx);
+	bleedTop->setNewUnit(docUnitIndex);
+	bleedBottom->setNewUnit(docUnitIndex);
+	bleedLeft->setNewUnit(docUnitIndex);
+	bleedRight->setNewUnit(docUnitIndex);
+	offsetValue->setNewUnit(docUnitIndex);
 }

Modified: branches/Version14x/Scribus/scribus/tabprinter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18315&path=/branches/Version14x/Scribus/scribus/tabprinter.h
==============================================================================
--- branches/Version14x/Scribus/scribus/tabprinter.h (original)
+++ branches/Version14x/Scribus/scribus/tabprinter.h Thu Jun 13 21:58:15 2013
@@ -21,7 +21,7 @@
 	~TabPrinter() {};
 	void restoreDefaults(struct ApplicationPrefs *prefsData);
 	void storeValues();
-	void unitChange(QString unit, int docUnitIx, double invUnitConversion);
+	void unitChange(int docUnitIndex);
 private:
 	int docUnitIndex;
 	double unitRatio;




More information about the scribus-commit mailing list