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

Unified Diff: fpdfsdk/fpdf_ext.cpp

Issue 2003853003: Remove dead code from CPDF_InterForm. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: helper functions Created 4 years, 7 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/fpdf_ext.cpp
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index 8a45a13e12046bb03897c732dc35d128c1b49a05..a61d90159689309fda16b87e61d9d9ae766c0a35 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -6,6 +6,8 @@
#include "public/fpdf_ext.h"
+#include <memory>
+
#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/include/cpdf_modulemgr.h"
@@ -20,13 +22,13 @@
class CFSDK_UnsupportInfo_Adapter {
public:
- CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info) {
- m_unsp_info = unsp_info;
- }
+ explicit CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info)
+ : m_unsp_info(unsp_info) {}
+
void ReportError(int nErrorType);
private:
- UNSUPPORT_INFO* m_unsp_info;
+ UNSUPPORT_INFO* const m_unsp_info;
};
void CFSDK_UnsupportInfo_Adapter::ReportError(int nErrorType) {
@@ -183,11 +185,9 @@ void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) {
#ifndef PDF_ENABLE_XFA
// XFA Forms
- CPDF_InterForm* pInterForm = new CPDF_InterForm(pDoc, FALSE);
- if (pInterForm->HasXFAForm()) {
+ CPDF_InterForm interform(pDoc);
+ if (interform.HasXFAForm())
FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM);
- }
- delete pInterForm;
#endif // PDF_ENABLE_XFA
}

Powered by Google App Engine
This is Rietveld 408576698