summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_edit_ctrl.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_edit_ctrl.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_edit_ctrl.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_edit_ctrl.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_edit_ctrl.cpp b/fpdfsdk/pdfwindow/cpwl_edit_ctrl.cpp
index e6076e15ae..f18aaaa130 100644
--- a/fpdfsdk/pdfwindow/cpwl_edit_ctrl.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_edit_ctrl.cpp
@@ -69,6 +69,11 @@ void CPWL_EditCtrl::SetScrollInfo(const PWL_SCROLL_INFO& info) {
pChild->SetScrollInfo(info);
}
+void CPWL_EditCtrl::SetScrollPosition(float pos) {
+ if (CPWL_Wnd* pChild = GetVScrollBar())
+ pChild->SetScrollPosition(pos);
+}
+
void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd,
uint32_t msg,
intptr_t wParam,
@@ -76,15 +81,6 @@ void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd,
CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
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: {
float fPos = *(float*)lParam;
switch (wParam) {
@@ -453,7 +449,7 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(float fPlateMin,
}
void CPWL_EditCtrl::IOnSetScrollPosY(float fy) {
- OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
+ SetScrollPosition(fy);
}
void CPWL_EditCtrl::IOnSetCaret(bool bVisible,