From ea61bee5bcca7ad7cb05bc66fdf973c04b3d3396 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 22 Aug 2024 20:14:16 +0100 Subject: ofz#68994 Timeout on unreasonably narrow header/footer area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4135609bdb0adf5b6d87dbb81137961ea39cf78f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172298 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/view/printfun.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sc/source/ui/view/printfun.cxx') 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; -- cgit