summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-03-28 19:52:00 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-08 02:50:13 +0500
commitee5584b926cd10ea600a3514242148db5a0a6f18 (patch)
treeaab147a09e9c93f34cc942ef4f58d1f699e3b291
parentFix UB after 8962141a12c966b2d891829925e6203bf8d51852 (diff)
downloadcore-ee5584b926cd10ea600a3514242148db5a0a6f18.tar.gz
core-ee5584b926cd10ea600a3514242148db5a0a6f18.zip
Simplify and drop unused method
Change-Id: Ie987bce2bb25232d54a4a83631c609ad6dba7213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165467 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--vcl/inc/win/winlayout.hxx1
-rw-r--r--vcl/win/gdi/winlayout.cxx14
2 files changed, 2 insertions, 13 deletions
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx
index 18de0e684b1c..0f253230c1b4 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 371bdeb9642e..3865f2ebed66 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -147,22 +147,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*/)