summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_datetimepicker.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-03-08 18:09:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-08 18:09:49 +0000
commita724cb2df9f7b766174ac578cd4d435596898cc1 (patch)
tree31af95a1bad460b72e2ce8e1a5922709494e12e9 /xfa/fwl/cfwl_datetimepicker.cpp
parent403d1ad40b3bc8a96a28fc211fff2c106f590ed8 (diff)
downloadpdfium-a724cb2df9f7b766174ac578cd4d435596898cc1.tar.xz
Move GetPopupPos from CFWL_Widget to subclasses that call it.
Change-Id: I27118d2c8d0d7e4509b6a89cd32a7c9c906d19bc Reviewed-on: https://pdfium-review.googlesource.com/28270 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_datetimepicker.cpp')
-rw-r--r--xfa/fwl/cfwl_datetimepicker.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index f3da454354..101540ffc0 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -604,3 +604,24 @@ void CFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg,
rtInvalidate.Inflate(2, 2);
RepaintRect(rtInvalidate);
}
+
+void CFWL_DateTimePicker::GetPopupPos(float fMinHeight,
+ float fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
+ if (m_pWidgetMgr->IsFormDisabled()) {
+ m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor,
+ rtPopup);
+ 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);
+}