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/cpdfsdk_interform.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'fpdfsdk/cpdfsdk_interform.h') diff --git a/fpdfsdk/cpdfsdk_interform.h b/fpdfsdk/cpdfsdk_interform.h index bd1a76087e..1862fdbe2c 100644 --- a/fpdfsdk/cpdfsdk_interform.h +++ b/fpdfsdk/cpdfsdk_interform.h @@ -39,8 +39,6 @@ class CPDFSDK_InterForm final : public IPDF_FormNotify { return m_pFormFillEnv.Get(); } - bool HighlightWidgets(); - CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, bool bNext) const; CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; void GetWidgets(const WideString& sFieldName, @@ -92,7 +90,7 @@ class CPDFSDK_InterForm final : public IPDF_FormNotify { const std::vector& fields, bool bIncludeOrExclude); - bool IsNeedHighLight(FormFieldType fieldType); + bool IsNeedHighLight(FormFieldType fieldType) const; void RemoveAllHighLights(); void SetHighlightAlpha(uint8_t alpha) { m_HighlightAlpha = alpha; } uint8_t GetHighlightAlpha() { return m_HighlightAlpha; } @@ -114,20 +112,18 @@ class CPDFSDK_InterForm final : public IPDF_FormNotify { int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const; - using CPDFSDK_WidgetMap = std::map; - - UnownedPtr m_pFormFillEnv; - std::unique_ptr m_pInterForm; - CPDFSDK_WidgetMap m_Map; + UnownedPtr const m_pFormFillEnv; + std::unique_ptr const m_pInterForm; + std::map m_Map; #ifdef PDF_ENABLE_XFA std::map m_XFAMap; - bool m_bXfaCalculate; - bool m_bXfaValidationsEnabled; + bool m_bXfaCalculate = true; + bool m_bXfaValidationsEnabled = true; #endif // PDF_ENABLE_XFA - bool m_bCalculate; - bool m_bBusy; + bool m_bCalculate = true; + bool m_bBusy = false; - uint8_t m_HighlightAlpha; + uint8_t m_HighlightAlpha = 0; FX_COLORREF m_HighlightColor[kFormFieldTypeCount]; bool m_NeedsHighlight[kFormFieldTypeCount]; }; -- cgit v1.2.3