diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-03 11:11:16 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-03 17:21:40 +0000 |
commit | cbd4410908e2a4898fdd5e0d6d17591fc2c71f54 (patch) | |
tree | 85ee81736d4c8de97e117a6500fafe6ac3c726fb /xfa/fxfa/parser/cxfa_widgetdata.cpp | |
parent | cf3d40d10276686f972761bafd005a7715f6eb1c (diff) | |
download | pdfium-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/parser/cxfa_widgetdata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index ba10f244d3..0f31fbafaa 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -275,9 +275,9 @@ CXFA_FontData CXFA_WidgetData::GetFontData(bool bModified) { 0, XFA_Element::Font, bModified)); } -CXFA_MarginData CXFA_WidgetData::GetMarginData() { - return CXFA_MarginData(m_pNode->JSObject()->GetProperty<CXFA_Margin>( - 0, XFA_Element::Margin, false)); +CXFA_Margin* CXFA_WidgetData::GetMargin() { + return m_pNode->JSObject()->GetProperty<CXFA_Margin>(0, XFA_Element::Margin, + false); } CXFA_Para* CXFA_WidgetData::GetPara() { @@ -373,12 +373,13 @@ CXFA_BorderData CXFA_WidgetData::GetUIBorderData() { CFX_RectF CXFA_WidgetData::GetUIMargin() { CXFA_Node* pUIChild = GetUIChild(); - CXFA_MarginData mgUI = - CXFA_MarginData(pUIChild ? pUIChild->JSObject()->GetProperty<CXFA_Margin>( - 0, XFA_Element::Margin, false) - : nullptr); + CXFA_Margin* mgUI = nullptr; + if (pUIChild) { + mgUI = pUIChild->JSObject()->GetProperty<CXFA_Margin>( + 0, XFA_Element::Margin, false); + } - if (!mgUI.HasValidNode()) + if (!mgUI) return CFX_RectF(); CXFA_BorderData borderData = GetUIBorderData(); @@ -387,10 +388,10 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { return CFX_RectF(); } - pdfium::Optional<float> left = mgUI.TryLeftInset(); - pdfium::Optional<float> top = mgUI.TryTopInset(); - pdfium::Optional<float> right = mgUI.TryRightInset(); - pdfium::Optional<float> bottom = mgUI.TryBottomInset(); + pdfium::Optional<float> left = mgUI->TryLeftInset(); + pdfium::Optional<float> top = mgUI->TryTopInset(); + pdfium::Optional<float> right = mgUI->TryRightInset(); + pdfium::Optional<float> bottom = mgUI->TryBottomInset(); if (borderData.HasValidNode()) { bool bVisible = false; float fThickness = 0; |