diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-21 17:28:24 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-21 17:28:24 +0000 |
commit | 3d8131535e6b127c7ededdbd2e76662688997272 (patch) | |
tree | 656faaadbaf0139f8a299b672f6530e7a004b6bb /fxjs/cjs_eventhandler.h | |
parent | a964f2a5ab09dc01d09fad78f940ee8e0e5c0c04 (diff) | |
download | pdfium-3d8131535e6b127c7ededdbd2e76662688997272.tar.xz |
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 <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_eventhandler.h')
-rw-r--r-- | fxjs/cjs_eventhandler.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/fxjs/cjs_eventhandler.h b/fxjs/cjs_eventhandler.h index 7c33ed739e..b38d3ff158 100644 --- a/fxjs/cjs_eventhandler.h +++ b/fxjs/cjs_eventhandler.h @@ -81,32 +81,31 @@ class CJS_EventHandler { void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, - WideString& Value, - bool& bRc); + WideString* Value, + bool* pbRc); void OnField_Format(CPDF_FormField* pTarget, - WideString& Value, + WideString* Value, bool bWillCommit); - void OnField_Keystroke(WideString& strChange, + void OnField_Keystroke(WideString* strChange, const WideString& strChangeEx, bool KeyDown, 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); - void OnField_Validate(WideString& strChange, + bool* bRc); + void OnField_Validate(WideString* strChange, const WideString& strChangeEx, bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget, - WideString& Value, - bool& bRc); - + WideString* Value, + bool* bRc); void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget); void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget); void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget); @@ -114,11 +113,11 @@ class CJS_EventHandler { void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, - const WideString& Value); + WideString* Value); void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, - const WideString& Value); + WideString* Value); void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); @@ -190,13 +189,13 @@ class CJS_EventHandler { bool m_bKeyDown = false; bool m_bModifier = false; bool m_bShift = false; - int* m_pISelEnd = nullptr; + UnownedPtr<int> m_pISelEnd; int m_nSelEndDu = 0; - int* m_pISelStart = nullptr; + UnownedPtr<int> m_pISelStart; int m_nSelStartDu = 0; bool m_bWillCommit = false; bool m_bFieldFull = false; - bool* m_pbRc = nullptr; + UnownedPtr<bool> m_pbRc; bool m_bRcDu = false; UnownedPtr<CPDF_Bookmark> m_pTargetBookMark; |