diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-07-05 16:00:48 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-05 21:24:34 +0000 |
commit | 0fdd1aea658bc65e4d136c58818451b9ddad00e0 (patch) | |
tree | 7b435514a01e74198159de880f65408e1b77ab2e /fpdfsdk/pdfwindow/cpwl_edit.cpp | |
parent | d32623b507c7e78221eb9f5f62641e3113501a5c (diff) | |
download | pdfium-0fdd1aea658bc65e4d136c58818451b9ddad00e0.tar.xz |
Cleanup IOn* methods and CPWL_CBEdit
This CL removes various IOn* methods and consolidates code where
possible. The CPWL_CBEdit class is also removed as it was a subclass
of CPWL_Edit which added no extra functionality.
Change-Id: Ifac579ab252b7ca64f8c9b3caeac443683a39c58
Reviewed-on: https://pdfium-review.googlesource.com/7279
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_edit.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/cpwl_edit.cpp | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_edit.cpp b/fpdfsdk/pdfwindow/cpwl_edit.cpp index 4ad107653d..de21dac144 100644 --- a/fpdfsdk/pdfwindow/cpwl_edit.cpp +++ b/fpdfsdk/pdfwindow/cpwl_edit.cpp @@ -451,7 +451,12 @@ void CPWL_Edit::OnSetFocus() { } void CPWL_Edit::OnKillFocus() { - ShowVScrollBar(false); + CPWL_ScrollBar* pScroll = GetVScrollBar(); + if (pScroll && pScroll->IsVisible()) { + pScroll->SetVisible(false); + Move(m_rcOldWindow, true, true); + } + m_pEdit->SelectNone(); SetCaret(false, CFX_PointF(), CFX_PointF()); SetCharSet(FX_CHARSET_ANSI); @@ -569,30 +574,9 @@ CFX_FloatRect CPWL_Edit::GetFocusRect() const { return CFX_FloatRect(); } -void CPWL_Edit::ShowVScrollBar(bool bShow) { - if (CPWL_ScrollBar* pScroll = GetVScrollBar()) { - if (bShow) { - if (!pScroll->IsVisible()) { - pScroll->SetVisible(true); - CFX_FloatRect rcWindow = GetWindowRect(); - m_rcOldWindow = rcWindow; - rcWindow.right += PWL_SCROLLBAR_WIDTH; - Move(rcWindow, true, true); - } - } else { - if (pScroll->IsVisible()) { - pScroll->SetVisible(false); - Move(m_rcOldWindow, true, true); - } - } - } -} - bool CPWL_Edit::IsVScrollBarVisible() const { - if (CPWL_ScrollBar* pScroll = GetVScrollBar()) { + if (CPWL_ScrollBar* pScroll = GetVScrollBar()) return pScroll->IsVisible(); - } - return false; } |