summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffcheckbutton.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-03 11:11:16 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-03 17:21:40 +0000
commitcbd4410908e2a4898fdd5e0d6d17591fc2c71f54 (patch)
tree85ee81736d4c8de97e117a6500fafe6ac3c726fb /xfa/fxfa/cxfa_ffcheckbutton.cpp
parentcf3d40d10276686f972761bafd005a7715f6eb1c (diff)
downloadpdfium-cbd4410908e2a4898fdd5e0d6d17591fc2c71f54.tar.xz
Fold CXFA_MarginData into CXFA_Marginchromium/3311
This CL removes the CXFA_MarginData wrapper and moves the methods directly to CXFA_Margin. Change-Id: I7c9e979fb78d0d356605f1318489daabcb8c32cd Reviewed-on: https://pdfium-review.googlesource.com/22110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffcheckbutton.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffcheckbutton.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp
index 8dc2882504..00369784e1 100644
--- a/xfa/fxfa/cxfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp
@@ -89,10 +89,10 @@ bool CXFA_FFCheckButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
float fCheckSize = m_pDataAcc->GetCheckButtonSize();
- CXFA_MarginData marginData = m_pDataAcc->GetMarginData();
+ CXFA_Margin* margin = m_pDataAcc->GetMargin();
CFX_RectF rtWidget = GetRectWithoutRotate();
- if (marginData.HasValidNode())
- XFA_RectWidthoutMargin(rtWidget, marginData);
+ if (margin)
+ XFA_RectWidthoutMargin(rtWidget, margin);
XFA_AttributeEnum iCapPlacement = XFA_AttributeEnum::Unknown;
float fCapReserve = 0;
@@ -120,18 +120,18 @@ bool CXFA_FFCheckButton::PerformLayout() {
}
m_rtUI = rtWidget;
- CXFA_MarginData captionMarginData = captionData.GetMarginData();
+ CXFA_Margin* captionMargin = captionData.GetMargin();
switch (iCapPlacement) {
case XFA_AttributeEnum::Left: {
m_rtCaption.width = fCapReserve;
- CapLeftRightPlacement(captionMarginData);
+ CapLeftRightPlacement(captionMargin);
m_rtUI.width -= fCapReserve;
m_rtUI.left += fCapReserve;
break;
}
case XFA_AttributeEnum::Top: {
m_rtCaption.height = fCapReserve;
- XFA_RectWidthoutMargin(m_rtCaption, captionMarginData);
+ XFA_RectWidthoutMargin(m_rtCaption, captionMargin);
m_rtUI.height -= fCapReserve;
m_rtUI.top += fCapReserve;
break;
@@ -139,14 +139,14 @@ bool CXFA_FFCheckButton::PerformLayout() {
case XFA_AttributeEnum::Right: {
m_rtCaption.left = m_rtCaption.right() - fCapReserve;
m_rtCaption.width = fCapReserve;
- CapLeftRightPlacement(captionMarginData);
+ CapLeftRightPlacement(captionMargin);
m_rtUI.width -= fCapReserve;
break;
}
case XFA_AttributeEnum::Bottom: {
m_rtCaption.top = m_rtCaption.bottom() - fCapReserve;
m_rtCaption.height = fCapReserve;
- XFA_RectWidthoutMargin(m_rtCaption, captionMarginData);
+ XFA_RectWidthoutMargin(m_rtCaption, captionMargin);
m_rtUI.height -= fCapReserve;
break;
}
@@ -173,9 +173,9 @@ bool CXFA_FFCheckButton::PerformLayout() {
m_rtCheckBox = m_rtUI;
CXFA_BorderData borderUIData = m_pDataAcc->GetUIBorderData();
if (borderUIData.HasValidNode()) {
- CXFA_MarginData borderMarginData = borderUIData.GetMarginData();
- if (borderMarginData.HasValidNode())
- XFA_RectWidthoutMargin(m_rtUI, borderMarginData);
+ CXFA_Margin* borderMargin = borderUIData.GetMargin();
+ if (borderMargin)
+ XFA_RectWidthoutMargin(m_rtUI, borderMargin);
}
m_rtUI.Normalize();
@@ -188,8 +188,8 @@ bool CXFA_FFCheckButton::PerformLayout() {
}
void CXFA_FFCheckButton::CapLeftRightPlacement(
- const CXFA_MarginData& captionMarginData) {
- XFA_RectWidthoutMargin(m_rtCaption, captionMarginData);
+ const CXFA_Margin* captionMargin) {
+ XFA_RectWidthoutMargin(m_rtCaption, captionMargin);
if (m_rtCaption.height < 0)
m_rtCaption.top += m_rtCaption.height;
if (m_rtCaption.width < 0) {