summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-06 23:18:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-07 16:47:59 +0200
commitb8e84ac201f5611635177f8404c28f7fa8d0c806 (patch)
tree8f997660a87a1bfda8366dc2596f379bf0275840
parent3604ca211204b9a0971a65c96a5075ba43f15693 (diff)
tdf#112163 sw: avoid crashing in layout on this document
SwTextFrame 0x5dfb7a0 is join locked so doesn't GetFormatted() so doesn't have a SwTextLineAccess created; add some defensive programming just to make it not crash. Whether this is the right fix or just a workaround for something going wrong in the 179 layout stack frames is beyond my meager knowledge. In case anybody has an obvious idea, the layout frames that are currently being formatted (SwTextFrame or SwTabFrame) are: #3 0x5dfb7a0 is master of 0x5e56330 #4 0x5e56330 #10 0x5e5f3f0 is follow of 0x5e56330 #19 0x5e60d30 SwTabFrame::Split #30 0x5e56330 #44 0x5dfb7a0 #53 0x2cefae0 master of 0x5dfb7a0 #57 0x63d1440 SwTabFrame::MakeAll is follow of #58 #58 0x5e106c0 SwTabFrame::MakeAll #68 0x5e812d0 #77 0x5e11f80 is master of #68 #86 0x2cef600 is master of #77 #90 0x5f86c00 SwTabFrame::MakeAll #91 0x63d0150 SwTabFrame::MakeAll #98 SwFlowFrame::MoveFwd #101 0x63cf3d0 #110 0x5e05ff0 is master of #101 #119 0x5e0c700 is master of #110 #128 0x5bd0ad0 is master of #119 #136 0x5f8b800 is master of #128 #145 0x86b29a0 is master of #136 #154 0x2c37340 is master of #145 #158 0x5e04ab0 SwTabFrame::MakeAll #168 0x2c371a0 #173 0x5e16340 SwTabFrame::MakeAll Change-Id: I716b5faec1512cbf1fbdb04a436da302bd628c51 (cherry picked from commit 6c8c51231e7415ecc20d1343211acf8382666613) Reviewed-on: https://gerrit.libreoffice.org/42041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/core/text/frmform.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index ee0469a929ce..74a6ff817739 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1405,10 +1405,17 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, SwTextFormatInfo &rInf,
{
if( !pMaster->HasPara() )
pMaster->GetFormatted();
- SwTextSizeInfo aInf( pMaster );
- SwTextIter aMasterLine( pMaster, &aInf );
- aMasterLine.Bottom();
- pLine = aMasterLine.GetCurr();
+ if (!pMaster->HasPara())
+ { // master could be locked because it's being formatted upstack
+ SAL_WARN("sw", "SwTextFrame::Format_: failed to format master!");
+ }
+ else
+ {
+ SwTextSizeInfo aInf( pMaster );
+ SwTextIter aMasterLine( pMaster, &aInf );
+ aMasterLine.Bottom();
+ pLine = aMasterLine.GetCurr();
+ }
}
SwLinePortion* pRest = pLine ?
rLine.MakeRestPortion(pLine, GetOfst()) : nullptr;