diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-27 20:51:48 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-09 09:50:45 +0200 |
commit | c9ab0bb6487e1be7e86e8be0ef4b8aecd0c58e6b (patch) | |
tree | 0a6fe25472c1ba669c1c65b848b99e449245d2d4 | |
parent | 86108b6ddabcbd0e649a6bc4d182a82a92025b69 (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 5aeff92b885d..2ea190d12854 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2967,6 +2967,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() ); } } |