r17338 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:17:11 UTC 2012


Author: jghali
Date: Sat Feb 25 22:17:11 2012
New Revision: 17338

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

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17338&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 Sat Feb 25 22:17:11 2012
@@ -572,6 +572,7 @@
 
 	m_Doc->setMasterPageMode(false);
 	m_Doc->reformPages();
+	m_Doc->refreshGuides();
 
 	// #9969 : Some old long doc may have page owner somewhat broken
 	m_Doc->fixItemPageOwner();

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17338&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 Feb 25 22:17:11 2012
@@ -1674,6 +1674,7 @@
 	m_Doc->setActiveLayer(layerToSetActive);
 	m_Doc->setMasterPageMode(false);
 	m_Doc->reformPages();
+	m_Doc->refreshGuides();
 
 	if (m_Doc->Layers.count() == 0)
 		m_Doc->Layers.newLayer( QObject::tr("Background") );

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

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17338&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Feb 25 22:17:11 2012
@@ -5353,6 +5353,16 @@
 	}
 }
 
+void ScribusDoc::refreshGuides()
+{
+	for (int i = 0; i < Pages->count(); ++i)
+	{
+		ScPage* 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: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17338&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Feb 25 22:17:11 2012
@@ -830,7 +830,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