diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-10-17 08:40:10 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-10-17 08:40:10 +0000 |
commit | a8ac4bc4145e7e558153b58c87b2def339aebe36 (patch) | |
tree | d1f5da0a1b702f12725b2b82117b7ff49872bb21 /drawinglayer/source/primitive2d/textlayoutdevice.cxx | |
parent | ae562e931a98e708a75e8d140cf1ff24854acfc7 (diff) |
CWS-TOOLING: integrate CWS aw057
Diffstat (limited to 'drawinglayer/source/primitive2d/textlayoutdevice.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index e994357b5724..8725323c6bf5 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -278,12 +278,8 @@ namespace drawinglayer double fFontScaleX, double fFontScaleY, double fFontRotation, - const OutputDevice& rOutDev) + const OutputDevice& /*rOutDev*/) { -#ifndef WIN32 - // not used under unix, but reference for warning-free - (void)rOutDev; -#endif sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX))); sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY))); Font aRetval( @@ -305,10 +301,26 @@ namespace drawinglayer #ifdef WIN32 if(nWidth != nHeight) { - const FontMetric aFontMetric(rOutDev.GetFontMetric(aRetval)); - const double fCurrentWidth(aFontMetric.GetWidth()); - - aRetval.SetWidth(basegfx::fround(fCurrentWidth * (nWidth/nHeight))); + // #i92757# + // Removed the relative calculation with GetFontMetric() usage again. On + // the one hand it was wrong (integer division always created zero), OTOH + // calculating a scale factor from current to target width and then using + // it to actually scale the current width does nothing but set the target + // value directly. Maybe more is needed here with WIN version of font + // width/height handling, but currently, this works the simple way. + // + // As can be seen, when this can stay the simple way, the OutputDevice + // can be removed from the whole getVclFontFromFontAttributes implementations + // again and make it more VCL-independent. + // + // Adapted nWidth usage to nWidth-1 to be completely compatible with + // non-primitive version. + // + // previous stuff: + // const FontMetric aFontMetric(rOutDev.GetFontMetric(aRetval)); + // const double fCurrentWidth(aFontMetric.GetWidth()); + // aRetval.SetWidth(basegfx::fround(fCurrentWidth * ((double)nWidth/(double)nHeight))); + aRetval.SetWidth(nWidth ? nWidth - 1 : 0); } #endif |