diff options
author | Diana Gage <drgage@google.com> | 2017-07-28 17:07:39 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-31 21:43:06 +0000 |
commit | ab3909796cf2e9fa192040bcd7cb9da7bb3328a5 (patch) | |
tree | c4b3d336aa8d3539794ec0a9740cb9d78a7b0af8 /public/fpdf_formfill.h | |
parent | 47c9e6d1a151c7c8b0649712a91e04f12177b7b9 (diff) | |
download | pdfium-ab3909796cf2e9fa192040bcd7cb9da7bb3328a5.tar.xz |
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 <thestig@chromium.org>
Commit-Queue: Diana Gage <drgage@google.com>
Diffstat (limited to 'public/fpdf_formfill.h')
-rw-r--r-- | public/fpdf_formfill.h | 16 |
1 files changed, 10 insertions, 6 deletions
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. |