summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn2
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.cpp6
-rw-r--r--xfa/fxfa/cxfa_ffapp.cpp7
-rw-r--r--xfa/fxfa/cxfa_ffapp.h3
-rw-r--r--xfa/fxfa/cxfa_ffdochandler.cpp61
-rw-r--r--xfa/fxfa/cxfa_ffdochandler.h29
6 files changed, 0 insertions, 108 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 626727d94e..c77c23672f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1687,8 +1687,6 @@ if (pdf_enable_xfa) {
"xfa/fxfa/cxfa_ffdatetimeedit.h",
"xfa/fxfa/cxfa_ffdoc.cpp",
"xfa/fxfa/cxfa_ffdoc.h",
- "xfa/fxfa/cxfa_ffdochandler.cpp",
- "xfa/fxfa/cxfa_ffdochandler.h",
"xfa/fxfa/cxfa_ffdocview.cpp",
"xfa/fxfa/cxfa_ffdocview.h",
"xfa/fxfa/cxfa_ffdraw.cpp",
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index 6496042e7d..4b67d0cf3f 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -101,12 +101,6 @@ bool CPDFXFA_Context::LoadXFADoc() {
return false;
}
- CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler();
- if (!pDocHandler) {
- SetLastError(FPDF_ERR_XFALOAD);
- return false;
- }
-
m_pXFADoc->StartLoad();
int iStatus = m_pXFADoc->DoLoad();
if (iStatus != XFA_PARSESTATUS_Done) {
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp
index e3ca42c129..4cb9deb466 100644
--- a/xfa/fxfa/cxfa_ffapp.cpp
+++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -17,7 +17,6 @@
#include "xfa/fwl/cfwl_notedriver.h"
#include "xfa/fwl/cfwl_widgetmgr.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
-#include "xfa/fxfa/cxfa_ffdochandler.h"
#include "xfa/fxfa/cxfa_ffwidgethandler.h"
#include "xfa/fxfa/cxfa_fontmgr.h"
#include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
@@ -30,12 +29,6 @@ CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider) : m_pProvider(pProvider) {
CXFA_FFApp::~CXFA_FFApp() {}
-CXFA_FFDocHandler* CXFA_FFApp::GetDocHandler() {
- if (!m_pDocHandler)
- m_pDocHandler = pdfium::MakeUnique<CXFA_FFDocHandler>();
- return m_pDocHandler.get();
-}
-
std::unique_ptr<CXFA_FFDoc> CXFA_FFApp::CreateDoc(
IXFA_DocEnvironment* pDocEnvironment,
CPDF_Document* pPDFDoc) {
diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h
index 2ce718a36a..f4bd9eb7a8 100644
--- a/xfa/fxfa/cxfa_ffapp.h
+++ b/xfa/fxfa/cxfa_ffapp.h
@@ -35,8 +35,6 @@ class CXFA_FFApp {
CPDF_Document* pPDFDoc);
void SetDefaultFontMgr(std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr);
- CXFA_FFDocHandler* GetDocHandler();
-
CXFA_FWLAdapterWidgetMgr* GetFWLAdapterWidgetMgr();
CFWL_WidgetMgr* GetFWLWidgetMgr() const { return m_pFWLApp->GetWidgetMgr(); }
@@ -51,7 +49,6 @@ class CXFA_FFApp {
void ClearEventTargets();
private:
- std::unique_ptr<CXFA_FFDocHandler> m_pDocHandler;
UnownedPtr<IXFA_AppProvider> const m_pProvider;
// The fonts stored in the font manager may have been created by the default
diff --git a/xfa/fxfa/cxfa_ffdochandler.cpp b/xfa/fxfa/cxfa_ffdochandler.cpp
deleted file mode 100644
index 86e493084b..0000000000
--- a/xfa/fxfa/cxfa_ffdochandler.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 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/cxfa_ffdochandler.h"
-
-#include "core/fxcrt/cfx_checksumcontext.h"
-#include "fxjs/cfxjse_engine.h"
-#include "xfa/fxfa/cxfa_ffdoc.h"
-#include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/xfa_resolvenode_rs.h"
-
-CXFA_FFDocHandler::CXFA_FFDocHandler() {}
-
-CXFA_FFDocHandler::~CXFA_FFDocHandler() {}
-
-CFXJSE_Value* CXFA_FFDocHandler::GetXFAScriptObject(CXFA_FFDoc* hDoc) {
- CXFA_Document* pXFADoc = hDoc->GetXFADoc();
- if (!pXFADoc)
- return nullptr;
-
- CFXJSE_Engine* pScriptContext = pXFADoc->GetScriptContext();
- if (!pScriptContext)
- return nullptr;
- return pScriptContext->GetJSValueFromMap(pXFADoc->GetRoot());
-}
-
-XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(CXFA_FFDoc* hDoc) {
- CXFA_Document* pXFADoc = hDoc->GetXFADoc();
- if (!pXFADoc)
- return XFA_ATTRIBUTEENUM_Unknown;
-
- CXFA_Node* pForm = ToNode(pXFADoc->GetXFAObject(XFA_HASHCODE_Form));
- if (!pForm)
- return XFA_ATTRIBUTEENUM_Unknown;
-
- CXFA_Node* pSubForm = pForm->GetFirstChildByClass(XFA_Element::Subform);
- if (!pSubForm)
- return XFA_ATTRIBUTEENUM_Unknown;
- return pSubForm->JSNode()->GetEnum(XFA_ATTRIBUTE_RestoreState);
-}
-
-bool CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc,
- XFA_SCRIPTTYPE eScriptType,
- const WideStringView& wsScript,
- CFXJSE_Value* pRetValue,
- CFXJSE_Value* pThisValue) {
- CXFA_Document* pXFADoc = hDoc->GetXFADoc();
- if (!pXFADoc)
- return false;
-
- CFXJSE_Engine* pScriptContext = pXFADoc->GetScriptContext();
- if (!pScriptContext)
- return false;
-
- return pScriptContext->RunScript(
- (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, pRetValue,
- pThisValue ? CFXJSE_Engine::ToObject(pThisValue, nullptr) : nullptr);
-}
diff --git a/xfa/fxfa/cxfa_ffdochandler.h b/xfa/fxfa/cxfa_ffdochandler.h
deleted file mode 100644
index 7da03b0148..0000000000
--- a/xfa/fxfa/cxfa_ffdochandler.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2014 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_CXFA_FFDOCHANDLER_H_
-#define XFA_FXFA_CXFA_FFDOCHANDLER_H_
-
-#include "xfa/fxfa/fxfa.h"
-
-class CFX_ChecksumContext;
-
-class CXFA_FFDocHandler {
- public:
- CXFA_FFDocHandler();
- ~CXFA_FFDocHandler();
-
- CFXJSE_Value* GetXFAScriptObject(CXFA_FFDoc* hDoc);
- XFA_ATTRIBUTEENUM GetRestoreState(CXFA_FFDoc* hDoc);
-
- bool RunDocScript(CXFA_FFDoc* hDoc,
- XFA_SCRIPTTYPE eScriptType,
- const WideStringView& wsScript,
- CFXJSE_Value* pRetValue,
- CFXJSE_Value* pThisObject);
-};
-
-#endif // XFA_FXFA_CXFA_FFDOCHANDLER_H_