diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-04-12 13:54:39 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 13:54:39 +0000 |
commit | 7023b8877475dda639a15d623b5a552f88a6812f (patch) | |
tree | 419e9359df5e36941e61ee18b3a470666253d379 /xfa/fxfa/parser/cxfa_dataimporter.cpp | |
parent | babeeb69b1744e414b46d77de03689682742d99d (diff) | |
download | pdfium-7023b8877475dda639a15d623b5a552f88a6812f.tar.xz |
Remove CXFA_DocumentParser::m_bDocumentParser flag
This CL removes the import data behaviour as it was never called and
cleans up the m_bDocumentParser flag as it will always be used in the
true case.
Change-Id: If90a0a55cc76f406e9987aa71580e90edeaa01ba
Reviewed-on: https://pdfium-review.googlesource.com/30292
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_dataimporter.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataimporter.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp deleted file mode 100644 index 481f946fe0..0000000000 --- a/xfa/fxfa/parser/cxfa_dataimporter.cpp +++ /dev/null @@ -1,60 +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_dataimporter.h" - -#include <memory> - -#include "core/fxcrt/fx_stream.h" -#include "core/fxcrt/xml/cfx_xmlnode.h" -#include "third_party/base/ptr_util.h" -#include "xfa/fxfa/fxfa.h" -#include "xfa/fxfa/fxfa_basic.h" -#include "xfa/fxfa/parser/cxfa_document.h" -#include "xfa/fxfa/parser/cxfa_document_parser.h" -#include "xfa/fxfa/parser/cxfa_node.h" - -CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument) - : m_pDocument(pDocument) { - ASSERT(m_pDocument); -} - -CXFA_DataImporter::~CXFA_DataImporter() {} - -bool CXFA_DataImporter::ImportData( - const RetainPtr<IFX_SeekableStream>& pDataDocument) { - CXFA_DocumentParser parser(m_pDocument.Get()); - if (!parser.Parse(pDataDocument, XFA_PacketType::Datasets)) - return false; - - CXFA_Node* pImportDataRoot = parser.GetRootNode(); - if (!pImportDataRoot) - return false; - - CXFA_Node* pDataModel = - ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Datasets)); - if (!pDataModel) - return false; - - CXFA_Node* pDataNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Data)); - if (pDataNode) - pDataModel->RemoveChild(pDataNode, true); - - if (pImportDataRoot->GetElementType() == XFA_Element::DataModel) { - while (CXFA_Node* pChildNode = pImportDataRoot->GetFirstChild()) { - pImportDataRoot->RemoveChild(pChildNode, true); - pDataModel->InsertChild(pChildNode, nullptr); - } - } else { - CFX_XMLNode* pXMLNode = pImportDataRoot->GetXMLMappingNode(); - CFX_XMLNode* pParentXMLNode = pXMLNode->GetParent(); - if (pParentXMLNode) - pParentXMLNode->RemoveChildNode(pXMLNode); - pDataModel->InsertChild(pImportDataRoot, nullptr); - } - m_pDocument->DoDataRemerge(false); - return true; -} |