sw/qa/extras/layout/data/forcepoint94.html |binary sw/qa/extras/layout/layout.cxx | 8 ++++++++ sw/source/core/layout/ftnfrm.cxx | 3 +++ 3 files changed, 11 insertions(+)
New commits: commit fc8c05dbf712b302e7dab76f275d44b75014afc4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Mar 27 20:51:48 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon May 16 12:40:01 2022 +0200 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.st...@allotropia.de> (cherry picked from commit 3b6ea366796f7f7e04fb60b9394c91e4790b5c72) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133940 Tested-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/qa/extras/layout/data/forcepoint94.html b/sw/qa/extras/layout/data/forcepoint94.html new file mode 100644 index 000000000000..8be788f8e4e5 Binary files /dev/null and b/sw/qa/extras/layout/data/forcepoint94.html differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index bd394317ad41..e565e31df9b0 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3059,6 +3059,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 425aa5fd0a9e..964af2008868 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2873,6 +2873,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() ); } }