summaryrefslogtreecommitdiff
path: root/xfa/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-27 16:36:35 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-27 16:36:35 -0700
commit18e5b4b41dc622d4601be538934272678beb7069 (patch)
treec81e775531cd328143d1ffd4f2bb6277627e8e76 /xfa/src
parent04db653b2b4c266036fbd274b53f0763e35f4ee6 (diff)
downloadpdfium-18e5b4b41dc622d4601be538934272678beb7069.tar.xz
Replace XFA_HDOC with IXFA_Doc*
There are better ways to provide information hiding than casting willy-nilly from an unrelated structure. Kill dozens of casts in the process. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1146153005
Diffstat (limited to 'xfa/src')
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffapp.cpp8
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffapp.h12
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdoc.cpp8
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdoc.h14
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdochandler.cpp64
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdochandler.h42
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdocview.cpp14
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffdocview.h16
-rw-r--r--xfa/src/fxfa/src/app/xfa_fffield.cpp2
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffnotify.cpp8
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffnotify.h2
-rw-r--r--xfa/src/fxfa/src/app/xfa_fftext.cpp2
-rw-r--r--xfa/src/fxfa/src/app/xfa_fftextedit.cpp6
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffwidget.cpp2
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp4
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp4
-rw-r--r--xfa/src/fxfa/src/app/xfa_fontmgr.cpp12
-rw-r--r--xfa/src/fxfa/src/app/xfa_fontmgr.h10
-rw-r--r--xfa/src/fxfa/src/app/xfa_textlayout.cpp2
-rw-r--r--xfa/src/fxfa/src/common/xfa_document.h2
-rw-r--r--xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp24
-rw-r--r--xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp10
-rw-r--r--xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp8
23 files changed, 144 insertions, 132 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.cpp b/xfa/src/fxfa/src/app/xfa_ffapp.cpp
index abd02460d1..ea5136955b 100644
--- a/xfa/src/fxfa/src/app/xfa_ffapp.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffapp.cpp
@@ -212,7 +212,7 @@ IXFA_DocHandler* CXFA_FFApp::GetDocHandler()
}
return m_pDocHandler;
}
-XFA_HDOC CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile)
+IXFA_Doc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile)
{
CXFA_FFDoc* pDoc = FX_NEW CXFA_FFDoc(this, pProvider);
if (!pDoc) {
@@ -223,9 +223,9 @@ XFA_HDOC CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStrea
delete pDoc;
pDoc = NULL;
}
- return (XFA_HDOC)pDoc;
+ return pDoc;
}
-XFA_HDOC CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document *pPDFDoc)
+IXFA_Doc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document *pPDFDoc)
{
if (pPDFDoc == NULL) {
return NULL;
@@ -239,7 +239,7 @@ XFA_HDOC CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document *pPDFD
delete pDoc;
pDoc = NULL;
}
- return (XFA_HDOC)pDoc;
+ return pDoc;
}
void CXFA_FFApp::SetDefaultFontMgr(IXFA_FontMgr* pFontMgr)
diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.h b/xfa/src/fxfa/src/app/xfa_ffapp.h
index b99f1fe209..19eb347c91 100644
--- a/xfa/src/fxfa/src/app/xfa_ffapp.h
+++ b/xfa/src/fxfa/src/app/xfa_ffapp.h
@@ -4,8 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FXFA_FORMFILLER_APP_IMP_H
-#define _FXFA_FORMFILLER_APP_IMP_H
+#ifndef XFA_FFAPP_H_
+#define XFA_FFAPP_H_
+
class CXFA_FileRead : public IFX_FileRead
{
public:
@@ -50,8 +51,8 @@ public:
~CXFA_FFApp() override;
virtual IXFA_DocHandler* GetDocHandler();
- virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile);
- virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc);
+ virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, IFX_FileRead* pStream, FX_BOOL bTakeOverFile);
+ virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc);
virtual IXFA_AppProvider* GetAppProvider()
{
return m_pProvider;
@@ -86,4 +87,5 @@ protected:
CXFA_FFMenuHandler* m_pMenuHandler;
CFWL_SDAdapterThreadMgr* m_pAdapterThreadMgr;
};
-#endif
+
+#endif // XFA_FFAPP_H_
diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp
index 92eb0ec24a..4ca1007dab 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp
@@ -126,13 +126,13 @@ FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause )
CFX_WideString wsHref;
((IFDE_XMLElement*)pPDFXML)->GetString(L"href", wsHref);
if (!wsHref.IsEmpty()) {
- pXFAReader = GetDocProvider()->OpenLinkedFile((XFA_HDOC)this, wsHref);
+ pXFAReader = GetDocProvider()->OpenLinkedFile(this, wsHref);
}
}
if (!pXFAReader) {
return XFA_PARSESTATUS_SyntaxErr;
}
- CPDF_Document* pPDFDocument = GetDocProvider()->OpenPDF(reinterpret_cast<XFA_HDOC>(this), pXFAReader, TRUE);
+ CPDF_Document* pPDFDocument = GetDocProvider()->OpenPDF(this, pXFAReader, TRUE);
FXSYS_assert(!m_pPDFDoc);
if (!OpenDoc(pPDFDocument)) {
return XFA_PARSESTATUS_SyntaxErr;
@@ -158,7 +158,7 @@ FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause )
}
void CXFA_FFDoc::StopLoad()
{
- m_pApp->GetXFAFontMgr()->LoadDocFonts((XFA_HDOC)this);
+ m_pApp->GetXFAFontMgr()->LoadDocFonts(this);
m_dwDocType = XFA_DOCTYPE_Static;
CXFA_Node* pConfig = (CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Config);
if (!pConfig) {
@@ -296,7 +296,7 @@ FX_BOOL CXFA_FFDoc::CloseDoc()
delete m_pNotify;
m_pNotify = NULL;
}
- m_pApp->GetXFAFontMgr()->ReleaseDocFonts((XFA_HDOC)this);
+ m_pApp->GetXFAFontMgr()->ReleaseDocFonts(this);
if (m_dwDocType != XFA_DOCTYPE_XDP && m_pStream && m_bOwnStream) {
m_pStream->Release();
m_pStream = NULL;
diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.h b/xfa/src/fxfa/src/app/xfa_ffdoc.h
index 0f95d0b2ff..964573f201 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdoc.h
+++ b/xfa/src/fxfa/src/app/xfa_ffdoc.h
@@ -4,18 +4,23 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FXFA_FORMFILLER_DOC_IMP_H
-#define _FXFA_FORMFILLER_DOC_IMP_H
+#ifndef FXFA_SRC_APP_XFA_FFDOC_H_
+#define FXFA_SRC_APP_XFA_FFDOC_H_
+
+#include "../../../../include/fxfa/fxfa.h"
+
class CXFA_FFApp;
class CXFA_FFNotify;
class CXFA_FFDocView;
class IXFA_Locale;
+
typedef struct _FX_IMAGEDIB_AND_DPI {
CFX_DIBSource* pDibSource;
FX_INT32 iImageXDpi;
FX_INT32 iImageYDpi;
} FX_IMAGEDIB_AND_DPI;
-class CXFA_FFDoc
+
+class CXFA_FFDoc : public IXFA_Doc
{
public:
CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider);
@@ -60,4 +65,5 @@ protected:
FX_DWORD m_dwDocType;
FX_BOOL m_bOwnStream;
};
-#endif
+
+#endif // FXFA_SRC_APP_XFA_FFDOC_H_
diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
index 426a455d4f..9d76ca19e2 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
@@ -14,66 +14,66 @@ CXFA_FFDocHandler::CXFA_FFDocHandler()
CXFA_FFDocHandler::~CXFA_FFDocHandler()
{
}
-void CXFA_FFDocHandler::ReleaseDoc(XFA_HDOC hDoc)
+void CXFA_FFDocHandler::ReleaseDoc(IXFA_Doc* hDoc)
{
- delete (CXFA_FFDoc*)hDoc;
+ delete hDoc; // virtual dtor.
}
-IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(XFA_HDOC hDoc)
+IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(IXFA_Doc* hDoc)
{
- return ((CXFA_FFDoc*)hDoc)->GetDocProvider();
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetDocProvider();
}
-FX_DWORD CXFA_FFDocHandler::GetDocType(XFA_HDOC hDoc)
+FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc)
{
- return ((CXFA_FFDoc*)hDoc)->GetDocType();
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetDocType();
}
-FX_INT32 CXFA_FFDocHandler::StartLoad(XFA_HDOC hDoc)
+FX_INT32 CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc)
{
- return ((CXFA_FFDoc*)hDoc)->StartLoad();
+ return static_cast<CXFA_FFDoc*>(hDoc)->StartLoad();
}
-FX_INT32 CXFA_FFDocHandler::DoLoad(XFA_HDOC hDoc, IFX_Pause *pPause )
+FX_INT32 CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause )
{
- return ((CXFA_FFDoc*)hDoc)->DoLoad(pPause);
+ return static_cast<CXFA_FFDoc*>(hDoc)->DoLoad(pPause);
}
-void CXFA_FFDocHandler::StopLoad(XFA_HDOC hDoc)
+void CXFA_FFDocHandler::StopLoad(IXFA_Doc* hDoc)
{
- ((CXFA_FFDoc*)hDoc)->StopLoad();
+ static_cast<CXFA_FFDoc*>(hDoc)->StopLoad();
}
-IXFA_DocView* CXFA_FFDocHandler::CreateDocView(XFA_HDOC hDoc, FX_DWORD dwView )
+IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView )
{
- return ((CXFA_FFDoc*)hDoc)->CreateDocView(dwView);
+ return static_cast<CXFA_FFDoc*>(hDoc)->CreateDocView(dwView);
}
-FX_INT32 CXFA_FFDocHandler::CountPackages(XFA_HDOC hDoc)
+FX_INT32 CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc)
{
return 0;
}
-void CXFA_FFDocHandler::GetPackageName(XFA_HDOC hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage)
+void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage)
{
}
-IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(XFA_HDOC hDoc, FX_WSTR wsPackage)
+IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage)
{
- return ((CXFA_FFDoc*)hDoc)->GetPackageData(wsPackage);
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetPackageData(wsPackage);
}
-FX_BOOL CXFA_FFDocHandler::SavePackage(XFA_HDOC hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext )
+FX_BOOL CXFA_FFDocHandler::SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext )
{
- return ((CXFA_FFDoc*)hDoc)->SavePackage(wsPackage, pFile, pCSContext);
+ return static_cast<CXFA_FFDoc*>(hDoc)->SavePackage(wsPackage, pFile, pCSContext);
}
-FX_BOOL CXFA_FFDocHandler::CloseDoc(XFA_HDOC hDoc)
+FX_BOOL CXFA_FFDocHandler::CloseDoc(IXFA_Doc* hDoc)
{
- return ((CXFA_FFDoc*)hDoc)->CloseDoc();
+ return static_cast<CXFA_FFDoc*>(hDoc)->CloseDoc();
}
-FX_BOOL CXFA_FFDocHandler::ImportData(XFA_HDOC hDoc, IFX_FileRead* pStream, FX_BOOL bXDP )
+FX_BOOL CXFA_FFDocHandler::ImportData(IXFA_Doc* hDoc, IFX_FileRead* pStream, FX_BOOL bXDP )
{
- return ((CXFA_FFDoc*)hDoc)->ImportData(pStream, bXDP);
+ return static_cast<CXFA_FFDoc*>(hDoc)->ImportData(pStream, bXDP);
}
-void CXFA_FFDocHandler::SetJSERuntime(XFA_HDOC hDoc, FXJSE_HRUNTIME hRuntime)
+void CXFA_FFDocHandler::SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime)
{
- ((CXFA_FFDoc*)hDoc)->GetXFADoc()->InitScriptContext(hRuntime);
+ static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc()->InitScriptContext(hRuntime);
}
-FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(XFA_HDOC hDoc)
+FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(IXFA_Doc* hDoc)
{
- CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
if (!pXFADoc) {
return NULL;
}
@@ -83,9 +83,9 @@ FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(XFA_HDOC hDoc)
}
return pScriptContext->GetJSValueFromMap(pXFADoc->GetRoot());
}
-XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(XFA_HDOC hDoc)
+XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(IXFA_Doc* hDoc)
{
- CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
if (!pXFADoc) {
return XFA_ATTRIBUTEENUM_Unknown;
}
@@ -99,9 +99,9 @@ XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(XFA_HDOC hDoc)
}
return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState);
}
-FX_BOOL CXFA_FFDocHandler::RunDocScript(XFA_HDOC hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject)
+FX_BOOL CXFA_FFDocHandler::RunDocScript(IXFA_Doc* hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject)
{
- CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
if (!pXFADoc) {
return FALSE;
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.h b/xfa/src/fxfa/src/app/xfa_ffdochandler.h
index 27b5b920be..95abc6ad33 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdochandler.h
+++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.h
@@ -4,31 +4,33 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FXFA_FORMFILLER_DOCHANDLER_IMP_H
-#define _FXFA_FORMFILLER_DOCHANDLER_IMP_H
+#ifndef XFA_FFDOCHANDLER_H_
+#define XFA_FFDOCHANDLER_H_
+
class CXFA_FFDocHandler : public IXFA_DocHandler
{
public:
CXFA_FFDocHandler();
~CXFA_FFDocHandler();
- virtual void ReleaseDoc(XFA_HDOC hDoc);
- virtual IXFA_DocProvider* GetDocProvider(XFA_HDOC hDoc);
- virtual FX_DWORD GetDocType(XFA_HDOC hDoc);
- virtual FX_INT32 StartLoad(XFA_HDOC hDoc);
- virtual FX_INT32 DoLoad(XFA_HDOC hDoc, IFX_Pause *pPause = NULL);
- virtual void StopLoad(XFA_HDOC hDoc);
+ virtual void ReleaseDoc(IXFA_Doc* hDoc);
+ virtual IXFA_DocProvider* GetDocProvider(IXFA_Doc* hDoc);
+ virtual FX_DWORD GetDocType(IXFA_Doc* hDoc);
+ virtual FX_INT32 StartLoad(IXFA_Doc* hDoc);
+ virtual FX_INT32 DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL);
+ virtual void StopLoad(IXFA_Doc* hDoc);
- virtual IXFA_DocView* CreateDocView(XFA_HDOC hDoc, FX_DWORD dwView = 0);
- virtual FX_INT32 CountPackages(XFA_HDOC hDoc);
- virtual void GetPackageName(XFA_HDOC hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage);
- virtual IFDE_XMLElement* GetPackageData(XFA_HDOC hDoc, FX_WSTR wsPackage);
- virtual FX_BOOL SavePackage(XFA_HDOC hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);
- virtual FX_BOOL CloseDoc(XFA_HDOC hDoc);
- virtual FX_BOOL ImportData(XFA_HDOC hDoc, IFX_FileRead* pStream, FX_BOOL bXDP = TRUE);
- virtual void SetJSERuntime(XFA_HDOC hDoc, FXJSE_HRUNTIME hRuntime);
- virtual FXJSE_HVALUE GetXFAScriptObject(XFA_HDOC hDoc);
- virtual XFA_ATTRIBUTEENUM GetRestoreState(XFA_HDOC hDoc);
- virtual FX_BOOL RunDocScript(XFA_HDOC hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject);
+ virtual IXFA_DocView* CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView = 0);
+ virtual FX_INT32 CountPackages(IXFA_Doc* hDoc);
+ virtual void GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage);
+ virtual IFDE_XMLElement* GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage);
+ virtual FX_BOOL SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);
+ virtual FX_BOOL CloseDoc(IXFA_Doc* hDoc);
+ virtual FX_BOOL ImportData(IXFA_Doc* hDoc, IFX_FileRead* pStream, FX_BOOL bXDP = TRUE);
+ virtual void SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime);
+ virtual FXJSE_HVALUE GetXFAScriptObject(IXFA_Doc* hDoc);
+ virtual XFA_ATTRIBUTEENUM GetRestoreState(IXFA_Doc* hDoc);
+ virtual FX_BOOL RunDocScript(IXFA_Doc* hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject);
protected:
};
-#endif
+
+#endif // XFA_FFDOCHANDLER_H_
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp
index bb6a5ce2a9..32d2789c7d 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp
@@ -277,7 +277,7 @@ void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc )
}
}
if (bChanged) {
- m_pDoc->GetDocProvider()->SetChangeMark((XFA_HDOC)m_pDoc);
+ m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
}
FX_INT32 CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc )
@@ -419,7 +419,7 @@ void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc)
if (SetFocus((XFA_HWIDGET)pNewFocus)) {
m_pFocusAcc = pWidgetAcc;
if (m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End) {
- m_pDoc->GetDocProvider()->SetFocusWidget((XFA_HDOC)m_pDoc, (XFA_HWIDGET)m_pFocusWidget);
+ m_pDoc->GetDocProvider()->SetFocusWidget(m_pDoc, (XFA_HWIDGET)m_pFocusWidget);
}
}
}
@@ -709,8 +709,8 @@ void CXFA_FFDocView::RunCalculateRecursive(FX_INT32& iIndex)
}
FX_INT32 CXFA_FFDocView::RunCalculateWidgets()
{
- if (!m_pDoc->GetDocProvider()->IsCalculationsEnabled((XFA_HDOC)m_pDoc)) {
- return XFA_EVENTERROR_Disabled;
+ if (!m_pDoc->GetDocProvider()->IsCalculationsEnabled(m_pDoc)) {
+ return XFA_EVENTERROR_Disabled;
}
FX_INT32 iCounts = m_CalculateAccs.GetSize();
FX_INT32 iIndex = 0;
@@ -737,7 +737,7 @@ FX_BOOL CXFA_FFDocView::InitCalculate(CXFA_Node* pNode)
}
FX_BOOL CXFA_FFDocView::InitValidate(CXFA_Node* pNode)
{
- if (!m_pDoc->GetDocProvider()->IsValidationsEnabled((XFA_HDOC)m_pDoc)) {
+ if (!m_pDoc->GetDocProvider()->IsValidationsEnabled(m_pDoc)) {
return FALSE;
}
ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Validate);
@@ -746,7 +746,7 @@ FX_BOOL CXFA_FFDocView::InitValidate(CXFA_Node* pNode)
}
FX_BOOL CXFA_FFDocView::RunValidate()
{
- if (!m_pDoc->GetDocProvider()->IsValidationsEnabled((XFA_HDOC)m_pDoc)) {
+ if (!m_pDoc->GetDocProvider()->IsValidationsEnabled(m_pDoc)) {
return FALSE;
}
FX_INT32 iCounts = m_ValidateAccs.GetSize();
@@ -841,7 +841,7 @@ void CXFA_FFDocView::SetChangeMark()
if (m_iStatus < XFA_DOCVIEW_LAYOUTSTATUS_End) {
return;
}
- m_pDoc->GetDocProvider()->SetChangeMark((XFA_HDOC)m_pDoc);
+ m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
CXFA_Node* CXFA_FFDocView::GetRootSubform()
{
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.h b/xfa/src/fxfa/src/app/xfa_ffdocview.h
index 2f7919bded..79a3008d70 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdocview.h
+++ b/xfa/src/fxfa/src/app/xfa_ffdocview.h
@@ -4,8 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FXFA_FORMFILLER_DOCVIEW_IMP_H
-#define _FXFA_FORMFILLER_DOCVIEW_IMP_H
+#ifndef FXFA_SRC_APP_XFA_FFDOCVIEW_H_
+#define FXFA_SRC_APP_XFA_FFDOCVIEW_H_
+
+#include "xfa_ffdoc.h"
+
class CXFA_FFPageView;
class CXFA_FFWidgetHandler;
class CXFA_FFDoc;
@@ -33,10 +36,8 @@ class CXFA_FFDocView : public IXFA_DocView
public:
CXFA_FFDocView(CXFA_FFDoc* pDoc);
~CXFA_FFDocView();
- virtual XFA_HDOC GetDoc()
- {
- return (XFA_HDOC)m_pDoc;
- }
+
+ virtual IXFA_Doc* GetDoc() { return m_pDoc; }
virtual FX_INT32 StartLayout(FX_INT32 iStartPage = 0);
virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL);
virtual void StopLayout();
@@ -161,4 +162,5 @@ protected:
CXFA_FFDocView* m_pDocView;
CXFA_WidgetAcc* m_pCurWidgetAcc;
};
-#endif
+
+#endif // FXFA_SRC_APP_XFA_FFDOCVIEW_H_
diff --git a/xfa/src/fxfa/src/app/xfa_fffield.cpp b/xfa/src/fxfa/src/app/xfa_fffield.cpp
index 5f32db5bb3..34b73b55b0 100644
--- a/xfa/src/fxfa/src/app/xfa_fffield.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fffield.cpp
@@ -82,7 +82,7 @@ void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, CFX_Matrix* pMatrix, FX_DWOR
}
if ((dwStatus & XFA_WIDGETSTATUS_Highlight) && m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) {
CXFA_FFDoc* pDoc = GetDoc();
- CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor((XFA_HDOC)pDoc));
+ CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc));
pGS->SetFillColor(&crHighlight);
CFX_Path path;
path.Create();
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
index fec25b55c0..2d6cc75046 100644
--- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
@@ -298,9 +298,9 @@ void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode)
pDocView->AddCalculateWidgetAcc(pWidgetAcc);
pDocView->AddValidateWidget(pWidgetAcc);
}
-XFA_HDOC CXFA_FFNotify::GetHDOC()
+IXFA_Doc* CXFA_FFNotify::GetHDOC()
{
- return (XFA_HDOC)m_pDoc;
+ return m_pDoc;
}
IXFA_DocProvider* CXFA_FFNotify::GetDocProvider()
{
@@ -529,7 +529,7 @@ void CXFA_FFNotify::OnChildAdded(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVOID
}
FX_BOOL bLayoutReady = !(pDocView->m_bInLayoutStatus) && (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady) {
- m_pDoc->GetDocProvider()->SetChangeMark((XFA_HDOC)m_pDoc);
+ m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
}
void CXFA_FFNotify::OnChildRemoved(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVOID pParam2)
@@ -537,7 +537,7 @@ void CXFA_FFNotify::OnChildRemoved(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVO
if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) {
FX_BOOL bLayoutReady = !(pDocView->m_bInLayoutStatus) && (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady) {
- m_pDoc->GetDocProvider()->SetChangeMark((XFA_HDOC)m_pDoc);
+ m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
}
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.h b/xfa/src/fxfa/src/app/xfa_ffnotify.h
index a0f0820cbb..739f25302f 100644
--- a/xfa/src/fxfa/src/app/xfa_ffnotify.h
+++ b/xfa/src/fxfa/src/app/xfa_ffnotify.h
@@ -24,7 +24,7 @@ public:
virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem);
virtual FX_INT32 ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc * pExclude = NULL);
virtual void AddCalcValidate(CXFA_Node* pNode);
- virtual XFA_HDOC GetHDOC();
+ virtual IXFA_Doc* GetHDOC();
virtual IXFA_DocProvider* GetDocProvider();
virtual IXFA_AppProvider* GetAppProvider();
virtual IXFA_WidgetHandler* GetWidgetHandler();
diff --git a/xfa/src/fxfa/src/app/xfa_fftext.cpp b/xfa/src/fxfa/src/app/xfa_fftext.cpp
index eed50b50ca..1d121a330a 100644
--- a/xfa/src/fxfa/src/app/xfa_fftext.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fftext.cpp
@@ -141,7 +141,7 @@ FX_BOOL CXFA_FFText::OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
return FALSE;
}
CXFA_FFDoc* pDoc = GetDoc();
- pDoc->GetDocProvider()->GotoURL((XFA_HDOC)pDoc, CFX_WideStringC(wsURLContent), FALSE);
+ pDoc->GetDocProvider()->GotoURL(pDoc, CFX_WideStringC(wsURLContent), FALSE);
return TRUE;
}
FX_DWORD CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy)
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
index b2e5299478..417891094f 100644
--- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
@@ -395,14 +395,14 @@ FX_BOOL CXFA_FFTextEdit::CheckWord(FX_BSTR sWord)
if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
return TRUE;
}
- return GetDoc()->GetDocProvider()->CheckWord((XFA_HDOC)GetDoc(), sWord);
+ return GetDoc()->GetDocProvider()->CheckWord(GetDoc(), sWord);
}
FX_BOOL CXFA_FFTextEdit::GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSuggest)
{
if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
return FALSE;
}
- return GetDoc()->GetDocProvider()->GetSuggestWords((XFA_HDOC)GetDoc(), sWord, sSuggest);
+ return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);
}
FX_INT32 CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage)
{
@@ -829,7 +829,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear,
CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)m_pNormalWidget;
pDateTime->SetEditText(wsDate);
pDateTime->Update();
- GetDoc()->GetDocProvider()->SetFocusWidget((XFA_HDOC)GetDoc(), NULL);
+ GetDoc()->GetDocProvider()->SetFocusWidget(GetDoc(), NULL);
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Change;
eParam.m_pTarget = m_pDataAcc;
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
index 46e1d94662..0967da1284 100644
--- a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
@@ -997,7 +997,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &b
return pBitmap;
}
}
- pImageFileRead = pDoc->GetDocProvider()->OpenLinkedFile((XFA_HDOC)pDoc, wsURL);
+ pImageFileRead = pDoc->GetDocProvider()->OpenLinkedFile(pDoc, wsURL);
}
if (!pImageFileRead) {
if (pImageBuffer) {
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
index d51b1faabf..d953e2bbe3 100644
--- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
@@ -382,7 +382,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEvent
break;
case XFA_ELEMENT_Submit: {
CXFA_Submit submit = event.GetSubmit();
- return GetDoc()->GetDocProvider()->SubmitData((XFA_HDOC)GetDoc(), submit);
+ return GetDoc()->GetDocProvider()->SubmitData(GetDoc(), submit);
}
default:
break;
@@ -1549,7 +1549,7 @@ IFX_Font* CXFA_WidgetAcc::GetFDEFont()
font.GetTypeface(wsFontName);
}
CXFA_FFDoc* pDoc = GetDoc();
- return pDoc->GetApp()->GetXFAFontMgr()->GetFont((XFA_HDOC)pDoc, wsFontName, dwFontStyle);
+ return pDoc->GetApp()->GetXFAFontMgr()->GetFont(pDoc, wsFontName, dwFontStyle);
}
FX_FLOAT CXFA_WidgetAcc::GetFontSize()
{
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp
index 12df3a096a..9790b4bb3a 100644
--- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp
@@ -78,7 +78,7 @@ FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlag
((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnLButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
- ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget((XFA_HDOC)m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
+ ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
}
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
@@ -120,7 +120,7 @@ FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlag
((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnRButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
- ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget((XFA_HDOC)m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
+ ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
}
m_pDocView->RunInvalidate();
return bRet;
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
index 8138e5870b..5cacacfff6 100644
--- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
@@ -1028,7 +1028,7 @@ CXFA_DefFontMgr::~CXFA_DefFontMgr()
m_CacheFonts.RemoveAll();
}
#define _FXFA_USEGASFONTMGR_
-IFX_Font* CXFA_DefFontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage )
+IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage )
{
CFX_WideString wsFontName = wsFontFamily;
IFX_FontMgr* pFDEFontMgr = ((CXFA_FFDoc*)hDoc)->GetApp()->GetFDEFontMgr();
@@ -1081,7 +1081,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD
}
return pFont;
}
-IFX_Font* CXFA_DefFontMgr::GetDefaultFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage)
+IFX_Font* CXFA_DefFontMgr::GetDefaultFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage)
{
IFX_FontMgr* pFDEFontMgr = ((CXFA_FFDoc*)hDoc)->GetApp()->GetFDEFontMgr();
#ifdef _FXFA_USEGASFONTMGR_
@@ -1305,7 +1305,7 @@ CXFA_FontMgr::~CXFA_FontMgr()
{
DelAllMgrMap();
}
-IFX_Font* CXFA_FontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles,
+IFX_Font* CXFA_FontMgr::GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles,
FX_WORD wCodePage )
{
FX_DWORD dwHash = FX_HashCode_String_GetW(wsFontFamily.GetPtr(), wsFontFamily.GetLength(), FALSE);
@@ -1348,13 +1348,13 @@ IFX_Font* CXFA_FontMgr::GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dw
}
return pFont;
}
-void CXFA_FontMgr::LoadDocFonts(XFA_HDOC hDoc)
+void CXFA_FontMgr::LoadDocFonts(IXFA_Doc* hDoc)
{
if (!m_PDFFontMgrArray.GetValueAt(hDoc)) {
m_PDFFontMgrArray.SetAt(hDoc, FX_NEW CXFA_PDFFontMgr((CXFA_FFDoc*)hDoc));
}
}
-void CXFA_FontMgr::ReleaseDocFonts(XFA_HDOC hDoc)
+void CXFA_FontMgr::ReleaseDocFonts(IXFA_Doc* hDoc)
{
CXFA_PDFFontMgr* pMgr = NULL;
if (m_PDFFontMgrArray.Lookup(hDoc, (void*&)pMgr)) {
@@ -1368,7 +1368,7 @@ void CXFA_FontMgr::DelAllMgrMap()
{
FX_POSITION ps = m_PDFFontMgrArray.GetStartPosition();
while (ps) {
- XFA_HDOC hDoc = NULL;
+ IXFA_Doc* hDoc = NULL;
CXFA_PDFFontMgr* pMgr = NULL;
m_PDFFontMgrArray.GetNextAssoc(ps, (void*&)hDoc, (void*&)pMgr);
if (pMgr != NULL) {
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.h b/xfa/src/fxfa/src/app/xfa_fontmgr.h
index fd65570115..9de1348293 100644
--- a/xfa/src/fxfa/src/app/xfa_fontmgr.h
+++ b/xfa/src/fxfa/src/app/xfa_fontmgr.h
@@ -18,8 +18,8 @@ class CXFA_DefFontMgr : public IXFA_FontMgr
public:
CXFA_DefFontMgr() {}
~CXFA_DefFontMgr() override;
- virtual IFX_Font* GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
- virtual IFX_Font* GetDefaultFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
+ virtual IFX_Font* GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
+ virtual IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
protected:
CFX_PtrArray m_CacheFonts;
};
@@ -43,10 +43,10 @@ class CXFA_FontMgr
public:
CXFA_FontMgr();
~CXFA_FontMgr();
- IFX_Font* GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles,
+ IFX_Font* GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWORD dwFontStyles,
FX_WORD wCodePage = 0xFFFF);
- void LoadDocFonts(XFA_HDOC hDoc);
- void ReleaseDocFonts(XFA_HDOC hDoc);
+ void LoadDocFonts(IXFA_Doc* hDoc);
+ void ReleaseDocFonts(IXFA_Doc* hDoc);
void SetDefFontMgr(IXFA_FontMgr* pFontMgr);
protected:
diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp
index c577042776..510b627b21 100644
--- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp
+++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp
@@ -378,7 +378,7 @@ IFX_Font* CXFA_TextParser::GetFont(IXFA_TextProvider *pTextProvider, IFDE_CSSCom
CXFA_FFDoc *pDoc = pTextProvider->GetDocNode();
FXSYS_assert(pDoc != NULL);
CXFA_FontMgr *pFontMgr = pDoc->GetApp()->GetXFAFontMgr();
- return pFontMgr->GetFont((XFA_HDOC)pDoc, wsFamily, dwStyle);
+ return pFontMgr->GetFont(pDoc, wsFamily, dwStyle);
}
FX_FLOAT CXFA_TextParser::GetFontSize(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const
{
diff --git a/xfa/src/fxfa/src/common/xfa_document.h b/xfa/src/fxfa/src/common/xfa_document.h
index e935940c37..9e985e2155 100644
--- a/xfa/src/fxfa/src/common/xfa_document.h
+++ b/xfa/src/fxfa/src/common/xfa_document.h
@@ -76,7 +76,7 @@ public:
virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) = 0;
virtual FX_INT32 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 XFA_HDOC GetHDOC() = 0;
+ virtual IXFA_Doc* GetHDOC() = 0;
virtual IXFA_DocProvider* GetDocProvider() = 0;
virtual IXFA_AppProvider* GetAppProvider() = 0;
virtual IXFA_WidgetHandler* GetWidgetHandler() = 0;
diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp
index fbf69a3c10..0189e5e464 100644
--- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp
@@ -65,7 +65,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CalculationsEnabled(FXJSE_H
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetCalculationsEnabled(hDoc, FXJSE_Value_ToBoolean(hValue));
return;
@@ -79,7 +79,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage(FXJSE_HVALUE hV
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetCurrentPage(hDoc, FXJSE_Value_ToInteger(hValue));
return;
@@ -107,7 +107,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages(FXJSE_HVALUE hValu
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_NUMPAGES);
return;
@@ -138,7 +138,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(FXJSE_HVALUE hValue,
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
@@ -155,7 +155,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ValidationsEnabled(FXJSE_HV
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
pNotify->GetDocProvider()->SetValidationsEnabled(hDoc, FXJSE_Value_ToBoolean(hValue));
return;
@@ -250,7 +250,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(CFXJSE_Arguments* p
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CFX_WideString wsURL;
if (iLength >= 1) {
CFX_ByteString bsURL = pArguments->GetUTF8String(0);
@@ -466,7 +466,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(CFXJSE_Arguments*
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CXFA_Node* pNode = NULL;
if (iLength >= 1) {
FXJSE_HVALUE hValue = pArguments->GetValue(0);
@@ -608,7 +608,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_DWORD dwOptions = 0;
FX_BOOL bShowDialog = TRUE;
if (iLength >= 1) {
@@ -679,7 +679,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(CFXJSE_Arguments
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(CFXJSE_Arguments* pArguments)
@@ -693,7 +693,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(CFXJSE_Arguments
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CFX_WideString wsFilePath;
FX_BOOL bXDP = TRUE;
if (iLength >= 1) {
@@ -711,7 +711,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp(CFXJSE_Arguments* pA
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
FX_INT32 nNewPage = 0;
if (nCurPage <= 1) {
@@ -726,7 +726,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageDown(CFXJSE_Arguments*
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc);
FX_INT32 nPageCount = pNotify->GetDocProvider()->CountPages(hDoc);
if (!nPageCount || nCurPage == nPageCount) {
diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp
index a1eee3c633..b2354b6f14 100644
--- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp
@@ -33,7 +33,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready(FXJSE_HVALUE hVal
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
if (bSetting) {
ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_READY);
return;
@@ -369,7 +369,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch(CFX
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
@@ -382,7 +382,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch(CFXJS
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
@@ -431,7 +431,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A
if (!hWidget) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
@@ -464,7 +464,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arg
if (!hWidget) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
diff --git a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp
index d37653321f..6e94791f40 100644
--- a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp
@@ -36,7 +36,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arg
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CXFA_Node* pNode = NULL;
if (iLength >= 1) {
pNode = (CXFA_Node*)pArguments->GetObject(0);
@@ -58,7 +58,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(CFXJSE_Argum
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CXFA_NodeList* pNodeList = NULL;
CFX_WideString wsExpression;
CFX_WideString wsXMLIdent;
@@ -90,7 +90,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(CFXJSE_
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CXFA_NodeList *pList = pNotify->GetDocProvider()->Enumerate(hDoc);
FXJSE_Value_Set(pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(pList));
}
@@ -105,7 +105,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear(CFXJSE_Argu
if (!pNotify) {
return;
}
- XFA_HDOC hDoc = pNotify->GetHDOC();
+ IXFA_Doc* hDoc = pNotify->GetHDOC();
CXFA_Node* pNode = NULL;
FX_BOOL bClear = TRUE;
if (iLength >= 1) {