r16985 by jghali - #10379: Scribus crash when opening .sla document

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 17 21:30:40 UTC 2011


Author: jghali
Date: Thu Nov 17 21:30:40 2011
New Revision: 16985

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16985
Log:
#10379: Scribus crash when opening .sla document

Modified:
    branches/Version135/Scribus/scribus/pageitem_textframe.cpp
    branches/Version135/Scribus/scribus/scribusdoc.cpp
    branches/Version135/Scribus/scribus/text/storytext.cpp

Modified: branches/Version135/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16985&path=/branches/Version135/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem_textframe.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem_textframe.cpp Thu Nov 17 21:30:40 2011
@@ -1406,7 +1406,7 @@
 						{
 							if (current.yPos <= lastLineY)
 								current.yPos = lastLineY +1;
-							double by;
+							double by = Ypos;
 							if (OwnPage != -1)
 								by = Ypos - m_Doc->Pages->at(OwnPage)->yOffset();
 							int ol1 = qRound((by + current.yPos - m_Doc->typographicSettings.offsetBaseGrid) * 10000.0);
@@ -1419,7 +1419,7 @@
 						if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
 						{
 							current.yPos += m_Doc->typographicSettings.valueBaseGrid;
-							double by;
+							double by = Ypos;
 							if (OwnPage != -1)
 								by = Ypos - m_Doc->Pages->at(OwnPage)->yOffset();
 							int ol1 = qRound((by + current.yPos - m_Doc->typographicSettings.offsetBaseGrid) * 10000.0);

Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16985&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Thu Nov 17 21:30:40 2011
@@ -4415,6 +4415,14 @@
 		// If no or page owner is incorrect, recompute page owner
 		currItem->OwnPage = OnPage(currItem);
  	}
+
+	// #10379: Scribus crash when opening .sla document
+	// OwnPage is not meaningful for inline frame
+	for (int i = 0; i < FrameItems.count(); ++i)
+	{
+		currItem = FrameItems.at(i);
+		currItem->OwnPage = -1;
+ 	}
 }
 
 

Modified: branches/Version135/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16985&path=/branches/Version135/Scribus/scribus/text/storytext.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/text/storytext.cpp (original)
+++ branches/Version135/Scribus/scribus/text/storytext.cpp Thu Nov 17 21:30:40 2011
@@ -512,6 +512,7 @@
 	insertChars(pos, SpecialChars::OBJECT);
 	const_cast<StoryText *>(this)->d->at(pos)->embedded = InlineFrame(ob);
 	ob->isEmbedded = true;   // this might not be enough...
+	ob->OwnPage = -1; // #10379: OwnPage is not meaningful for inline object
 }
 
 




More information about the scribus-commit mailing list