Index: xfa/src/fxfa/src/app/xfa_fontmgr.cpp |
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp |
index d6a5677e854cbd725d9ce0154c93d02ce17242d1..5be4c8b426a773eca2f868ea90ea5cfa675e5d1b 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; |
} |