diff options
author | dsinclair <dsinclair@chromium.org> | 2016-03-31 20:34:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-31 20:34:43 -0700 |
commit | df4bc596c64fb848647c670be66a29ea0861b4f4 (patch) | |
tree | 096f18bc5903e45982291daf81424d0d4954d158 /xfa/fxfa/parser | |
parent | 64376be4aac4710848b36b823fd98aae75095336 (diff) | |
download | pdfium-df4bc596c64fb848647c670be66a29ea0861b4f4.tar.xz |
Remove IXFA_* interfaces.
This CL removes the IXFA_* interfaces which are:
- Implemented once.
- Not implemented by an fpdfsdk class.
This requires making a few classes visible to fpdfsdk so we can have the
correct instances available instead of the IXFA types.
Review URL: https://codereview.chromium.org/1846993002
Diffstat (limited to 'xfa/fxfa/parser')
31 files changed, 341 insertions, 462 deletions
diff --git a/xfa/fxfa/parser/xfa_docdata.h b/xfa/fxfa/parser/xfa_docdata.h index b57b8da552..690ff3334f 100644 --- a/xfa/fxfa/parser/xfa_docdata.h +++ b/xfa/fxfa/parser/xfa_docdata.h @@ -13,24 +13,4 @@ enum XFA_DATAFORMAT { XFA_DATAFORMAT_XDP, }; -class IXFA_PacketExport { - public: - static IXFA_PacketExport* Create(CXFA_Document* pDocument, - XFA_DATAFORMAT eFormat = XFA_DATAFORMAT_XDP); - virtual ~IXFA_PacketExport() {} - virtual void Release() = 0; - virtual FX_BOOL Export(IFX_FileWrite* pWrite) = 0; - virtual FX_BOOL Export(IFX_FileWrite* pWrite, - CXFA_Node* pNode, - uint32_t dwFlag = 0, - const FX_CHAR* pChecksum = NULL) = 0; -}; -class IXFA_PacketImport { - public: - static IXFA_PacketImport* Create(CXFA_Document* pDstDoc); - virtual ~IXFA_PacketImport() {} - virtual void Release() = 0; - virtual FX_BOOL ImportData(IFX_FileRead* pDataDocument) = 0; -}; - #endif // XFA_FXFA_PARSER_XFA_DOCDATA_H_ diff --git a/xfa/fxfa/parser/xfa_doclayout.h b/xfa/fxfa/parser/xfa_doclayout.h index 8558cd0992..0bae0184ec 100644 --- a/xfa/fxfa/parser/xfa_doclayout.h +++ b/xfa/fxfa/parser/xfa_doclayout.h @@ -11,16 +11,7 @@ class CXFA_ContainerLayoutItem; class CXFA_ContentLayoutItem; -class IXFA_DocLayout; - -class IXFA_LayoutPage { - public: - virtual ~IXFA_LayoutPage() {} - virtual IXFA_DocLayout* GetLayout() const = 0; - virtual int32_t GetPageIndex() const = 0; - virtual void GetPageSize(CFX_SizeF& size) = 0; - virtual CXFA_Node* GetMasterPage() const = 0; -}; +class CXFA_LayoutProcessor; class CXFA_LayoutItem { public: @@ -31,7 +22,7 @@ class CXFA_LayoutItem { inline CXFA_ContainerLayoutItem* AsContainerLayoutItem(); inline CXFA_ContentLayoutItem* AsContentLayoutItem(); - IXFA_LayoutPage* GetPage() const; + CXFA_ContainerLayoutItem* GetPage() const; CXFA_Node* GetFormNode() const; void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const; int32_t GetIndex() const; @@ -60,16 +51,14 @@ class CXFA_LayoutItem { FX_BOOL m_bIsContentLayoutItem; }; -class CXFA_ContainerLayoutItem : public CXFA_LayoutItem, - public IXFA_LayoutPage { +class CXFA_ContainerLayoutItem : public CXFA_LayoutItem { public: CXFA_ContainerLayoutItem(CXFA_Node* pNode); - // IXFA_LayoutPage: - IXFA_DocLayout* GetLayout() const override; - int32_t GetPageIndex() const override; - void GetPageSize(CFX_SizeF& size) override; - CXFA_Node* GetMasterPage() const override; + CXFA_LayoutProcessor* GetLayout() const; + int32_t GetPageIndex() const; + void GetPageSize(CFX_SizeF& size); + CXFA_Node* GetMasterPage() const; CXFA_Node* m_pOldSubform; }; @@ -121,16 +110,4 @@ class CXFA_TraverseStrategy_LayoutItem { } }; -class IXFA_DocLayout { - public: - virtual ~IXFA_DocLayout() {} - virtual CXFA_Document* GetDocument() const = 0; - virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE) = 0; - virtual int32_t DoLayout(IFX_Pause* pPause = NULL) = 0; - virtual FX_BOOL IncrementLayout() = 0; - virtual int32_t CountPages() const = 0; - virtual IXFA_LayoutPage* GetPage(int32_t index) const = 0; - virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem) = 0; -}; - #endif // XFA_FXFA_PARSER_XFA_DOCLAYOUT_H_ diff --git a/xfa/fxfa/parser/xfa_document.h b/xfa/fxfa/parser/xfa_document.h index 5938f2da56..3c96e9a711 100644 --- a/xfa/fxfa/parser/xfa_document.h +++ b/xfa/fxfa/parser/xfa_document.h @@ -15,12 +15,11 @@ class CXFA_Document; class CXFA_LayoutItem; class CXFA_LayoutProcessor; class CXFA_Node; -class IXFA_DocLayout; -class IXFA_DocParser; -class IXFA_LayoutPage; -class IXFA_Notify; -class IXFA_ObjFactory; -class IXFA_ScriptContext; +class CXFA_LayoutProcessor; +class CXFA_DocumentParser; +class CXFA_ContainerLayoutItem; +class CXFA_FFNotify; +class CXFA_ScriptContext; enum XFA_VERSION { XFA_VERSION_UNKNOWN = 0, @@ -68,65 +67,6 @@ enum XFA_LAYOUTRESULT { #define XFA_LAYOUTNOTIFY_StrictHeight 0x0001 #define XFA_LAYOUTNOTIFY_NoParentBreak 0x0002 -class IXFA_Notify { - public: - virtual ~IXFA_Notify() {} - virtual void OnPageEvent(IXFA_LayoutPage* pSender, - XFA_PAGEEVENT eEvent, - void* pParam = NULL) = 0; - - virtual void OnNodeEvent(CXFA_Node* pSender, - XFA_NODEEVENT eEvent, - void* pParam = NULL, - void* pParam2 = NULL, - void* pParam3 = NULL, - void* pParam4 = NULL) = 0; - virtual void OnWidgetDataEvent(CXFA_WidgetData* pSender, - uint32_t dwEvent, - void* pParam = NULL, - void* pAdditional = NULL, - void* pAdditional2 = NULL) = 0; - - virtual CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node* pNode) = 0; - virtual void OnLayoutEvent(IXFA_DocLayout* pLayout, - CXFA_LayoutItem* pSender, - XFA_LAYOUTEVENT eEvent, - void* pParam = NULL, - void* pParam2 = NULL) = 0; - virtual void StartFieldDrawLayout(CXFA_Node* pItem, - FX_FLOAT& fCalcWidth, - FX_FLOAT& fCalcHeight) = 0; - virtual FX_BOOL FindSplitPos(CXFA_Node* pItem, - int32_t iBlockIndex, - FX_FLOAT& fCalcHeightPos) = 0; - virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) = 0; - virtual int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, - XFA_EVENTTYPE eEventType, - FX_BOOL bIsFormReady = FALSE, - FX_BOOL bRecursive = TRUE, - CXFA_WidgetAcc* pExclude = NULL) = 0; - virtual void AddCalcValidate(CXFA_Node* pNode) = 0; - virtual IXFA_Doc* GetHDOC() = 0; - virtual IXFA_DocProvider* GetDocProvider() = 0; - virtual IXFA_AppProvider* GetAppProvider() = 0; - virtual IXFA_WidgetHandler* GetWidgetHandler() = 0; - virtual IXFA_Widget* GetHWidget(CXFA_LayoutItem* pLayoutItem) = 0; - virtual void OpenDropDownList(IXFA_Widget* hWidget) = 0; - virtual CFX_WideString GetCurrentDateTime() = 0; - virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL) = 0; - virtual int32_t GetLayoutStatus() = 0; - virtual void RunNodeInitialize(CXFA_Node* pNode) = 0; - virtual void RunSubformIndexChange(CXFA_Node* pSubformNode) = 0; - virtual CXFA_Node* GetFocusWidgetNode() = 0; - virtual void SetFocusWidgetNode(CXFA_Node* pNode) = 0; -}; -class IXFA_ObjFactory { - public: - virtual ~IXFA_ObjFactory() {} - virtual CXFA_Node* CreateNode(uint32_t dwPacket, XFA_ELEMENT eElement) = 0; - virtual CXFA_Node* CreateNode(const XFA_PACKETINFO* pPacket, - XFA_ELEMENT eElement) = 0; -}; #define XFA_DOCFLAG_StrictScoping 0x0001 #define XFA_DOCFLAG_HasInteractive 0x0002 #define XFA_DOCFLAG_Interactive 0x0004 @@ -137,13 +77,13 @@ class CScript_HostPseudoModel; class CScript_LogPseudoModel; class CScript_LayoutPseudoModel; class CScript_SignaturePseudoModel; -class CXFA_Document : public IXFA_ObjFactory { +class CXFA_Document { public: - CXFA_Document(IXFA_DocParser* pParser); + CXFA_Document(CXFA_DocumentParser* pParser); ~CXFA_Document(); CXFA_Node* GetRoot() const { return m_pRootNode; } - IXFA_DocParser* GetParser() const { return m_pParser; } - IXFA_Notify* GetNotify() const; + CXFA_DocumentParser* GetParser() const { return m_pParser; } + CXFA_FFNotify* GetNotify() const; void SetRoot(CXFA_Node* pNewRoot); CXFA_Object* GetXFAObject(const CFX_WideStringC& wsNodeName); CXFA_Object* GetXFAObject(uint32_t wsNodeNameHash); @@ -156,9 +96,8 @@ class CXFA_Document : public IXFA_ObjFactory { XFA_VERSION GetCurVersionMode() { return m_eCurVersionMode; } XFA_VERSION RecognizeXFAVersionNumber(CFX_WideString& wsTemplateNS); CXFA_LocaleMgr* GetLocalMgr(); - virtual CXFA_Node* CreateNode(uint32_t dwPacket, XFA_ELEMENT eElement); - virtual CXFA_Node* CreateNode(const XFA_PACKETINFO* pPacket, - XFA_ELEMENT eElement); + CXFA_Node* CreateNode(uint32_t dwPacket, XFA_ELEMENT eElement); + CXFA_Node* CreateNode(const XFA_PACKETINFO* pPacket, XFA_ELEMENT eElement); void DoProtoMerge(); CXFA_Node* GetNodeByID(CXFA_Node* pRoot, const CFX_WideStringC& wsID); void DoDataMerge(); @@ -172,17 +111,17 @@ class CXFA_Document : public IXFA_ObjFactory { void DataMerge_UpdateBindingRelations(CXFA_Node* pFormUpdateRoot); CXFA_Node* GetNotBindNode(CXFA_ObjArray& arrayNodes); CXFA_LayoutProcessor* GetLayoutProcessor(); - IXFA_DocLayout* GetDocLayout(); - IXFA_ScriptContext* InitScriptContext(FXJSE_HRUNTIME hRuntime); - IXFA_ScriptContext* GetScriptContext(); + CXFA_LayoutProcessor* GetDocLayout(); + CXFA_ScriptContext* InitScriptContext(FXJSE_HRUNTIME hRuntime); + CXFA_ScriptContext* GetScriptContext(); void ClearLayoutData(); CFX_MapPtrTemplate<uint32_t, CXFA_Node*> m_rgGlobalBinding; CXFA_NodeArray m_pPendingPageSet; protected: - IXFA_DocParser* m_pParser; - IXFA_ScriptContext* m_pScriptContext; + CXFA_DocumentParser* m_pParser; + CXFA_ScriptContext* m_pScriptContext; CXFA_LayoutProcessor* m_pLayoutProcessor; CXFA_Node* m_pRootNode; CXFA_LocaleMgr* m_pLocalMgr; diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index 476dde4104..e525532f7c 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -18,7 +18,9 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp index 6f08489c17..d56e57c99d 100644 --- a/xfa/fxfa/parser/xfa_document_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_imp.cpp @@ -5,6 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcrt/include/fx_ext.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_basic_imp.h" #include "xfa/fxfa/parser/xfa_docdata.h" @@ -14,16 +15,18 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" #include "xfa/fxfa/parser/xfa_script_datawindow.h" #include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h" #include "xfa/fxfa/parser/xfa_script_hostpseudomodel.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h" #include "xfa/fxfa/parser/xfa_script_logpseudomodel.h" #include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h" #include "xfa/fxfa/parser/xfa_utils.h" -CXFA_Document::CXFA_Document(IXFA_DocParser* pParser) +CXFA_Document::CXFA_Document(CXFA_DocumentParser* pParser) : m_pParser(pParser), m_pScriptContext(nullptr), m_pLayoutProcessor(nullptr), @@ -88,7 +91,7 @@ void CXFA_Document::SetRoot(CXFA_Node* pNewRoot) { m_pRootNode = pNewRoot; RemovePurgeNode(pNewRoot); } -IXFA_Notify* CXFA_Document::GetNotify() const { +CXFA_FFNotify* CXFA_Document::GetNotify() const { return m_pParser->GetNotify(); } CXFA_Object* CXFA_Document::GetXFAObject(const CFX_WideStringC& wsNodeName) { @@ -245,17 +248,15 @@ CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { } return m_pLocalMgr; } -IXFA_ScriptContext* CXFA_Document::InitScriptContext(FXJSE_HRUNTIME hRuntime) { - if (!m_pScriptContext) { - m_pScriptContext = XFA_ScriptContext_Create(this); - } +CXFA_ScriptContext* CXFA_Document::InitScriptContext(FXJSE_HRUNTIME hRuntime) { + if (!m_pScriptContext) + m_pScriptContext = new CXFA_ScriptContext(this); m_pScriptContext->Initialize(hRuntime); return m_pScriptContext; } -IXFA_ScriptContext* CXFA_Document::GetScriptContext() { - if (!m_pScriptContext) { - m_pScriptContext = XFA_ScriptContext_Create(this); - } +CXFA_ScriptContext* CXFA_Document::GetScriptContext() { + if (!m_pScriptContext) + m_pScriptContext = new CXFA_ScriptContext(this); return m_pScriptContext; } XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber( diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.cpp b/xfa/fxfa/parser/xfa_document_layout_imp.cpp index dbaa6e4df7..79037d7ec7 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_layout_imp.cpp @@ -28,7 +28,7 @@ CXFA_LayoutProcessor* CXFA_Document::GetLayoutProcessor() { } return m_pLayoutProcessor; } -IXFA_DocLayout* CXFA_Document::GetDocLayout() { +CXFA_LayoutProcessor* CXFA_Document::GetDocLayout() { return GetLayoutProcessor(); } CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument) @@ -133,7 +133,7 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() { int32_t CXFA_LayoutProcessor::CountPages() const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0; } -IXFA_LayoutPage* CXFA_LayoutProcessor::GetPage(int32_t index) const { +CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : NULL; } CXFA_LayoutItem* CXFA_LayoutProcessor::GetLayoutItem(CXFA_Node* pFormItem) { @@ -171,7 +171,7 @@ CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem) CXFA_LayoutItem::~CXFA_LayoutItem() {} CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode) : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(NULL) {} -IXFA_DocLayout* CXFA_ContainerLayoutItem::GetLayout() const { +CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { return m_pFormNode->GetDocument()->GetLayoutProcessor(); } int32_t CXFA_ContainerLayoutItem::GetPageIndex() const { diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.h b/xfa/fxfa/parser/xfa_document_layout_imp.h index 7f6c14e73f..4da405fc6c 100644 --- a/xfa/fxfa/parser/xfa_document_layout_imp.h +++ b/xfa/fxfa/parser/xfa_document_layout_imp.h @@ -13,17 +13,18 @@ class CXFA_ItemLayoutProcessor; class CXFA_LayoutPageMgr; class CXFA_ContainerLayoutItem; -class CXFA_LayoutProcessor : public IXFA_DocLayout { +class CXFA_LayoutProcessor { public: CXFA_LayoutProcessor(CXFA_Document* pDocument); ~CXFA_LayoutProcessor(); - virtual CXFA_Document* GetDocument() const; - virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE); - virtual int32_t DoLayout(IFX_Pause* pPause = NULL); - virtual FX_BOOL IncrementLayout(); - virtual int32_t CountPages() const; - virtual IXFA_LayoutPage* GetPage(int32_t index) const; - virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); + + CXFA_Document* GetDocument() const; + int32_t StartLayout(FX_BOOL bForceRestart = FALSE); + int32_t DoLayout(IFX_Pause* pPause = NULL); + FX_BOOL IncrementLayout(); + int32_t CountPages() const; + CXFA_ContainerLayoutItem* GetPage(int32_t index) const; + CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); void AddChangedContainer(CXFA_Node* pContainer); void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; } diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 289581ecae..f207b32263 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -15,12 +15,10 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" #include "xfa/fxfa/parser/xfa_utils.h" -IXFA_PacketImport* IXFA_PacketImport::Create(CXFA_Document* pDocument) { - return new CXFA_DataImporter(pDocument); -} CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument) : m_pDocument(pDocument) { ASSERT(m_pDocument); @@ -465,10 +463,7 @@ void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, XFA_DataExporter_RegenerateFormFile_Container(pNode, pStream, bSaveXML); } } -IXFA_PacketExport* IXFA_PacketExport::Create(CXFA_Document* pDocument, - XFA_DATAFORMAT eFormat) { - return new CXFA_DataExporter(pDocument); -} + CXFA_DataExporter::CXFA_DataExporter(CXFA_Document* pDocument) : m_pDocument(pDocument) { ASSERT(m_pDocument); diff --git a/xfa/fxfa/parser/xfa_document_serialize.h b/xfa/fxfa/parser/xfa_document_serialize.h index f18e163a8d..9bde4b038e 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.h +++ b/xfa/fxfa/parser/xfa_document_serialize.h @@ -9,32 +9,34 @@ #include "xfa/fxfa/parser/xfa_docdata.h" -class CXFA_DataImporter : public IXFA_PacketImport { +class CXFA_DataImporter { public: - CXFA_DataImporter(CXFA_Document* pDocument); - virtual void Release() { delete this; } - virtual FX_BOOL ImportData(IFX_FileRead* pDataDocument); + explicit CXFA_DataImporter(CXFA_Document* pDocument); + + void Release() { delete this; } + FX_BOOL ImportData(IFX_FileRead* pDataDocument); protected: - CXFA_Document* m_pDocument; + CXFA_Document* const m_pDocument; }; -class CXFA_DataExporter : public IXFA_PacketExport { +class CXFA_DataExporter { public: - CXFA_DataExporter(CXFA_Document* pDocument); - virtual void Release() { delete this; } - virtual FX_BOOL Export(IFX_FileWrite* pWrite); - virtual FX_BOOL Export(IFX_FileWrite* pWrite, - CXFA_Node* pNode, - uint32_t dwFlag = 0, - const FX_CHAR* pChecksum = NULL); + explicit CXFA_DataExporter(CXFA_Document* pDocument); + + void Release() { delete this; } + FX_BOOL Export(IFX_FileWrite* pWrite); + FX_BOOL Export(IFX_FileWrite* pWrite, + CXFA_Node* pNode, + uint32_t dwFlag = 0, + const FX_CHAR* pChecksum = NULL); protected: FX_BOOL Export(IFX_Stream* pStream, CXFA_Node* pNode, uint32_t dwFlag, const FX_CHAR* pChecksum); - CXFA_Document* m_pDocument; + CXFA_Document* const m_pDocument; }; #endif // XFA_FXFA_PARSER_XFA_DOCUMENT_SERIALIZE_H_ diff --git a/xfa/fxfa/parser/xfa_layout_appadapter.cpp b/xfa/fxfa/parser/xfa_layout_appadapter.cpp index b175cad9c6..e223ab8ce7 100644 --- a/xfa/fxfa/parser/xfa_layout_appadapter.cpp +++ b/xfa/fxfa/parser/xfa_layout_appadapter.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/xfa_layout_appadapter.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -16,6 +17,7 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" #include "xfa/fxfa/parser/xfa_utils.h" @@ -41,9 +43,9 @@ uint32_t XFA_GetRelevant(CXFA_Node* pFormItem, uint32_t dwParentRelvant) { } void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) { CXFA_LayoutItem* pNode = pLayoutItem->m_pFirstChild; - IXFA_Notify* pNotify = + CXFA_FFNotify* pNotify = pLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify(); - IXFA_DocLayout* pDocLayout = + CXFA_LayoutProcessor* pDocLayout = pLayoutItem->m_pFormNode->GetDocument()->GetDocLayout(); while (pNode) { CXFA_LayoutItem* pNext = pNode->m_pNextSibling; diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index 2924fad922..0f22a27bd7 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -10,6 +10,7 @@ #include <memory> #include "xfa/fgas/crt/fgas_algorithm.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -20,6 +21,7 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" #include "xfa/fxfa/parser/xfa_utils.h" @@ -91,7 +93,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos( case XFA_ATTRIBUTEENUM_None: { FX_BOOL bAnyChanged = FALSE; CXFA_Document* pDocument = pFormNode->GetDocument(); - IXFA_Notify* pNotify = pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = pDocument->GetParser()->GetNotify(); FX_FLOAT fCurTopMargin = 0, fCurBottomMargin = 0; CXFA_Node* pMarginNode = pFormNode->GetFirstChildByClass(XFA_ELEMENT_Margin); @@ -353,7 +355,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(FX_FLOAT fSplitPos) { SplitLayoutItem(m_pLayoutItem, NULL, fSplitPos); } -IXFA_LayoutPage* CXFA_LayoutItem::GetPage() const { +CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const { for (CXFA_LayoutItem* pCurNode = const_cast<CXFA_LayoutItem*>(this); pCurNode; pCurNode = pCurNode->m_pParent) { if (pCurNode->m_pFormNode->GetClassID() == XFA_ELEMENT_PageArea) @@ -551,9 +553,9 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() { if (m_pOldLayoutItem->m_pPrev) { m_pOldLayoutItem->m_pPrev->m_pNext = NULL; } - IXFA_Notify* pNotify = + CXFA_FFNotify* pNotify = m_pOldLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify(); - IXFA_DocLayout* pDocLayout = + CXFA_LayoutProcessor* pDocLayout = m_pOldLayoutItem->m_pFormNode->GetDocument()->GetDocLayout(); CXFA_ContentLayoutItem* pOldLayoutItem = m_pOldLayoutItem; while (pOldLayoutItem) { @@ -614,8 +616,10 @@ static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode( return bFindRs; } static void XFA_DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) { - IXFA_Notify* pNotify = pGenerateNode->GetDocument()->GetParser()->GetNotify(); - IXFA_DocLayout* pDocLayout = pGenerateNode->GetDocument()->GetDocLayout(); + CXFA_FFNotify* pNotify = + pGenerateNode->GetDocument()->GetParser()->GetNotify(); + CXFA_LayoutProcessor* pDocLayout = + pGenerateNode->GetDocument()->GetDocLayout(); CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode> sIterator( pGenerateNode); for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; @@ -2863,7 +2867,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutField() { return; } CXFA_Document* pDocument = m_pFormNode->GetDocument(); - IXFA_Notify* pNotify = pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = pDocument->GetParser()->GetNotify(); FX_FLOAT fHeight = -1; FX_FLOAT fWidth = -1; pNotify->StartFieldDrawLayout(m_pFormNode, fWidth, fHeight); diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp index 61c0715f1a..888cf4fe5b 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -17,7 +18,9 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor) @@ -82,7 +85,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) { return FALSE; } CXFA_Document* pDocument = pTemplateNode->GetDocument(); - IXFA_ObjFactory* pObjFactory = pDocument->GetParser()->GetFactory(); + CXFA_Document* pObjFactory = pDocument->GetParser()->GetFactory(); pPageArea = m_pTemplatePageSetRoot->GetChild(0, XFA_ELEMENT_PageArea); if (!pPageArea) { pPageArea = pObjFactory->CreateNode(m_pTemplatePageSetRoot->GetPacketID(), @@ -406,7 +409,7 @@ void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, m_nAvailPages++; pNewPageAreaLayoutItem = pContainerItem; } else { - IXFA_Notify* pNotify = + CXFA_FFNotify* pNotify = pNewPageArea->GetDocument()->GetParser()->GetNotify(); CXFA_ContainerLayoutItem* pContainerItem = (CXFA_ContainerLayoutItem*)pNotify->OnCreateLayoutItem(pNewPageArea); @@ -599,15 +602,15 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() { int32_t CXFA_LayoutPageMgr::GetPageCount() const { return m_PageArray.GetSize(); } -IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(int32_t index) const { +CXFA_ContainerLayoutItem* CXFA_LayoutPageMgr::GetPage(int32_t index) const { if (index < 0 || index >= m_PageArray.GetSize()) return nullptr; return m_PageArray[index]; } -int32_t CXFA_LayoutPageMgr::GetPageIndex(const IXFA_LayoutPage* pPage) const { +int32_t CXFA_LayoutPageMgr::GetPageIndex( + const CXFA_ContainerLayoutItem* pPage) const { // FIXME: Find() method should take const. - return m_PageArray.Find(static_cast<CXFA_ContainerLayoutItem*>( - const_cast<IXFA_LayoutPage*>(pPage))); + return m_PageArray.Find(const_cast<CXFA_ContainerLayoutItem*>(pPage)); } FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_ELEMENT eBreakType, XFA_ATTRIBUTEENUM eTargetType, @@ -1495,8 +1498,8 @@ CXFA_LayoutItem* CXFA_LayoutPageMgr::FindOrCreateLayoutItem( pFormNode); } static void XFA_SyncRemoveLayoutItem(CXFA_LayoutItem* pParentLayoutItem, - IXFA_Notify* pNotify, - IXFA_DocLayout* pDocLayout) { + CXFA_FFNotify* pNotify, + CXFA_LayoutProcessor* pDocLayout) { CXFA_LayoutItem* pNextLayoutItem; CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild; while (pCurLayoutItem) { @@ -1518,9 +1521,9 @@ void CXFA_LayoutPageMgr::SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem) { if (pCurLayoutItem->IsContentLayoutItem()) { uint32_t dwFlag = pCurLayoutItem->m_pFormNode->GetFlag(); if (dwFlag & (XFA_NODEFLAG_HasRemoved)) { - IXFA_Notify* pNotify = + CXFA_FFNotify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify(); - IXFA_DocLayout* pDocLayout = + CXFA_LayoutProcessor* pDocLayout = m_pTemplatePageSetRoot->GetDocument()->GetDocLayout(); if (pCurLayoutItem->m_pFirstChild) { XFA_SyncRemoveLayoutItem(pCurLayoutItem, pNotify, pDocLayout); @@ -1578,8 +1581,8 @@ CXFA_Node* CXFA_LayoutPageMgr::QueryOverflow( } void CXFA_LayoutPageMgr::MergePageSetContents() { CXFA_Document* pDocument = m_pTemplatePageSetRoot->GetDocument(); - IXFA_Notify* pNotify = pDocument->GetParser()->GetNotify(); - IXFA_DocLayout* pDocLayout = pDocument->GetDocLayout(); + CXFA_FFNotify* pNotify = pDocument->GetParser()->GetNotify(); + CXFA_LayoutProcessor* pDocLayout = pDocument->GetDocLayout(); CXFA_ContainerLayoutItem* pRootLayout = GetRootLayoutItem(); { for (int32_t iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); @@ -1790,8 +1793,8 @@ void CXFA_LayoutPageMgr::LayoutPageSetContents() { } } } -void XFA_SyncContainer(IXFA_Notify* pNotify, - IXFA_DocLayout* pDocLayout, +void XFA_SyncContainer(CXFA_FFNotify* pNotify, + CXFA_LayoutProcessor* pDocLayout, CXFA_LayoutItem* pContainerItem, uint32_t dwRelevant, FX_BOOL bVisible, @@ -1825,7 +1828,7 @@ void XFA_SyncContainer(IXFA_Notify* pNotify, void CXFA_LayoutPageMgr::SyncLayoutData() { MergePageSetContents(); LayoutPageSetContents(); - IXFA_Notify* pNotify = + CXFA_FFNotify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify(); int32_t nPageIdx = -1; CXFA_ContainerLayoutItem* pRootLayoutItem = GetRootLayoutItem(); diff --git a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h index 354daa5e31..a82c152df9 100644 --- a/xfa/fxfa/parser/xfa_layout_pagemgr_new.h +++ b/xfa/fxfa/parser/xfa_layout_pagemgr_new.h @@ -35,8 +35,8 @@ class CXFA_LayoutPageMgr { void FinishPaginatedPageSets(); void SyncLayoutData(); int32_t GetPageCount() const; - IXFA_LayoutPage* GetPage(int32_t index) const; - int32_t GetPageIndex(const IXFA_LayoutPage* pPage) const; + CXFA_ContainerLayoutItem* GetPage(int32_t index) const; + int32_t GetPageIndex(const CXFA_ContainerLayoutItem* pPage) const; inline CXFA_ContainerLayoutItem* GetRootLayoutItem() const { return m_pPageSetLayoutItemRoot; } diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp index c721d7da17..35d8c36fa2 100644 --- a/xfa/fxfa/parser/xfa_locale.cpp +++ b/xfa/fxfa/parser/xfa_locale.cpp @@ -107,8 +107,7 @@ void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE); } void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const { - IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); - pProvider->GetTimeZone(tz); + CXFA_TimeZoneProvider::Get()->GetTimeZone(tz); } void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE); @@ -278,8 +277,7 @@ void CXFA_NodeLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, GetCalendarSymbol(XFA_ELEMENT_MeridiemNames, bAM ? 0 : 1, FALSE); } void CXFA_NodeLocale::GetTimeZone(FX_TIMEZONE& tz) const { - IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); - pProvider->GetTimeZone(tz); + CXFA_TimeZoneProvider::Get()->GetTimeZone(tz); } void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { wsEraName = GetCalendarSymbol(XFA_ELEMENT_EraNames, bAD ? 1 : 0, FALSE); diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index ce638a3b97..7ccf228177 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1269,21 +1269,28 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { return m_wsConfigLocale; } static CXFA_TimeZoneProvider* g_pProvider = NULL; -IXFA_TimeZoneProvider* IXFA_TimeZoneProvider::Create() { + +// Static. +CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() { FXSYS_assert(!g_pProvider); g_pProvider = new CXFA_TimeZoneProvider(); return g_pProvider; } -IXFA_TimeZoneProvider* IXFA_TimeZoneProvider::Get() { + +// Static. +CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Get() { if (!g_pProvider) { g_pProvider = new CXFA_TimeZoneProvider(); } return g_pProvider; } -void IXFA_TimeZoneProvider::Destroy() { + +// Static. +void CXFA_TimeZoneProvider::Destroy() { delete g_pProvider; g_pProvider = NULL; } + #include <time.h> CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ diff --git a/xfa/fxfa/parser/xfa_localemgr.h b/xfa/fxfa/parser/xfa_localemgr.h index a30d0cc1ad..62b8c67924 100644 --- a/xfa/fxfa/parser/xfa_localemgr.h +++ b/xfa/fxfa/parser/xfa_localemgr.h @@ -52,24 +52,17 @@ class CXFA_LocaleMgr : public IFX_LocaleMgr { uint16_t m_dwLocaleFlags; }; -class IXFA_TimeZoneProvider { +class CXFA_TimeZoneProvider { public: - static IXFA_TimeZoneProvider* Create(); - static IXFA_TimeZoneProvider* Get(); - static void Destroy(); - - virtual ~IXFA_TimeZoneProvider() {} + CXFA_TimeZoneProvider(); + ~CXFA_TimeZoneProvider(); - virtual void SetTimeZone(FX_TIMEZONE& tz) = 0; + static CXFA_TimeZoneProvider* Create(); + static CXFA_TimeZoneProvider* Get(); + static void Destroy(); - virtual void GetTimeZone(FX_TIMEZONE& tz) = 0; -}; -class CXFA_TimeZoneProvider : public IXFA_TimeZoneProvider { - public: - CXFA_TimeZoneProvider(); - virtual ~CXFA_TimeZoneProvider(); - virtual void SetTimeZone(FX_TIMEZONE& tz); - virtual void GetTimeZone(FX_TIMEZONE& tz); + void SetTimeZone(FX_TIMEZONE& tz); + void GetTimeZone(FX_TIMEZONE& tz); private: FX_TIMEZONE m_tz; diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index eed5323ab8..0bd114b6c4 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -10,6 +10,7 @@ #include "xfa/fde/xml/fde_xml_imp.h" #include "xfa/fgas/crt/fgas_codepage.h" #include "xfa/fgas/crt/fgas_system.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_basic_imp.h" #include "xfa/fxfa/parser/xfa_docdata.h" @@ -18,7 +19,9 @@ #include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" #include "xfa/fxjse/cfxjse_arguments.h" @@ -117,7 +120,7 @@ CXFA_Node::~CXFA_Node() { } } CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { - IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); + CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); CXFA_Node* pClone = pFactory->CreateNode(m_ePacket, m_eNodeClass); if (!pClone) { return NULL; @@ -286,7 +289,7 @@ int32_t CXFA_Node::GetNodeList(CXFA_NodeArray& nodes, } for (int32_t i = 0; i < iProperties; i++) { if (pProperty[i].uFlags & XFA_PROPERTYFLAG_DefaultOneOf) { - IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); + CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(GetPacketID()); CXFA_Node* pNewNode = pFactory->CreateNode(pPacket, (XFA_ELEMENT)pProperty[i].eName); @@ -305,14 +308,14 @@ int32_t CXFA_Node::GetNodeList(CXFA_NodeArray& nodes, } CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_ELEMENT eElement, uint32_t dwFlags) { - IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); + CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); CXFA_Node* pNode = pFactory->CreateNode(m_ePacket, eElement); pNode->SetFlag(dwFlags); return pNode; } CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) { FXSYS_assert(m_ePacket == XFA_XDPPACKET_Template); - IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); + CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); CXFA_Node* pClone = pFactory->CreateNode(XFA_XDPPACKET_Form, m_eNodeClass); if (!pClone) { return NULL; @@ -631,7 +634,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -695,7 +698,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, CFX_WideString wsExpression, uint32_t dwFlag, CXFA_Node* refNode) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -740,7 +743,7 @@ void CXFA_Node::Script_TreeClass_All(FXJSE_HVALUE hValue, void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -1309,7 +1312,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( if (!pLayoutPro) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -1604,7 +1607,7 @@ void CXFA_Node::Script_Som_Message(FXJSE_HVALUE hValue, break; } if (!bNew) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2185,7 +2188,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2278,7 +2281,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2360,7 +2363,7 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { @@ -2450,7 +2453,7 @@ void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2463,7 +2466,7 @@ void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2476,7 +2479,7 @@ void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { @@ -2539,7 +2542,7 @@ void CXFA_Node::Script_Som_InstanceIndex(FXJSE_HVALUE hValue, } if (pManagerNode) { pManagerNode->InstanceManager_MoveInstance(iTo, iFrom); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2616,7 +2619,7 @@ void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2629,7 +2632,7 @@ void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -2642,7 +2645,7 @@ void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { @@ -3134,7 +3137,7 @@ void CXFA_Node::Script_InstanceManager_MoveInstance( int32_t iFrom = pArguments->GetInt32(0); int32_t iTo = pArguments->GetInt32(1); InstanceManager_MoveInstance(iTo, iFrom); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3168,7 +3171,7 @@ void CXFA_Node::Script_InstanceManager_RemoveInstance( } CXFA_Node* pRemoveInstance = XFA_ScriptInstanceManager_GetItem(this, iIndex); XFA_ScriptInstanceManager_RemoveItem(this, pRemoveInstance); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { for (int32_t i = iIndex; i < iCount - 1; i++) { CXFA_Node* pSubformInstance = XFA_ScriptInstanceManager_GetItem(this, i); @@ -3220,7 +3223,7 @@ void CXFA_Node::Script_InstanceManager_AddInstance( FXJSE_Value_Set( pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3263,7 +3266,7 @@ void CXFA_Node::Script_InstanceManager_InsertInstance( FXJSE_Value_Set( pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3326,7 +3329,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iCount, iCount, FALSE); iCount++; - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return 0; } @@ -3419,7 +3422,7 @@ void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Form_ExecInitialize(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3439,7 +3442,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 1) { const bool bScriptFlags = pArguments->GetInt32(0) != 0; - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3456,7 +3459,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -3469,7 +3472,7 @@ void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) { void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { int32_t argc = pArguments->GetLength(); if (argc == 0) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { @@ -4429,7 +4432,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent, } if (pNode) { if (bScriptModify) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (pScriptContext) { m_pDocument->GetScriptContext()->AddNodesOfRunScript(this); } @@ -4526,7 +4529,7 @@ CXFA_Node* CXFA_Node::GetProperty(int32_t index, } } } - IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); + CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket); CXFA_Node* pNewNode; for (; iCount <= index; iCount++) { @@ -4614,7 +4617,7 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { ASSERT(m_pLastChild); ASSERT(m_pLastChild->m_pNext == NULL); pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); } @@ -4660,7 +4663,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { ASSERT(m_pLastChild); ASSERT(m_pLastChild->m_pNext == NULL); pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); } @@ -4784,21 +4787,21 @@ CXFA_Node* CXFA_Node::GetNextSameClassSibling(XFA_ELEMENT eElement) const { return NULL; } int32_t CXFA_Node::GetNodeSameNameIndex() const { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return -1; } return pScriptContext->GetIndexByName(const_cast<CXFA_Node*>(this)); } int32_t CXFA_Node::GetNodeSameClassIndex() const { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return -1; } return pScriptContext->GetIndexByClassName(const_cast<CXFA_Node*>(this)); } void CXFA_Node::GetSOMExpression(CFX_WideString& wsSOMExpression) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -4851,7 +4854,7 @@ void CXFA_Node::SetFlag(uint32_t dwFlag, FX_BOOL bOn, FX_BOOL bNotify) { switch (dwFlag) { case XFA_NODEFLAG_Initialized: if (bNotify && !HasFlag(XFA_NODEFLAG_Initialized)) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_Ready); } @@ -4872,7 +4875,7 @@ void CXFA_Node::OnRemoved(CXFA_Node* pParent, CXFA_Node* pRemoved, FX_BOOL bNotify) { if (bNotify && pParent) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { pNotify->OnNodeEvent(pParent, XFA_NODEEVENT_ChildRemoved, pRemoved); } @@ -4882,7 +4885,7 @@ void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, void* pNewValue, FX_BOOL bNotify) { if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, (void*)(uintptr_t)eAttr, pNewValue); @@ -4905,7 +4908,7 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, GetEventParaInfoByName(wsEventName); if (eventParaInfo) { uint32_t validFlags = eventParaInfo->m_validFlags; - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return iRet; } diff --git a/xfa/fxfa/parser/xfa_objectacc_imp.cpp b/xfa/fxfa/parser/xfa_objectacc_imp.cpp index 72a18bcd3a..b634746ef4 100644 --- a/xfa/fxfa/parser/xfa_objectacc_imp.cpp +++ b/xfa/fxfa/parser/xfa_objectacc_imp.cpp @@ -6,6 +6,7 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" diff --git a/xfa/fxfa/parser/xfa_parser.h b/xfa/fxfa/parser/xfa_parser.h index 86a0d9d94f..5ccc1af199 100644 --- a/xfa/fxfa/parser/xfa_parser.h +++ b/xfa/fxfa/parser/xfa_parser.h @@ -13,7 +13,7 @@ class CFDE_XMLDoc; class IXFA_Parser { public: - static IXFA_Parser* Create(IXFA_ObjFactory* pFactory, + static IXFA_Parser* Create(CXFA_Document* pFactory, FX_BOOL bDocumentParser = FALSE); virtual ~IXFA_Parser() {} virtual void Release() = 0; @@ -25,16 +25,10 @@ class IXFA_Parser { IFX_Pause* pPause = NULL) = 0; virtual void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) = 0; - virtual IXFA_ObjFactory* GetFactory() const = 0; + virtual CXFA_Document* GetFactory() const = 0; virtual CXFA_Node* GetRootNode() const = 0; virtual CFDE_XMLDoc* GetXMLDoc() const = 0; virtual void CloseParser() = 0; }; -class IXFA_DocParser : public IXFA_Parser { - public: - static IXFA_DocParser* Create(IXFA_Notify* pNotify); - virtual CXFA_Document* GetDocument() const = 0; - virtual IXFA_Notify* GetNotify() const = 0; -}; #endif // XFA_FXFA_PARSER_XFA_PARSER_H_ diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 75198dc443..a2c2ae7909 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -18,12 +18,13 @@ #include "xfa/fxfa/parser/xfa_parser.h" #include "xfa/fxfa/parser/xfa_script.h" #include "xfa/fxfa/parser/xfa_utils.h" +#include "xfa/include/fxfa/xfa_checksum.h" -IXFA_Parser* IXFA_Parser::Create(IXFA_ObjFactory* pFactory, +IXFA_Parser* IXFA_Parser::Create(CXFA_Document* pFactory, FX_BOOL bDocumentParser) { return new CXFA_SimpleParser(pFactory, bDocumentParser); } -CXFA_SimpleParser::CXFA_SimpleParser(IXFA_ObjFactory* pFactory, +CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory, FX_BOOL bDocumentParser) : m_pXMLParser(nullptr), m_pXMLDoc(nullptr), @@ -36,7 +37,7 @@ CXFA_SimpleParser::CXFA_SimpleParser(IXFA_ObjFactory* pFactory, CXFA_SimpleParser::~CXFA_SimpleParser() { CloseParser(); } -void CXFA_SimpleParser::SetFactory(IXFA_ObjFactory* pFactory) { +void CXFA_SimpleParser::SetFactory(CXFA_Document* pFactory) { m_pFactory = pFactory; } static CFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( @@ -564,7 +565,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm( m_pXMLParser->m_dwCheckStatus != 0x03) { return NULL; } - IXFA_ChecksumContext* pChecksum = XFA_Checksum_Create(); + CXFA_ChecksumContext* pChecksum = new CXFA_ChecksumContext; pChecksum->StartChecksum(); pChecksum->UpdateChecksum(m_pFileRead, m_pXMLParser->m_nStart[0], m_pXMLParser->m_nSize[0]); @@ -1342,10 +1343,8 @@ void CXFA_SimpleParser::CloseParser() { m_pStream = NULL; } } -IXFA_DocParser* IXFA_DocParser::Create(IXFA_Notify* pNotify) { - return new CXFA_DocumentParser(pNotify); -} -CXFA_DocumentParser::CXFA_DocumentParser(IXFA_Notify* pNotify) + +CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify) : m_nodeParser(NULL, TRUE), m_pNotify(pNotify), m_pDocument(NULL) {} CXFA_DocumentParser::~CXFA_DocumentParser() { CloseParser(); diff --git a/xfa/fxfa/parser/xfa_parser_imp.h b/xfa/fxfa/parser/xfa_parser_imp.h index 308de7e587..d81637516d 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.h +++ b/xfa/fxfa/parser/xfa_parser_imp.h @@ -14,21 +14,22 @@ class CXFA_XMLParser; class CXFA_SimpleParser : public IXFA_Parser { public: - CXFA_SimpleParser(IXFA_ObjFactory* pFactory, FX_BOOL bDocumentParser = FALSE); - ~CXFA_SimpleParser(); - virtual void Release() { delete this; } + CXFA_SimpleParser(CXFA_Document* pFactory, FX_BOOL bDocumentParser = FALSE); + ~CXFA_SimpleParser() override; + + void Release() override { delete this; } - virtual int32_t StartParse(IFX_FileRead* pStream, - XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); - virtual int32_t DoParse(IFX_Pause* pPause = NULL); - virtual int32_t ParseXMLData(const CFX_WideString& wsXML, - CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = NULL); - virtual void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode); - virtual IXFA_ObjFactory* GetFactory() const { return m_pFactory; } - virtual CXFA_Node* GetRootNode() const { return m_pRootNode; } - virtual CFDE_XMLDoc* GetXMLDoc() const { return m_pXMLDoc; } - virtual void CloseParser(); + int32_t StartParse(IFX_FileRead* pStream, + XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; + int32_t DoParse(IFX_Pause* pPause = NULL) override; + int32_t ParseXMLData(const CFX_WideString& wsXML, + CFDE_XMLNode*& pXMLNode, + IFX_Pause* pPause = NULL) override; + void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; + CXFA_Document* GetFactory() const override { return m_pFactory; } + CXFA_Node* GetRootNode() const override { return m_pRootNode; } + CFDE_XMLDoc* GetXMLDoc() const override { return m_pXMLDoc; } + void CloseParser() override; protected: CXFA_Node* ParseAsXDPPacket(CFDE_XMLNode* pXMLDocumentNode, @@ -68,43 +69,44 @@ class CXFA_SimpleParser : public IXFA_Parser { void ParseInstruction(CXFA_Node* pXFANode, CFDE_XMLInstruction* pXMLInstruction, XFA_XDPPACKET ePacketID); - void SetFactory(IXFA_ObjFactory* pFactory); + void SetFactory(CXFA_Document* pFactory); CXFA_XMLParser* m_pXMLParser; CFDE_XMLDoc* m_pXMLDoc; IFX_Stream* m_pStream; IFX_FileRead* m_pFileRead; - IXFA_ObjFactory* m_pFactory; + CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; XFA_XDPPACKET m_ePacketID; FX_BOOL m_bDocumentParser; friend class CXFA_DocumentParser; }; -class CXFA_DocumentParser : public IXFA_DocParser { +class CXFA_DocumentParser : public IXFA_Parser { public: - CXFA_DocumentParser(IXFA_Notify* pNotify); - ~CXFA_DocumentParser(); - virtual void Release() { delete this; } - virtual int32_t StartParse(IFX_FileRead* pStream, - XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); - virtual int32_t DoParse(IFX_Pause* pPause = NULL); - virtual int32_t ParseXMLData(const CFX_WideString& wsXML, - CFDE_XMLNode*& pXMLNode, - IFX_Pause* pPause = NULL); - virtual void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode); - virtual IXFA_ObjFactory* GetFactory() const { + CXFA_DocumentParser(CXFA_FFNotify* pNotify); + ~CXFA_DocumentParser() override; + + void Release() override { delete this; } + int32_t StartParse(IFX_FileRead* pStream, + XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) override; + int32_t DoParse(IFX_Pause* pPause = NULL) override; + int32_t ParseXMLData(const CFX_WideString& wsXML, + CFDE_XMLNode*& pXMLNode, + IFX_Pause* pPause = NULL) override; + void ConstructXFANode(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLNode) override; + CXFA_Document* GetFactory() const override { return m_nodeParser.GetFactory(); } - virtual CXFA_Node* GetRootNode() const { return m_nodeParser.GetRootNode(); } - virtual CFDE_XMLDoc* GetXMLDoc() const { return m_nodeParser.GetXMLDoc(); } - virtual IXFA_Notify* GetNotify() const { return m_pNotify; } - virtual CXFA_Document* GetDocument() const { return m_pDocument; } - virtual void CloseParser(); + CXFA_Node* GetRootNode() const override { return m_nodeParser.GetRootNode(); } + CFDE_XMLDoc* GetXMLDoc() const override { return m_nodeParser.GetXMLDoc(); } + CXFA_FFNotify* GetNotify() const { return m_pNotify; } + CXFA_Document* GetDocument() const { return m_pDocument; } + void CloseParser() override; protected: CXFA_SimpleParser m_nodeParser; - IXFA_Notify* m_pNotify; + CXFA_FFNotify* m_pNotify; CXFA_Document* m_pDocument; }; typedef CFX_StackTemplate<CFDE_XMLNode*> CXFA_XMLNodeStack; diff --git a/xfa/fxfa/parser/xfa_script.h b/xfa/fxfa/parser/xfa_script.h index fb2960d09b..80601c5b97 100644 --- a/xfa/fxfa/parser/xfa_script.h +++ b/xfa/fxfa/parser/xfa_script.h @@ -82,40 +82,4 @@ struct XFA_JSBUILTININFO { const XFA_JSBUILTININFO* XFA_GetJSBuiltinByHash(uint32_t uHashCode); -class IXFA_ScriptContext { - public: - virtual ~IXFA_ScriptContext() {} - virtual void Release() = 0; - virtual void Initialize(FXJSE_HRUNTIME hRuntime) = 0; - - virtual void SetEventParam(CXFA_EventParam param) = 0; - virtual CXFA_EventParam* GetEventParam() = 0; - virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, - const CFX_WideStringC& wsScript, - FXJSE_HVALUE hRetValue, - CXFA_Object* pThisObject = NULL) = 0; - virtual int32_t ResolveObjects(CXFA_Object* refNode, - const CFX_WideStringC& wsExpression, - XFA_RESOLVENODE_RS& resolveNodeRS, - uint32_t dwStyles = XFA_RESOLVENODE_Children, - CXFA_Node* bindNode = NULL) = 0; - virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject) = 0; - virtual void CacheList(CXFA_NodeList* pList) = 0; - virtual CXFA_Object* GetThisObject() const = 0; - virtual FXJSE_HRUNTIME GetRuntime() const = 0; - virtual int32_t GetIndexByName(CXFA_Node* refNode) = 0; - virtual int32_t GetIndexByClassName(CXFA_Node* refNode) = 0; - virtual void GetSomExpression(CXFA_Node* refNode, - CFX_WideString& wsExpression) = 0; - - virtual void SetNodesOfRunScript(CXFA_NodeArray* pArray) = 0; - virtual void AddNodesOfRunScript(const CXFA_NodeArray& nodes) = 0; - virtual void AddNodesOfRunScript(CXFA_Node* pNode) = 0; - virtual FXJSE_HCLASS GetJseNormalClass() = 0; - virtual XFA_SCRIPTLANGTYPE GetType() = 0; - virtual void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) = 0; - virtual FX_BOOL IsRunAtClient() = 0; -}; -IXFA_ScriptContext* XFA_ScriptContext_Create(CXFA_Document* pDocument); - #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ diff --git a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp index 3f415e2a75..f616596a7f 100644 --- a/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -13,9 +14,12 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" #include "xfa/fxjse/cfxjse_arguments.h" +#include "xfa/include/fxfa/xfa_ffwidgethandler.h" CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument) : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) { @@ -55,7 +59,7 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Property( FXJSE_HVALUE hValue, uint32_t dwFlag, FX_BOOL bSetting) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -238,7 +242,7 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Target( } void CScript_EventPseudoModel::Script_EventPseudoModel_Emit( CFXJSE_Arguments* pArguments) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -246,11 +250,11 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Emit( if (!pEventParam) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_WidgetHandler* pWidgetHandler = pNotify->GetWidgetHandler(); + CXFA_FFWidgetHandler* pWidgetHandler = pNotify->GetWidgetHandler(); if (!pWidgetHandler) { return; } @@ -258,7 +262,7 @@ void CScript_EventPseudoModel::Script_EventPseudoModel_Emit( } void CScript_EventPseudoModel::Script_EventPseudoModel_Reset( CFXJSE_Arguments* pArguments) { - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index e2bc9dc857..ad20b76380 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -6,14 +6,18 @@ #include "xfa/fxfa/parser/xfa_script_hostpseudomodel.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" #include "xfa/fxfa/parser/xfa_document.h" +#include "xfa/fxfa/parser/xfa_document_layout_imp.h" #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" #include "xfa/fxjse/cfxjse_arguments.h" @@ -24,7 +28,7 @@ CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument) CScript_HostPseudoModel::~CScript_HostPseudoModel() {} void CScript_HostPseudoModel::Script_HostPseudoModel_LoadString( FXJSE_HVALUE hValue, - IXFA_Notify* pNotify, + CXFA_FFNotify* pNotify, uint32_t dwFlag) { CFX_WideString wsValue; pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); @@ -34,7 +38,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_AppType( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -50,7 +54,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitAppType( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -66,11 +70,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); if (bSetting) { pNotify->GetDocProvider()->SetCalculationsEnabled( hDoc, FXJSE_Value_ToBoolean(hValue)); @@ -83,11 +87,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); if (bSetting) { pNotify->GetDocProvider()->SetCurrentPage(hDoc, FXJSE_Value_ToInteger(hValue)); @@ -100,7 +104,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Language( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -116,11 +120,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); if (bSetting) { ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_NUMPAGES); return; @@ -132,7 +136,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Platform( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -151,11 +155,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title( if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); @@ -171,11 +175,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); if (bSetting) { pNotify->GetDocProvider()->SetValidationsEnabled( hDoc, FXJSE_Value_ToBoolean(hValue)); @@ -191,7 +195,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Variation( if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -207,7 +211,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Version( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -223,7 +227,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitVersion( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -239,7 +243,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Name( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -255,7 +259,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_FoxitName( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -277,11 +281,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"gotoURL"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CFX_WideString wsURL; if (iLength >= 1) { CFX_ByteString bsURL = pArguments->GetUTF8String(0); @@ -299,7 +303,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"openList"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -313,7 +317,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( FXJSE_Value_ToUTF8String(hValue, bsString); CFX_WideString wsExpression = CFX_WideString::FromUTF8(bsString, bsString.GetLength()); - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { FXJSE_Value_Release(hValue); return; @@ -336,11 +340,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( } FXJSE_Value_Release(hValue); } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } - IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); + CXFA_FFWidget* hWidget = + pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); if (!hWidget) { return; } @@ -354,7 +359,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"response"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -388,7 +393,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response( } void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -429,7 +434,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resetData"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -449,7 +454,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData( int32_t iExpLength = wsExpression.GetLength(); while (iStart < iExpLength) { iStart = XFA_FilterName(wsExpression, iStart, wsName); - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } @@ -482,7 +487,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Beep( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"beep"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -502,7 +507,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setFocus"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -516,7 +521,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( FXJSE_Value_ToUTF8String(hValue, bsString); CFX_WideString wsExpression = CFX_WideString::FromUTF8(bsString, bsString.GetLength()); - IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); + CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { FXJSE_Value_Release(hValue); return; @@ -543,7 +548,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( } void CScript_HostPseudoModel::Script_HostPseudoModel_GetFocus( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -564,7 +569,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"messageBox"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -631,7 +636,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg( } void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentCountInBatch( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -651,11 +656,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"print"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); uint32_t dwOptions = 0; FX_BOOL bShowDialog = TRUE; if (iLength >= 1) { @@ -717,7 +722,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"importData"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -726,7 +731,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData( CFX_ByteString bsFilePath = pArguments->GetUTF8String(0); wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength()); } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath); } void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData( @@ -736,11 +741,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"exportData"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CFX_WideString wsFilePath; FX_BOOL bXDP = TRUE; if (iLength >= 1) { @@ -754,11 +759,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData( } void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); int32_t nNewPage = 0; if (nCurPage <= 1) { @@ -769,11 +774,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp( } void CScript_HostPseudoModel::Script_HostPseudoModel_PageDown( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); int32_t nPageCount = pNotify->GetDocProvider()->CountPages(hDoc); if (!nPageCount || nCurPage == nPageCount) { @@ -789,7 +794,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageDown( } void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentDateTime( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h index 5718074b2f..1f456ffe7c 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.h +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.h @@ -79,7 +79,7 @@ class CScript_HostPseudoModel : public CXFA_OrdinaryObject { protected: void Script_HostPseudoModel_LoadString(FXJSE_HVALUE hValue, - IXFA_Notify* pNotify, + CXFA_FFNotify* pNotify, uint32_t dwFlag); FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg( CFXJSE_Arguments* pArguments, diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index e20a4e0b2a..ce3931149b 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -7,6 +7,7 @@ #include "xfa/fxfa/parser/xfa_script_imp.h" #include "core/fxcrt/include/fx_ext.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -133,7 +134,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject, return; } } - IXFA_Notify* pNotify = pDoc->GetNotify(); + CXFA_FFNotify* pNotify = pDoc->GetNotify(); if (!pNotify) { return; } @@ -213,7 +214,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, hValue, TRUE)) { return; } - IXFA_Notify* pNotify = pDoc->GetNotify(); + CXFA_FFNotify* pNotify = pDoc->GetNotify(); if (!pNotify) { return; } @@ -777,6 +778,3 @@ void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { m_pScriptNodeArray->Add(pNode); } } -IXFA_ScriptContext* XFA_ScriptContext_Create(CXFA_Document* pDocument) { - return new CXFA_ScriptContext(pDocument); -} diff --git a/xfa/fxfa/parser/xfa_script_imp.h b/xfa/fxfa/parser/xfa_script_imp.h index 237192e855..414e403d19 100644 --- a/xfa/fxfa/parser/xfa_script_imp.h +++ b/xfa/fxfa/parser/xfa_script_imp.h @@ -18,44 +18,41 @@ class CXFA_ResolveProcessor; -class CXFA_ScriptContext : public IXFA_ScriptContext { +class CXFA_ScriptContext { public: explicit CXFA_ScriptContext(CXFA_Document* pDocument); ~CXFA_ScriptContext(); - virtual void Release(); - virtual void Initialize(FXJSE_HRUNTIME hRuntime); - virtual void SetEventParam(CXFA_EventParam param) { m_eventParam = param; } - virtual CXFA_EventParam* GetEventParam() { return &m_eventParam; } - virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, - const CFX_WideStringC& wsScript, - FXJSE_HVALUE hRetValue, - CXFA_Object* pThisObject = NULL); + void Release(); + void Initialize(FXJSE_HRUNTIME hRuntime); + void SetEventParam(CXFA_EventParam param) { m_eventParam = param; } + CXFA_EventParam* GetEventParam() { return &m_eventParam; } + FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, + const CFX_WideStringC& wsScript, + FXJSE_HVALUE hRetValue, + CXFA_Object* pThisObject = NULL); - virtual int32_t ResolveObjects(CXFA_Object* refNode, - const CFX_WideStringC& wsExpression, - XFA_RESOLVENODE_RS& resolveNodeRS, - uint32_t dwStyles = XFA_RESOLVENODE_Children, - CXFA_Node* bindNode = NULL); - virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject); - virtual void CacheList(CXFA_NodeList* pList) { m_CacheListArray.Add(pList); } - virtual CXFA_Object* GetThisObject() const { return m_pThisObject; } - virtual FXJSE_HRUNTIME GetRuntime() const { return m_hJsRuntime; } + int32_t ResolveObjects(CXFA_Object* refNode, + const CFX_WideStringC& wsExpression, + XFA_RESOLVENODE_RS& resolveNodeRS, + uint32_t dwStyles = XFA_RESOLVENODE_Children, + CXFA_Node* bindNode = NULL); + FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject); + void CacheList(CXFA_NodeList* pList) { m_CacheListArray.Add(pList); } + CXFA_Object* GetThisObject() const { return m_pThisObject; } + FXJSE_HRUNTIME GetRuntime() const { return m_hJsRuntime; } - virtual int32_t GetIndexByName(CXFA_Node* refNode); - virtual int32_t GetIndexByClassName(CXFA_Node* refNode); - virtual void GetSomExpression(CXFA_Node* refNode, - CFX_WideString& wsExpression); + int32_t GetIndexByName(CXFA_Node* refNode); + int32_t GetIndexByClassName(CXFA_Node* refNode); + void GetSomExpression(CXFA_Node* refNode, CFX_WideString& wsExpression); - virtual void SetNodesOfRunScript(CXFA_NodeArray* pArray); - virtual void AddNodesOfRunScript(const CXFA_NodeArray& nodes); - virtual void AddNodesOfRunScript(CXFA_Node* pNode); - virtual FXJSE_HCLASS GetJseNormalClass(); + void SetNodesOfRunScript(CXFA_NodeArray* pArray); + void AddNodesOfRunScript(const CXFA_NodeArray& nodes); + void AddNodesOfRunScript(CXFA_Node* pNode); + FXJSE_HCLASS GetJseNormalClass(); - virtual void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) { m_eRunAtType = eRunAt; } - virtual FX_BOOL IsRunAtClient() { - return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; - } + void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) { m_eRunAtType = eRunAt; } + FX_BOOL IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; } FX_BOOL QueryNodeByFlag(CXFA_Node* refNode, const CFX_WideStringC& propname, FXJSE_HVALUE hValue, diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp index 97f2c8b45d..922b0d6bb6 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -15,7 +16,9 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" #include "xfa/fxjse/cfxjse_arguments.h" @@ -28,7 +31,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready( FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } @@ -80,7 +83,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( if (!pNode) { return; } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } @@ -140,7 +143,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Y( void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_NumberedPageCount( CFXJSE_Arguments* pArguments, FX_BOOL bNumbered) { - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } @@ -148,7 +151,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_NumberedPageCount( int32_t iPageNum = pDocLayout->CountPages(); if (bNumbered) { for (int32_t i = 0; i < iPageNum; i++) { - IXFA_LayoutPage* pLayoutPage = pDocLayout->GetPage(i); + CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(i); if (!pLayoutPage) { continue; } @@ -183,7 +186,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan( if (!pNode) { return; } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } @@ -205,7 +208,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page( Script_LayoutPseudoModel_PageImp(pArguments, FALSE); } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray( - IXFA_DocLayout* pDocLayout, + CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, FX_BOOL bOnPageArea, @@ -369,11 +372,11 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageContent( if (iLength >= 3) { bOnPageArea = pArguments->GetInt32(2) == 0 ? FALSE : TRUE; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } @@ -392,11 +395,11 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCount( } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -405,11 +408,11 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch( } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch( CFXJSE_Arguments* pArguments) { - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -447,19 +450,20 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch( if (!pNode) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } - IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); + CXFA_FFWidget* hWidget = + pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); if (!hWidget) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -481,19 +485,20 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch( if (!pNode) { return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } - IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); + CXFA_FFWidget* hWidget = + pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); if (!hWidget) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -537,7 +542,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp( if (!pNode && hValue) { FXJSE_Value_SetInteger(hValue, iPage); } - IXFA_DocLayout* pDocLayout = m_pDocument->GetDocLayout(); + CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); if (!pDocLayout) { return; } diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h index 56d9894284..7473bc0fe1 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.h @@ -53,7 +53,7 @@ class CScript_LayoutPseudoModel : public CXFA_OrdinaryObject { void Script_LayoutPseudoModel_AbsPage(CFXJSE_Arguments* pArguments); protected: - void Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, + void Script_LayoutPseudoModel_GetObjArray(CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, FX_BOOL bOnPageArea, diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index 3467471c5f..6311314d82 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -694,7 +694,6 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter( CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes; FXSYS_assert(iFoundCount == findNodes.GetSize()); CFX_WideString wsExpression; - IXFA_ScriptContext* pContext = NULL; XFA_SCRIPTLANGTYPE eLangType = XFA_SCRIPTLANGTYPE_Unkown; if (wsCondition.Left(2) == FX_WSTRC(L".[") && wsCondition.Right(1) == FX_WSTRC(L"]")) { @@ -705,7 +704,8 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter( } else { return; } - pContext = rnd.m_pSC; + + CXFA_ScriptContext* pContext = rnd.m_pSC; wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3); for (int32_t i = iFoundCount - 1; i >= 0; i--) { CXFA_Object* node = findNodes[i]; diff --git a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp index 15328b0ce3..2919664b52 100644 --- a/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_signaturepseudomodel.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h" +#include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" #include "xfa/fxfa/parser/xfa_docdata.h" #include "xfa/fxfa/parser/xfa_doclayout.h" @@ -13,7 +14,9 @@ #include "xfa/fxfa/parser/xfa_localemgr.h" #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_parser.h" +#include "xfa/fxfa/parser/xfa_parser_imp.h" #include "xfa/fxfa/parser/xfa_script.h" +#include "xfa/fxfa/parser/xfa_script_imp.h" #include "xfa/fxfa/parser/xfa_utils.h" #include "xfa/fxjse/cfxjse_arguments.h" @@ -30,11 +33,11 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CXFA_Node* pNode = NULL; if (iLength >= 1) { pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); @@ -52,11 +55,11 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sign"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CXFA_NodeList* pNodeList = NULL; CFX_WideString wsExpression; CFX_WideString wsXMLIdent; @@ -86,11 +89,11 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CXFA_NodeList* pList = pNotify->GetDocProvider()->Enumerate(hDoc); if (!pList) return; @@ -104,11 +107,11 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear( ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clear"); return; } - IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); + CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } - IXFA_Doc* hDoc = pNotify->GetHDOC(); + CXFA_FFDoc* hDoc = pNotify->GetHDOC(); CXFA_Node* pNode = NULL; FX_BOOL bClear = TRUE; if (iLength >= 1) { |