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 --- fpdfsdk/cpdfsdk_pageview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/cpdfsdk_pageview.cpp') diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index 84a60fa42f..209e8de482 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -253,11 +253,11 @@ CFX_WideString CPDFSDK_PageView::GetSelectedText() { return CFX_WideString(); } -void CPDFSDK_PageView::DeleteSelectedText() { +void CPDFSDK_PageView::ReplaceSelection(const CFX_WideString& text) { if (CPDFSDK_Annot* pAnnot = GetFocusAnnot()) { CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = m_pFormFillEnv->GetAnnotHandlerMgr(); - pAnnotHandlerMgr->Annot_DeleteSelectedText(pAnnot); + pAnnotHandlerMgr->Annot_ReplaceSelection(pAnnot, text); } } -- cgit v1.2.3