summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/parser/cxfa_bind.cpp7
-rw-r--r--xfa/fxfa/parser/cxfa_bind.h2
-rw-r--r--xfa/fxfa/parser/cxfa_binddata.cpp18
-rw-r--r--xfa/fxfa/parser/cxfa_binddata.h22
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp12
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.h4
6 files changed, 17 insertions, 48 deletions
diff --git a/xfa/fxfa/parser/cxfa_bind.cpp b/xfa/fxfa/parser/cxfa_bind.cpp
index e93b3696df..a9779f2514 100644
--- a/xfa/fxfa/parser/cxfa_bind.cpp
+++ b/xfa/fxfa/parser/cxfa_bind.cpp
@@ -8,6 +8,7 @@
#include "fxjs/xfa/cjx_bind.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fxfa/parser/cxfa_picture.h"
namespace {
@@ -43,3 +44,9 @@ CXFA_Bind::CXFA_Bind(CXFA_Document* doc, XFA_PacketType packet)
pdfium::MakeUnique<CJX_Bind>(this)) {}
CXFA_Bind::~CXFA_Bind() {}
+
+WideString CXFA_Bind::GetPicture() {
+ CXFA_Picture* pPicture =
+ GetChild<CXFA_Picture>(0, XFA_Element::Picture, false);
+ return pPicture ? pPicture->JSObject()->GetContent(false) : L"";
+}
diff --git a/xfa/fxfa/parser/cxfa_bind.h b/xfa/fxfa/parser/cxfa_bind.h
index 9c457bb536..1924cb6f78 100644
--- a/xfa/fxfa/parser/cxfa_bind.h
+++ b/xfa/fxfa/parser/cxfa_bind.h
@@ -13,6 +13,8 @@ class CXFA_Bind : public CXFA_Node {
public:
CXFA_Bind(CXFA_Document* doc, XFA_PacketType packet);
~CXFA_Bind() override;
+
+ WideString GetPicture();
};
#endif // XFA_FXFA_PARSER_CXFA_BIND_H_
diff --git a/xfa/fxfa/parser/cxfa_binddata.cpp b/xfa/fxfa/parser/cxfa_binddata.cpp
deleted file mode 100644
index 7a7e2eef86..0000000000
--- a/xfa/fxfa/parser/cxfa_binddata.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxfa/parser/cxfa_binddata.h"
-
-#include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/cxfa_picture.h"
-
-CXFA_BindData::CXFA_BindData(CXFA_Node* pNode) : CXFA_DataData(pNode) {}
-
-WideString CXFA_BindData::GetPicture() {
- CXFA_Picture* pPicture =
- m_pNode->GetChild<CXFA_Picture>(0, XFA_Element::Picture, false);
- return pPicture ? pPicture->JSObject()->GetContent(false) : L"";
-}
diff --git a/xfa/fxfa/parser/cxfa_binddata.h b/xfa/fxfa/parser/cxfa_binddata.h
deleted file mode 100644
index fde030fc50..0000000000
--- a/xfa/fxfa/parser/cxfa_binddata.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXFA_PARSER_CXFA_BINDDATA_H_
-#define XFA_FXFA_PARSER_CXFA_BINDDATA_H_
-
-#include "core/fxcrt/fx_string.h"
-#include "xfa/fxfa/parser/cxfa_datadata.h"
-
-class CXFA_Node;
-
-class CXFA_BindData : public CXFA_DataData {
- public:
- explicit CXFA_BindData(CXFA_Node* pNode);
-
- WideString GetPicture();
-};
-
-#endif // XFA_FXFA_PARSER_CXFA_BINDDATA_H_
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index a7f157d0a2..9c08c1ac43 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -336,9 +336,9 @@ CXFA_Validate* CXFA_WidgetData::GetValidate(bool bModified) {
0, XFA_Element::Validate, bModified);
}
-CXFA_BindData CXFA_WidgetData::GetBindData() {
- return CXFA_BindData(
- m_pNode->JSObject()->GetProperty<CXFA_Bind>(0, XFA_Element::Bind, false));
+CXFA_Bind* CXFA_WidgetData::GetBind() {
+ return m_pNode->JSObject()->GetProperty<CXFA_Bind>(0, XFA_Element::Bind,
+ false);
}
pdfium::Optional<float> CXFA_WidgetData::TryWidth() {
@@ -1489,9 +1489,9 @@ WideString CXFA_WidgetData::GetPictureContent(XFA_VALUEPICTURE ePicture) {
}
}
case XFA_VALUEPICTURE_DataBind: {
- CXFA_BindData bindData = GetBindData();
- if (bindData.HasValidNode())
- return bindData.GetPicture();
+ CXFA_Bind* bind = GetBind();
+ if (bind)
+ return bind->GetPicture();
break;
}
default:
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h
index 57548e329c..c75225b5fe 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.h
+++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -14,7 +14,6 @@
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
#include "fxbarcode/BC_Library.h"
-#include "xfa/fxfa/parser/cxfa_binddata.h"
#include "xfa/fxfa/parser/cxfa_datadata.h"
#include "xfa/fxfa/parser/cxfa_fontdata.h"
@@ -31,6 +30,7 @@ enum XFA_VALUEPICTURE {
XFA_VALUEPICTURE_DataBind,
};
+class CXFA_Bind;
class CXFA_Border;
class CXFA_Calculate;
class CXFA_Caption;
@@ -174,7 +174,7 @@ class CXFA_WidgetData : public CXFA_DataData {
void SetIsNull(bool val) { m_bIsNull = val; }
private:
- CXFA_BindData GetBindData();
+ CXFA_Bind* GetBind();
void SyncValue(const WideString& wsValue, bool bNotify);
void InsertListTextItem(CXFA_Node* pItems,
const WideString& wsText,