r15306 by jghali - #9230 : changing baseline grid settings in doc prefs does not update the text alignement

scribus-commit scribus-commit at lists.scribus.net
Sun Jul 4 23:31:11 CEST 2010


Revision: 15306
Author: jghali
Date: 2010-07-04T21:27:48.074608Z
Commit message: #9230 : changing baseline grid settings in doc prefs does not update the text alignement

Changeset: 
M  /branches/Version135/Scribus/scribus/reformdoc.cpp
M  /branches/Version135/Scribus/scribus/scribusdoc.cpp
M  /branches/Version135/Scribus/scribus/scribusdoc.h

Diffs:
Index: scribus/reformdoc.cpp
===================================================================
--- scribus/reformdoc.cpp	(revision 15305)
+++ scribus/reformdoc.cpp	(revision 15306)
@@ -222,6 +222,9 @@
 {
 	MarginStruct updatedMargins(tabPage->marginGroup->margins());
 	int fp = tabPage->choosenLayout;
+	double oldBaseGridValue  = currDoc->typographicSettings.valueBaseGrid;
+	double oldBaseGridOffset = currDoc->typographicSettings.offsetBaseGrid;
+
 	currDoc->pageSets[fp].FirstPage = tabPage->docLayout->firstPage->currentIndex();
 //	currDoc->pageSets[fp].GapHorizontal = tabView->gapHorizontal->value() / currDoc->unitRatio();
 	currDoc->GapVertical = tabView->gapVertical->value() / currDoc->unitRatio();
@@ -643,6 +646,12 @@
 		if (currDoc->Items->at(b)->itemType() == PageItem::ImageFrame)
 			currDoc->Items->at(b)->setImageShown(currDoc->guidesSettings.showPic);
 	}
+
+	if (oldBaseGridValue  != currDoc->typographicSettings.valueBaseGrid ||
+		oldBaseGridOffset != currDoc->typographicSettings.offsetBaseGrid )
+	{
+		currDoc->invalidateAll();
+	}
 }
 
 void ReformDoc::applyChangesButton_clicked()
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 15305)
+++ scribus/scribusdoc.cpp	(revision 15306)
@@ -9009,6 +9009,21 @@
 	}
 }
 
+void ScribusDoc::invalidateAll()
+{
+	for (int c = 0; c < DocItems.count(); ++c)
+	{
+		PageItem *ite = DocItems.at(c);
+		ite->invalidateLayout();
+	}
+	for (int c=0; c < MasterItems.count(); ++c)
+	{
+		PageItem *ite = MasterItems.at(c);
+		ite->invalidateLayout();
+	}
+	// for now hope that frameitems get invalidated by their parents layout() method.
+}
+
 void ScribusDoc::invalidateLayer(int layerID)
 {
 	for (int c = 0; c < DocItems.count(); ++c)
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 15305)
+++ scribus/scribusdoc.h	(revision 15306)
@@ -144,6 +144,7 @@
 	MassObservable<Page*>     * pagesChanged() { return &m_pagesChanged; }
 	MassObservable<QRectF>    * regionsChanged() { return &m_regionsChanged; }
 	
+	void invalidateAll();
 	void invalidateLayer(int layerID);
 	void invalidateRegion(QRectF region);
 	




More information about the scribus-commit mailing list