From 3d8131535e6b127c7ededdbd2e76662688997272 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 21 Jun 2018 17:28:24 +0000 Subject: Pass output parameters as pointers in ijs_event_context It is hard to tell if there is some unsavory stuff going on with references otherwise. Avoids some const_casts in the process. Add some UnownedPtrs along the way to check caller's storage duration. Change-Id: Ic8d85802083f0b27e07993ea25f8f1c15fca1712 Reviewed-on: https://pdfium-review.googlesource.com/35750 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- fxjs/cjs_event_context.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'fxjs/cjs_event_context.cpp') diff --git a/fxjs/cjs_event_context.cpp b/fxjs/cjs_event_context.cpp index 70f06771d1..3d40c9dc5a 100644 --- a/fxjs/cjs_event_context.cpp +++ b/fxjs/cjs_event_context.cpp @@ -136,55 +136,55 @@ void CJS_EventContext::OnField_MouseUp(bool bModifier, void CJS_EventContext::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, - const WideString& Value) { + WideString* Value) { m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value); } void CJS_EventContext::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, - const WideString& Value) { + WideString* Value) { m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value); } void CJS_EventContext::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, - WideString& Value, - bool& bRc) { - m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc); + WideString* pValue, + bool* pRc) { + m_pEventHandler->OnField_Calculate(pSource, pTarget, pValue, pRc); } void CJS_EventContext::OnField_Format(CPDF_FormField* pTarget, - WideString& Value, + WideString* Value, bool bWillCommit) { m_pEventHandler->OnField_Format(pTarget, Value, bWillCommit); } -void CJS_EventContext::OnField_Keystroke(WideString& strChange, +void CJS_EventContext::OnField_Keystroke(WideString* strChange, const WideString& strChangeEx, bool bKeyDown, bool bModifier, - int& nSelEnd, - int& nSelStart, + int* nSelEnd, + int* nSelStart, bool bShift, CPDF_FormField* pTarget, - WideString& Value, + WideString* Value, bool bWillCommit, bool bFieldFull, - bool& bRc) { + bool* bRc) { m_pEventHandler->OnField_Keystroke( strChange, strChangeEx, bKeyDown, bModifier, nSelEnd, nSelStart, bShift, pTarget, Value, bWillCommit, bFieldFull, bRc); } -void CJS_EventContext::OnField_Validate(WideString& strChange, +void CJS_EventContext::OnField_Validate(WideString* strChange, const WideString& strChangeEx, bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget, - WideString& Value, - bool& bRc) { + WideString* Value, + bool* bRc) { m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc); } -- cgit v1.2.3