bnc#881024 Handle 0 font height just like outdev & drawinglayer

Change-Id: I80055e4101873e0ddd408ac1f0ee9c75cc3bf6b3
This commit is contained in:
Tomaž Vajngerl
2014-07-18 13:36:59 +02:00
parent 8f705df122
commit 816f4be79c

View File

@@ -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 )
{