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

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

Issue 2425783002: Revert "Make CPDF_Object containers hold objects via unique pointers." (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | xfa/fxfa/app/xfa_fontmgr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "fpdfsdk/javascript/Document.h" 7 #include "fpdfsdk/javascript/Document.h"
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 pRuntime->PutObjectString(pObj, L"Keywords", cwKeywords); 801 pRuntime->PutObjectString(pObj, L"Keywords", cwKeywords);
802 pRuntime->PutObjectString(pObj, L"Creator", cwCreator); 802 pRuntime->PutObjectString(pObj, L"Creator", cwCreator);
803 pRuntime->PutObjectString(pObj, L"Producer", cwProducer); 803 pRuntime->PutObjectString(pObj, L"Producer", cwProducer);
804 pRuntime->PutObjectString(pObj, L"CreationDate", cwCreationDate); 804 pRuntime->PutObjectString(pObj, L"CreationDate", cwCreationDate);
805 pRuntime->PutObjectString(pObj, L"ModDate", cwModDate); 805 pRuntime->PutObjectString(pObj, L"ModDate", cwModDate);
806 pRuntime->PutObjectString(pObj, L"Trapped", cwTrapped); 806 pRuntime->PutObjectString(pObj, L"Trapped", cwTrapped);
807 807
808 // It's to be compatible to non-standard info dictionary. 808 // It's to be compatible to non-standard info dictionary.
809 for (const auto& it : *pDictionary) { 809 for (const auto& it : *pDictionary) {
810 const CFX_ByteString& bsKey = it.first; 810 const CFX_ByteString& bsKey = it.first;
811 CPDF_Object* pValueObj = it.second.get(); 811 CPDF_Object* pValueObj = it.second;
812 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey.AsStringC()); 812 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey.AsStringC());
813 if (pValueObj->IsString() || pValueObj->IsName()) { 813 if (pValueObj->IsString() || pValueObj->IsName()) {
814 pRuntime->PutObjectString(pObj, wsKey, pValueObj->GetUnicodeText()); 814 pRuntime->PutObjectString(pObj, wsKey, pValueObj->GetUnicodeText());
815 } else if (pValueObj->IsNumber()) { 815 } else if (pValueObj->IsNumber()) {
816 pRuntime->PutObjectNumber(pObj, wsKey, (float)pValueObj->GetNumber()); 816 pRuntime->PutObjectNumber(pObj, wsKey, (float)pValueObj->GetNumber());
817 } else if (pValueObj->IsBoolean()) { 817 } else if (pValueObj->IsBoolean()) {
818 pRuntime->PutObjectBoolean(pObj, wsKey, !!pValueObj->GetInteger()); 818 pRuntime->PutObjectBoolean(pObj, wsKey, !!pValueObj->GetInteger());
819 } 819 }
820 } 820 }
821 vp << pObj; 821 vp << pObj;
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 } 1715 }
1716 } 1716 }
1717 1717
1718 for (const auto& pData : DelayDataForFieldAndControlIndex) 1718 for (const auto& pData : DelayDataForFieldAndControlIndex)
1719 Field::DoDelay(m_pFormFillEnv.Get(), pData.get()); 1719 Field::DoDelay(m_pFormFillEnv.Get(), pData.get());
1720 } 1720 }
1721 1721
1722 CJS_Document* Document::GetCJSDoc() const { 1722 CJS_Document* Document::GetCJSDoc() const {
1723 return static_cast<CJS_Document*>(m_pJSObject); 1723 return static_cast<CJS_Document*>(m_pJSObject);
1724 } 1724 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | xfa/fxfa/app/xfa_fontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698