r16986 by jghali - #10379: Scribus crash when opening .sla document
scribus-commit
scribus-commit at lists.scribus.net
Thu Nov 17 21:31:03 UTC 2011
Author: jghali
Date: Thu Nov 17 21:31:03 2011
New Revision: 16986
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16986
Log:
#10379: Scribus crash when opening .sla document
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/text/storytext.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16986&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Thu Nov 17 21:31:03 2011
@@ -1570,7 +1570,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->guidesPrefs().offsetBaselineGrid) * 10000.0);
@@ -1583,7 +1583,7 @@
if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
{
current.yPos += m_Doc->guidesPrefs().valueBaselineGrid;
- double by;
+ double by = Ypos;
if (OwnPage != -1)
by = Ypos - m_Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + current.yPos - m_Doc->guidesPrefs().offsetBaselineGrid) * 10000.0);
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16986&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu Nov 17 21:31:03 2011
@@ -5074,6 +5074,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: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16986&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Thu Nov 17 21:31:03 2011
@@ -511,6 +511,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