From 461acb276e1c38c9ebb3546c5b3254fa5cf9c585 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 10 Oct 2018 18:38:03 +0000 Subject: Remove impossible nullptr checks in CPDFSDK_InterForm. Also remove dead code and move initialization to headers in CPDFSDK_InterForm. Change-Id: Ib75864ccfd3f1d0d255d9c7942cc610edce822a3 Reviewed-on: https://pdfium-review.googlesource.com/c/43599 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 1 - fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index 2e1abb859f..40ccbdc1ef 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -12,7 +12,6 @@ #include "core/fpdfapi/parser/cpdf_document.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_helpers.h" -#include "fpdfsdk/cpdfsdk_interform.h" #include "fpdfsdk/cpdfsdk_pageview.h" #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index db58c8724a..6b617eaef0 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -380,12 +380,7 @@ void CPDFXFA_DocEnvironment::SetCurrentPage(CXFA_FFDoc* hDoc, bool CPDFXFA_DocEnvironment::IsCalculationsEnabled(CXFA_FFDoc* hDoc) { if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetFormFillEnv()) return false; - if (m_pContext->GetFormFillEnv()->GetInterForm()) { - return m_pContext->GetFormFillEnv() - ->GetInterForm() - ->IsXfaCalculateEnabled(); - } - return false; + return m_pContext->GetFormFillEnv()->GetInterForm()->IsXfaCalculateEnabled(); } void CPDFXFA_DocEnvironment::SetCalculationsEnabled(CXFA_FFDoc* hDoc, @@ -602,9 +597,6 @@ FX_ARGB CPDFXFA_DocEnvironment::GetHighlightColor(CXFA_FFDoc* hDoc) { return 0; CPDFSDK_InterForm* pInterForm = m_pContext->GetFormFillEnv()->GetInterForm(); - if (!pInterForm) - return 0; - return AlphaAndColorRefToArgb( pInterForm->GetHighlightAlpha(), pInterForm->GetHighlightColor(FormFieldType::kXFA)); -- cgit v1.2.3