summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_fffield.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-12-07 18:47:00 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 18:47:00 -0800
commitda911bc12558667555266425d0b7e83296e8cc7d (patch)
treed0e0e84597e30f2d59856a9a55b737f49faa9522 /xfa/fxfa/app/xfa_fffield.cpp
parent67c6ca3cd86b6a31c888264bb8067c6c4324e56c (diff)
downloadpdfium-da911bc12558667555266425d0b7e83296e8cc7d.tar.xz
Convert GetWidgetRect to return rect.
Current GetWidgetRect accepts the rect as an out-param. This CL converts the code to return the rect instead. Review-Url: https://codereview.chromium.org/2556873004
Diffstat (limited to 'xfa/fxfa/app/xfa_fffield.cpp')
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 136a99cb6c..9b5504708f 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -69,8 +69,8 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS,
DrawBorder(pGS, borderUI, m_rtUI, &mtRotate);
RenderCaption(pGS, &mtRotate);
DrawHighlight(pGS, &mtRotate, dwStatus, false);
- CFX_RectF rtWidget;
- m_pNormalWidget->GetWidgetRect(rtWidget, false);
+
+ CFX_RectF rtWidget = m_pNormalWidget->GetWidgetRect();
CFX_Matrix mt;
mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
mt.Concat(mtRotate);
@@ -363,15 +363,16 @@ bool CXFA_FFField::OnMouseExit() {
TranslateFWLMessage(&ms);
return true;
}
+
void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) {
- if (!m_pNormalWidget) {
+ if (!m_pNormalWidget)
return;
- }
- CFX_RectF rtWidget;
- m_pNormalWidget->GetWidgetRect(rtWidget, false);
+
+ CFX_RectF rtWidget = m_pNormalWidget->GetWidgetRect();
fx -= rtWidget.left;
fy -= rtWidget.top;
}
+
bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
return false;
@@ -585,20 +586,15 @@ FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
return FWL_WidgetHit::Titlebar;
return FWL_WidgetHit::Border;
}
+
bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
return true;
}
+
bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
- if (!m_pNormalWidget) {
- return false;
- }
- CFX_RectF rtWidget;
- m_pNormalWidget->GetWidgetRect(rtWidget, false);
- if (rtWidget.Contains(fx, fy)) {
- return true;
- }
- return false;
+ return m_pNormalWidget && m_pNormalWidget->GetWidgetRect().Contains(fx, fy);
}
+
void CXFA_FFField::LayoutCaption() {
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
if (!pCapTextLayout)