diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-10 18:38:03 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-10 18:38:03 +0000 |
commit | 461acb276e1c38c9ebb3546c5b3254fa5cf9c585 (patch) | |
tree | 1680a982413c0fc199af16392772e261fec97a71 /fpdfsdk/fpdfxfa | |
parent | 8d8d3bc54593d2d86054d59669b86a959ec0b602 (diff) | |
download | pdfium-461acb276e1c38c9ebb3546c5b3254fa5cf9c585.tar.xz |
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 <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa')
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 1 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 10 |
2 files changed, 1 insertions, 10 deletions
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)); |