Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp

Issue 2323523002: Remove unused code in CPDFXFA_Document (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index d4c43c570679c9c22f2b8732600e718f76ca4145..2944ed6c2ea58a3c9e8326b190956d49629e368f 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -515,13 +515,6 @@ void CPDFXFA_Document::WidgetPreRemove(CXFA_FFWidget* hWidget,
pSdkPageView->DeleteAnnot(pAnnot);
}
-FX_BOOL CPDFXFA_Document::RenderCustomWidget(CXFA_FFWidget* hWidget,
- CFX_Graphics* pGS,
- CFX_Matrix* pMatrix,
- const CFX_RectF& rtUI) {
- return FALSE;
-}
-
int32_t CPDFXFA_Document::CountPages(CXFA_FFDoc* hDoc) {
if (hDoc == m_pXFADoc.get() && m_pSDKDoc)
return GetPageCount();
@@ -552,6 +545,7 @@ void CPDFXFA_Document::SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage) {
return;
pEnv->FFI_SetCurrentPage(this, iCurPage);
}
+
FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(CXFA_FFDoc* hDoc) {
if (hDoc != m_pXFADoc.get() || !m_pSDKDoc)
return FALSE;
@@ -560,6 +554,7 @@ FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(CXFA_FFDoc* hDoc) {
return FALSE;
}
+
void CPDFXFA_Document::SetCalculationsEnabled(CXFA_FFDoc* hDoc,
FX_BOOL bEnabled) {
if (hDoc != m_pXFADoc.get() || !m_pSDKDoc)
@@ -680,8 +675,6 @@ void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
// Ignoring flush error.
}
}
-void CPDFXFA_Document::ImportData(CXFA_FFDoc* hDoc,
- const CFX_WideString& wsFilePath) {}
void CPDFXFA_Document::GotoURL(CXFA_FFDoc* hDoc,
const CFX_WideString& bsURL,
@@ -709,6 +702,7 @@ FX_BOOL CPDFXFA_Document::IsValidationsEnabled(CXFA_FFDoc* hDoc) {
return TRUE;
}
+
void CPDFXFA_Document::SetValidationsEnabled(CXFA_FFDoc* hDoc,
FX_BOOL bEnabled) {
if (hDoc != m_pXFADoc.get() || !m_pSDKDoc)
@@ -716,6 +710,7 @@ void CPDFXFA_Document::SetValidationsEnabled(CXFA_FFDoc* hDoc,
if (m_pSDKDoc->GetInterForm())
m_pSDKDoc->GetInterForm()->XfaSetValidationsEnabled(bEnabled);
}
+
void CPDFXFA_Document::SetFocusWidget(CXFA_FFDoc* hDoc,
CXFA_FFWidget* hWidget) {
if (hDoc != m_pXFADoc.get())
@@ -738,6 +733,7 @@ void CPDFXFA_Document::SetFocusWidget(CXFA_FFDoc* hDoc,
}
}
}
+
void CPDFXFA_Document::Print(CXFA_FFDoc* hDoc,
int32_t nStartPage,
int32_t nEndPage,
@@ -760,49 +756,6 @@ void CPDFXFA_Document::Print(CXFA_FFDoc* hDoc,
dwOptions & XFA_PRINTOPT_PrintAnnot);
}
-int32_t CPDFXFA_Document::AbsPageCountInBatch(CXFA_FFDoc* hDoc) {
- return 0;
-}
-
-int32_t CPDFXFA_Document::AbsPageInBatch(CXFA_FFDoc* hDoc,
- CXFA_FFWidget* hWidget) {
- return 0;
-}
-
-int32_t CPDFXFA_Document::SheetCountInBatch(CXFA_FFDoc* hDoc) {
- return 0;
-}
-
-int32_t CPDFXFA_Document::SheetInBatch(CXFA_FFDoc* hDoc,
- CXFA_FFWidget* hWidget) {
- return 0;
-}
-
-int32_t CPDFXFA_Document::Verify(CXFA_FFDoc* hDoc,
- CXFA_Node* pSigNode,
- FX_BOOL bUsed) {
- return 0;
-}
-
-FX_BOOL CPDFXFA_Document::Sign(CXFA_FFDoc* hDoc,
- CXFA_NodeList* pNodeList,
- const CFX_WideStringC& wsExpression,
- const CFX_WideStringC& wsXMLIdent,
- const CFX_WideStringC& wsValue,
- FX_BOOL bUsed) {
- return 0;
-}
-
-CXFA_NodeList* CPDFXFA_Document::Enumerate(CXFA_FFDoc* hDoc) {
- return 0;
-}
-
-FX_BOOL CPDFXFA_Document::Clear(CXFA_FFDoc* hDoc,
- CXFA_Node* pSigNode,
- FX_BOOL bCleared) {
- return 0;
-}
-
void CPDFXFA_Document::GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL) {
if (hDoc != m_pXFADoc.get())
return;
@@ -828,15 +781,15 @@ FX_ARGB CPDFXFA_Document::GetHighlightColor(CXFA_FFDoc* hDoc) {
return 0;
}
-FX_BOOL CPDFXFA_Document::_NotifySubmit(FX_BOOL bPrevOrPost) {
+FX_BOOL CPDFXFA_Document::NotifySubmit(FX_BOOL bPrevOrPost) {
if (bPrevOrPost)
- return _OnBeforeNotifySumbit();
+ return OnBeforeNotifySubmit();
- _OnAfterNotifySumbit();
+ OnAfterNotifySubmit();
return TRUE;
}
-FX_BOOL CPDFXFA_Document::_OnBeforeNotifySumbit() {
+FX_BOOL CPDFXFA_Document::OnBeforeNotifySubmit() {
if (m_iDocType != DOCTYPE_DYNAMIC_XFA && m_iDocType != DOCTYPE_STATIC_XFA)
return TRUE;
@@ -883,7 +836,7 @@ FX_BOOL CPDFXFA_Document::_OnBeforeNotifySumbit() {
return TRUE;
}
-void CPDFXFA_Document::_OnAfterNotifySumbit() {
+void CPDFXFA_Document::OnAfterNotifySubmit() {
if (m_iDocType != DOCTYPE_DYNAMIC_XFA && m_iDocType != DOCTYPE_STATIC_XFA)
return;
@@ -910,27 +863,15 @@ void CPDFXFA_Document::_OnAfterNotifySumbit() {
}
FX_BOOL CPDFXFA_Document::SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
- if (!_NotifySubmit(TRUE) || !m_pXFADocView)
+ if (!NotifySubmit(TRUE) || !m_pXFADocView)
return FALSE;
m_pXFADocView->UpdateDocView();
- FX_BOOL ret = _SubmitData(hDoc, submit);
- _NotifySubmit(FALSE);
+ FX_BOOL ret = SubmitDataInternal(hDoc, submit);
+ NotifySubmit(FALSE);
return ret;
}
-FX_BOOL CPDFXFA_Document::CheckWord(CXFA_FFDoc* hDoc,
- const CFX_ByteStringC& sWord) {
- return FALSE;
-}
-
-FX_BOOL CPDFXFA_Document::GetSuggestWords(
- CXFA_FFDoc* hDoc,
- const CFX_ByteStringC& sWord,
- std::vector<CFX_ByteString>& sSuggest) {
- return FALSE;
-}
-
IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(CXFA_FFDoc* hDoc,
const CFX_WideString& wsLink) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
@@ -946,10 +887,11 @@ IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(CXFA_FFDoc* hDoc,
return nullptr;
return new CFPDF_FileStream(pFileHandler);
}
-FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
- int fileType,
- FPDF_DWORD encodeType,
- FPDF_DWORD flag) {
+
+FX_BOOL CPDFXFA_Document::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
+ int fileType,
+ FPDF_DWORD encodeType,
+ FPDF_DWORD flag) {
if (!m_pXFADocView)
return FALSE;
@@ -1030,13 +972,13 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
return TRUE;
}
-void CPDFXFA_Document::_ClearChangeMark() {
+void CPDFXFA_Document::ClearChangeMark() {
if (m_pSDKDoc)
m_pSDKDoc->ClearChangeMark();
}
-void CPDFXFA_Document::_ToXFAContentFlags(CFX_WideString csSrcContent,
- FPDF_DWORD& flag) {
+void CPDFXFA_Document::ToXFAContentFlags(CFX_WideString csSrcContent,
+ FPDF_DWORD& flag) {
if (csSrcContent.Find(L" config ", 0) != -1)
flag |= FXFA_CONFIG;
if (csSrcContent.Find(L" template ", 0) != -1)
@@ -1055,12 +997,13 @@ void CPDFXFA_Document::_ToXFAContentFlags(CFX_WideString csSrcContent,
flag = FXFA_CONFIG | FXFA_TEMPLATE | FXFA_LOCALESET | FXFA_DATASETS |
FXFA_XMPMETA | FXFA_XFDF | FXFA_FORM;
}
-FX_BOOL CPDFXFA_Document::_MailToInfo(CFX_WideString& csURL,
- CFX_WideString& csToAddress,
- CFX_WideString& csCCAddress,
- CFX_WideString& csBCCAddress,
- CFX_WideString& csSubject,
- CFX_WideString& csMsg) {
+
+FX_BOOL CPDFXFA_Document::MailToInfo(CFX_WideString& csURL,
+ CFX_WideString& csToAddress,
+ CFX_WideString& csCCAddress,
+ CFX_WideString& csBCCAddress,
+ CFX_WideString& csSubject,
+ CFX_WideString& csMsg) {
CFX_WideString srcURL = csURL;
srcURL.TrimLeft();
if (0 != srcURL.Left(7).CompareNoCase(L"mailto:"))
@@ -1128,7 +1071,8 @@ FX_BOOL CPDFXFA_Document::_MailToInfo(CFX_WideString& csURL,
return TRUE;
}
-FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
+FX_BOOL CPDFXFA_Document::SubmitDataInternal(CXFA_FFDoc* hDoc,
+ CXFA_Submit submit) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (!pEnv)
return FALSE;
@@ -1162,23 +1106,23 @@ FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
FPDF_DWORD flag = 0;
if (submit.IsSubmitEmbedPDF())
flag |= FXFA_PDF;
- _ToXFAContentFlags(csContent, flag);
+ ToXFAContentFlags(csContent, flag);
pFileHandler = pEnv->FFI_OpenFile(FXFA_SAVEAS_XDP, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XDP;
- _ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XDP, 0, flag);
+ ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XDP, 0, flag);
break;
}
case XFA_ATTRIBUTEENUM_Xml:
pFileHandler = pEnv->FFI_OpenFile(FXFA_SAVEAS_XML, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XML;
- _ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0);
+ ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0, 0x01111111);
break;
case XFA_ATTRIBUTEENUM_Pdf:
break;
case XFA_ATTRIBUTEENUM_Urlencoded:
pFileHandler = pEnv->FFI_OpenFile(FXFA_SAVEAS_XML, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XML;
- _ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0);
+ ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0, 0x01111111);
break;
default:
return false;
@@ -1191,8 +1135,8 @@ FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
CFX_WideString csBCCAddress;
CFX_WideString csSubject;
CFX_WideString csMsg;
- bRet = _MailToInfo(csURL, csToAddress, csCCAddress, csBCCAddress, csSubject,
- csMsg);
+ bRet = MailToInfo(csURL, csToAddress, csCCAddress, csBCCAddress, csSubject,
+ csMsg);
if (!bRet)
return FALSE;
CFX_ByteString bsTo = CFX_WideString(csToAddress).UTF16LE_Encode();
@@ -1268,9 +1212,3 @@ FX_BOOL CPDFXFA_Document::GetGlobalProperty(CXFA_FFDoc* hDoc,
return m_pSDKDoc->GetEnv()->GetJSRuntime()->GetValueByName(szPropName,
pValue);
}
-
-CPDF_Document* CPDFXFA_Document::OpenPDF(CXFA_FFDoc* hDoc,
- IFX_FileRead* pFile,
- FX_BOOL bTakeOverFile) {
- return nullptr;
-}

Powered by Google App Engine
This is Rietveld 408576698