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 . --- xfa/src/fxfa/src/app/xfa_fontmgr.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xfa') diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp index d6a5677e85..5be4c8b426 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp @@ -1896,10 +1896,9 @@ IFX_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, } strPsName.Remove(' '); IFX_FontMgr* pFDEFontMgr = m_pDoc->GetApp()->GetFDEFontMgr(); - FX_POSITION pos = pFontSetDict->GetStartPos(); - while (pos) { - CFX_ByteString key; - CPDF_Object* pObj = pFontSetDict->GetNextElement(pos, key); + for (const auto& it : *pFontSetDict) { + const CFX_ByteString& key = it.first; + CPDF_Object* pObj = it.second; if (!PsNameMatchDRFontName(strPsName, bBold, bItalic, key, bStrictMatch)) { continue; } -- cgit v1.2.3