From cbf1550e48e300142a53f635daba3c1d8910add9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Fri, 25 May 2018 16:18:40 +0000 Subject: [xfa] Generate CXFA_EventParam.newText dynamically When an xfa.event is sent it is possible to change the selStart, selEnd and change values of the event. This should cause the value of newText to be changed as needed. This CL removes m_wsNewText from CXFA_EventParam and instead generates the new text based on the previous text, the selection and the change. Bug: 1066 Change-Id: I35d126fad9771c8980654a8af64d2b98989bff3f Reviewed-on: https://pdfium-review.googlesource.com/32970 Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- xfa/fxfa/cxfa_eventparam.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xfa/fxfa/cxfa_eventparam.cpp') diff --git a/xfa/fxfa/cxfa_eventparam.cpp b/xfa/fxfa/cxfa_eventparam.cpp index bd6742f4dd..4e3cae9d1d 100644 --- a/xfa/fxfa/cxfa_eventparam.cpp +++ b/xfa/fxfa/cxfa_eventparam.cpp @@ -33,7 +33,6 @@ void CXFA_EventParam::Reset() { m_bKeyDown = false; m_bModifier = false; m_wsNewContentType.clear(); - m_wsNewText.clear(); m_wsPrevContentType.clear(); m_wsPrevText.clear(); m_bReenter = false; @@ -44,3 +43,8 @@ void CXFA_EventParam::Reset() { m_wsSoapFaultString.clear(); m_bIsFormReady = false; } + +WideString CXFA_EventParam::GetNewText() const { + return m_wsPrevText.Left(m_iSelStart) + m_wsChange + + m_wsPrevText.Right(m_wsPrevText.GetLength() - m_iSelEnd); +} -- cgit v1.2.3