Index: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
index c9eee8e380838de182e960a96f187d3b5b082278..168cbf3a611392e07020342ef2c41b3efe5a92ec 100644 |
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
@@ -1213,11 +1213,9 @@ CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj) { |
if (!pDict) |
return nullptr; |
- CPDF_ColorSpace* pRet = nullptr; |
- FX_POSITION pos = pDict->GetStartPos(); |
- while (pos) { |
- CFX_ByteString bsKey; |
- CPDF_Object* pValue = pDict->GetNextElement(pos, bsKey); |
+ for (const auto& it : *pDict) { |
+ CPDF_ColorSpace* pRet = nullptr; |
+ CPDF_Object* pValue = it.second; |
if (ToName(pValue)) |
pRet = _CSFromName(pValue->GetString()); |
if (pRet) |