diff options
author | Oliver Chang <ochang@chromium.org> | 2016-01-11 08:45:31 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2016-01-11 08:45:31 -0800 |
commit | 3f1c71f5a6ea058e3eec611c9dcc759b374dcb80 (patch) | |
tree | b4ef8de26360979381c441cbdfaba94e493b09f6 /fpdfsdk/src/fpdf_transformpage.cpp | |
parent | c909ce872d999a17ffd44afdc88caf2de43e6cba (diff) | |
download | pdfium-3f1c71f5a6ea058e3eec611c9dcc759b374dcb80.tar.xz |
Merge to XFA: 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.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1541703003 .
(cherry picked from commit 14f39950451bb9c2a11fbc7173fd47367410f80f)
Review URL: https://codereview.chromium.org/1576033002 .
Diffstat (limited to 'fpdfsdk/src/fpdf_transformpage.cpp')
-rw-r--r-- | fpdfsdk/src/fpdf_transformpage.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp index 3f6ab972c8..3e2c7b1151 100644 --- a/fpdfsdk/src/fpdf_transformpage.cpp +++ b/fpdfsdk/src/fpdf_transformpage.cpp @@ -160,14 +160,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, if (pRes) { CPDF_Dictionary* pPattenDict = pRes->GetDict("Pattern"); if (pPattenDict) { - FX_POSITION pos = pPattenDict->GetStartPos(); - while (pos) { - CPDF_Dictionary* pDict = nullptr; - CFX_ByteString key; - CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key); + for (const auto& it : *pPattenDict) { + CPDF_Object* pObj = it.second; if (pObj->IsReference()) pObj = pObj->GetDirect(); + CPDF_Dictionary* pDict = nullptr; if (pObj->IsDictionary()) pDict = pObj->AsDictionary(); else if (CPDF_Stream* pStream = pObj->AsStream()) |