summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cjs_event_context.cpp28
-rw-r--r--fxjs/cjs_event_context.h26
-rw-r--r--fxjs/cjs_event_context_stub.h26
-rw-r--r--fxjs/cjs_eventhandler.cpp58
-rw-r--r--fxjs/cjs_eventhandler.h33
-rw-r--r--fxjs/ijs_event_context.h27
6 files changed, 101 insertions, 97 deletions
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);
}
diff --git a/fxjs/cjs_event_context.h b/fxjs/cjs_event_context.h
index 3cfc6da775..29bbd5a853 100644
--- a/fxjs/cjs_event_context.h
+++ b/fxjs/cjs_event_context.h
@@ -52,38 +52,38 @@ class CJS_EventContext : public IJS_EventContext {
void OnField_Focus(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) override;
+ WideString* Value) override;
void OnField_Blur(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) override;
+ WideString* Value) override;
void OnField_Calculate(CPDF_FormField* pSource,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) override;
+ WideString* pValue,
+ bool* pRc) override;
void OnField_Format(CPDF_FormField* pTarget,
- WideString& Value,
+ WideString* Value,
bool bWillCommit) override;
- void OnField_Keystroke(WideString& strChange,
+ void 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) override;
- void OnField_Validate(WideString& strChange,
+ bool* bRc) override;
+ void OnField_Validate(WideString* strChange,
const WideString& strChangeEx,
bool bKeyDown,
bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) override;
+ WideString* Value,
+ bool* bRc) override;
void OnScreen_Focus(bool bModifier,
bool bShift,
CPDFSDK_Annot* pScreen) override;
diff --git a/fxjs/cjs_event_context_stub.h b/fxjs/cjs_event_context_stub.h
index c8c5e33ac3..341b9959f9 100644
--- a/fxjs/cjs_event_context_stub.h
+++ b/fxjs/cjs_event_context_stub.h
@@ -44,38 +44,38 @@ class CJS_EventContextStub final : public IJS_EventContext {
void OnField_Focus(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) override {}
+ WideString* Value) override {}
void OnField_Blur(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) override {}
+ WideString* Value) override {}
void OnField_Calculate(CPDF_FormField* pSource,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) override {}
+ WideString* pValue,
+ bool* pRc) override {}
void OnField_Format(CPDF_FormField* pTarget,
- WideString& Value,
+ WideString* Value,
bool bWillCommit) override {}
- 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) override {}
- void OnField_Validate(WideString& strChange,
+ bool* bRc) override {}
+ void OnField_Validate(WideString* strChange,
const WideString& strChangeEx,
bool bKeyDown,
bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) override {}
+ WideString* Value,
+ bool* bRc) override {}
void OnScreen_Focus(bool bModifier,
bool bShift,
CPDFSDK_Annot* pScreen) override {}
diff --git a/fxjs/cjs_eventhandler.cpp b/fxjs/cjs_eventhandler.cpp
index 43605d985b..884651a77b 100644
--- a/fxjs/cjs_eventhandler.cpp
+++ b/fxjs/cjs_eventhandler.cpp
@@ -127,97 +127,103 @@ void CJS_EventHandler::OnField_MouseUp(bool bModifier,
void CJS_EventHandler::OnField_Focus(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) {
+ WideString* pValue) {
+ ASSERT(pValue);
Initialize(JET_FIELD_FOCUS);
m_bModifier = bModifier;
m_bShift = bShift;
m_strTargetName = pTarget->GetFullName();
- m_pValue = const_cast<WideString*>(&Value);
+ m_pValue = pValue;
}
void CJS_EventHandler::OnField_Blur(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) {
+ WideString* pValue) {
+ ASSERT(pValue);
Initialize(JET_FIELD_BLUR);
m_bModifier = bModifier;
m_bShift = bShift;
m_strTargetName = pTarget->GetFullName();
- m_pValue = const_cast<WideString*>(&Value);
+ m_pValue = pValue;
}
-void CJS_EventHandler::OnField_Keystroke(WideString& strChange,
+void CJS_EventHandler::OnField_Keystroke(WideString* strChange,
const WideString& strChangeEx,
bool KeyDown,
bool bModifier,
- int& nSelEnd,
- int& nSelStart,
+ int* pSelEnd,
+ int* pSelStart,
bool bShift,
CPDF_FormField* pTarget,
- WideString& Value,
+ WideString* pValue,
bool bWillCommit,
bool bFieldFull,
- bool& bRc) {
+ bool* pbRc) {
+ ASSERT(pValue && pbRc && pSelEnd && pSelStart);
Initialize(JET_FIELD_KEYSTROKE);
m_nCommitKey = 0;
- m_pWideStrChange = &strChange;
+ m_pWideStrChange = strChange;
m_WideStrChangeEx = strChangeEx;
m_bKeyDown = KeyDown;
m_bModifier = bModifier;
- m_pISelEnd = &nSelEnd;
- m_pISelStart = &nSelStart;
+ m_pISelEnd = pSelEnd;
+ m_pISelStart = pSelStart;
m_bShift = bShift;
m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
+ m_pValue = pValue;
m_bWillCommit = bWillCommit;
- m_pbRc = &bRc;
+ m_pbRc = pbRc;
m_bFieldFull = bFieldFull;
}
-void CJS_EventHandler::OnField_Validate(WideString& strChange,
+void CJS_EventHandler::OnField_Validate(WideString* strChange,
const WideString& strChangeEx,
bool bKeyDown,
bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) {
+ WideString* pValue,
+ bool* pbRc) {
+ ASSERT(pValue && pbRc);
Initialize(JET_FIELD_VALIDATE);
- m_pWideStrChange = &strChange;
+ m_pWideStrChange = strChange;
m_WideStrChangeEx = strChangeEx;
m_bKeyDown = bKeyDown;
m_bModifier = bModifier;
m_bShift = bShift;
m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_pbRc = &bRc;
+ m_pValue = pValue;
+ m_pbRc = pbRc;
}
void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) {
+ WideString* pValue,
+ bool* pRc) {
+ ASSERT(pValue && pRc);
Initialize(JET_FIELD_CALCULATE);
if (pSource)
m_strSourceName = pSource->GetFullName();
m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_pbRc = &bRc;
+ m_pValue = pValue;
+ m_pbRc = pRc;
}
void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
- WideString& Value,
+ WideString* pValue,
bool bWillCommit) {
+ ASSERT(pValue);
Initialize(JET_FIELD_FORMAT);
m_nCommitKey = 0;
m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
+ m_pValue = pValue;
m_bWillCommit = bWillCommit;
}
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;
diff --git a/fxjs/ijs_event_context.h b/fxjs/ijs_event_context.h
index 8317bc29be..a81f9fb5cc 100644
--- a/fxjs/ijs_event_context.h
+++ b/fxjs/ijs_event_context.h
@@ -57,39 +57,38 @@ class IJS_EventContext {
virtual void OnField_Focus(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) = 0;
+ WideString* Value) = 0;
virtual void OnField_Blur(bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- const WideString& Value) = 0;
-
+ WideString* Value) = 0;
virtual void OnField_Calculate(CPDF_FormField* pSource,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) = 0;
+ WideString* Value,
+ bool* bRc) = 0;
virtual void OnField_Format(CPDF_FormField* pTarget,
- WideString& Value,
+ WideString* Value,
bool bWillCommit) = 0;
- virtual void OnField_Keystroke(WideString& strChange,
+ virtual 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) = 0;
- virtual void OnField_Validate(WideString& strChange,
+ bool* bRc) = 0;
+ virtual void OnField_Validate(WideString* strChange,
const WideString& strChangeEx,
bool bKeyDown,
bool bModifier,
bool bShift,
CPDF_FormField* pTarget,
- WideString& Value,
- bool& bRc) = 0;
+ WideString* Value,
+ bool* bRc) = 0;
virtual void OnScreen_Focus(bool bModifier,
bool bShift,