summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-27 20:51:48 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-13 14:14:27 +0200
commit092e1706cd0a6b51ab5a900608679c0eb7b7f03b (patch)
treec3d549ff81a00a6af0fa6590ad5e2868890084d8
parentforcepoint#92 fix crash on layout of specific doc (diff)
downloadcore-092e1706cd0a6b51ab5a900608679c0eb7b7f03b.tar.gz
core-092e1706cd0a6b51ab5a900608679c0eb7b7f03b.zip
forcepoint#94 fix crash on layout of specific html
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) (cherry picked from commit c9ab0bb6487e1be7e86e8be0ef4b8aecd0c58e6b) Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a
-rw-r--r--sw/qa/extras/layout/data/forcepoint94.htmlbin0 -> 12370 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx8
-rw-r--r--sw/source/core/layout/ftnfrm.cxx3
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
new file mode 100644
index 000000000000..8be788f8e4e5
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint94.html
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 5e9e2b2d950b..fea34df825c3 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -269,6 +269,14 @@ void SwLayoutWriter::testUXTSOREL() { createDoc("LIBREOFFICE-UXTSOREL.rtf"); }
//just care it doesn't crash/assert
void 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
+
void SwLayoutWriter::testTdf118058()
{
SwDoc* pDoc = createDoc("tdf118058.fodt");
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 7fd3bcbbd2f7..9400c71ea24c 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2786,6 +2786,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() );
}
}