r19232 by jghali - #12391: Undo/Redo crashes Scribus deleting items of a Master Page

scribus-commit scribus-commit at lists.scribus.net
Sun Jun 15 00:32:41 UTC 2014


Author: jghali
Date: Sun Jun 15 00:32:41 2014
New Revision: 19232

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19232
Log:
#12391: Undo/Redo crashes Scribus deleting items of a Master Page

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19232&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sun Jun 15 00:32:41 2014
@@ -9977,15 +9977,6 @@
 
 void PageItem::updateConstants()
 {
-	if (OwnPage!=-1)
-	{
-		m_Doc->constants().insert("pagewidth", m_Doc->Pages->at(OwnPage)->width());
-		m_Doc->constants().insert("pageheight", m_Doc->Pages->at(OwnPage)->height());
-		m_Doc->constants().insert("marginleft", m_Doc->Pages->at(OwnPage)->Margins.Left);
-		m_Doc->constants().insert("marginright", m_Doc->Pages->at(OwnPage)->width() - m_Doc->Pages->at(OwnPage)->Margins.Right);
-		m_Doc->constants().insert("margintop", m_Doc->Pages->at(OwnPage)->Margins.Top);
-		m_Doc->constants().insert("marginbottom", m_Doc->Pages->at(OwnPage)->height() - m_Doc->Pages->at(OwnPage)->Margins.Bottom);
-	}
 	m_Doc->constants().insert("width", m_width);
 	m_Doc->constants().insert("height", m_height);
 }

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19232&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun Jun 15 00:32:41 2014
@@ -13827,6 +13827,12 @@
 			m_ScMW->pagePalette->markPage(newPage->pageNr());
 		}
 	}
+	m_constants.insert("pagewidth", newPage->width());
+	m_constants.insert("pageheight", newPage->height());
+	m_constants.insert("marginleft", newPage->Margins.Left);
+	m_constants.insert("marginright", newPage->width() - newPage->Margins.Right);
+	m_constants.insert("margintop", newPage->Margins.Top);
+	m_constants.insert("marginbottom", newPage->height() - newPage->Margins.Bottom);
 }
 
 




More information about the scribus-commit mailing list