Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_font/ttgsubtable.cpp |
| diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp |
| index a1717a9fd4df1e9a44f341bfb81a03423fcad4c9..84614ed0bfa665534bc6848f3a9b76dffbae9166 100644 |
| --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp |
| +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp |
| @@ -85,33 +85,28 @@ bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, |
| k); |
| if (FeatureList.FeatureRecord[index].FeatureTag == tag[0] || |
| FeatureList.FeatureRecord[index].FeatureTag == tag[1]) { |
| - FX_DWORD value; |
| - if (!m_featureMap.Lookup(index, value)) { |
| - m_featureMap.SetAt(index, index); |
| + if (m_featureMap.find(index) == m_featureMap.end()) { |
| + m_featureMap[index] = index; |
| } |
| } |
| } |
| } |
| } |
| - if (!m_featureMap.GetStartPosition()) { |
| + if (m_featureMap.empty()) { |
| for (int i = 0; i < FeatureList.FeatureCount; i++) { |
| if (FeatureList.FeatureRecord[i].FeatureTag == tag[0] || |
| FeatureList.FeatureRecord[i].FeatureTag == tag[1]) { |
| - FX_DWORD value; |
| - if (!m_featureMap.Lookup(i, value)) { |
| - m_featureMap.SetAt(i, i); |
| + if (m_featureMap.find(i) == m_featureMap.end()) { |
|
Lei Zhang
2015/08/17 23:45:13
Assuming we started with an empty map on line 95 a
Tom Sepez
2015/08/18 16:21:42
Indeed it will.
|
| + m_featureMap[i] = i; |
| } |
| } |
| } |
| } |
| m_bFeautureMapLoad = TRUE; |
| } |
| - FX_POSITION pos = m_featureMap.GetStartPosition(); |
| - while (pos) { |
| - FX_DWORD index, value; |
| - m_featureMap.GetNextAssoc(pos, index, value); |
| + for (const auto& pair : m_featureMap) { |
| if (GetVerticalGlyphSub(glyphnum, vglyphnum, |
| - &FeatureList.FeatureRecord[value].Feature)) { |
| + &FeatureList.FeatureRecord[pair.second].Feature)) { |
| return true; |
| } |
| } |