From b8777a2c5f38ea4d6fc74ea01a114d3e056c0fdb Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 20 Sep 2017 16:21:31 -0400 Subject: Add embeddertest for CFWL_Edit This CL adds two mouse selection tests for CFWL_Edit. In order to do so the needed selection code was added to the XFA widget handler and plumbed down to the CFWL_Edit field as needed. Bug: pdfium:840 Change-Id: Ia3b5f5d191494a4579c01524df8fb35b24cc0085 Reviewed-on: https://pdfium-review.googlesource.com/14530 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffwidgethandler.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'xfa/fxfa/cxfa_ffwidgethandler.cpp') diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index 524bbed9e2..8f916d804b 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -142,6 +142,23 @@ bool CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget, return bRet; } +WideString CXFA_FFWidgetHandler::GetSelectedText(CXFA_FFWidget* widget) { + if (!widget->CanCopy()) + return WideString(); + + WideString val; + widget->Copy(val); + return val; +} + +void CXFA_FFWidgetHandler::PasteText(CXFA_FFWidget* widget, + const WideString& text) { + if (!widget->CanPaste()) + return; + + widget->Paste(text); +} + FWL_WidgetHit CXFA_FFWidgetHandler::OnHitTest(CXFA_FFWidget* hWidget, const CFX_PointF& point) { if (!(hWidget->GetStatus() & XFA_WidgetStatus_Visible)) -- cgit v1.2.3