diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-04 21:46:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-05 08:05:16 +0200 |
commit | 13894996601daf10d133f4a71eb0b26794d782bc (patch) | |
tree | 0040f2c81ffd7984373ba27234cea24fbbc3d916 /starmath/source/rect.cxx | |
parent | d83b1383ffbe98502c196cccae4bcb2eb3978f6a (diff) |
handle empty Rectangle better in starmath
which required fixing a unit test to call Prepare, otherwise the nodes
are not ready for layout
Change-Id: I763c1b05d4dfafa73ebaee55d080876848de94f6
Reviewed-on: https://gerrit.libreoffice.org/71800
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/rect.cxx')
-rw-r--r-- | starmath/source/rect.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index ab32022aac2a..113cf4998a65 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -38,6 +38,7 @@ bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev, // basically the same as 'GetTextBoundRect' (in class 'OutputDevice') // but with a string as argument. { + assert(!rText.isEmpty()); // handle special case first if (rText.isEmpty()) { @@ -183,6 +184,7 @@ SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat, : aTopLeft(0, 0) , aSize(rDev.GetTextWidth(rText), rDev.GetTextHeight()) { + assert(!rText.isEmpty()); const FontMetric aFM (rDev.GetFontMetric()); bool bIsMath = aFM.GetFamilyName().equalsIgnoreAsciiCase( FONTNAME_MATH ); bool bAllowSmaller = bIsMath && !SmIsMathAlpha(rText); |