summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/printfun.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-22 20:14:16 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-23 10:47:34 +0200
commitea61bee5bcca7ad7cb05bc66fdf973c04b3d3396 (patch)
tree504010f710ab2624c6b851599a90291a7a644589 /sc/source/ui/view/printfun.cxx
parent58b5c524e9869e797104efcf1ac835f26d753068 (diff)
ofz#68994 Timeout on unreasonably narrow header/footer area
Change-Id: I4135609bdb0adf5b6d87dbb81137961ea39cf78f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172298 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui/view/printfun.cxx')
-rw-r--r--sc/source/ui/view/printfun.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index c5dd892bab25..ec1458323e9c 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -812,6 +812,12 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
nPaperWidth -= ( rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) +
rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) ) * 100 / nZoom;
+ if (nPaperWidth <= 0)
+ {
+ SAL_WARN("sc.ui", "Header/Footer unreasonably narrow width of: " << nPaperWidth << ", cannot calculate height");
+ return;
+ }
+
pEditEngine->SetPaperSize( Size( nPaperWidth, 10000 ) );
tools::Long nMaxHeight = 0;