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

Side by Side Diff: fpdfsdk/src/javascript/Document.cpp

Issue 1541703003: Use std::map as CPDF_Dictionary's underlying store. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: XFA still uses CFX_CMapByteStringToPtr :( Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "Document.h" 7 #include "Document.h"
8 8
9 #include "Field.h" 9 #include "Field.h"
10 #include "Icon.h" 10 #include "Icon.h"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 FXJS_PutObjectString(isolate, pObj, L"Subject", cwSubject.c_str()); 804 FXJS_PutObjectString(isolate, pObj, L"Subject", cwSubject.c_str());
805 FXJS_PutObjectString(isolate, pObj, L"Keywords", cwKeywords.c_str()); 805 FXJS_PutObjectString(isolate, pObj, L"Keywords", cwKeywords.c_str());
806 FXJS_PutObjectString(isolate, pObj, L"Creator", cwCreator.c_str()); 806 FXJS_PutObjectString(isolate, pObj, L"Creator", cwCreator.c_str());
807 FXJS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str()); 807 FXJS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str());
808 FXJS_PutObjectString(isolate, pObj, L"CreationDate", 808 FXJS_PutObjectString(isolate, pObj, L"CreationDate",
809 cwCreationDate.c_str()); 809 cwCreationDate.c_str());
810 FXJS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str()); 810 FXJS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str());
811 FXJS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str()); 811 FXJS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str());
812 812
813 // It's to be compatible to non-standard info dictionary. 813 // It's to be compatible to non-standard info dictionary.
814 FX_POSITION pos = pDictionary->GetStartPos(); 814 for (const auto& it : *pDictionary) {
815 while (pos) { 815 const CFX_ByteString& bsKey = it.first;
816 CFX_ByteString bsKey; 816 CPDF_Object* pValueObj = it.second;
817 CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
818 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength()); 817 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength());
819 818
820 if (pValueObj->IsString() || pValueObj->IsName()) { 819 if (pValueObj->IsString() || pValueObj->IsName()) {
821 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), 820 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(),
822 pValueObj->GetUnicodeText().c_str()); 821 pValueObj->GetUnicodeText().c_str());
823 } else if (pValueObj->IsNumber()) { 822 } else if (pValueObj->IsNumber()) {
824 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), 823 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(),
825 (float)pValueObj->GetNumber()); 824 (float)pValueObj->GetNumber());
826 } else if (pValueObj->IsBoolean()) { 825 } else if (pValueObj->IsBoolean()) {
827 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), 826 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(),
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 CFX_DWordArray DelArray; 1772 CFX_DWordArray DelArray;
1774 1773
1775 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { 1774 for (int j = DelArray.GetSize() - 1; j >= 0; j--) {
1776 m_DelayData.RemoveAt(DelArray[j]); 1775 m_DelayData.RemoveAt(DelArray[j]);
1777 } 1776 }
1778 } 1777 }
1779 1778
1780 CJS_Document* Document::GetCJSDoc() const { 1779 CJS_Document* Document::GetCJSDoc() const {
1781 return static_cast<CJS_Document*>(m_pJSObject); 1780 return static_cast<CJS_Document*>(m_pJSObject);
1782 } 1781 }
OLDNEW
« core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp ('K') | « fpdfsdk/src/fpdfview.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698