From d9fb538bc08c4923fbfd3d50c47a61716d679956 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 20 Jun 2018 21:39:53 +0000 Subject: Remove duplicate method for generating alerts 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 Reviewed-by: Henrique Nakashima --- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp') 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(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(L""), 0, 4); + pFormFillEnv->JS_appAlert(WideString::FromLocal("Submit cancelled."), L"", + 0, 4); return false; } -- cgit v1.2.3