diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-27 16:36:35 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-27 16:36:35 -0700 |
commit | 18e5b4b41dc622d4601be538934272678beb7069 (patch) | |
tree | c81e775531cd328143d1ffd4f2bb6277627e8e76 /fpdfsdk | |
parent | 04db653b2b4c266036fbd274b53f0763e35f4ee6 (diff) | |
download | pdfium-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 'fpdfsdk')
-rw-r--r-- | fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h | 80 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp | 48 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp | 5 |
3 files changed, 65 insertions, 68 deletions
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h index 954162e338..dc15ec42d8 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFXFA_DOC_H_
-#define _FPDFXFA_DOC_H_
+#ifndef FPDFXFA_DOC_H_
+#define FPDFXFA_DOC_H_
class CPDFXFA_App;
class CPDFXFA_Document;
@@ -25,7 +25,7 @@ public: FX_BOOL LoadXFADoc();
CPDFXFA_App* GetApp() {return m_pApp;}
CPDF_Document* GetPDFDoc() { return m_pPDFDoc; }
- XFA_HDOC GetXFADoc() { return m_pXFADoc; }
+ IXFA_Doc* GetXFADoc() { return m_pXFADoc; }
IXFA_DocView* GetXFADocView() { return m_pXFADocView; }
int GetPageCount();
@@ -40,8 +40,8 @@ public: void FXRect2PDFRect(const CFX_RectF& fxRectF, CPDF_Rect& pdfRect);
public:
- virtual void SetChangeMark(XFA_HDOC hDoc);
- virtual FX_BOOL GetChangeMark(XFA_HDOC hDoc);
+ virtual void SetChangeMark(IXFA_Doc* hDoc);
+ virtual FX_BOOL GetChangeMark(IXFA_Doc* hDoc);
//used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
virtual void InvalidateRect(IXFA_PageView* pPageView, const CFX_RectF& rt, FX_DWORD dwFlags = 0);
//used in static xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
@@ -62,37 +62,37 @@ public: virtual FX_BOOL RenderCustomWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}
//host method
- virtual FX_INT32 CountPages(XFA_HDOC hDoc);
- virtual FX_INT32 GetCurrentPage(XFA_HDOC hDoc);
- virtual void SetCurrentPage(XFA_HDOC hDoc, FX_INT32 iCurPage);
- virtual FX_BOOL IsCalculationsEnabled(XFA_HDOC hDoc);
- virtual void SetCalculationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled);
- virtual void GetTitle(XFA_HDOC hDoc, CFX_WideString &wsTitle);
- virtual void SetTitle(XFA_HDOC hDoc, FX_WSTR wsTitle);
- virtual void ExportData(XFA_HDOC hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP = TRUE);
- virtual void ImportData(XFA_HDOC hDoc, FX_WSTR wsFilePath);
- virtual void GotoURL(XFA_HDOC hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE);
- virtual FX_BOOL IsValidationsEnabled(XFA_HDOC hDoc);
- virtual void SetValidationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled);
- virtual void SetFocusWidget(XFA_HDOC hDoc, XFA_HWIDGET hWidget);
- virtual void Print(XFA_HDOC hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);
+ virtual FX_INT32 CountPages(IXFA_Doc* hDoc);
+ virtual FX_INT32 GetCurrentPage(IXFA_Doc* hDoc);
+ virtual void SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage);
+ virtual FX_BOOL IsCalculationsEnabled(IXFA_Doc* hDoc);
+ virtual void SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
+ virtual void GetTitle(IXFA_Doc* hDoc, CFX_WideString &wsTitle);
+ virtual void SetTitle(IXFA_Doc* hDoc, FX_WSTR wsTitle);
+ virtual void ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP = TRUE);
+ virtual void ImportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath);
+ virtual void GotoURL(IXFA_Doc* hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE);
+ virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc);
+ virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
+ virtual void SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget);
+ virtual void Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);
//LayoutPseudo method
- virtual FX_INT32 AbsPageCountInBatch(XFA_HDOC hDoc){return 0;}
- virtual FX_INT32 AbsPageInBatch(XFA_HDOC hDoc, XFA_HWIDGET hWidget){return 0;}
- virtual FX_INT32 SheetCountInBatch(XFA_HDOC hDoc){return 0;}
- virtual FX_INT32 SheetInBatch(XFA_HDOC hDoc, XFA_HWIDGET hWidget){return 0;}
+ virtual FX_INT32 AbsPageCountInBatch(IXFA_Doc* hDoc){return 0;}
+ virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}
+ virtual FX_INT32 SheetCountInBatch(IXFA_Doc* hDoc){return 0;}
+ virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}
//SignaturePseudoModel method
//TODO:
- virtual FX_INT32 Verify(XFA_HDOC hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}
- virtual FX_BOOL Sign(XFA_HDOC hDoc, CXFA_NodeList* pNodeList, FX_WSTR wsExpression, FX_WSTR wsXMLIdent, FX_WSTR wsValue = FX_WSTRC(L"open"), FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) {return 0;}
- virtual CXFA_NodeList* Enumerate(XFA_HDOC hDoc) {return 0;}
- virtual FX_BOOL Clear(XFA_HDOC hDoc, CXFA_Node* pSigNode, FX_BOOL bCleared = TRUE) {return 0;}
+ virtual FX_INT32 Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}
+ virtual FX_BOOL Sign(IXFA_Doc* hDoc, CXFA_NodeList* pNodeList, FX_WSTR wsExpression, FX_WSTR wsXMLIdent, FX_WSTR wsValue = FX_WSTRC(L"open"), FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) {return 0;}
+ virtual CXFA_NodeList* Enumerate(IXFA_Doc* hDoc) {return 0;}
+ virtual FX_BOOL Clear(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bCleared = TRUE) {return 0;}
//Get document path
- virtual void GetURL(XFA_HDOC hDoc, CFX_WideString &wsDocURL);
- virtual FX_ARGB GetHighlightColor(XFA_HDOC hDoc);
+ virtual void GetURL(IXFA_Doc* hDoc, CFX_WideString &wsDocURL);
+ virtual FX_ARGB GetHighlightColor(IXFA_Doc* hDoc);
virtual void AddDoRecord(XFA_HWIDGET hWidget);
/**
*Submit data to email, http, ftp.
@@ -103,25 +103,25 @@ public: * @param[in] pXDPContent Controls what subset of the data is submitted, used only when the format property is xdp.
* @param[in] bEmbedPDF, specifies whether PDF is embedded in the submitted content or not.
*/
- virtual FX_BOOL SubmitData(XFA_HDOC hDoc, CXFA_Submit submit);
+ virtual FX_BOOL SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);
- virtual FX_BOOL CheckWord(XFA_HDOC hDoc, FX_BSTR sWord){return FALSE;}
- virtual FX_BOOL GetSuggestWords(XFA_HDOC hDoc, FX_BSTR sWord, CFX_ByteStringArray& sSuggest){return FALSE;}
+ virtual FX_BOOL CheckWord(IXFA_Doc* hDoc, FX_BSTR sWord){return FALSE;}
+ virtual FX_BOOL GetSuggestWords(IXFA_Doc* hDoc, FX_BSTR sWord, CFX_ByteStringArray& sSuggest){return FALSE;}
//Get PDF javascript object, set the object to hValue.
- virtual FX_BOOL GetPDFScriptObject(XFA_HDOC hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue);
+ virtual FX_BOOL GetPDFScriptObject(IXFA_Doc* hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue);
- virtual FX_BOOL GetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);
- virtual FX_BOOL SetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);
- virtual CPDF_Document* OpenPDF(XFA_HDOC hDoc, IFX_FileRead* pFile, FX_BOOL bTakeOverFile){return NULL;}
+ virtual FX_BOOL GetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);
+ virtual FX_BOOL SetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);
+ virtual CPDF_Document* OpenPDF(IXFA_Doc* hDoc, IFX_FileRead* pFile, FX_BOOL bTakeOverFile){return NULL;}
- virtual IFX_FileRead* OpenLinkedFile(XFA_HDOC hDoc, const CFX_WideString& wsLink);
+ virtual IFX_FileRead* OpenLinkedFile(IXFA_Doc* hDoc, const CFX_WideString& wsLink);
FX_BOOL _GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue, IFXJS_Runtime* runTime);
FX_BOOL _OnBeforeNotifySumbit();
void _OnAfterNotifySumbit();
FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost);
- FX_BOOL _SubmitData(XFA_HDOC hDoc, CXFA_Submit submit);
+ FX_BOOL _SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);
FX_BOOL _MailToInfo(CFX_WideString& csURL, CFX_WideString& csToAddress, CFX_WideString& csCCAddress, CFX_WideString& csBCCAddress, CFX_WideString& csSubject, CFX_WideString& csMsg);
FX_BOOL _ExportSubmitFile(FPDF_FILEHANDLER* ppFileHandler, int fileType, FPDF_DWORD encodeType, FPDF_DWORD flag = 0x01111111);
void _ToXFAContentFlags(CFX_WideString csSrcContent, FPDF_DWORD& flag);
@@ -138,7 +138,7 @@ private: }
CPDF_Document* m_pPDFDoc;
- XFA_HDOC m_pXFADoc;
+ IXFA_Doc* m_pXFADoc;
IXFA_DocView* m_pXFADocView;
CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
@@ -154,4 +154,4 @@ private: int m_iDocType;
};
-#endif
+#endif // FPDFXFA_DOC_H_
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index c3137f51c6..9ef8d53ee9 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -252,7 +252,7 @@ void CPDFXFA_Document::FXRect2PDFRect(const CFX_RectF& fxRectF, CPDF_Rect& pdfRe }
//////////////////////////////////////////////////////////////////////////
-void CPDFXFA_Document::SetChangeMark(XFA_HDOC hDoc)
+void CPDFXFA_Document::SetChangeMark(IXFA_Doc* hDoc)
{
if (hDoc == m_pXFADoc && m_pSDKDoc)
{
@@ -260,7 +260,7 @@ void CPDFXFA_Document::SetChangeMark(XFA_HDOC hDoc) }
}
-FX_BOOL CPDFXFA_Document::GetChangeMark(XFA_HDOC hDoc)
+FX_BOOL CPDFXFA_Document::GetChangeMark(IXFA_Doc* hDoc)
{
if (hDoc == m_pXFADoc && m_pSDKDoc)
return m_pSDKDoc->GetChangeMark();
@@ -633,7 +633,7 @@ void CPDFXFA_Document::WidgetEvent(XFA_HWIDGET hWidget, CXFA_WidgetAcc* pWidgetD }
}
-FX_INT32 CPDFXFA_Document::CountPages(XFA_HDOC hDoc)
+FX_INT32 CPDFXFA_Document::CountPages(IXFA_Doc* hDoc)
{
if (hDoc == m_pXFADoc && m_pSDKDoc)
{
@@ -641,7 +641,7 @@ FX_INT32 CPDFXFA_Document::CountPages(XFA_HDOC hDoc) }
return 0;
}
-FX_INT32 CPDFXFA_Document::GetCurrentPage(XFA_HDOC hDoc)
+FX_INT32 CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return -1;
@@ -655,7 +655,7 @@ FX_INT32 CPDFXFA_Document::GetCurrentPage(XFA_HDOC hDoc) return pEnv->FFI_GetCurrentPageIndex(this);
}
-void CPDFXFA_Document::SetCurrentPage(XFA_HDOC hDoc, FX_INT32 iCurPage)
+void CPDFXFA_Document::SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return;
@@ -668,7 +668,7 @@ void CPDFXFA_Document::SetCurrentPage(XFA_HDOC hDoc, FX_INT32 iCurPage) pEnv->FFI_SetCurrentPage(this, iCurPage);
}
-FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(XFA_HDOC hDoc)
+FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(IXFA_Doc* hDoc)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return FALSE;
@@ -678,7 +678,7 @@ FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(XFA_HDOC hDoc) return FALSE;
}
-void CPDFXFA_Document::SetCalculationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled)
+void CPDFXFA_Document::SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return;
@@ -686,7 +686,7 @@ void CPDFXFA_Document::SetCalculationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled) m_pSDKDoc->GetInterForm()->XfaEnableCalculate(bEnabled);
}
-void CPDFXFA_Document::GetTitle(XFA_HDOC hDoc, CFX_WideString &wsTitle)
+void CPDFXFA_Document::GetTitle(IXFA_Doc* hDoc, CFX_WideString &wsTitle)
{
if (hDoc != m_pXFADoc)
return;
@@ -701,7 +701,7 @@ void CPDFXFA_Document::GetTitle(XFA_HDOC hDoc, CFX_WideString &wsTitle) wsTitle = wsTitle.FromLocal(csTitle.GetBuffer(csTitle.GetLength()));
csTitle.ReleaseBuffer(csTitle.GetLength());
}
-void CPDFXFA_Document::SetTitle(XFA_HDOC hDoc, FX_WSTR wsTitle)
+void CPDFXFA_Document::SetTitle(IXFA_Doc* hDoc, FX_WSTR wsTitle)
{
if (hDoc != m_pXFADoc)
return;
@@ -713,7 +713,7 @@ void CPDFXFA_Document::SetTitle(XFA_HDOC hDoc, FX_WSTR wsTitle) return;
pInfoDict->SetAt("Title", FX_NEW CPDF_String(wsTitle));
}
-void CPDFXFA_Document::ExportData(XFA_HDOC hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP)
+void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP)
{
if (hDoc != m_pXFADoc)
return;
@@ -834,12 +834,12 @@ void CPDFXFA_Document::ExportData(XFA_HDOC hDoc, FX_WSTR wsFilePath, FX_BOOL bXD }
FX_BOOL bError= fileWrite.Flush();
}
-void CPDFXFA_Document::ImportData(XFA_HDOC hDoc, FX_WSTR wsFilePath)
+void CPDFXFA_Document::ImportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath)
{
//TODO...
}
-void CPDFXFA_Document::GotoURL(XFA_HDOC hDoc, FX_WSTR bsURL, FX_BOOL bAppend)
+void CPDFXFA_Document::GotoURL(IXFA_Doc* hDoc, FX_WSTR bsURL, FX_BOOL bAppend)
{
if (hDoc != m_pXFADoc)
return;
@@ -857,7 +857,7 @@ void CPDFXFA_Document::GotoURL(XFA_HDOC hDoc, FX_WSTR bsURL, FX_BOOL bAppend) }
-FX_BOOL CPDFXFA_Document::IsValidationsEnabled(XFA_HDOC hDoc)
+FX_BOOL CPDFXFA_Document::IsValidationsEnabled(IXFA_Doc* hDoc)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return FALSE;
@@ -866,14 +866,14 @@ FX_BOOL CPDFXFA_Document::IsValidationsEnabled(XFA_HDOC hDoc) return TRUE;
}
-void CPDFXFA_Document::SetValidationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled)
+void CPDFXFA_Document::SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled)
{
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return;
if (m_pSDKDoc->GetInterForm())
m_pSDKDoc->GetInterForm()->XfaSetValidationsEnabled(bEnabled);
}
-void CPDFXFA_Document::SetFocusWidget(XFA_HDOC hDoc, XFA_HWIDGET hWidget)
+void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget)
{
if (hDoc != m_pXFADoc)
return;
@@ -896,7 +896,7 @@ void CPDFXFA_Document::SetFocusWidget(XFA_HDOC hDoc, XFA_HWIDGET hWidget) }
}
}
-void CPDFXFA_Document::Print(XFA_HDOC hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions)
+void CPDFXFA_Document::Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions)
{
if (hDoc != m_pXFADoc)
return;
@@ -914,7 +914,7 @@ void CPDFXFA_Document::Print(XFA_HDOC hDoc, FX_INT32 nStartPage, FX_INT32 nEndPa dwOptions&XFA_PRINTOPT_ReverseOrder,dwOptions&XFA_PRINTOPT_PrintAnnot);
}
-void CPDFXFA_Document::GetURL(XFA_HDOC hDoc, CFX_WideString &wsDocURL)
+void CPDFXFA_Document::GetURL(IXFA_Doc* hDoc, CFX_WideString &wsDocURL)
{
if (hDoc != m_pXFADoc)
return;
@@ -926,7 +926,7 @@ void CPDFXFA_Document::GetURL(XFA_HDOC hDoc, CFX_WideString &wsDocURL) pEnv->FFI_GetURL(this, wsDocURL);
}
-FX_ARGB CPDFXFA_Document::GetHighlightColor(XFA_HDOC hDoc)
+FX_ARGB CPDFXFA_Document::GetHighlightColor(IXFA_Doc* hDoc)
{
if (hDoc != m_pXFADoc)
return 0;
@@ -1039,7 +1039,7 @@ void CPDFXFA_Document::_OnAfterNotifySumbit() m_pXFADocView->UpdateDocView();
}
-FX_BOOL CPDFXFA_Document::SubmitData(XFA_HDOC hDoc, CXFA_Submit submit)
+FX_BOOL CPDFXFA_Document::SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit)
{
if (!_NotifySubmit(TRUE))
return FALSE;
@@ -1052,7 +1052,7 @@ FX_BOOL CPDFXFA_Document::SubmitData(XFA_HDOC hDoc, CXFA_Submit submit) return ret;
}
-IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(XFA_HDOC hDoc, const CFX_WideString& wsLink)
+IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(IXFA_Doc* hDoc, const CFX_WideString& wsLink)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (pEnv == NULL)
@@ -1277,7 +1277,7 @@ FX_BOOL CPDFXFA_Document::_MailToInfo(CFX_WideString& csURL, CFX_WideString& csT return TRUE;
}
-FX_BOOL CPDFXFA_Document::_SubmitData(XFA_HDOC hDoc, CXFA_Submit submit)
+FX_BOOL CPDFXFA_Document::_SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit)
{
CFX_WideStringC csURLC;
submit.GetSubmitTarget(csURLC);
@@ -1392,7 +1392,7 @@ FX_BOOL CPDFXFA_Document::_SubmitData(XFA_HDOC hDoc, CXFA_Submit submit) return bRet;
}
-FX_BOOL CPDFXFA_Document::SetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue)
+FX_BOOL CPDFXFA_Document::SetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue)
{
if (hDoc != m_pXFADoc)
return FALSE;
@@ -1401,7 +1401,7 @@ FX_BOOL CPDFXFA_Document::SetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, F return m_pSDKDoc->GetEnv()->GetJSRuntime()->SetHValueByName(szPropName, hValue);
return FALSE;
}
-FX_BOOL CPDFXFA_Document::GetPDFScriptObject(XFA_HDOC hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue)
+FX_BOOL CPDFXFA_Document::GetPDFScriptObject(IXFA_Doc* hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue)
{
if (hDoc != m_pXFADoc)
return FALSE;
@@ -1418,7 +1418,7 @@ FX_BOOL CPDFXFA_Document::GetPDFScriptObject(XFA_HDOC hDoc, FX_BSTR utf8Name, FX return _GetHValueByName(utf8Name, hValue, m_pSDKDoc->GetEnv()->GetJSRuntime());
}
-FX_BOOL CPDFXFA_Document::GetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue)
+FX_BOOL CPDFXFA_Document::GetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue)
{
if (hDoc != m_pXFADoc)
return FALSE;
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp index cf05d4ced7..7cd72de503 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp @@ -69,7 +69,7 @@ FX_BOOL CPDFXFA_Page::LoadXFAPageView() {
if (!m_pDocument)
return FALSE;
- XFA_HDOC pXFADoc = m_pDocument->GetXFADoc();
+ IXFA_Doc* pXFADoc = m_pDocument->GetXFADoc();
if (pXFADoc)
{
IXFA_DocView* pXFADocView = m_pDocument->GetXFADocView();
@@ -99,9 +99,6 @@ FX_BOOL CPDFXFA_Page::LoadPage() return FALSE;
int iDocType = m_pDocument->GetDocType();
- CPDF_Document* pPDFDoc = m_pDocument->GetPDFDoc();
- XFA_HDOC pXFADoc = m_pDocument->GetXFADoc();
-
switch (iDocType)
{
case DOCTYPE_PDF:
|