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 865c6b71169af03a9c2900594de9801caaef6a0d..4849c13dfcc5a1420540d2dda906aa78e4166219 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); |