summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-16 16:45:14 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-29 07:51:46 +0100
commit2d8084b0fe9f39ef80aad569799f5475674b2aeb (patch)
tree356a28cc80066d2bf055de469cd03c69cc7dcd92
parent0f24e5550b1cca8fd7e02223bb6f6bdcffdf7573 (diff)
forcepoint#39 bad layout
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 <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2a957e408530cd16526d793c87f0e6fd4bed1548)
-rwxr-xr-xsw/qa/core/data/ww8/pass/forcepoint-layout-1.docbin0 -> 580608 bytes
-rw-r--r--sw/source/core/layout/fly.cxx1
-rw-r--r--sw/source/core/layout/pagechg.cxx2
3 files changed, 3 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/forcepoint-layout-1.doc
Binary files 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;
}