diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-10 21:34:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-10 21:34:17 +0000 |
commit | 7db136abc305630fb9ba9754a2c371c0e7ae8237 (patch) | |
tree | b04ed80e31df6677881d1b0b8901d7669c14d7c2 /fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | |
parent | e2210acfff622ac73b0783e1523615753484073b (diff) | |
download | pdfium-7db136abc305630fb9ba9754a2c371c0e7ae8237.tar.xz |
Remove more impossible checks in form filler code.
Also fix some nits and inline some calls.
Change-Id: Ie962f416b8ecd51ce05341e5511129ea0602fa8e
Reviewed-on: https://pdfium-review.googlesource.com/c/43604
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp')
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 6b617eaef0..d95d242c48 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -387,9 +387,7 @@ void CPDFXFA_DocEnvironment::SetCalculationsEnabled(CXFA_FFDoc* hDoc, bool bEnabled) { if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetFormFillEnv()) return; - if (m_pContext->GetFormFillEnv()->GetInterForm()) { - m_pContext->GetFormFillEnv()->GetInterForm()->XfaEnableCalculate(bEnabled); - } + m_pContext->GetFormFillEnv()->GetInterForm()->XfaEnableCalculate(bEnabled); } void CPDFXFA_DocEnvironment::GetTitle(CXFA_FFDoc* hDoc, WideString& wsTitle) { @@ -530,9 +528,8 @@ void CPDFXFA_DocEnvironment::GotoURL(CXFA_FFDoc* hDoc, bool CPDFXFA_DocEnvironment::IsValidationsEnabled(CXFA_FFDoc* hDoc) { if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetFormFillEnv()) return false; - - auto* interform = m_pContext->GetFormFillEnv()->GetInterForm(); - return !interform || interform->IsXfaValidationsEnabled(); + auto* pInterform = m_pContext->GetFormFillEnv()->GetInterForm(); + return pInterform->IsXfaValidationsEnabled(); } void CPDFXFA_DocEnvironment::SetValidationsEnabled(CXFA_FFDoc* hDoc, @@ -540,9 +537,8 @@ void CPDFXFA_DocEnvironment::SetValidationsEnabled(CXFA_FFDoc* hDoc, if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetFormFillEnv()) return; - auto* interform = m_pContext->GetFormFillEnv()->GetInterForm(); - if (interform) - interform->XfaSetValidationsEnabled(bEnabled); + m_pContext->GetFormFillEnv()->GetInterForm()->XfaSetValidationsEnabled( + bEnabled); } void CPDFXFA_DocEnvironment::SetFocusWidget(CXFA_FFDoc* hDoc, |