summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-28 08:30:22 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-28 12:36:02 +0200
commitf8d6ec1a516237f0e9f73080b172ecba3e96478d (patch)
treef207c4e625f86850a40eb5b1e694b4f383e67f8e
parent8642389b954a0b8f5673c85f44d8b0ea34eb3430 (diff)
make some LogicalFontInstance functions const
They call non-const GetHbFont() internally, but conceptually they are const. Change-Id: Idec7f06425383c5e78030c76da2c50f560bf64fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133536 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--vcl/inc/fontinstance.hxx4
-rw-r--r--vcl/source/font/fontinstance.cxx8
2 files changed, 6 insertions, 6 deletions
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index 4f216df0389b..5cb05b1d3804 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -100,9 +100,9 @@ public: // TODO: make data members private
bool GetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const;
virtual bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const = 0;
- int GetKashidaWidth();
+ int GetKashidaWidth() const;
- void GetScale(double* nXScale, double* nYScale);
+ void GetScale(double* nXScale, double* nYScale) const;
static inline void DecodeOpenTypeTag(const uint32_t nTableTag, char* pTagName);
protected:
diff --git a/vcl/source/font/fontinstance.cxx b/vcl/source/font/fontinstance.cxx
index 5c63338b75a1..0907d657ad02 100644
--- a/vcl/source/font/fontinstance.cxx
+++ b/vcl/source/font/fontinstance.cxx
@@ -63,9 +63,9 @@ hb_font_t* LogicalFontInstance::InitHbFont(hb_face_t* pHbFace)
return pHbFont;
}
-int LogicalFontInstance::GetKashidaWidth()
+int LogicalFontInstance::GetKashidaWidth() const
{
- hb_font_t* pHbFont = GetHbFont();
+ hb_font_t* pHbFont = const_cast<LogicalFontInstance*>(this)->GetHbFont();
hb_position_t nWidth = 0;
hb_codepoint_t nIndex = 0;
@@ -79,9 +79,9 @@ int LogicalFontInstance::GetKashidaWidth()
return nWidth;
}
-void LogicalFontInstance::GetScale(double* nXScale, double* nYScale)
+void LogicalFontInstance::GetScale(double* nXScale, double* nYScale) const
{
- hb_face_t* pHbFace = hb_font_get_face(GetHbFont());
+ hb_face_t* pHbFace = hb_font_get_face(const_cast<LogicalFontInstance*>(this)->GetHbFont());
unsigned int nUPEM = hb_face_get_upem(pHbFace);
double nHeight(m_aFontSelData.mnHeight);