diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-18 20:00:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-02-18 22:12:51 +0100 |
commit | 0038a2df911d807a47f7891ab47d19af0a9ed544 (patch) | |
tree | 29f2716c9aaeb58f23d473d7522f2f53c9f7d93c /sw | |
parent | 87aeb7be943921942f791cd182122e8e073ce804 (diff) |
cid#1500272 silence Dereference after null check
before:
commit 24caeee8236576abd92086974c1dbbf15b81a4c5
Date: Sun Dec 8 17:33:53 2019 +0000
Refactor a bit of the footnote handling code
the IsFootnoteContFrame() was assume to be always true,
return to that state but assert rather than OSL_ENSURE
Change-Id: Ia8ca179814b08e3c415ea74ada8a063b75a2557a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130175
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index ce7bc0b7c073..a01c0c8bc4f0 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2800,8 +2800,9 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pO // it into the container. // Create also a SectionFrame if currently in an area inside a footnote. SwFootnoteFrame* pTmpFootnote = pNewUpper->IsFootnoteFrame() ? static_cast<SwFootnoteFrame*>(pNewUpper) : nullptr; - if (!pTmpFootnote && pNewUpper->IsFootnoteContFrame()) + if (!pTmpFootnote) { + assert(pNewUpper->IsFootnoteContFrame() && "New Upper not a FootnoteCont"); SwFootnoteContFrame *pCont = static_cast<SwFootnoteContFrame*>(pNewUpper); pTmpFootnote = SwFootnoteContFrame::AppendChained(this, true); SwFrame* pNx = pCont->Lower(); |