diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-03-07 08:42:42 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-03-07 16:58:17 +0000 |
commit | 364a8e7462948b83f3ad7aec64f86fa4386889c1 (patch) | |
tree | d714563c37b094b47f75b4c07992f1e07c25658d | |
parent | 4b16ed30c345bbce7f579acf556db29a4d95b80a (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/+/148391
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index e53d32b9fa20..0aa9c6f14534 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1749,6 +1749,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 = |