diff options
author | Oliver Chang <ochang@chromium.org> | 2016-01-11 08:30:17 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2016-01-11 08:30:17 -0800 |
commit | 14f39950451bb9c2a11fbc7173fd47367410f80f (patch) | |
tree | cec41364915b38e6a7709c76fc2fb02f6994990a /fpdfsdk/src/javascript | |
parent | 9adfbb0920a258e916003b1ee9515e97879db82a (diff) | |
download | pdfium-14f39950451bb9c2a11fbc7173fd47367410f80f.tar.xz |
Use std::map as CPDF_Dictionary's underlying store.
Replaces CFX_CMapByteStringToPtr. XFA still uses CFX_CMapByteStringToPtr
so it's not completely removed just yet.
Adds begin()/end() to CPDF_Dictionary and removes the
GetStartPos()/GetNextElement() functions to traverse the dictionary.
Callers are changed accordingly. AddValue() is also removed.
R=tsepez@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/1541703003 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index db98fcc5e4..1040c34770 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -790,10 +790,9 @@ FX_BOOL Document::info(IJS_Context* cc, FXJS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str()); // It's to be compatible to non-standard info dictionary. - FX_POSITION pos = pDictionary->GetStartPos(); - while (pos) { - CFX_ByteString bsKey; - CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey); + for (const auto& it : *pDictionary) { + const CFX_ByteString& bsKey = it.first; + CPDF_Object* pValueObj = it.second; CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength()); if (pValueObj->IsString() || pValueObj->IsName()) { |