diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-03 15:11:52 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-03 21:13:01 +0000 |
commit | 44820980f762797f1ffba61b9f5b8cf0922489a3 (patch) | |
tree | b2531d761af57526945881c395c790a00685584c /xfa/fxfa | |
parent | bf1cf346ba28a9eab0d2ea490868c51040ee2bc4 (diff) | |
download | pdfium-44820980f762797f1ffba61b9f5b8cf0922489a3.tar.xz |
Fold CXFA_BindData into CXFA_Bind
This CL merges the CXFA_BindData wrapper into CXFA_Bind.
Change-Id: I621955be2673938bf08c7897779311b776d0bf8b
Reviewed-on: https://pdfium-review.googlesource.com/22131
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/parser/cxfa_bind.cpp | 7 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_bind.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_binddata.cpp | 18 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_binddata.h | 22 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 12 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.h | 4 |
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, |