diff options
Diffstat (limited to 'fpdfsdk/pwl')
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit.cpp | 11 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_list_box.cpp | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp index 0b74a1896e..662c69e369 100644 --- a/fpdfsdk/pwl/cpwl_edit.cpp +++ b/fpdfsdk/pwl/cpwl_edit.cpp @@ -481,11 +481,17 @@ bool CPWL_Edit::OnKeyDown(uint16_t nChar, uint32_t nFlag) { if (nSelStart == nSelEnd) nSelEnd = nSelStart + 1; + CPWL_Wnd::ObservedPtr thisObserved(this); + bool bRC; bool bExit; std::tie(bRC, bExit) = m_pFillerNotify->OnBeforeKeyStroke( GetAttachedData(), strChange, strChangeEx, nSelStart, nSelEnd, true, nFlag); + + if (!thisObserved) + return false; + if (!bRC) return false; if (bExit) @@ -558,10 +564,15 @@ bool CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) { break; } + CPWL_Wnd::ObservedPtr thisObserved(this); + WideString strChangeEx; std::tie(bRC, bExit) = m_pFillerNotify->OnBeforeKeyStroke( GetAttachedData(), swChange, strChangeEx, nSelStart, nSelEnd, true, nFlag); + + if (!thisObserved) + return false; } } diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp index b5c629392b..c8f7be995d 100644 --- a/fpdfsdk/pwl/cpwl_list_box.cpp +++ b/fpdfsdk/pwl/cpwl_list_box.cpp @@ -260,6 +260,8 @@ bool CPWL_ListBox::OnNotifySelectionChanged(bool bKeyDown, uint32_t nFlag) { if (!m_pFillerNotify) return false; + CPWL_Wnd::ObservedPtr thisObserved(this); + WideString swChange = GetText(); WideString strChangeEx; int nSelStart = 0; @@ -269,6 +271,10 @@ bool CPWL_ListBox::OnNotifySelectionChanged(bool bKeyDown, uint32_t nFlag) { std::tie(bRC, bExit) = m_pFillerNotify->OnBeforeKeyStroke( GetAttachedData(), swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, nFlag); + + if (!thisObserved) + return false; + return bExit; } |