vcl/inc/win/winlayout.hxx | 1 - vcl/win/gdi/winlayout.cxx | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-)
New commits: commit ff7a6711277bda28711cc92540fbd62ebaaf8db7 Author: Mike Kaganski <[email protected]> AuthorDate: Thu Mar 28 19:52:00 2024 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Mar 29 04:17:12 2024 +0100 Simplify and drop unused method Change-Id: Ie987bce2bb25232d54a4a83631c609ad6dba7213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165467 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index e1d66a0e1ab2..cfb36e825b54 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -36,7 +36,6 @@ class WinFontInstance : public LogicalFontInstance public: ~WinFontInstance() override; - bool hasHScale() const; float getHScale() const; void SetGraphics(WinSalGraphics*); diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index eb5c740580c5..19eaae2ecee7 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -146,22 +146,12 @@ WinFontInstance::~WinFontInstance() ::DeleteFont(m_hFont); } -bool WinFontInstance::hasHScale() const -{ - const vcl::font::FontSelectPattern& rPattern = GetFontSelectPattern(); - int nHeight(rPattern.mnHeight); - int nWidth(rPattern.mnWidth ? rPattern.mnWidth * GetAverageWidthFactor() : nHeight); - return nWidth != nHeight; -} - float WinFontInstance::getHScale() const { const vcl::font::FontSelectPattern& rPattern = GetFontSelectPattern(); - int nHeight(rPattern.mnHeight); - if (!nHeight) + if (!rPattern.mnHeight || !rPattern.mnWidth) return 1.0; - float nWidth(rPattern.mnWidth ? rPattern.mnWidth * GetAverageWidthFactor() : nHeight); - return nWidth / nHeight; + return rPattern.mnWidth * GetAverageWidthFactor() / rPattern.mnHeight; } void WinFontInstance::ImplInitHbFont(hb_font_t* /*pHbFont*/)
