sc/source/ui/view/printfun.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit ea61bee5bcca7ad7cb05bc66fdf973c04b3d3396 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Aug 22 20:14:16 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Aug 23 10:47:34 2024 +0200 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.mcnam...@collabora.com> 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;