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>
This commit is contained in:
Luboš Luňák
2022-04-28 08:30:22 +02:00
parent 8642389b95
commit f8d6ec1a51
2 changed files with 6 additions and 6 deletions

View File

@@ -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:

View File

@@ -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);