summaryrefslogtreecommitdiff
path: root/xfa/fgas/font
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/font')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp24
-rw-r--r--xfa/fgas/font/cfgas_gefont.h2
2 files changed, 13 insertions, 13 deletions
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 35d3480d03..b6ec23a414 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -155,34 +155,34 @@ uint32_t CFGAS_GEFont::GetFontStyles() const {
return dwStyles;
}
-bool CFGAS_GEFont::GetCharWidth(wchar_t wUnicode, int32_t& iWidth) {
+bool CFGAS_GEFont::GetCharWidth(wchar_t wUnicode, int32_t* pWidth) {
auto it = m_CharWidthMap.find(wUnicode);
- iWidth = it != m_CharWidthMap.end() ? it->second : 0;
- if (iWidth == 65535)
+ *pWidth = it != m_CharWidthMap.end() ? it->second : 0;
+ if (*pWidth == 65535)
return false;
- if (iWidth > 0)
+ if (*pWidth > 0)
return true;
if (!m_pProvider || !m_pProvider->GetCharWidth(RetainPtr<CFGAS_GEFont>(this),
- wUnicode, &iWidth)) {
+ wUnicode, pWidth)) {
RetainPtr<CFGAS_GEFont> pFont;
int32_t iGlyph;
std::tie(iGlyph, pFont) = GetGlyphIndexAndFont(wUnicode, true);
if (iGlyph != 0xFFFF && pFont) {
if (pFont.Get() == this) {
- iWidth = m_pFont->GetGlyphWidth(iGlyph);
- if (iWidth < 0)
- iWidth = -1;
- } else if (pFont->GetCharWidth(wUnicode, iWidth)) {
+ *pWidth = m_pFont->GetGlyphWidth(iGlyph);
+ if (*pWidth < 0)
+ *pWidth = -1;
+ } else if (pFont->GetCharWidth(wUnicode, pWidth)) {
return true;
}
} else {
- iWidth = -1;
+ *pWidth = -1;
}
}
- m_CharWidthMap[wUnicode] = iWidth;
- return iWidth > 0;
+ m_CharWidthMap[wUnicode] = *pWidth;
+ return *pWidth > 0;
}
bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, FX_RECT* bbox) {
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index b1d3a0e34d..ab72f1356f 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -38,7 +38,7 @@ class CFGAS_GEFont : public Retainable {
CFGAS_FontMgr* pFontMgr);
uint32_t GetFontStyles() const;
- bool GetCharWidth(wchar_t wUnicode, int32_t& iWidth);
+ bool GetCharWidth(wchar_t wUnicode, int32_t* pWidth);
int32_t GetGlyphIndex(wchar_t wUnicode);
int32_t GetAscent() const;
int32_t GetDescent() const;