Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: core/src/fpdfapi/fpdf_font/ttgsubtable.cpp

Issue 1289703003: FX_CMapDwordToDword considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, remove if(). Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_font/ttgsubtable.h ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..81383fa8691896264256b6f97982e5215b2f7b0d 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -85,33 +85,26 @@ 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);
- }
+ 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;
}
}
« no previous file with comments | « core/src/fpdfapi/fpdf_font/ttgsubtable.h ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698