diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-01 15:49:13 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-05-17 15:47:05 +0200 |
commit | e3f2278e9f90e03a20dd3c390ed5be2d9c3851b2 (patch) | |
tree | a048b68615648d8eb3b4b0e3ba9ed8995874764a | |
parent | forcepoint#91 fix crash on layout of specific html (diff) | |
download | core-e3f2278e9f90e03a20dd3c390ed5be2d9c3851b2.tar.gz core-e3f2278e9f90e03a20dd3c390ed5be2d9c3851b2.zip |
forcepoint#98 don't delete SwFrame flagged as IsDeleteForbidden
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132435
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 3644508aceee6019842bea1fee6c177eabd61681)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132484
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit ff6ca44405e0f472441bfa3902f6a3d614028029)
Change-Id: I1ac2db4bf96afc4bdc8e0646576f5fa0bcd9e410
-rw-r--r-- | sw/qa/extras/layout/data/forcepoint98.html | bin | 0 -> 7171 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/forcepoint98.html b/sw/qa/extras/layout/data/forcepoint98.html Binary files differnew file mode 100644 index 000000000000..9d4b76c53e76 --- /dev/null +++ b/sw/qa/extras/layout/data/forcepoint98.html diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 022bc431cb50..133aa05d465c 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2354,6 +2354,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94) #endif //just care it doesn't crash/assert +#if 0 // no createSwWebDoc +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint98) +{ + createSwWebDoc(DATA_DIRECTORY, "forcepoint98.html"); +} +#endif + +//just care it doesn't crash/assert CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf147485Forcepoint) { createDoc("tdf147485-forcepoint.doc"); diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index e293be36a2ed..ace20d5975db 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2867,7 +2867,8 @@ void SwRootFrame::DeleteEmptySct_() mpDestroy->erase( mpDestroy->begin() ); OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(), "DeleteEmptySct: Locked SectionFrame" ); - if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() ) + SAL_WARN_IF(pSect->IsDeleteForbidden(), "sw.layout", "not allowed delete SwFrame"); + if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() && !pSect->IsDeleteForbidden() ) { SwLayoutFrame* pUp = pSect->GetUpper(); pSect->RemoveFromLayout(); |