summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-06-20 21:39:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-20 21:39:53 +0000
commitd9fb538bc08c4923fbfd3d50c47a61716d679956 (patch)
treec1c87ffef3a99a5d63f700bf028be05cff84236e
parentcc4802edc4faee4bafae5219e94a5a22bfbb684b (diff)
downloadpdfium-d9fb538bc08c4923fbfd3d50c47a61716d679956.tar.xz
Remove duplicate method for generating alertschromium/3468
XFA has its own method for generating alerts in the embedder, CPDFSDK_FormFillEnvironment::Alert, which is a slight variation of the non-XFA CPDFSDK_FormFillEnvironment::JS_appAlert. Converting the two instances of calls to the XFA only method to use the non-XFA method and removing the XFA only method. Change-Id: I60ea92b2ae69ea96ce4c216ef6d9029d79580b05 Reviewed-on: https://pdfium-review.googlesource.com/35690 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp10
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.h1
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp12
3 files changed, 4 insertions, 19 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 44807fdc0c..29d88a7e60 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -405,16 +405,6 @@ bool CPDFSDK_FormFillEnvironment::PopupMenu(CPDFXFA_Page* page,
menuFlag, pt.x, pt.y);
}
-void CPDFSDK_FormFillEnvironment::Alert(FPDF_WIDESTRING Msg,
- FPDF_WIDESTRING Title,
- int Type,
- int Icon) {
- if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert) {
- m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, Msg, Title, Type,
- Icon);
- }
-}
-
void CPDFSDK_FormFillEnvironment::EmailTo(FPDF_FILEHANDLER* fileHandler,
FPDF_WIDESTRING pTo,
FPDF_WIDESTRING pSubject,
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index 9818259ca2..5bce1ac93a 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -137,7 +137,6 @@ class CPDFSDK_FormFillEnvironment
int menuFlag,
CFX_PointF pt);
- void Alert(FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
void EmailTo(FPDF_FILEHANDLER* fileHandler,
FPDF_WIDESTRING pTo,
FPDF_WIDESTRING pSubject,
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 3f9f3038fe..f3fe89c1e2 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -655,10 +655,8 @@ bool CPDFXFA_DocEnvironment::OnBeforeNotifySubmit() {
if (!pFormFillEnv)
return false;
- WideString ws = WideString::FromLocal(IDS_XFA_Validate_Input);
- ByteString bs = ws.UTF16LE_Encode();
- pFormFillEnv->Alert(AsFPDFWideString(&bs),
- reinterpret_cast<FPDF_WIDESTRING>(L""), 0, 1);
+ pFormFillEnv->JS_appAlert(WideString::FromLocal(IDS_XFA_Validate_Input),
+ L"", 0, 1);
return false;
}
pNode = it->MoveToNext();
@@ -910,10 +908,8 @@ bool CPDFXFA_DocEnvironment::SubmitInternal(CXFA_FFDoc* hDoc,
WideString csURL = submit->GetSubmitTarget();
if (csURL.IsEmpty()) {
- WideString ws = WideString::FromLocal("Submit cancelled.");
- ByteString bs = ws.UTF16LE_Encode();
- pFormFillEnv->Alert(AsFPDFWideString(&bs),
- reinterpret_cast<FPDF_WIDESTRING>(L""), 0, 4);
+ pFormFillEnv->JS_appAlert(WideString::FromLocal("Submit cancelled."), L"",
+ 0, 4);
return false;
}