vcl/inc/fontinstance.hxx | 4 ++-- vcl/source/font/fontinstance.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit f8d6ec1a516237f0e9f73080b172ecba3e96478d Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Thu Apr 28 08:30:22 2022 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Thu Apr 28 12:36:02 2022 +0200 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.lu...@collabora.com> 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);