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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 FXJS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str()); | 777 FXJS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str()); |
778 FXJS_PutObjectString(isolate, pObj, L"CreationDate", | 778 FXJS_PutObjectString(isolate, pObj, L"CreationDate", |
779 cwCreationDate.c_str()); | 779 cwCreationDate.c_str()); |
780 FXJS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str()); | 780 FXJS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str()); |
781 FXJS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str()); | 781 FXJS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str()); |
782 | 782 |
783 // It's to be compatible to non-standard info dictionary. | 783 // It's to be compatible to non-standard info dictionary. |
784 for (const auto& it : *pDictionary) { | 784 for (const auto& it : *pDictionary) { |
785 const CFX_ByteString& bsKey = it.first; | 785 const CFX_ByteString& bsKey = it.first; |
786 CPDF_Object* pValueObj = it.second; | 786 CPDF_Object* pValueObj = it.second; |
787 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey.AsByteStringC()); | 787 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey.AsStringC()); |
788 if (pValueObj->IsString() || pValueObj->IsName()) { | 788 if (pValueObj->IsString() || pValueObj->IsName()) { |
789 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), | 789 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), |
790 pValueObj->GetUnicodeText().c_str()); | 790 pValueObj->GetUnicodeText().c_str()); |
791 } else if (pValueObj->IsNumber()) { | 791 } else if (pValueObj->IsNumber()) { |
792 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), | 792 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), |
793 (float)pValueObj->GetNumber()); | 793 (float)pValueObj->GetNumber()); |
794 } else if (pValueObj->IsBoolean()) { | 794 } else if (pValueObj->IsBoolean()) { |
795 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), | 795 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), |
796 !!pValueObj->GetInteger()); | 796 !!pValueObj->GetInteger()); |
797 } | 797 } |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 } | 1589 } |
1590 } | 1590 } |
1591 | 1591 |
1592 for (const auto& pData : DelayDataForFieldAndControlIndex) | 1592 for (const auto& pData : DelayDataForFieldAndControlIndex) |
1593 Field::DoDelay(m_pDocument, pData.get()); | 1593 Field::DoDelay(m_pDocument, pData.get()); |
1594 } | 1594 } |
1595 | 1595 |
1596 CJS_Document* Document::GetCJSDoc() const { | 1596 CJS_Document* Document::GetCJSDoc() const { |
1597 return static_cast<CJS_Document*>(m_pJSObject); | 1597 return static_cast<CJS_Document*>(m_pJSObject); |
1598 } | 1598 } |
OLD | NEW |