From ab3909796cf2e9fa192040bcd7cb9da7bb3328a5 Mon Sep 17 00:00:00 2001 From: Diana Gage Date: Fri, 28 Jul 2017 17:07:39 -0700 Subject: Add FORM_ReplaceSelection() and embedder tests. This method replaces the selected text in a user-editable form text area with another text string (which can be empty or non-empty). If there is no selected text, FORM_ReplaceSelection() will append the replacement text after the current caret position. BUG=chromium:59266 Change-Id: I76448ef757d107888c33ebd5656457ebac93b952 Reviewed-on: https://pdfium-review.googlesource.com/8812 Reviewed-by: Lei Zhang Commit-Queue: Diana Gage --- public/fpdf_formfill.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'public/fpdf_formfill.h') diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h index 83a4e58bdc..617bc34b17 100644 --- a/public/fpdf_formfill.h +++ b/public/fpdf_formfill.h @@ -1378,20 +1378,24 @@ DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, unsigned long buflen); /** - * Function: FORM_DeleteSelectedText - * You can call this function to delete the current text selection in - * a form text field or user-editable form combobox text field. If - * there is no selected text, this function does nothing. + * Function: FORM_ReplaceSelection + * You can call this function to replace the selected text in a form + * text field or user-editable form combobox text field with another + * text string (which can be empty or non-empty). If there is no + * selected text, this function will append the replacement text after + * the current caret position. * Parameters: * hHandle - Handle to the form fill module. Returned by * FPDFDOC_InitFormFillEnvironment. * page - Handle to the page. Returned by FPDF_LoadPage * function. + * wsText - The text to be inserted, in UTF-16LE format. * Return Value: * None. **/ -DLLEXPORT void STDCALL FORM_DeleteSelectedText(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page); +DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + FPDF_WIDESTRING wsText); /** * Function: FORM_ForceToKillFocus. -- cgit v1.2.3