From 1c7f1420b78f37ec1619ab1552261e9ce3947a3b Mon Sep 17 00:00:00 2001 From: Diana Gage Date: Mon, 24 Jul 2017 11:19:52 -0700 Subject: Add FORM_DeleteSelectedText() and embedder tests. This method deletes the current text selection in a form text field or user-editable form combobox text field. If there is no selection, this method does nothing. BUG=chromium:59266 Change-Id: I3229ffad990c62beac1cf769cd366458b9ee5daa Reviewed-on: https://pdfium-review.googlesource.com/8370 Reviewed-by: Lei Zhang Commit-Queue: Diana Gage --- fpdfsdk/fpdfformfill.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fpdfsdk/fpdfformfill.cpp') diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 24cd64efa1..627bd0a925 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -383,6 +383,14 @@ DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, return form_text_len; } +DLLEXPORT void STDCALL FORM_DeleteSelectedText(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page) { + CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); + if (!pPageView) + return; + pPageView->DeleteSelectedText(); +} + DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); -- cgit v1.2.3