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

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

Issue 1242263010: document.delay and document.external are boolean properties. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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 "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 { 933 {
934 if (vp.IsGetting()) 934 if (vp.IsGetting())
935 { 935 {
936 vp << m_bDelay; 936 vp << m_bDelay;
937 } 937 }
938 else 938 else
939 { 939 {
940 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) 940 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
941 return FALSE; 941 return FALSE;
942 942
943 bool b; 943 vp >> m_bDelay;
944 vp >> b;
945 m_bDelay = b;
946 if (m_bDelay) 944 if (m_bDelay)
947 { 945 {
948 for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++) 946 for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
949 delete m_DelayData.GetAt(i); 947 delete m_DelayData.GetAt(i);
950 948
951 m_DelayData.RemoveAll(); 949 m_DelayData.RemoveAll();
952 } 950 }
953 else 951 else
954 { 952 {
955 CFX_ArrayTemplate<CJS_DelayData*> DelayDataToProcess; 953 CFX_ArrayTemplate<CJS_DelayData*> DelayDataToProcess;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 return FALSE; 1098 return FALSE;
1101 } 1099 }
1102 vp << m_pDocument->GetPageCount(); 1100 vp << m_pDocument->GetPageCount();
1103 return TRUE; 1101 return TRUE;
1104 } 1102 }
1105 1103
1106 FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) 1104 FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
1107 { 1105 {
1108 //In Chrome case,should always return true. 1106 //In Chrome case,should always return true.
1109 if (vp.IsGetting()) { 1107 if (vp.IsGetting()) {
1110 vp << TRUE; 1108 vp << true;
1111 } 1109 }
1112 return TRUE; 1110 return TRUE;
1113 } 1111 }
1114 1112
1115 FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) 1113 FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
1116 { 1114 {
1117 if (vp.IsSetting()) { 1115 if (vp.IsSetting()) {
1118 CJS_Context* pContext = static_cast<CJS_Context*>(cc); 1116 CJS_Context* pContext = static_cast<CJS_Context*>(cc);
1119 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); 1117 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
1120 return FALSE; 1118 return FALSE;
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 for (int j=DelArray.GetSize()-1; j>=0; j--) 1832 for (int j=DelArray.GetSize()-1; j>=0; j--)
1835 { 1833 {
1836 m_DelayData.RemoveAt(DelArray[j]); 1834 m_DelayData.RemoveAt(DelArray[j]);
1837 } 1835 }
1838 } 1836 }
1839 1837
1840 CJS_Document* Document::GetCJSDoc() const 1838 CJS_Document* Document::GetCJSDoc() const
1841 { 1839 {
1842 return static_cast<CJS_Document*>(m_pJSObject); 1840 return static_cast<CJS_Document*>(m_pJSObject);
1843 } 1841 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/Document.h ('k') | testing/resources/javascript/document_props_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698