summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_list_box.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-07-05 09:39:50 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-05 18:05:50 +0000
commit7e0336e278d69f1d66967db7375c75322da55d69 (patch)
tree505496fa39ac02cbaf4f4fbb8cb9dd0a20cc9ea4 /fpdfsdk/pdfwindow/cpwl_list_box.cpp
parent3ff54008a163eea3158a7c107595daf79ccc7d44 (diff)
downloadpdfium-7e0336e278d69f1d66967db7375c75322da55d69.tar.xz
Move PNM_SETSCROLLPOS to custom method
This CL splits PNM_SETSCROLLPOS out of OnNotify and places into a method which is called as needed. Change-Id: Ic144bc30bca57869f0679bef40e07b6a130e944c Reviewed-on: https://pdfium-review.googlesource.com/7252 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.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_list_box.cpp b/fpdfsdk/pdfwindow/cpwl_list_box.cpp
index 25842b3d63..be6d00f62b 100644
--- a/fpdfsdk/pdfwindow/cpwl_list_box.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_list_box.cpp
@@ -55,8 +55,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(float fPlateMin,
}
void CPWL_List_Notify::IOnSetScrollPosY(float fy) {
- m_pList->OnNotify(m_pList.Get(), PNM_SETSCROLLPOS, SBT_VSCROLL,
- reinterpret_cast<intptr_t>(&fy));
+ m_pList->SetScrollPosition(fy);
}
void CPWL_List_Notify::IOnInvalidateRect(CFX_FloatRect* pRect) {
@@ -290,6 +289,11 @@ void CPWL_ListBox::SetScrollInfo(const PWL_SCROLL_INFO& info) {
pChild->SetScrollInfo(info);
}
+void CPWL_ListBox::SetScrollPosition(float pos) {
+ if (CPWL_Wnd* pChild = GetVScrollBar())
+ pChild->SetScrollPosition(pos);
+}
+
void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
uint32_t msg,
intptr_t wParam,
@@ -299,15 +303,6 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
float fPos;
switch (msg) {
- case PNM_SETSCROLLPOS:
- switch (wParam) {
- case SBT_VSCROLL:
- if (CPWL_Wnd* pChild = GetVScrollBar()) {
- pChild->OnNotify(pWnd, PNM_SETSCROLLPOS, wParam, lParam);
- }
- break;
- }
- break;
case PNM_SCROLLWINDOW:
fPos = *(float*)lParam;
switch (wParam) {