summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-09 15:52:16 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-09 15:59:19 +0200
commitc488214817516c13603deb1c180fef02f4c700bf (patch)
treef139da3173a9bf65a67d7d575af5d1ddc6a9d07a
parent6a5cb3dae1760283c2c9156de666964ea4794f0f (diff)
tdf#96089 sw: fix scope of bBreakAfter in InsertCnt_()
The problem is that bBreakAfter is passed by reference to SwLayHelper and stored as a reference member there, so it has to live at least as long as pPageMaker. (Unfortunately C++ can't statically check that.) This then somehow caused the number of pages created after initial load to be 812 instead of the correct 396 determined from the layout-cache in the bugdoc, and that then caused Drawing objects to move backward during the following re-pagination, and then SwDrawContact::Changed_() calls SetFlyFrmAttr() and that sets the document to modified, which triggers the AutoSave that was reported in the bug. (regression from b4b7703e4335460cf48bfd6440f116359994c8ff) Change-Id: I14dc4644c2e127b3c3ff0e6876eedcc534e1a68e
-rw-r--r--sw/source/core/layout/frmtool.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 4cfcdf7d0329..70c1409a0dc0 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1246,6 +1246,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
SwPageFrame *pPage = pLay->FindPageFrame();
const SwFrameFormats *pTable = pDoc->GetSpzFrameFormats();
SwFrame *pFrame = nullptr;
+ bool bBreakAfter = false;
SwActualSection *pActualSection = nullptr;
SwLayHelper *pPageMaker;
@@ -1256,7 +1257,6 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
{
// Attention: the SwLayHelper class uses references to the content-,
// page-, layout-frame etc. and may change them!
- bool bBreakAfter = false;
pPageMaker = new SwLayHelper( pDoc, pFrame, pPrv, pPage, pLay,
pActualSection, bBreakAfter, nIndex, 0 == nEndIndex );
if( bStartPercent )