From 87dd08660836bfe38d4ec309363d897210f4afb8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 7 Mar 2018 10:56:39 +0000 Subject: preview of empty page ends up with negative size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sfx2/source/doc/new.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sfx2/source') 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; -- cgit