diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-22 20:32:21 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-22 20:32:21 -0800 |
commit | 5eca305b1586b2107566a5c124baa5f2e00096c0 (patch) | |
tree | d2b6b17b62995b2249a28956a17ae87122f83124 /fpdfsdk/src/formfiller | |
parent | d2019df0a77c5d01a336f16be054d2f373e38c54 (diff) | |
download | pdfium-5eca305b1586b2107566a5c124baa5f2e00096c0.tar.xz |
Remove foo != NULL outside of xfa/
Most of these are from the XFA branch.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1720043003 .
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 17 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_CheckBox.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp | 16 |
3 files changed, 6 insertions, 29 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index 96f727eee6..bba44ab639 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -59,7 +59,7 @@ void CBA_FontMap::Initialize() { void CBA_FontMap::SetDefaultFont(CPDF_Font* pFont, const CFX_ByteString& sFontName) { - ASSERT(pFont != NULL); + ASSERT(pFont); if (m_pDefaultFont) return; @@ -75,12 +75,8 @@ void CBA_FontMap::SetDefaultFont(CPDF_Font* pFont, CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset) { - ASSERT(m_pAnnotDict != NULL); - if (m_pAnnotDict->GetStringBy("Subtype") == "Widget") { CPDF_Document* pDocument = GetDocument(); - ASSERT(pDocument != NULL); - CPDF_Dictionary* pRootDict = pDocument->GetRoot(); if (!pRootDict) return NULL; @@ -109,15 +105,12 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, if (!pResDict) return NULL; - CPDF_Document* pDocument = GetDocument(); - ASSERT(pDocument != NULL); - CPDF_Dictionary* pFonts = pResDict->GetDictBy("Font"); if (!pFonts) return NULL; + CPDF_Document* pDocument = GetDocument(); CPDF_Font* pFind = NULL; - for (const auto& it : *pFonts) { const CFX_ByteString& csKey = it.first; CPDF_Object* pObj = it.second; @@ -154,9 +147,6 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, if (!pFont) return; - ASSERT(m_pAnnotDict != NULL); - ASSERT(m_pDocument != NULL); - CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP"); if (!pAPDict) { @@ -205,9 +195,6 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, } CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) { - ASSERT(m_pAnnotDict != NULL); - ASSERT(m_pDocument != NULL); - CPDF_Dictionary* pAcroFormDict = NULL; FX_BOOL bWidget = (m_pAnnotDict->GetStringBy("Subtype") == "Widget"); diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp index c2e1b20253..f76613ed3f 100644 --- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp @@ -100,8 +100,6 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) { if (bNewChecked) { CPDF_FormField* pField = m_pWidget->GetFormField(); - ASSERT(pField != NULL); - for (int32_t i = 0, sz = pField->CountControls(); i < sz; i++) { if (CPDF_FormControl* pCtrl = pField->GetControl(i)) { if (pCtrl->IsChecked()) { diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 36b123e165..7049fe6a97 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -747,8 +747,6 @@ void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, FX_BOOL& bReset, FX_BOOL& bExit, FX_UINT nFlag) { - ASSERT(pWidget != NULL); - if (!m_bNotifying) { if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) { m_bNotifying = TRUE; @@ -784,8 +782,6 @@ void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget, FX_BOOL& bReset, FX_BOOL& bExit, FX_UINT nFlag) { - ASSERT(pWidget != NULL); - if (!m_bNotifying) { if (pWidget->HasXFAAAction(PDFSDK_XFA_Full)) { m_bNotifying = TRUE; @@ -819,9 +815,9 @@ void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget, void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData, FX_BOOL& bExit, FX_DWORD nFlag) { - ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; - ASSERT(pData->pWidget != NULL); + ASSERT(pData); + ASSERT(pData->pWidget); FX_BOOL bTempReset = FALSE; FX_BOOL bTempExit = FALSE; @@ -836,9 +832,9 @@ void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData, void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData, FX_BOOL& bExit, FX_DWORD nFlag) { - ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; - ASSERT(pData->pWidget != NULL); + ASSERT(pData); + ASSERT(pData->pWidget); FX_BOOL bTempReset = FALSE; FX_BOOL bTempExit = FALSE; @@ -855,8 +851,6 @@ void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget, FX_BOOL& bReset, FX_BOOL& bExit, FX_UINT nFlag) { - ASSERT(pWidget != NULL); - if (!m_bNotifying) { if (pWidget->HasXFAAAction(PDFSDK_XFA_PreOpen)) { m_bNotifying = TRUE; @@ -892,8 +886,6 @@ void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, FX_BOOL& bReset, FX_BOOL& bExit, FX_UINT nFlag) { - ASSERT(pWidget != NULL); - if (!m_bNotifying) { if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) { m_bNotifying = TRUE; |