Replace XFA_HDOC with IXFA_Doc*
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffdochandler.cpp
index 426a455..9d76ca1 100644 (file)
@@ -14,66 +14,66 @@ CXFA_FFDocHandler::CXFA_FFDocHandler()
 CXFA_FFDocHandler::~CXFA_FFDocHandler()\r
 {\r
 }\r
-void CXFA_FFDocHandler::ReleaseDoc(XFA_HDOC hDoc)\r
+void CXFA_FFDocHandler::ReleaseDoc(IXFA_Doc* hDoc)\r
 {\r
-    delete (CXFA_FFDoc*)hDoc;\r
+    delete hDoc;  // virtual dtor.\r
 }\r
-IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(XFA_HDOC hDoc)\r
+IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(IXFA_Doc* hDoc)\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->GetDocProvider();\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->GetDocProvider();\r
 }\r
-FX_DWORD CXFA_FFDocHandler::GetDocType(XFA_HDOC hDoc)\r
+FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc)\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->GetDocType();\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->GetDocType();\r
 }\r
-FX_INT32 CXFA_FFDocHandler::StartLoad(XFA_HDOC hDoc)\r
+FX_INT32 CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc)\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->StartLoad();\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->StartLoad();\r
 }\r
-FX_INT32 CXFA_FFDocHandler::DoLoad(XFA_HDOC hDoc, IFX_Pause *pPause )\r
+FX_INT32 CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause )\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->DoLoad(pPause);\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->DoLoad(pPause);\r
 }\r
-void CXFA_FFDocHandler::StopLoad(XFA_HDOC hDoc)\r
+void CXFA_FFDocHandler::StopLoad(IXFA_Doc* hDoc)\r
 {\r
-    ((CXFA_FFDoc*)hDoc)->StopLoad();\r
+    static_cast<CXFA_FFDoc*>(hDoc)->StopLoad();\r
 }\r
 \r
-IXFA_DocView* CXFA_FFDocHandler::CreateDocView(XFA_HDOC hDoc, FX_DWORD dwView )\r
+IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView )\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->CreateDocView(dwView);\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->CreateDocView(dwView);\r
 }\r
-FX_INT32 CXFA_FFDocHandler::CountPackages(XFA_HDOC hDoc)\r
+FX_INT32 CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc)\r
 {\r
     return 0;\r
 }\r
-void CXFA_FFDocHandler::GetPackageName(XFA_HDOC hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage)\r
+void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage)\r
 {\r
 }\r
-IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(XFA_HDOC hDoc, FX_WSTR wsPackage)\r
+IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage)\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->GetPackageData(wsPackage);\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->GetPackageData(wsPackage);\r
 }\r
-FX_BOOL CXFA_FFDocHandler::SavePackage(XFA_HDOC hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext )\r
+FX_BOOL CXFA_FFDocHandler::SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext )\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->SavePackage(wsPackage, pFile, pCSContext);\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->SavePackage(wsPackage, pFile, pCSContext);\r
 }\r
-FX_BOOL CXFA_FFDocHandler::CloseDoc(XFA_HDOC hDoc)\r
+FX_BOOL CXFA_FFDocHandler::CloseDoc(IXFA_Doc* hDoc)\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->CloseDoc();\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->CloseDoc();\r
 }\r
 \r
-FX_BOOL CXFA_FFDocHandler::ImportData(XFA_HDOC hDoc, IFX_FileRead* pStream, FX_BOOL bXDP )\r
+FX_BOOL CXFA_FFDocHandler::ImportData(IXFA_Doc* hDoc, IFX_FileRead* pStream, FX_BOOL bXDP )\r
 {\r
-    return ((CXFA_FFDoc*)hDoc)->ImportData(pStream, bXDP);\r
+    return static_cast<CXFA_FFDoc*>(hDoc)->ImportData(pStream, bXDP);\r
 }\r
-void CXFA_FFDocHandler::SetJSERuntime(XFA_HDOC hDoc, FXJSE_HRUNTIME hRuntime)\r
+void CXFA_FFDocHandler::SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime)\r
 {\r
-    ((CXFA_FFDoc*)hDoc)->GetXFADoc()->InitScriptContext(hRuntime);\r
+    static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc()->InitScriptContext(hRuntime);\r
 }\r
-FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(XFA_HDOC hDoc)\r
+FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(IXFA_Doc* hDoc)\r
 {\r
-    CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();\r
+    CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();\r
     if (!pXFADoc) {\r
         return NULL;\r
     }\r
@@ -83,9 +83,9 @@ FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(XFA_HDOC hDoc)
     }\r
     return pScriptContext->GetJSValueFromMap(pXFADoc->GetRoot());\r
 }\r
-XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(XFA_HDOC hDoc)\r
+XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(IXFA_Doc* hDoc)\r
 {\r
-    CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();\r
+    CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();\r
     if (!pXFADoc) {\r
         return XFA_ATTRIBUTEENUM_Unknown;\r
     }\r
@@ -99,9 +99,9 @@ XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(XFA_HDOC hDoc)
     }\r
     return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState);\r
 }\r
-FX_BOOL        CXFA_FFDocHandler::RunDocScript(XFA_HDOC hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject)\r
+FX_BOOL        CXFA_FFDocHandler::RunDocScript(IXFA_Doc* hDoc, XFA_SCRIPTTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, FXJSE_HVALUE hThisObject)\r
 {\r
-    CXFA_Document* pXFADoc = ((CXFA_FFDoc*)hDoc)->GetXFADoc();\r
+    CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();\r
     if (!pXFADoc) {\r
         return FALSE;\r
     }\r