[Libreoffice-commits] core.git: Branch 'libreoffice-5-1-4' - sw/source
Michael Stahl
mstahl at redhat.com
Fri Jun 10 13:30:12 UTC 2016
sw/source/core/layout/frmtool.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a73629cf36a484d58aba74057bacdf04d4728599
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Jun 9 15:52:16 2016 +0200
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
(cherry picked from commit c488214817516c13603deb1c180fef02f4c700bf)
Reviewed-on: https://gerrit.libreoffice.org/26121
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 95ed42cc9f9cd40503ca609f1bcad31c5298889b)
Reviewed-on: https://gerrit.libreoffice.org/26151
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 8033f04..aac8960 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1248,6 +1248,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;
@@ -1258,7 +1259,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 )
More information about the Libreoffice-commits
mailing list