From 88d72b44a1a9345e7eacdd707cecfb300517df9c Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 10 Jul 2023 09:49:38 +0000 Subject: Drop unused WinFontInstance scale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unsed since: commit 7cb3e475f2fb0162c7290414509de4fb8fe57e30 Author: Jan-Marek Glogowski Date: Thu Sep 6 14:04:25 2018 +0200 WIN add SalGraphics* to WinFontInstance Change-Id: I7d14f2efce04c919cffee612b09833810ff3f78b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154240 Tested-by: Jenkins Reviewed-by: خالد حسني --- vcl/win/gdi/salfont.cxx | 11 ++++------- vcl/win/gdi/winlayout.cxx | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'vcl/win') diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index f4a3029a454f..3b31028c88bb 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -867,7 +867,7 @@ void WinSalGraphics::GetFontMetric( FontMetricDataRef& rxFontMetric, int nFallba rxFontMetric->SetSlant( 0 ); // transformation dependent font metrics - rxFontMetric->SetWidth(static_cast(pFontInstance->GetScale() * aWinMetric.tmAveCharWidth)); + rxFontMetric->SetWidth(aWinMetric.tmAveCharWidth); } FontCharMapRef WinSalGraphics::GetFontCharMap() const @@ -1167,7 +1167,6 @@ bool WinFontInstance::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& r const ::comphelper::ScopeGuard aFontRestoreScopeGuard([hFont, hOrigFont, hDC]() { if (hFont != hOrigFont) SelectObject(hDC, hOrigFont); }); - const float fFontScale = GetScale(); // use unity matrix MAT2 aMat; @@ -1202,10 +1201,8 @@ bool WinFontInstance::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& r rRect = tools::Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ), Size( aGM.gmBlackBoxX, aGM.gmBlackBoxY ) ); - rRect.SetLeft(static_cast( fFontScale * rRect.Left() )); - rRect.SetRight(static_cast( fFontScale * rRect.Right() ) + 1); - rRect.SetTop(static_cast( fFontScale * rRect.Top() )); - rRect.SetBottom(static_cast( fFontScale * rRect.Bottom() ) + 1); + rRect.SetRight(rRect.Right() + 1); + rRect.SetBottom(rRect.Bottom() + 1); return true; } @@ -1389,7 +1386,7 @@ bool WinFontInstance::GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& // rescaling needed for the tools::PolyPolygon conversion if( rB2DPolyPoly.count() ) { - const double fFactor(GetScale()/256); + const double fFactor(1.0f/256); rB2DPolyPoly.transform(basegfx::utils::createScaleB2DHomMatrix(fFactor, fFactor)); } diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 371bdeb9642e..5081456aaaef 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -135,7 +135,6 @@ WinFontInstance::WinFontInstance(const WinFontFace& rPFF, const vcl::font::FontS : LogicalFontInstance(rPFF, rFSP) , m_pGraphics(nullptr) , m_hFont(nullptr) - , m_fScale(1.0f) , m_bIsCJKVerticalFont(false) , m_nTmDescent(0) { -- cgit