vcl/inc/win/winlayout.hxx | 2 -- vcl/win/gdi/salfont.cxx | 11 ++++------- vcl/win/gdi/winlayout.cxx | 1 - 3 files changed, 4 insertions(+), 10 deletions(-)
New commits: commit 88d72b44a1a9345e7eacdd707cecfb300517df9c Author: Khaled Hosny <kha...@libreofice.org> AuthorDate: Mon Jul 10 09:49:38 2023 +0000 Commit: خالد حسني <kha...@libreoffice.org> CommitDate: Mon Jul 10 15:45:31 2023 +0200 Drop unused WinFontInstance scale Unsed since: commit 7cb3e475f2fb0162c7290414509de4fb8fe57e30 Author: Jan-Marek Glogowski <glo...@fbihome.de> 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: خالد حسني <kha...@libreoffice.org> diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index fb8e5a1c6e43..07c80e8e8b39 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -43,7 +43,6 @@ public: WinSalGraphics* GetGraphics() const { return m_pGraphics; } HFONT GetHFONT() const { return m_hFont; } - float GetScale() const { return m_fScale; } // Return true if the font is for vertical writing. // I.e. the font name of the LOGFONT is prefixed with '@'. bool IsCJKVerticalFont() const { return m_bIsCJKVerticalFont; } @@ -64,7 +63,6 @@ private: WinSalGraphics *m_pGraphics; HFONT m_hFont; - float m_fScale; bool m_bIsCJKVerticalFont; sal_Int32 m_nTmDescent; mutable sal::systools::COMReference<IDWriteFontFace> mxDWFontFace; 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<int>(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<int>( fFontScale * rRect.Left() )); - rRect.SetRight(static_cast<int>( fFontScale * rRect.Right() ) + 1); - rRect.SetTop(static_cast<int>( fFontScale * rRect.Top() )); - rRect.SetBottom(static_cast<int>( 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) {