From ca02733961f84abd562d59e4b6a83018ef41b143 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 25 May 2018 23:37:50 +0000 Subject: Replace some #ifdefs PDF_ENABLE_XFA, part 2. Tidy some code encountered along the way in cpdfsdk_helpers.cpp Remove one ifdef from xfa-only file. Restore some option flag processing (probably wrong to remove). Flip some #ifndef to #ifdef (#ifndef PDF_ENABLE_XFA is an anti-pattern and should be treated with suspicion since XFA should always be "additive"). Change-Id: I564a28401e20e6269c85ea610da8c96f8c8dd737 Reviewed-on: https://pdfium-review.googlesource.com/32834 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fpdfsdk/cpdfsdk_helpers.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/cpdfsdk_helpers.cpp') diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp index eb91bcf9ba..5773a8b512 100644 --- a/fpdfsdk/cpdfsdk_helpers.cpp +++ b/fpdfsdk/cpdfsdk_helpers.cpp @@ -215,10 +215,9 @@ void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) { if (!pDoc) return; - // Portfolios and Packages const CPDF_Dictionary* pRootDict = pDoc->GetRoot(); if (pRootDict) { - ByteString cbString; + // Portfolios and Packages if (pRootDict->KeyExist("Collection")) { RaiseUnSupportError(FPDF_UNSP_DOC_PORTABLECOLLECTION); return; @@ -244,12 +243,8 @@ void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) { } } } - } - - // SharedForm - const CPDF_Dictionary* pRoot = pDoc->GetRoot(); - if (pRoot) { - const CPDF_Stream* pStream = pRoot->GetStreamFor("Metadata"); + // SharedForm + const CPDF_Stream* pStream = pRootDict->GetStreamFor("Metadata"); if (pStream) { CPDF_Metadata metaData(pStream); for (const auto& err : metaData.CheckForSharedForm()) -- cgit v1.2.3