summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-13 12:23:30 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-13 12:23:30 -0700
commitf86ca3884886506c999a3b521078151e7cda0bf9 (patch)
tree691e3fe357541698159f3ca903a85461e20a43f0 /fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
parentf34518bd1379289659b4c050d140690ba8f8b8aa (diff)
downloadpdfium-f86ca3884886506c999a3b521078151e7cda0bf9.tar.xz
Remove more strcmp/memcmp usage.
Review-Url: https://codereview.chromium.org/2340513002
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_ScrollBar.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 1789d15764..17f62f58d6 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -818,15 +818,14 @@ void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
}
break;
case PNM_SETSCROLLINFO: {
- if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam) {
- if (FXSYS_memcmp(&m_OriginInfo, pInfo, sizeof(PWL_SCROLL_INFO)) != 0) {
- m_OriginInfo = *pInfo;
- FX_FLOAT fMax =
- pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
- fMax = fMax > 0.0f ? fMax : 0.0f;
- SetScrollRange(0, fMax, pInfo->fPlateWidth);
- SetScrollStep(pInfo->fBigStep, pInfo->fSmallStep);
- }
+ PWL_SCROLL_INFO* pInfo = reinterpret_cast<PWL_SCROLL_INFO*>(lParam);
+ if (pInfo && *pInfo != m_OriginInfo) {
+ m_OriginInfo = *pInfo;
+ FX_FLOAT fMax =
+ pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
+ fMax = fMax > 0.0f ? fMax : 0.0f;
+ SetScrollRange(0, fMax, pInfo->fPlateWidth);
+ SetScrollStep(pInfo->fBigStep, pInfo->fSmallStep);
}
} break;
case PNM_SETSCROLLPOS: {
@@ -1183,13 +1182,12 @@ void CPWL_ScrollBar::CreateChildWnd(const PWL_CREATEPARAM& cp) {
void CPWL_ScrollBar::TimerProc() {
PWL_SCROLL_PRIVATEDATA sTemp = m_sData;
-
if (m_bMinOrMax)
m_sData.SubSmall();
else
m_sData.AddSmall();
- if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) {
+ if (sTemp != m_sData) {
MovePosButton(TRUE);
NotifyScrollWindow();
}