summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-11-27 19:40:57 -0400
committerHenry Castro <hcastro@collabora.com>2016-11-28 02:00:56 +0000
commite2d5f1ba3fd0db00276cf48b0d9be9b16dcbf7a0 (patch)
tree6cb98ca8548d36f0cad77540b12dae096a31a05e /desktop
parentaf18b7d60f4320fc01b84593af404dbfb4237fcf (diff)
lok: avoid render font with empty rectangle
Change-Id: I58e24e0de37144ae5d67857b243e6a7091f2b77a Reviewed-on: https://gerrit.libreoffice.org/31281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0d403e31a6b5..2ecfddcecd88 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2581,6 +2581,9 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
aFont.SetFontSize(Size(0, 25));
aDevice->SetFont(aFont);
aDevice->GetTextBoundRect(aRect, aText);
+ if (aRect.IsEmpty())
+ break;
+
int nFontWidth = aRect.BottomRight().X() + 1;
*pFontWidth = nFontWidth;
int nFontHeight = aRect.BottomRight().Y() + 1;