diff options
Diffstat (limited to 'fpdfsdk/pwl/cpwl_edit.cpp')
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp index 662c69e369..650db5438b 100644 --- a/fpdfsdk/pwl/cpwl_edit.cpp +++ b/fpdfsdk/pwl/cpwl_edit.cpp @@ -79,13 +79,18 @@ void CPWL_Edit::SetText(const WideString& csText) { m_pEdit->SetText(swText); } -void CPWL_Edit::RePosChildWnd() { +bool CPWL_Edit::RePosChildWnd() { if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { CFX_FloatRect rcWindow = m_rcOldWindow; CFX_FloatRect rcVScroll = CFX_FloatRect(rcWindow.right, rcWindow.bottom, rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); + + ObservedPtr thisObserved(this); + pVSB->Move(rcVScroll, true, false); + if (!thisObserved) + return false; } if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW)) { @@ -98,7 +103,7 @@ void CPWL_Edit::RePosChildWnd() { m_pEditCaret->SetClipRect(rect); } - CPWL_EditCtrl::RePosChildWnd(); + return CPWL_EditCtrl::RePosChildWnd(); } CFX_FloatRect CPWL_Edit::GetClientRect() const { @@ -290,8 +295,8 @@ bool CPWL_Edit::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) { - if (m_bMouseDown) - InvalidateRect(nullptr); + if (m_bMouseDown && !InvalidateRect(nullptr)) + return true; m_bMouseDown = true; SetCapture(); @@ -355,17 +360,15 @@ void CPWL_Edit::OnKillFocus() { if (!observed_ptr) return; - Move(m_rcOldWindow, true, true); + if (!Move(m_rcOldWindow, true, true)) + return; } - if (!observed_ptr) - return; m_pEdit->SelectNone(); if (!observed_ptr) return; - SetCaret(false, CFX_PointF(), CFX_PointF()); - if (!observed_ptr) + if (!SetCaret(false, CFX_PointF(), CFX_PointF())) return; SetCharSet(FX_CHARSET_ANSI); |