summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/Document.cpp')
-rw-r--r--fpdfsdk/javascript/Document.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 076e99849e..258dddbe10 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -379,8 +379,7 @@ FX_BOOL Document::mailForm(IJS_Context* cc,
CFX_WideString cSubject = iLength > 4 ? params[4].ToCFXWideString() : L"";
CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString() : L"";
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CFX_ByteTextBuf textBuf;
if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
return FALSE;
@@ -478,12 +477,9 @@ FX_BOOL Document::removeField(IJS_Context* cc,
}
CFX_WideString sFieldName = params[0].ToCFXWideString();
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
-
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
std::vector<CPDFSDK_Widget*> widgets;
pInterForm->GetWidgets(sFieldName, &widgets);
-
if (widgets.empty())
return TRUE;
@@ -520,8 +516,7 @@ FX_BOOL Document::resetForm(IJS_Context* cc,
m_pDocument->GetPermissions(FPDFPERM_FILL_FORM)))
return FALSE;
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
CJS_Array aName(pRuntime);
@@ -611,8 +606,7 @@ FX_BOOL Document::submitForm(IJS_Context* cc,
CJS_Value(pRuntime, pValue, GET_VALUE_TYPE(pValue)).ToV8Array());
}
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
if (aFields.GetLength() == 0 && bEmpty) {
if (pPDFInterForm->CheckRequiredFields(nullptr, true)) {
@@ -1028,9 +1022,7 @@ FX_BOOL Document::baseURL(IJS_Context* cc,
FX_BOOL Document::calculate(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
-
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
if (vp.IsGetting()) {
if (pInterForm->IsCalculateEnabled())
vp << true;
@@ -1311,8 +1303,7 @@ FX_BOOL Document::calculateNow(IJS_Context* cc,
m_pDocument->GetPermissions(FPDFPERM_FILL_FORM)))
return FALSE;
- CPDFSDK_InterForm* pInterForm =
- (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
pInterForm->OnCalculate();
return TRUE;
}