diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-07-05 09:28:15 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-05 15:31:45 +0000 |
commit | fb00ec2af390ccfe8f5e81f49b9113e044f5e5ad (patch) | |
tree | 9f1c89f504db465251d46d5de4cd9042e2d5c663 /fpdfsdk/pdfwindow/cpwl_list_box.cpp | |
parent | e5e889eec8b362f5c65fc142660ad745a0d5cf21 (diff) | |
download | pdfium-fb00ec2af390ccfe8f5e81f49b9113e044f5e5ad.tar.xz |
Move PNM_SETSCROLLINFO out of OnNotify
This CL moves the SETSCROLLINFO from a OnNotify message to a method
which is called directly.
Change-Id: I5d793c1c7a54c0fa3bdadffac72aae934cb9da57
Reviewed-on: https://pdfium-review.googlesource.com/7251
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_list_box.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/cpwl_list_box.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_list_box.cpp b/fpdfsdk/pdfwindow/cpwl_list_box.cpp index f612c2945b..25842b3d63 100644 --- a/fpdfsdk/pdfwindow/cpwl_list_box.cpp +++ b/fpdfsdk/pdfwindow/cpwl_list_box.cpp @@ -31,15 +31,12 @@ void CPWL_List_Notify::IOnSetScrollInfoY(float fPlateMin, float fSmallStep, float fBigStep) { PWL_SCROLL_INFO Info; - Info.fPlateWidth = fPlateMax - fPlateMin; Info.fContentMin = fContentMin; Info.fContentMax = fContentMax; Info.fSmallStep = fSmallStep; Info.fBigStep = fBigStep; - - m_pList->OnNotify(m_pList.Get(), PNM_SETSCROLLINFO, SBT_VSCROLL, - reinterpret_cast<intptr_t>(&Info)); + m_pList->SetScrollInfo(Info); if (CPWL_ScrollBar* pScroll = m_pList->GetVScrollBar()) { if (IsFloatBigger(Info.fPlateWidth, Info.fContentMax - Info.fContentMin) || @@ -288,6 +285,11 @@ bool CPWL_ListBox::OnMouseMove(const CFX_PointF& point, uint32_t nFlag) { return true; } +void CPWL_ListBox::SetScrollInfo(const PWL_SCROLL_INFO& info) { + if (CPWL_Wnd* pChild = GetVScrollBar()) + pChild->SetScrollInfo(info); +} + void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, uint32_t msg, intptr_t wParam, @@ -297,15 +299,6 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, float fPos; switch (msg) { - case PNM_SETSCROLLINFO: - switch (wParam) { - case SBT_VSCROLL: - if (CPWL_Wnd* pChild = GetVScrollBar()) { - pChild->OnNotify(pWnd, PNM_SETSCROLLINFO, wParam, lParam); - } - break; - } - break; case PNM_SETSCROLLPOS: switch (wParam) { case SBT_VSCROLL: |