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

Unified Diff: fpdfsdk/javascript/Document.cpp

Issue 2400473002: Start proxying CPDFSDK_Document methods through CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fsdk_actionhandler.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/Document.cpp
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index f5779aa438813fe05d8349c2afe1a427663f993c..38f957cc4ad80abfe22516c43872c5762d1f9d52 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -173,7 +173,7 @@ FX_BOOL Document::numFields(IJS_Context* cc,
sError = JSGetStringFromID(IDS_STRING_JSBADOBJECT);
return FALSE;
}
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
vp << static_cast<int>(pPDFForm->CountFields(CFX_WideString()));
return TRUE;
@@ -298,7 +298,7 @@ FX_BOOL Document::getField(IJS_Context* cc,
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CFX_WideString wideName = params[0].ToCFXWideString(pRuntime);
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
if (pPDFForm->CountFields(wideName) <= 0) {
vRet.SetNull(pRuntime);
@@ -336,7 +336,7 @@ FX_BOOL Document::getNthFieldName(IJS_Context* cc,
sError = JSGetStringFromID(IDS_STRING_JSVALUEERROR);
return FALSE;
}
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
CPDF_FormField* pField = pPDFForm->GetField(nIndex, CFX_WideString());
if (!pField)
@@ -402,7 +402,7 @@ FX_BOOL Document::mailForm(IJS_Context* cc,
iLength > 4 ? params[4].ToCFXWideString(pRuntime) : L"";
CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString(pRuntime) : L"";
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CFX_ByteTextBuf textBuf;
if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
return FALSE;
@@ -509,7 +509,7 @@ FX_BOOL Document::removeField(IJS_Context* cc,
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CFX_WideString sFieldName = params[0].ToCFXWideString(pRuntime);
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
std::vector<CPDFSDK_Widget*> widgets;
pInterForm->GetWidgets(sFieldName, &widgets);
if (widgets.empty())
@@ -561,7 +561,7 @@ FX_BOOL Document::resetForm(IJS_Context* cc,
return FALSE;
}
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
CJS_Array aName;
@@ -659,7 +659,7 @@ FX_BOOL Document::submitForm(IJS_Context* cc,
aFields.Attach(CJS_Value(pRuntime, pValue).ToV8Array(pRuntime));
}
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
if (aFields.GetLength(pRuntime) == 0 && bEmpty) {
if (pPDFInterForm->CheckRequiredFields(nullptr, true)) {
@@ -1009,7 +1009,7 @@ FX_BOOL Document::calculate(IJS_Context* cc,
sError = JSGetStringFromID(IDS_STRING_JSBADOBJECT);
return FALSE;
}
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetEnv()->GetInterForm();
if (vp.IsGetting()) {
vp << !!pInterForm->IsCalculateEnabled();
} else {
@@ -1387,7 +1387,7 @@ FX_BOOL Document::calculateNow(IJS_Context* cc,
sError = JSGetStringFromID(IDS_STRING_JSNOPERMISSION);
return FALSE;
}
- m_pDocument->GetInterForm()->OnCalculate();
+ m_pDocument->GetEnv()->GetInterForm()->OnCalculate();
return TRUE;
}
« no previous file with comments | « fpdfsdk/fsdk_actionhandler.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698