r17337 by jghali - #10598 : Automatic guides which refer to margins are not loaded correctly

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 25 22:16:13 UTC 2012


Author: jghali
Date: Sat Feb 25 22:16:13 2012
New Revision: 17337

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17337
Log:
#10598 : Automatic guides which refer to margins are not loaded correctly

Modified:
    branches/Version14x/Scribus/scribus/guidemanager.cpp
    branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    branches/Version14x/Scribus/scribus/scribus.cpp
    branches/Version14x/Scribus/scribus/scribusdoc.cpp
    branches/Version14x/Scribus/scribus/scribusdoc.h

Modified: branches/Version14x/Scribus/scribus/guidemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17337&path=/branches/Version14x/Scribus/scribus/guidemanager.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/guidemanager.cpp (original)
+++ branches/Version14x/Scribus/scribus/guidemanager.cpp Sat Feb 25 22:16:13 2012
@@ -565,7 +565,7 @@
 
 Guides GuideManager::getAutoVerticals()
 {
-GuideManagerCore guides;
+	GuideManagerCore guides;
 
 	double gapValue = 0.0;
 	if (horizontalAutoGapCheck->isChecked())

Modified: branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17337&path=/branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sat Feb 25 22:16:13 2012
@@ -1542,6 +1542,7 @@
 	m_Doc->setActiveLayer(layerToSetActive);
 	m_Doc->setMasterPageMode(false);
 	m_Doc->reformPages();
+	m_Doc->refreshGuides();
 
 	// Some old long doc may have page owner somewhat broken
 	m_Doc->fixItemPageOwner();
@@ -2976,7 +2977,6 @@
 
 				Apage->guides.addHorizontals(Apage->guides.getAutoHorizontals(Apage), GuideManagerCore::Auto);
 				Apage->guides.addVerticals(Apage->guides.getAutoVerticals(Apage), GuideManagerCore::Auto);
-				
 			}
 			if ((pg.tagName()=="PAGEOBJECT") || (pg.tagName()=="MASTEROBJECT") || (pg.tagName()=="FRAMEOBJECT"))
 			{

Modified: branches/Version14x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17337&path=/branches/Version14x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribus.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribus.cpp Sat Feb 25 22:16:13 2012
@@ -4183,6 +4183,7 @@
 		doc->RePos = true;
 		doc->setMasterPageMode(true);
 		doc->reformPages();
+		doc->refreshGuides();
 		doc->setLoading(false);
 		for (int azz=0; azz<doc->MasterItems.count(); ++azz)
 		{

Modified: branches/Version14x/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17337&path=/branches/Version14x/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.cpp Sat Feb 25 22:16:13 2012
@@ -4626,6 +4626,16 @@
 	}
 }
 
+void ScribusDoc::refreshGuides()
+{
+	for (int i = 0; i < Pages->count(); ++i)
+	{
+		Page* page = Pages->at(i);
+		page->guides.addHorizontals(page->guides.getAutoHorizontals(page), GuideManagerCore::Auto);
+		page->guides.addVerticals(page->guides.getAutoVerticals(page), GuideManagerCore::Auto);
+	}
+}
+
 double ScribusDoc::getXOffsetForPage(const int pageNumber)
 {
 	if (Pages->at(pageNumber)!=NULL)

Modified: branches/Version14x/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17337&path=/branches/Version14x/Scribus/scribus/scribusdoc.h
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.h (original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.h Sat Feb 25 22:16:13 2012
@@ -697,7 +697,11 @@
 	int  OnPage(double x2, double  y2);
 	int  OnPage(PageItem *currItem);
 	void GroupOnPage(PageItem *currItem);
+
 	void reformPages(bool moveObjects = true);
+	/** @brief Refresh automatic guides once Margin struct has been properly configure by reformPages() */
+	void refreshGuides();
+	/** @brief Check and fix if needed PageItem OwnPage member */
 	void fixItemPageOwner();
 	
 	/**




More information about the scribus-commit mailing list