summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_datetimepicker.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-05-02 20:46:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-02 20:46:38 +0000
commit20c62003660cc7bf7ab28a5e638556e22d5a525b (patch)
treee8c45ca96b1441a8743b8a1cd8934e4e2523ee7e /xfa/fwl/cfwl_datetimepicker.cpp
parentcef665eb28bbf4caaa5625332be8f891e3ec2a8e (diff)
downloadpdfium-20c62003660cc7bf7ab28a5e638556e22d5a525b.tar.xz
Use pointers instead of refs for GetPopupPos() params.
Change-Id: Ic19b91f91f08b1867437b22de04a2c54045ce8ae Reviewed-on: https://pdfium-review.googlesource.com/31992 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_datetimepicker.cpp')
-rw-r--r--xfa/fwl/cfwl_datetimepicker.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 101540ffc0..66e55dea9c 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -241,7 +241,7 @@ void CFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) {
CFX_RectF rtAnchor(0, 0, m_pProperties->m_rtWidget.width,
m_pProperties->m_rtWidget.height);
- GetPopupPos(0, rtMonth.height, rtAnchor, rtMonth);
+ GetPopupPos(0, rtMonth.height, rtAnchor, &rtMonth);
m_pForm->SetWidgetRect(rtMonth);
rtMonth.left = rtMonth.top = 0;
@@ -356,7 +356,7 @@ void CFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) {
rtAnchor.width = rtMonthCal.width;
rtMonthCal.left = m_rtClient.left;
rtMonthCal.top = rtAnchor.Height();
- GetPopupPos(fPopupMin, fPopupMax, rtAnchor, rtMonthCal);
+ GetPopupPos(fPopupMin, fPopupMax, rtAnchor, &rtMonthCal);
m_pMonthCal->SetWidgetRect(rtMonthCal);
if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0)
m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay);
@@ -608,20 +608,18 @@ void CFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg,
void CFWL_DateTimePicker::GetPopupPos(float fMinHeight,
float fMaxHeight,
const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+ CFX_RectF* pPopupRect) {
if (m_pWidgetMgr->IsFormDisabled()) {
m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor,
- rtPopup);
+ pPopupRect);
return;
}
CFX_PointF point = TransformTo(nullptr, CFX_PointF());
- if (rtAnchor.bottom() + point.y > 0.0f) {
- rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.top - rtPopup.height,
- rtPopup.width, rtPopup.height);
- } else {
- rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.bottom(), rtPopup.width,
- rtPopup.height);
- }
- rtPopup.Offset(point.x, point.y);
+ float fPopupTop = (rtAnchor.bottom() + point.y > 0.0f)
+ ? rtAnchor.top - pPopupRect->height
+ : rtAnchor.bottom();
+ *pPopupRect = CFX_RectF(rtAnchor.left, fPopupTop, pPopupRect->width,
+ pPopupRect->height);
+ pPopupRect->Offset(point.x, point.y);
}