summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_gefont.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-04-30 21:54:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-30 21:54:13 +0000
commit3d3c2dea9fcb7372e195f453a5e4ec3fd47392b9 (patch)
tree443142fe49a3c509d7664b8c3a4b2901278f6066 /xfa/fgas/font/cfgas_gefont.cpp
parent39e7e610d8d697f05134890446caf4101539a032 (diff)
downloadpdfium-3d3c2dea9fcb7372e195f453a5e4ec3fd47392b9.tar.xz
Change out parameter of CFGAS_GEFont::GetCharWidth to pointer.chromium/3416
Change-Id: I1e04c7645b2238d292a6a8eb5fb5fa365fa958f5 Reviewed-on: https://pdfium-review.googlesource.com/31752 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fgas/font/cfgas_gefont.cpp')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp24
1 files changed, 12 insertions, 12 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) {