diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-12-14 20:09:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-14 20:09:43 +0000 |
commit | 0821c95ee9f132f77f3670a7dbbf114a82a6b9a0 (patch) | |
tree | fd736c2764ee7b1e187995548a608ed431601ac7 /xfa/fxfa/parser/cxfa_value.cpp | |
parent | dcbb8e53e604178dc97d12846ddbdef88be41297 (diff) | |
download | pdfium-0821c95ee9f132f77f3670a7dbbf114a82a6b9a0.tar.xz |
Fold CXFA_ValueData into CXFA_Value
The CXFA_ValueData class is a thin wrapper around the CXFA_Value, this
CL moves the methods from CXFA_ValueData into CXFA_Value.
Change-Id: I2c57e93e5c4675b82af71cf75f2dfc0fb12e4b20
Reviewed-on: https://pdfium-review.googlesource.com/21170
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_value.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_value.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_value.cpp b/xfa/fxfa/parser/cxfa_value.cpp index 4de833a8fc..aae11da211 100644 --- a/xfa/fxfa/parser/cxfa_value.cpp +++ b/xfa/fxfa/parser/cxfa_value.cpp @@ -50,3 +50,39 @@ CXFA_Value::CXFA_Value(CXFA_Document* doc, XFA_PacketType packet) pdfium::MakeUnique<CJX_Value>(this)) {} CXFA_Value::~CXFA_Value() {} + +XFA_Element CXFA_Value::GetChildValueClassID() const { + CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_FirstChild); + return pNode ? pNode->GetElementType() : XFA_Element::Unknown; +} + +WideString CXFA_Value::GetChildValueContent() const { + CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_FirstChild); + if (!pNode) + return L""; + return pNode->JSObject()->TryContent(false, true).value_or(L""); +} + +CXFA_ArcData CXFA_Value::GetArcData() const { + return CXFA_ArcData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} + +CXFA_LineData CXFA_Value::GetLineData() const { + return CXFA_LineData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} + +CXFA_RectangleData CXFA_Value::GetRectangleData() const { + return CXFA_RectangleData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} + +CXFA_TextData CXFA_Value::GetTextData() const { + return CXFA_TextData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} + +CXFA_ExDataData CXFA_Value::GetExData() const { + return CXFA_ExDataData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} + +CXFA_ImageData CXFA_Value::GetImageData() const { + return CXFA_ImageData(GetNodeItem(XFA_NODEITEM_FirstChild)); +} |