Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
index 264b6fb36f2e6fd386ab77a266b3c1139f21f03e..6b870e1ae2bb7c97859f297afdd7283b18abf795 100644 |
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
@@ -488,10 +488,9 @@ void _PDF_ReplaceAbbr(CPDF_Object* pObj) { |
switch (pObj->GetType()) { |
case PDFOBJ_DICTIONARY: { |
CPDF_Dictionary* pDict = pObj->AsDictionary(); |
- FX_POSITION pos = pDict->GetStartPos(); |
- while (pos) { |
- CFX_ByteString key; |
- CPDF_Object* value = pDict->GetNextElement(pos, key); |
+ for (const auto& it : *pDict) { |
+ CFX_ByteString key = it.first; |
+ CPDF_Object* value = it.second; |
CFX_ByteStringC fullname = _PDF_FindFullName( |
_PDF_InlineKeyAbbr, sizeof _PDF_InlineKeyAbbr / sizeof(_FX_BSTR), |
key); |
@@ -552,10 +551,9 @@ void _PDF_ReplaceFull(CPDF_Object* pObj) { |
switch (pObj->GetType()) { |
case PDFOBJ_DICTIONARY: { |
CPDF_Dictionary* pDict = pObj->AsDictionary(); |
- FX_POSITION pos = pDict->GetStartPos(); |
- while (pos) { |
- CFX_ByteString key; |
- CPDF_Object* value = pDict->GetNextElement(pos, key); |
+ for (const auto& it : *pDict) { |
+ CFX_ByteString key = it.first; |
+ CPDF_Object* value = it.second; |
CFX_ByteStringC abbrName = _PDF_FindAbbrName( |
_PDF_InlineKeyAbbr, sizeof(_PDF_InlineKeyAbbr) / sizeof(_FX_BSTR), |
key); |