diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-07 10:56:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-07 14:45:21 +0100 |
commit | 87dd08660836bfe38d4ec309363d897210f4afb8 (patch) | |
tree | 1eda38ee90183c7de4924d998cfeec21c235eeaa /sfx2/source | |
parent | 29e89925093f2c143fab675310b2533ed720a9ae (diff) |
preview of empty page ends up with negative size
in load templates, i.e. SfxPreviewWin_Impl, with
an empty writer template selected.
Change-Id: I7194def1dacb25e39416532ed91addc1de0c1d39
Reviewed-on: https://gerrit.libreoffice.org/50877
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/new.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 9c363b02e17b..67c6b73a31da 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -82,7 +82,7 @@ void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFil if (nWidth <= 0 || nHeight <= 0) return; - double dRatio = double(aTmpSize.Width()) / aTmpSize.Height(); + double dRatio = aTmpSize.Height() ? (double(aTmpSize.Width()) / aTmpSize.Height()) : 1; double dRatioPreV = double(nWidth) / nHeight; Size aSize; Point aPoint; |