[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - cppcanvas/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Mon Jul 21 11:29:49 PDT 2014


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

New commits:
commit 48242717e3a7a8d4c936bad0b96d75cca70b5e0b
Author: Tomaž Vajngerl <tomaz.vajngerl at 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.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at 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 )
             {


More information about the Libreoffice-commits mailing list