diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-27 20:51:48 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-05-31 15:43:27 +0200 |
commit | 610f9311b66dcf66525e5da70ac16d5110da7a6d (patch) | |
tree | 23edda32f509dbd036f25c92b50b5a6fdc5fe4a3 | |
parent | 66cdfcb26b88f87cc83a2162f9cb2471412ea350 (diff) |
forcepoint#94 fix crash on layout of specific html
Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132179
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 3b6ea366796f7f7e04fb60b9394c91e4790b5c72)
-rw-r--r-- | sw/qa/extras/layout/data/forcepoint94.html | bin | 0 -> 12370 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/forcepoint94.html b/sw/qa/extras/layout/data/forcepoint94.html Binary files differnew file mode 100644 index 000000000000..8be788f8e4e5 --- /dev/null +++ b/sw/qa/extras/layout/data/forcepoint94.html diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 9f2d2a21bcb4..0d05f0744e53 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2950,6 +2950,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testN4LA0OHZ) { createDoc("LIBREOFFICE-N4LA //just care it doesn't crash/assert CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) { createDoc("forcepoint92.doc"); } +#if 0 // no createSwWebDoc +//just care it doesn't crash/assert +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94) +{ + createSwWebDoc(DATA_DIRECTORY, "forcepoint94.html"); +} +#endif + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058) { SwDoc* pDoc = createDoc("tdf118058.fodt"); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 9573944b71d1..df8a2e54a6f9 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2863,6 +2863,9 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pO OSL_ENSURE( pTmp->IsTabFrame(), "GetNextSctLeaf: Wrong Type" ); pTmpNxt = static_cast<SwTabFrame*>(pTmp); } + // we will dereference pNewUp in the following MoveSubTree call + // so it certainly should not be deleted before that + SwFrameDeleteGuard aDeleteGuard(pNewUp); pTmpNxt->MoveSubTree( pTmpFootnote, pNewUp->GetNext() ); } } |