diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-24 18:41:11 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-24 22:51:15 +0200 |
commit | 0a1e297ac23ae79ce9d511b4fd6bd0d8276a2e25 (patch) | |
tree | 73c907f9aad90bab01e9bef2943830edfa9c86e0 | |
parent | c2d5b59fc6a3b3fbe20a19282538d5f95fa53301 (diff) |
fdo#77089 if font width 0, pass 0 - don't take it from font metric
Change-Id: I6c73da1d2470e75774affda836a8d587eebfbe4b
-rw-r--r-- | vcl/source/filter/wmf/winmtf.cxx | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 14b81f9d6f69..7aa73372c6f8 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -236,28 +236,15 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) aVDev.SetFont( aFont ); FontMetric aMetric( aVDev.GetFontMetric() ); long nHeight = aMetric.GetAscent() + aMetric.GetDescent(); - if ( nHeight ) + if (nHeight) { double fHeight = ((double)aFontSize.Height() * rFont.lfHeight ) / nHeight; aFontSize.Height() = (sal_Int32)( fHeight + 0.5 ); } } - else if ( rFont.lfHeight < 0 ) - { - aFontSize.Height() = std::abs(rFont.lfHeight); - } - if ( !rFont.lfWidth ) - { - // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading - SolarMutexGuard aGuard; - VirtualDevice aVDev; - - aFont.SetSize( aFontSize ); - aVDev.SetFont( aFont ); - FontMetric aMetric( aVDev.GetFontMetric() ); - aFontSize.Width() = aMetric.GetWidth(); - } + // Convert height to positive + aFontSize.Height() = std::abs(aFontSize.Height()); aFont.SetSize( aFontSize ); }; |