r17223 by jghali - #9621: Changing automatic linespacing setting in prefs does not work

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 22 18:55:01 UTC 2012


Author: jghali
Date: Sun Jan 22 18:55:01 2012
New Revision: 17223

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17223
Log:
#9621: Changing automatic linespacing setting in prefs does not work

Added:
    trunk/Scribus/scribus/scdomelement.cpp
    trunk/Scribus/scribus/scdomelement.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/gtaction.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/sampleitem.cpp
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scxmlstreamreader.cpp
    trunk/Scribus/scribus/scxmlstreamreader.h
    trunk/Scribus/scribus/styles/paragraphstyle.cpp
    trunk/Scribus/scribus/ui/prefs_typographybase.ui
    trunk/Scribus/win32/vc9/scribus-main/Scribus.vcproj

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sun Jan 22 18:55:01 2012
@@ -588,6 +588,7 @@
   sccolorshade.cpp
   scdocoutput.cpp
   scdocoutput_ps2.cpp
+  scdomelement.cpp
   scfonts.cpp
   scgtplugin.cpp
   scgzfile.cpp

Modified: trunk/Scribus/scribus/gtaction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/gtaction.cpp
==============================================================================
--- trunk/Scribus/scribus/gtaction.cpp (original)
+++ trunk/Scribus/scribus/gtaction.cpp Sun Jan 22 18:55:01 2012
@@ -616,7 +616,7 @@
 
 double gtAction::getLineSpacing(int fontSize)
 {
-	return ((fontSize / 10.0) * static_cast<double>(textFrame->doc()->typographicPrefs().autoLineSpacing) / 100) + (fontSize / 10.0);
+	return ((fontSize / 10.0) * (static_cast<double>(textFrame->doc()->typographicPrefs().autoLineSpacing) / 100));
 }
 
 double gtAction::getFrameWidth()

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sun Jan 22 18:55:01 2012
@@ -1131,7 +1131,10 @@
 static double calculateLineSpacing (const ParagraphStyle &style, PageItem *item)
 {
 	if (style.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
-		return style.charStyle().font().height(style.charStyle().fontSize() / 10.0);
+	{
+		double autoLS = static_cast<double>(item->doc()->typographicPrefs().autoLineSpacing) / 100.0;
+		return (style.charStyle().font().height(style.charStyle().fontSize() / 10.0) * autoLS);
+	}
 	if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
 		return item->doc()->guidesPrefs().valueBaselineGrid;
 	return style.lineSpacing();
@@ -1346,6 +1349,9 @@
 		
 		current.nextColumn();
 		lastLineY = extra.Top;
+
+		//automatic line spacing factor (calculated once)
+		double autoLS = static_cast<double>(m_Doc->typographicPrefs().autoLineSpacing) / 100.0;
 
 		// find start of first line
 		if (firstInFrame() < itemText.length())
@@ -2313,7 +2319,7 @@
 						// go back to last break position
 						style = itemText.paragraphStyle(a);
 						if (style.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
-							style.setLineSpacing(charStyle.font().height(hlcsize10));
+							style.setLineSpacing(charStyle.font().height(hlcsize10) * autoLS);
 						else if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
 							style.setLineSpacing(m_Doc->guidesPrefs().valueBaselineGrid);
 						

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Sun Jan 22 18:55:01 2012
@@ -836,7 +836,8 @@
 		m_Doc->typographicPrefs().valueSmallCaps = dc.attribute("VKAPIT").toInt();
 		m_Doc->guidesPrefs().valueBaselineGrid = ScCLocale::toDoubleC(dc.attribute("BASEGRID"), 12.0);
 		m_Doc->guidesPrefs().offsetBaselineGrid = ScCLocale::toDoubleC(dc.attribute("BASEO"), 0.0);
-		m_Doc->typographicPrefs().autoLineSpacing = dc.attribute("AUTOL", "20").toInt();
+		// #9621 : autolinespacing is now express as a percentage of the font height
+		m_Doc->typographicPrefs().autoLineSpacing = 100 /*dc.attribute("AUTOL", "20").toInt()*/;
 		m_Doc->GroupCounter = 1 /*dc.attribute("GROUPC", "1").toInt()*/;
 		//m_Doc->HasCMS = static_cast<bool>(dc.attribute("HCMS", "0").toInt());
 		m_Doc->cmsSettings().SoftProofOn = static_cast<bool>(dc.attribute("DPSo", "0").toInt());

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&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 Jan 22 18:55:01 2012
@@ -1029,7 +1029,9 @@
 	doc->typographicPrefs().valueSmallCaps     = attrs.valueAsInt("VKAPIT");
 	doc->guidesPrefs().valueBaselineGrid      = attrs.valueAsDouble("BASEGRID", 12.0);
 	doc->guidesPrefs().offsetBaselineGrid     = attrs.valueAsDouble("BASEO", 0.0);
-	doc->typographicPrefs().autoLineSpacing    = attrs.valueAsInt("AUTOL", 20);
+	// #9621 : autolinespacing is now express as a percentage of the font height
+	// It was not working in regualer text frame in 1.3.4+, so set it to the default value
+	doc->typographicPrefs().autoLineSpacing    = 100 /*attrs.valueAsInt("AUTOL", 20)*/;
 	doc->typographicPrefs().valueUnderlinePos  = attrs.valueAsInt("UnderlinePos", -1);
 	doc->typographicPrefs().valueUnderlineWidth  = attrs.valueAsInt("UnderlineWidth", -1);
 	doc->typographicPrefs().valueStrikeThruPos   = attrs.valueAsInt("StrikeThruPos", -1);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sun Jan 22 18:55:01 2012
@@ -296,7 +296,9 @@
 		m_Doc->typographicPrefs().valueSmallCaps = dc.attribute("VKAPIT").toInt();
 		m_Doc->guidesPrefs().valueBaselineGrid  = ScCLocale::toDoubleC(dc.attribute("BASEGRID"), 12.0);
 		m_Doc->guidesPrefs().offsetBaselineGrid = ScCLocale::toDoubleC(dc.attribute("BASEO"), 0.0);
-		m_Doc->typographicPrefs().autoLineSpacing = dc.attribute("AUTOL", "20").toInt();
+		// #9621 : autolinespacing is now express as a percentage of the font height
+		// It was not working in regualer text frame in 1.3.x, so set it to the default value
+		m_Doc->typographicPrefs().autoLineSpacing = 100 /*dc.attribute("AUTOL", "20").toInt()*/;
 		m_Doc->typographicPrefs().valueUnderlinePos = dc.attribute("UnderlinePos", "-1").toInt();
 		m_Doc->typographicPrefs().valueUnderlineWidth = dc.attribute("UnderlineWidth", "-1").toInt();
 		m_Doc->typographicPrefs().valueStrikeThruPos = dc.attribute("StrikeThruPos", "-1").toInt();

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&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 Jan 22 18:55:01 2012
@@ -2085,7 +2085,8 @@
 	doc->typographicPrefs().valueSmallCaps     = attrs.valueAsInt("VKAPIT");
 	doc->guidesPrefs().valueBaselineGrid      = attrs.valueAsDouble("BASEGRID", 12.0);
 	doc->guidesPrefs().offsetBaselineGrid     = attrs.valueAsDouble("BASEO", 0.0);
-	doc->typographicPrefs().autoLineSpacing    = attrs.valueAsInt("AUTOL", 20);
+	// #9621 : autolinespacing is now expressed as a percentage of the font height
+	doc->typographicPrefs().autoLineSpacing    = attrs.valueAsInt("AUTOL", 100, 500, 100);
 	doc->typographicPrefs().valueUnderlinePos  = attrs.valueAsInt("UnderlinePos", -1);
 	doc->typographicPrefs().valueUnderlineWidth  = attrs.valueAsInt("UnderlineWidth", -1);
 	doc->typographicPrefs().valueStrikeThruPos   = attrs.valueAsInt("StrikeThruPos", -1);

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sun Jan 22 18:55:01 2012
@@ -37,24 +37,26 @@
 #include "commonstrings.h"
 #include "filewatcher.h"
 #include "latexhelpers.h"
-#include "ui/missing.h"
-#include "ui/prefs_keyboardshortcuts.h"
 #include "pagesize.h"
 #include "pagestructs.h"
 #include "pdfoptions.h"
 #include "prefsfile.h"
 #include "scclocale.h"
 #include "sccolorengine.h"
+#include "scdomelement.h"
 #include "scfonts.h"
-#include "ui/scmessagebox.h"
 #include "scpaths.h"
 #include "scribuscore.h"
 #include "scribusstructs.h"
 #include "sctextstream.h"
-#include "ui/modetoolbar.h"
 #include "util_color.h"
 #include "util_file.h"
 #include "util_ghostscript.h"
+
+#include "ui/missing.h"
+#include "ui/modetoolbar.h"
+#include "ui/prefs_keyboardshortcuts.h"
+#include "ui/scmessagebox.h"
 
 extern bool emergencyActivated;
 
@@ -189,7 +191,7 @@
 	appPrefs.typoPrefs.valueSubScript = 33;
 	appPrefs.typoPrefs.scalingSubScript = 66;
 	appPrefs.typoPrefs.valueSmallCaps = 75;
-	appPrefs.typoPrefs.autoLineSpacing = 20;
+	appPrefs.typoPrefs.autoLineSpacing = 100;
 	appPrefs.typoPrefs.valueUnderlinePos = -1;
 	appPrefs.typoPrefs.valueUnderlineWidth = -1;
 	appPrefs.typoPrefs.valueStrikeThruPos = -1;
@@ -1861,7 +1863,7 @@
 		return false;
 	}
 	f.close();
-	QDomElement elem=docu.documentElement();
+	ScDomElement elem = docu.documentElement();
 	if (elem.tagName() != "SCRIBUSRC")
 		return false;
 	//Ignore scribus*.rc files prior to 1.5.0 due to changes
@@ -1886,7 +1888,7 @@
 		appPrefs.verifierPrefs.checkerPrefsList.clear();
 	while(!DOC.isNull())
 	{
-		QDomElement dc=DOC.toElement();
+		ScDomElement dc = DOC.toElement();
 
 		if (dc.tagName()=="UI")
 		{
@@ -2036,7 +2038,7 @@
 			appPrefs.typoPrefs.valueSubScript = dc.attribute("SubScriptDistance").toInt();
 			appPrefs.typoPrefs.scalingSubScript = dc.attribute("SubScriptScaling").toInt();
 			appPrefs.typoPrefs.valueSmallCaps  = dc.attribute("SmallCapsScaling").toInt();
-			appPrefs.typoPrefs.autoLineSpacing = dc.attribute("AutomaticLineSpacing", "20").toInt();
+			appPrefs.typoPrefs.autoLineSpacing = dc.valueAsInt("AutomaticLineSpacing", 100, 500, 100);
 			double ulp = ScCLocale::toDoubleC(dc.attribute("UnderlineDistance"), -1.0);
 			if (ulp != -1)
 				appPrefs.typoPrefs.valueUnderlinePos = qRound(ulp * 10);
@@ -2202,7 +2204,7 @@
 			while(!scrp.isNull())
 			{
 				QDomElement scrpElem = scrp.toElement();
-				if (scrpElem.tagName()=="Recent")
+				if (scrpElem.tagName() == "Recent")
 				{
 					QString nam = scrpElem.attribute("Name");
 					QFileInfo fd(nam);

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sun Jan 22 18:55:01 2012
@@ -11,17 +11,20 @@
 #include "scconfig.h"
 #endif
 
+#include <cstring>
+
 #include <QColor>
 #include <QString>
 #include <QList>
 #include <QSet>
 #include <QHash>
+
+#include "documentinformation.h"
 #include "pagestructs.h"
 #include "pdfoptions.h"
 #include "scfonts.h"
 #include "scpattern.h"
 #include "vgradient.h"
-#include "documentinformation.h"
 
 struct CheckerPrefs
 {
@@ -69,6 +72,15 @@
 	int valueUnderlineWidth; //! Underline width
 	int valueStrikeThruPos; //! Strike-through displacement
 	int valueStrikeThruWidth; //! Strike-through line width
+
+	inline bool operator==(const TypoPrefs &other)
+	{
+		return (memcmp(this, &other, sizeof(TypoPrefs)) == 0);
+	}
+	inline bool operator!=(const TypoPrefs &other)
+	{
+		return (memcmp(this, &other, sizeof(TypoPrefs)) != 0);
+	}
 };
 
 struct WindowPrefs

Modified: trunk/Scribus/scribus/sampleitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/sampleitem.cpp
==============================================================================
--- trunk/Scribus/scribus/sampleitem.cpp (original)
+++ trunk/Scribus/scribus/sampleitem.cpp Sun Jan 22 18:55:01 2012
@@ -36,9 +36,7 @@
 	bgShade = 100;
 	tmpStyle.setName("(preview temporary)");
 	tmpStyle.setLineSpacingMode(ParagraphStyle::FixedLineSpacing);
-	tmpStyle.setLineSpacing((m_Doc->itemToolPrefs().textSize / 10.0)
-		* static_cast<double>(m_Doc->typographicPrefs().autoLineSpacing) / 100
-		+ (m_Doc->itemToolPrefs().textSize / 10.0));
+	tmpStyle.setLineSpacing((m_Doc->itemToolPrefs().textSize / 10.0) * (static_cast<double>(m_Doc->typographicPrefs().autoLineSpacing) / 100));
 	tmpStyle.setAlignment(ParagraphStyle::Leftaligned);
 	tmpStyle.setLeftMargin(0);
 	tmpStyle.setFirstIndent(0);
@@ -162,7 +160,7 @@
 {
 	tmpStyle.charStyle().setFontSize(fontSize);
 	if (autoLineSpa)
-		tmpStyle.setLineSpacing(((fontSize / 10)  * (m_Doc->typographicPrefs().autoLineSpacing / 100) + (fontSize / 10)));
+		tmpStyle.setLineSpacing((fontSize / 10)  * (m_Doc->typographicPrefs().autoLineSpacing / 100.0));
 }
 
 /*void SampleItem::setTabValues(QValueList<PageItem::TabRecord> tabValues)

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Sun Jan 22 18:55:01 2012
@@ -1234,6 +1234,10 @@
 			painter->scale(1, -1);
 		}
 		uint tabCc = 0;
+
+		//automatic line spacing factor (calculated once)
+		double autoLS = static_cast<double>(m_doc->typographicPrefs().autoLineSpacing) / 100.0;
+
 		for (uint ll=0; ll < item->itemText.lines(); ++ll)
 		{
 			LineSpec ls = item->itemText.line(ll);
@@ -1261,15 +1265,12 @@
 					const ParagraphStyle& style(item->itemText.paragraphStyle(a));
 					if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
 						chs = qRound(10 * ((m_doc->guidesPrefs().valueBaselineGrid * (style.dropCapLines()-1) + (charStyle.font().ascent(style.charStyle().fontSize() / 10.0))) / charStyle.font().realCharHeight(chstr[0], 10)));
+					else if (style.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
+						chs = qRound(10 * ((style.lineSpacing() * (style.dropCapLines()-1)+(charStyle.font().ascent(style.charStyle().fontSize() / 10.0))) / charStyle.font().realCharHeight(chstr[0], 10)));
 					else
 					{
-						if (style.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
-							chs = qRound(10 * ((style.lineSpacing() * (style.dropCapLines()-1)+(charStyle.font().ascent(style.charStyle().fontSize() / 10.0))) / charStyle.font().realCharHeight(chstr[0], 10)));
-						else
-						{
-							double currasce = charStyle.font().height(style.charStyle().fontSize() / 10.0);
-							chs = qRound(10 * ((currasce * (style.dropCapLines()-1)+(charStyle.font().ascent(style.charStyle().fontSize() / 10.0))) / charStyle.font().realCharHeight(chstr[0], 10)));
-						}
+						double currasce = charStyle.font().height(style.charStyle().fontSize() / 10.0) * autoLS;
+						chs = qRound(10 * ((currasce * (style.dropCapLines() - 1)+(charStyle.font().ascent(style.charStyle().fontSize() / 10.0))) / charStyle.font().realCharHeight(chstr[0], 10)));
 					}
 				}
 				if (chstr[0] == SpecialChars::TAB)

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Jan 22 18:55:01 2012
@@ -7673,7 +7673,6 @@
 		prefsDialog.getResizeDocumentPages(resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins);
 		doc->setNewPrefs(newDocPrefs, oldDocPrefs, resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins);
 
-
 		slotChangeUnit(doc->unitIndex(), false);
 		//dia->updateDocumentSettings();
 		if (oldDocPrefs.itemToolPrefs.imageLowResType!=newDocPrefs.itemToolPrefs.imageLowResType)
@@ -7689,6 +7688,10 @@
 			view->previewQualitySwitcher->blockSignals(true);
 			view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
 			view->previewQualitySwitcher->blockSignals(false);
+		}
+		if (oldDocPrefs.typoPrefs != newDocPrefs.typoPrefs)
+		{
+			doc->invalidateAll();
 		}
 		emit UpdateRequest(reqDocFontListUpdate);
 		scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Jan 22 18:55:01 2012
@@ -7836,11 +7836,11 @@
 	{
 		ParagraphStyle storyStyle;
 		storyStyle.charStyle().setFontSize(size);
-		if (storyStyle.lineSpacingMode() == 0)
-		{
-			storyStyle.setLineSpacing(((size / 10.0) * static_cast<double>(docPrefsData.typoPrefs.autoLineSpacing) / 100) + (size / 10.0));
-		}
-		else if (storyStyle.lineSpacingMode() == 1)
+		if (storyStyle.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
+		{
+			storyStyle.setLineSpacing((size / 10.0) * (static_cast<double>(docPrefsData.typoPrefs.autoLineSpacing) / 100));
+		}
+		else if (storyStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
 		{
 			storyStyle.setLineSpacing(storyStyle.charStyle().font().height(size));
 		}
@@ -13066,7 +13066,7 @@
 //			bb->setFontSize(qMax(qRound(bb->fontSize()*((scx+scy)/2)), 1));
 			if ((bb->itemText.length() != 0) && (!bb->isTableItem))
 			{
-//				bb->setLineSpacing(((bb->fontSize() / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100) + (bb->fontSize() / 10.0));
+//				bb->setLineSpacing(((bb->fontSize() / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100));
 				for (aa = 0; aa < bb->itemText.length(); ++aa)
 					bb->itemText.item(aa)->setFontSize(qMax(qRound(bb->itemText.item(aa)->fontSize()*((scx+scy)/2)), 1));
 				if (bb->asPathText())

Modified: trunk/Scribus/scribus/scxmlstreamreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/scxmlstreamreader.cpp
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.cpp (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.cpp Sun Jan 22 18:55:01 2012
@@ -78,6 +78,18 @@
 			retValue = intVal;
 	}
 	return retValue;
+}
+
+int ScXmlStreamAttributes::valueAsInt (const char* attrName, int min, int max, int def) const
+{
+	int value = valueAsInt(attrName, def);
+	return qMin(max, qMax(value, min));
+}
+
+int ScXmlStreamAttributes::valueAsInt (const QString& attrName, int min, int max, int def) const
+{
+	int value = valueAsInt(attrName, def);
+	return qMin(max, qMax(value, min));
 }
 
 uint ScXmlStreamAttributes::valueAsUInt  (const char*    attrName, uint def) const

Modified: trunk/Scribus/scribus/scxmlstreamreader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/scxmlstreamreader.h
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.h (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.h Sun Jan 22 18:55:01 2012
@@ -23,6 +23,8 @@
 	bool    valueAsBool   (const QString& attrName, bool def = false) const;
 	int     valueAsInt    (const char*    attrName, int def = 0) const;
 	int     valueAsInt    (const QString& attrName, int def = 0) const;
+	int     valueAsInt    (const char*    attrName, int min, int max, int def = 0) const;
+	int     valueAsInt    (const QString& attrName, int min, int max, int def = 0) const;
 	uint    valueAsUInt   (const char*    attrName, uint def = 0) const;
 	uint    valueAsUInt   (const QString& attrName, uint def = 0) const;
 	double  valueAsDouble (const char*    attrName, double def = 0.0) const;

Modified: trunk/Scribus/scribus/styles/paragraphstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/styles/paragraphstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/paragraphstyle.cpp (original)
+++ trunk/Scribus/scribus/styles/paragraphstyle.cpp Sun Jan 22 18:55:01 2012
@@ -98,7 +98,7 @@
 	switch (that.lineSpacingMode())
 	{
 		case 0: 
-			that.setLineSpacing(((that.charStyle().fontSize() / 10.0) * static_cast<qreal>(typographicSettings.autoLineSpacing) / 100) + (size / 10.0));
+			that.setLineSpacing(((that.charStyle().fontSize() / 10.0) * static_cast<qreal>(typographicSettings.autoLineSpacing) / 100));
 			break;
 		case 1:
 			that.setLineSpacing(that.charStyle().font().height(size));

Modified: trunk/Scribus/scribus/ui/prefs_typographybase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/scribus/ui/prefs_typographybase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_typographybase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_typographybase.ui Sun Jan 22 18:55:01 2012
@@ -515,8 +515,11 @@
            <property name="suffix">
             <string> %</string>
            </property>
-           <property name="maximum">
+           <property name="minimum">
             <number>100</number>
+           </property>
+           <property name="maximum">
+            <number>500</number>
            </property>
           </widget>
          </item>

Modified: trunk/Scribus/win32/vc9/scribus-main/Scribus.vcproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17223&path=/trunk/Scribus/win32/vc9/scribus-main/Scribus.vcproj
==============================================================================
--- trunk/Scribus/win32/vc9/scribus-main/Scribus.vcproj (original)
+++ trunk/Scribus/win32/vc9/scribus-main/Scribus.vcproj Sun Jan 22 18:55:01 2012
@@ -1547,6 +1547,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\scdomelement.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\fonts\scface.cpp"
 				>
 			</File>
@@ -6424,6 +6428,10 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\scdomelement.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\fonts\scface.h"
 				>
 			</File>




More information about the scribus-commit mailing list