From 85f019a8e7d33cbba368a6c6b75fd091269e14a1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 17 Mar 2017 15:14:19 -0700 Subject: Add pdfium::clamp() as a placeholder for std::clamp(). Ue it to fix a typo as well. BUG=pdfium:634 Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404 Reviewed-on: https://pdfium-review.googlesource.com/3113 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- xfa/fwl/cfwl_listbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fwl/cfwl_listbox.cpp') diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index 925c6f1f72..c858063d07 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -527,7 +527,7 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) { m_pVertScrollBar->SetStepSize(m_fItemHeight); float fPos = - std::min(std::max(m_pVertScrollBar->GetPos(), 0.f), szRange.height); + pdfium::clamp(m_pVertScrollBar->GetPos(), 0.0f, szRange.height); m_pVertScrollBar->SetPos(fPos); m_pVertScrollBar->SetTrackPos(fPos); if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) == @@ -559,7 +559,7 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) { m_pHorzScrollBar->SetStepSize(fWidth / 10); float fPos = - std::min(std::max(m_pHorzScrollBar->GetPos(), 0.f), szRange.height); + pdfium::clamp(m_pHorzScrollBar->GetPos(), 0.0f, szRange.height); m_pHorzScrollBar->SetPos(fPos); m_pHorzScrollBar->SetTrackPos(fPos); if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) == -- cgit v1.2.3