diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-18 13:36:59 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-21 10:24:30 +0200 |
commit | 7ed1e4d076a44a20ba1fa8540054699a88aa1ac3 (patch) | |
tree | d1b4e17688485c5e6258ac0d03e30d8ab91b186f /cppcanvas | |
parent | 93a77d07fa49cad9d836699a48777e0e8ff170b4 (diff) |
bnc#881024 Handle 0 font height just like outdev & drawinglayer
Change-Id: I80055e4101873e0ddd408ac1f0ee9c75cc3bf6b3
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 7d2a6bc584e0..4f261b08a632 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 ) { |