OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/Annot.h" | 7 #include "fpdfsdk/javascript/Annot.h" |
8 | 8 |
9 #include "fpdfsdk/javascript/JS_Define.h" | 9 #include "fpdfsdk/javascript/JS_Define.h" |
10 #include "fpdfsdk/javascript/JS_Object.h" | 10 #include "fpdfsdk/javascript/JS_Object.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 CFX_WideString annotName; | 84 CFX_WideString annotName; |
85 vp >> annotName; | 85 vp >> annotName; |
86 baAnnot->SetAnnotName(annotName); | 86 baAnnot->SetAnnotName(annotName); |
87 return TRUE; | 87 return TRUE; |
88 } | 88 } |
89 | 89 |
90 FX_BOOL Annot::type(IJS_Context* cc, | 90 FX_BOOL Annot::type(IJS_Context* cc, |
91 CJS_PropValue& vp, | 91 CJS_PropValue& vp, |
92 CFX_WideString& sError) { | 92 CFX_WideString& sError) { |
93 if (vp.IsSetting()) { | 93 if (vp.IsSetting()) { |
94 CJS_Context* pContext = static_cast<CJS_Context*>(cc); | 94 sError = JSGetStringFromID(IDS_STRING_JSREADONLY); |
95 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); | |
96 return FALSE; | 95 return FALSE; |
97 } | 96 } |
98 | 97 |
99 CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot); | 98 CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot); |
100 if (!baAnnot) | 99 if (!baAnnot) |
101 return FALSE; | 100 return FALSE; |
102 | 101 |
103 vp << CPDF_Annot::AnnotSubtypeToString(baAnnot->GetAnnotSubtype()); | 102 vp << CPDF_Annot::AnnotSubtypeToString(baAnnot->GetAnnotSubtype()); |
104 return TRUE; | 103 return TRUE; |
105 } | 104 } |
106 | 105 |
107 void Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) { | 106 void Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) { |
108 m_pAnnot = annot; | 107 m_pAnnot = annot; |
109 SetWatchedPtr(&m_pAnnot); | 108 SetWatchedPtr(&m_pAnnot); |
110 } | 109 } |
OLD | NEW |