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/formfiller/cffl_formfiller.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp') diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index edbd671f29..a37a7501d0 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -245,6 +245,20 @@ CFX_WideString CFFL_FormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) { return pWnd ? pWnd->GetSelectedText() : CFX_WideString(); } +void CFFL_FormFiller::DeleteSelectedText(CPDFSDK_Annot* pAnnot) { + if (!IsValid()) + return; + + CPDFSDK_PageView* pPageView = GetCurPageView(true); + ASSERT(pPageView); + + CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false); + if (!pWnd) + return; + + pWnd->DeleteSelectedText(); +} + void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); -- cgit v1.2.3