summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_widgetdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-03 12:01:24 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-03 18:20:01 +0000
commit39628b04bc86461426f2dcf5a568f5e9e70ad997 (patch)
treea0cf6c494a74b83e93a5cc526ab5897a08e3d743 /xfa/fxfa/parser/cxfa_widgetdata.cpp
parent9647614a5dcd00d50aacf4e000fd23a5ebb13931 (diff)
downloadpdfium-39628b04bc86461426f2dcf5a568f5e9e70ad997.tar.xz
Change CXFA_BoxData to CXFA_Box
This CL renames CXFA_BoxData to CXFA_Box and sets it to inhert from CXFA_Node instead of CXFA_DataData. The CXFA_BoxData subclasses, CXFA_RectangleData, CXFA_BorderData and CXFA_ArcData classes are removed and the nodes now inherit from CXFA_Box. Change-Id: Ia0df7d56535b5d90be29f040180a5d5fc55a64e0 Reviewed-on: https://pdfium-review.googlesource.com/22091 Reviewed-by: Ryan Harrison <rharrison@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.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 0f31fbafaa..8fef4b4418 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -260,9 +260,9 @@ int32_t CXFA_WidgetData::GetRotate() const {
return degrees ? XFA_MapRotation(*degrees) / 90 * 90 : 0;
}
-CXFA_BorderData CXFA_WidgetData::GetBorderData(bool bModified) {
- return CXFA_BorderData(m_pNode->JSObject()->GetProperty<CXFA_Border>(
- 0, XFA_Element::Border, bModified));
+CXFA_Border* CXFA_WidgetData::GetBorder(bool bModified) {
+ return m_pNode->JSObject()->GetProperty<CXFA_Border>(0, XFA_Element::Border,
+ bModified);
}
CXFA_CaptionData CXFA_WidgetData::GetCaptionData() {
@@ -363,12 +363,11 @@ pdfium::Optional<float> CXFA_WidgetData::TryMaxHeight() {
return TryMeasureAsFloat(XFA_Attribute::MaxH);
}
-CXFA_BorderData CXFA_WidgetData::GetUIBorderData() {
+CXFA_Border* CXFA_WidgetData::GetUIBorder() {
CXFA_Node* pUIChild = GetUIChild();
- return CXFA_BorderData(pUIChild
- ? pUIChild->JSObject()->GetProperty<CXFA_Border>(
- 0, XFA_Element::Border, false)
- : nullptr);
+ return pUIChild ? pUIChild->JSObject()->GetProperty<CXFA_Border>(
+ 0, XFA_Element::Border, false)
+ : nullptr;
}
CFX_RectF CXFA_WidgetData::GetUIMargin() {
@@ -382,23 +381,21 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() {
if (!mgUI)
return CFX_RectF();
- CXFA_BorderData borderData = GetUIBorderData();
- if (borderData.HasValidNode() &&
- borderData.GetPresence() != XFA_AttributeEnum::Visible) {
+ CXFA_Border* border = GetUIBorder();
+ if (border && border->GetPresence() != XFA_AttributeEnum::Visible)
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();
- if (borderData.HasValidNode()) {
+ if (border) {
bool bVisible = false;
float fThickness = 0;
XFA_AttributeEnum iType = XFA_AttributeEnum::Unknown;
- std::tie(iType, bVisible, fThickness) = borderData.Get3DStyle();
+ std::tie(iType, bVisible, fThickness) = border->Get3DStyle();
if (!left || !top || !right || !bottom) {
- std::vector<CXFA_StrokeData> strokes = borderData.GetStrokes();
+ std::vector<CXFA_StrokeData> strokes = border->GetStrokes();
if (!top)
top = GetEdgeThickness(strokes, bVisible, 0);
if (!right)