summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_ext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_ext.cpp')
-rw-r--r--fpdfsdk/fpdf_ext.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index 9bb54da594..350945e328 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
}