From 2d8084b0fe9f39ef80aad569799f5475674b2aeb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 16 Apr 2018 16:45:14 +0100 Subject: forcepoint#39 bad layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reproducible with ./instdir/program/soffice.bin --headless --convert-to pdf sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc Change-Id: I93bd8a75196ddb2a1a242752bb1e06164bf7148e Reviewed-on: https://gerrit.libreoffice.org/53002 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 2a957e408530cd16526d793c87f0e6fd4bed1548) --- sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc | Bin 0 -> 580608 bytes sw/source/core/layout/fly.cxx | 1 + sw/source/core/layout/pagechg.cxx | 2 ++ 3 files changed, 3 insertions(+) create mode 100755 sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc diff --git a/sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc b/sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc new file mode 100755 index 000000000000..37801a9b14e2 Binary files /dev/null and b/sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc differ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index aaa74c72ba0f..54442191f4e6 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1363,6 +1363,7 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) } { + SwFrameDeleteGuard aDeletePageGuard(pSect->FindPageFrame()); SwFrameDeleteGuard aDeleteGuard(pSect); pFrame->Calc(pRenderContext); } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 9f61fab99771..53afdb0425d1 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1213,6 +1213,8 @@ namespace !pSibling->FindFirstBodyContent() && (!pRefPage || !isDeleteForbidden(pSibling)) ) { + if (pSibling->IsDeleteForbidden()) + throw uno::RuntimeException("bad layout"); pRoot->RemovePage( pRefSibling, SwRemoveResult::Next ) ; return false; } -- cgit v1.2.3