From 5eca305b1586b2107566a5c124baa5f2e00096c0 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 22 Feb 2016 20:32:21 -0800 Subject: 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 . --- fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp') 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"); -- cgit v1.2.3