| 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/src/javascript/Document.h" | 7 #include "fpdfsdk/src/javascript/Document.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 CPDF_FormField* pField = pPDFForm->GetField(j, sName); | 645 CPDF_FormField* pField = pPDFForm->GetField(j, sName); |
| 646 if (!bEmpty && pField->GetValue().IsEmpty()) | 646 if (!bEmpty && pField->GetValue().IsEmpty()) |
| 647 continue; | 647 continue; |
| 648 | 648 |
| 649 fieldObjects.push_back(pField); | 649 fieldObjects.push_back(pField); |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 | 652 |
| 653 if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true)) { | 653 if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true)) { |
| 654 pRuntime->BeginBlock(); | 654 pRuntime->BeginBlock(); |
| 655 pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF); | 655 pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF); |
| 656 pRuntime->EndBlock(); | 656 pRuntime->EndBlock(); |
| 657 } | 657 } |
| 658 return TRUE; | 658 return TRUE; |
| 659 } | 659 } |
| 660 | 660 |
| 661 void Document::AttachDoc(CPDFSDK_Document* pDoc) { | 661 void Document::AttachDoc(CPDFSDK_Document* pDoc) { |
| 662 m_pDocument = pDoc; | 662 m_pDocument = pDoc; |
| 663 } | 663 } |
| 664 | 664 |
| 665 CPDFSDK_Document* Document::GetReaderDoc() { | 665 CPDFSDK_Document* Document::GetReaderDoc() { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength()); | 796 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength()); |
| 797 | 797 |
| 798 if (pValueObj->IsString() || pValueObj->IsName()) { | 798 if (pValueObj->IsString() || pValueObj->IsName()) { |
| 799 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), | 799 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), |
| 800 pValueObj->GetUnicodeText().c_str()); | 800 pValueObj->GetUnicodeText().c_str()); |
| 801 } else if (pValueObj->IsNumber()) { | 801 } else if (pValueObj->IsNumber()) { |
| 802 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), | 802 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), |
| 803 (float)pValueObj->GetNumber()); | 803 (float)pValueObj->GetNumber()); |
| 804 } else if (pValueObj->IsBoolean()) { | 804 } else if (pValueObj->IsBoolean()) { |
| 805 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), | 805 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), |
| 806 (bool)pValueObj->GetInteger()); | 806 !!pValueObj->GetInteger()); |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 vp << pObj; | 809 vp << pObj; |
| 810 } | 810 } |
| 811 return TRUE; | 811 return TRUE; |
| 812 } | 812 } |
| 813 | 813 |
| 814 FX_BOOL Document::creationDate(IJS_Context* cc, | 814 FX_BOOL Document::creationDate(IJS_Context* cc, |
| 815 CJS_PropValue& vp, | 815 CJS_PropValue& vp, |
| 816 CFX_WideString& sError) { | 816 CFX_WideString& sError) { |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); | 1624 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); |
| 1625 Field::DoDelay(m_pDocument, pData); | 1625 Field::DoDelay(m_pDocument, pData); |
| 1626 DelayDataForFieldAndControlIndex.SetAt(i, NULL); | 1626 DelayDataForFieldAndControlIndex.SetAt(i, NULL); |
| 1627 delete pData; | 1627 delete pData; |
| 1628 } | 1628 } |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 CJS_Document* Document::GetCJSDoc() const { | 1631 CJS_Document* Document::GetCJSDoc() const { |
| 1632 return static_cast<CJS_Document*>(m_pJSObject); | 1632 return static_cast<CJS_Document*>(m_pJSObject); |
| 1633 } | 1633 } |
| OLD | NEW |