summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_gefont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/font/cfgas_gefont.cpp')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index a57962d084..2d5a927cde 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -216,10 +216,6 @@ bool CFGAS_GEFont::InitFont() {
if (!m_pFontEncoding)
return false;
}
- if (!m_pCharWidthMap) {
- m_pCharWidthMap =
- pdfium::MakeUnique<CFX_DiscreteArrayTemplate<uint16_t>>(1024);
- }
return true;
}
@@ -273,8 +269,8 @@ bool CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
int32_t& iWidth,
bool bRecursive,
bool bCharCode) {
- ASSERT(m_pCharWidthMap);
- iWidth = m_pCharWidthMap->GetAt(wUnicode, 0);
+ auto it = m_CharWidthMap.find(wUnicode);
+ iWidth = it != m_CharWidthMap.end() ? it->second : 0;
if (iWidth == 65535)
return false;
@@ -299,7 +295,7 @@ bool CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
iWidth = -1;
}
}
- m_pCharWidthMap->SetAtGrow(wUnicode, iWidth);
+ m_CharWidthMap[wUnicode] = iWidth;
return iWidth > 0;
}