cppcanvas/source/mtfrenderer/implrenderer.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 48242717e3a7a8d4c936bad0b96d75cca70b5e0b
Author: Tomaž Vajngerl <tomaz.vajng...@collabora.com>
Date:   Fri Jul 18 13:36:59 2014 +0200

    bnc#881024 Handle 0 font height just like outdev & drawinglayer
    
    Change-Id: I80055e4101873e0ddd408ac1f0ee9c75cc3bf6b3
    Reviewed-on: https://gerrit.libreoffice.org/10435
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx 
b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index a8145bb..b7cbcab 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -809,7 +809,18 @@ namespace cppcanvas
 
             // TODO(Q3): This code smells of programming by
             // coincidence (the next two if statements)
-            const ::Size rFontSizeLog( rFont.GetSize() );
+
+            ::Size rFontSizeLog( rFont.GetSize() );
+
+            if (rFontSizeLog.Height() == 0)
+            {
+                // guess 16 pixel (as in VCL)
+                rFontSizeLog = ::Size(0, 16);
+
+                // convert to target MapUnit if not pixels
+                rFontSizeLog = OutputDevice::LogicToLogic(rFontSizeLog, 
MAP_PIXEL, rParms.mrVDev.GetMapMode());
+            }
+
             const sal_Int32 nFontWidthLog = rFontSizeLog.Width();
             if( nFontWidthLog != 0 )
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to