From 1e2ece0cf98f8daecdea5b45ebd20cedbcef4bd9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 11 Aug 2015 13:54:33 -0700 Subject: Remove dead code from CPDF_Metadata. Add missing nullptr check. BUG=pdfium:117 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1282653002 . --- fpdfsdk/src/fpdf_ext.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index e95a2f0094..2d84ff2a50 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -88,7 +88,7 @@ void CheckUnSupportAnnot(CPDF_Document* pDoc, CPDF_Annot* pPDFAnnot) { } } -FX_BOOL CheckSharedForm(CXML_Element* pElement, CFX_ByteString cbName) { +FX_BOOL CheckSharedForm(const CXML_Element* pElement, CFX_ByteString cbName) { int count = pElement->CountAttrs(); int i = 0; for (i = 0; i < count; i++) { @@ -169,9 +169,8 @@ void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code) { } // SharedForm - CPDF_Metadata metaData; - metaData.LoadDoc(pDoc); - CXML_Element* pElement = metaData.GetRoot(); + CPDF_Metadata metaData(pDoc); + const CXML_Element* pElement = metaData.GetRoot(); if (pElement) CheckSharedForm(pElement, "workflowType"); -- cgit v1.2.3