summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-16 16:45:14 +0100
committerAndras Timar <andras.timar@collabora.com>2019-08-22 12:33:11 +0200
commit6c3d568c976d9f9513cd9f294b449f958de63bc6 (patch)
tree3bb9141495220df483fc30655094259d6ed5a3ea
parent3baa1fe0569fd49514e2625af6d1a0fb1ccc4e4c (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 523e1a1e7133..5f60078f6203 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1449,6 +1449,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 bafe1a96d7d1..674282280c19 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1212,6 +1212,8 @@ namespace
!pSibling->FindFirstBodyContent() &&
(!pRefPage || !isDeleteForbidden(pSibling)) )
{
+ if (pSibling->IsDeleteForbidden())
+ throw uno::RuntimeException("bad layout");
pRoot->RemovePage( pRefSibling, SwRemoveResult::Next ) ;
return false;
}