summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/printfun.cxx
diff options
context:
space:
mode:
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;