OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |