summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-03-07 08:42:42 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-03-08 10:54:14 +0000
commit1ec152e4f725207f9e067777b49ed689e5f1b8ec (patch)
treeccb0322a4aebba13c33949499f3558df2c534cc8
parent0d60b7914f4026cedf3455b79636fa108b05d432 (diff)
sw: fix crash in GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid()
Crashreport signature: program/libswlo.so SwFlowFrame::GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid() const sw/source/core/layout/flowfrm.cxx:1741 program/libswlo.so objectpositioning::SwAnchoredObjectPosition::GetTopForObjPos(SwFrame const&, SwRectFnCollection* const&, bool) const include/svl/itemset.hxx:101 program/libswlo.so objectpositioning::SwToContentAnchoredObjectPosition::CalcPosition() sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx:1020 program/libswlo.so SwAnchoredDrawObject::MakeObjPosAnchoredAtPara() sw/source/core/layout/anchoreddrawobject.cxx:424 Change-Id: If162602f6a1cc2108c0de385652e93e23be920be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148396 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/source/core/layout/flowfrm.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 891ff1574bb6..78c3a34ca09b 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1737,6 +1737,11 @@ SwTwips SwFlowFrame::GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid() cons
{
SwTwips nUpperSpaceAmountConsideredForPrevFrameAndPageGrid = 0;
+ if (!m_rThis.GetUpper() || !m_rThis.GetUpper()->GetFormat())
+ {
+ return nUpperSpaceAmountConsideredForPrevFrameAndPageGrid;
+ }
+
if ( !m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::USE_FORMER_OBJECT_POS) )
{
nUpperSpaceAmountConsideredForPrevFrameAndPageGrid =