summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index fa7bdf9bb3f9..612659473c99 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -774,12 +774,12 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangl
if( maPageSize.Width() > maPageSize.Height() )
{
nWidth = maOutRect.GetWidth();
- nHeight = long( (double)(nWidth * maPageSize.Height()) / (double)maPageSize.Width() );
+ nHeight = maPageSize.Width() == 0 ? 0 : long( (double)(nWidth * maPageSize.Height()) / (double)maPageSize.Width() );
}
else
{
nHeight = maOutRect.GetHeight();
- nWidth = long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() );
+ nWidth = maPageSize.Height() == 0 ? 0 : long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() );
}
maOutRect.Left() += (maOutRect.GetWidth() - nWidth) >> 1;