Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1721)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

Issue 1576033002: Merge to XFA: Use std::map as CPDF_Dictionary's underlying store. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698