From 3f1c71f5a6ea058e3eec611c9dcc759b374dcb80 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Mon, 11 Jan 2016 08:45:31 -0800 Subject: Merge to XFA: Use std::map as CPDF_Dictionary's underlying store. Replaces CFX_CMapByteStringToPtr. XFA still uses CFX_CMapByteStringToPtr so it's not completely removed just yet. Adds begin()/end() to CPDF_Dictionary and removes the GetStartPos()/GetNextElement() functions to traverse the dictionary. Callers are changed accordingly. AddValue() is also removed. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1541703003 . (cherry picked from commit 14f39950451bb9c2a11fbc7173fd47367410f80f) Review URL: https://codereview.chromium.org/1576033002 . --- fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/src/formfiller') diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index 1649eaf35d..9253563c38 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -118,11 +118,9 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CPDF_Font* pFind = NULL; - FX_POSITION pos = pFonts->GetStartPos(); - while (pos) { - CPDF_Object* pObj = NULL; - CFX_ByteString csKey; - pObj = pFonts->GetNextElement(pos, csKey); + for (const auto& it : *pFonts) { + const CFX_ByteString& csKey = it.first; + CPDF_Object* pObj = it.second; if (!pObj) continue; -- cgit v1.2.3