diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-27 12:26:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 12:26:01 -0700 |
commit | 43854a5073602a4613131aa6dbac5f7b9a095bcd (patch) | |
tree | 653ebf0cd690e13d1ca9e315ffeb34f8ac85cfbb /xfa/fxfa/app | |
parent | b2f6f9158f54cee1825830c7ed57fe9d89cff26e (diff) | |
download | pdfium-43854a5073602a4613131aa6dbac5f7b9a095bcd.tar.xz |
Standardize on ASSERT.
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and
assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can
be overridden if the platform requies and we can pickup the Chromium version
if it has already been defined in the build.
This does change behaviour. Currently FXSYS_assert is always defined but ASSERT
is only defined in debug builds. So, the FXSYS_assert's would fire in Release
builds. That will no longer happen.
BUG=pdfium:219
Review-Url: https://codereview.chromium.org/1914303003
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r-- | xfa/fxfa/app/xfa_checksum.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffdoc.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffdocview.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fffield.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffpageview.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffpushbutton.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffsignature.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffwidget.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffwidgetacc.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffwidgetacc.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fontmgr.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fwltheme.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.cpp | 10 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.h | 4 |
14 files changed, 21 insertions, 21 deletions
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 56b0c88d63..59bf37b6a5 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -11,7 +11,7 @@ CXFA_SAXReaderHandler::CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext) : m_pContext(pContext) { - FXSYS_assert(m_pContext); + ASSERT(m_pContext); } CXFA_SAXReaderHandler::~CXFA_SAXReaderHandler() {} void* CXFA_SAXReaderHandler::OnTagEnter(const CFX_ByteStringC& bsTagName, diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 0acd9a59ce..12e562cdfb 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -141,7 +141,7 @@ int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) { } CPDF_Document* pPDFDocument = GetDocProvider()->OpenPDF(this, pXFAReader, TRUE); - FXSYS_assert(!m_pPDFDoc); + ASSERT(!m_pPDFDoc); if (!OpenDoc(pPDFDocument)) { return XFA_PARSESTATUS_SyntaxErr; } diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index 7a858748b7..405e4103a6 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -617,7 +617,7 @@ void CXFA_FFDocView::AddNewFormNode(CXFA_Node* pNode) { InitLayout(pNode); } void CXFA_FFDocView::AddIndexChangedSubform(CXFA_Node* pNode) { - FXSYS_assert(pNode->GetClassID() == XFA_ELEMENT_Subform); + ASSERT(pNode->GetClassID() == XFA_ELEMENT_Subform); m_IndexChangedSubforms.Add(pNode); } void CXFA_FFDocView::RunDocClose() { diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index 872dc8f3ce..b48893a1fc 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -335,7 +335,7 @@ void CXFA_FFField::SetFWLRect() { } CFX_RectF rtUi = m_rtUI; if (rtUi.width < 1.0) { - FXSYS_assert(rtUi.width < 1.0); + ASSERT(rtUi.width < 1.0); rtUi.width = 1.0; } if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index a5217abe7a..11628aa790 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -25,7 +25,7 @@ void GetPageMatrix(CFX_Matrix& pageMatrix, const CFX_Rect& devicePageRect, int32_t iRotate, uint32_t dwCoordinatesType) { - FXSYS_assert(iRotate >= 0 && iRotate <= 3); + ASSERT(iRotate >= 0 && iRotate <= 3); FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0; CFX_Matrix m; diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index d070223751..6136fd3ce8 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -52,7 +52,7 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, pGS, &mt); } FX_BOOL CXFA_FFPushButton::LoadWidget() { - FXSYS_assert(m_pNormalWidget == NULL); + ASSERT(m_pNormalWidget == NULL); CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); if (pPushButton) { pPushButton->Initialize(); diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp index 1cb77a4df1..ce1cee2033 100644 --- a/xfa/fxfa/app/xfa_ffsignature.cpp +++ b/xfa/fxfa/app/xfa_ffsignature.cpp @@ -37,7 +37,7 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); CFX_RectF rtWidget = m_rtUI; IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider(); - FXSYS_assert(pDocProvider); + ASSERT(pDocProvider); pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget); } FX_BOOL CXFA_FFSignature::OnMouseEnter() { diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 037e6560de..34b29c79d2 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -1153,7 +1153,7 @@ static void XFA_BOX_GetPath(CXFA_Box box, int32_t nIndex, FX_BOOL bStart, FX_BOOL bCorner) { - FXSYS_assert(nIndex >= 0 && nIndex < 8); + ASSERT(nIndex >= 0 && nIndex < 8); FX_BOOL bInverted, bRound; FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny, offsetY, offsetX, offsetEX, offsetEY; diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index 561db255d8..ad8cabad3a 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -293,7 +293,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideStringC& wsContentType, pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); } else { CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); - FXSYS_assert(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); static_cast<CFDE_XMLElement*>(pXMLNode) ->SetString(FX_WSTRC(L"href"), wsHref); } @@ -647,7 +647,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, static const uint32_t MAX_RECURSION_DEPTH = 2; if (m_nRecursionDepth > MAX_RECURSION_DEPTH) return XFA_EVENTERROR_Success; - FXSYS_assert(pEventParam); + ASSERT(pEventParam); if (!script) { return XFA_EVENTERROR_NotExist; } @@ -1596,7 +1596,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); - FXSYS_assert(pXMLNode); + ASSERT(pXMLNode); for (CFDE_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); pXMLChild; diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.h b/xfa/fxfa/app/xfa_ffwidgetacc.h index 6d4303d72a..97514b78db 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.h +++ b/xfa/fxfa/app/xfa_ffwidgetacc.h @@ -22,7 +22,7 @@ class CXFA_TextProvider { XFA_TEXTPROVIDERTYPE eType, CXFA_Node* pTextNode = NULL) : m_pWidgetAcc(pWidgetAcc), m_eType(eType), m_pTextNode(pTextNode) { - FXSYS_assert(m_pWidgetAcc); + ASSERT(m_pWidgetAcc); } ~CXFA_TextProvider() {} diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 02b44be789..7c6d5cddec 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1799,7 +1799,7 @@ IFX_Font* CXFA_DefFontMgr::GetDefaultFont(CXFA_FFDoc* hDoc, if (!pFont) pFont = pFDEFontMgr->LoadFont((const FX_WCHAR*)NULL, dwFontStyles, wCodePage); - FXSYS_assert(pFont); + ASSERT(pFont); if (pFont) { m_CacheFonts.Add(pFont); } diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index 462c7cb090..86da75e066 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -93,7 +93,7 @@ FWL_ERR CXFA_FWLTheme::Initialize() { #endif } - FXSYS_assert(NULL != m_pCalendarFont); + ASSERT(NULL != m_pCalendarFont); FWLTHEME_Init(); return FWL_ERR_Succeeded; } diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index b259a7f357..e210418337 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -70,7 +70,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) { if (m_pSelector == NULL) { CXFA_FFDoc* pDoc = pTextProvider->GetDocNode(); IFX_FontMgr* pFontMgr = pDoc->GetApp()->GetFDEFontMgr(); - FXSYS_assert(pFontMgr); + ASSERT(pFontMgr); m_pSelector = IFDE_CSSStyleSelector::Create(); m_pSelector->SetFontMgr(pFontMgr); FX_FLOAT fFontSize = 10; @@ -165,7 +165,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::CreateStyle( IFDE_CSSComputedStyle* pParentStyle) { IFDE_CSSComputedStyle* pNewStyle = m_pSelector->CreateComputedStyle(pParentStyle); - FXSYS_assert(pNewStyle); + ASSERT(pNewStyle); if (pParentStyle) { IFDE_CSSParagraphStyle* pParaStyle = pParentStyle->GetParagraphStyles(); uint32_t dwDecoration = pParaStyle->GetTextDecoration(); @@ -645,7 +645,7 @@ CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider) m_fMaxWidth(0), m_pTabstopContext(nullptr), m_bBlockContinue(TRUE) { - FXSYS_assert(m_pTextProvider); + ASSERT(m_pTextProvider); } CXFA_TextLayout::~CXFA_TextLayout() { m_textParser.Reset(); @@ -1194,7 +1194,7 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, pDevice->SetClipRect(rtClip); CFDE_Brush* pSolidBrush = new CFDE_Brush; CFDE_Pen* pPen = new CFDE_Pen; - FXSYS_assert(pDevice); + ASSERT(pDevice); if (m_pieceLines.GetSize() == 0) { int32_t iBlockCount = CountBlocks(); @@ -1390,7 +1390,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } if (wsName == FX_WSTRC(L"a")) { CFX_WideString wsLinkContent; - FXSYS_assert(pElement); + ASSERT(pElement); pElement->GetString(FX_WSTRC(L"href").c_str(), wsLinkContent); if (!wsLinkContent.IsEmpty()) { pLinkData = FXTARGET_NewWith(m_pAllocator) CXFA_LinkUserData( diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index ccebff8ad9..e823448105 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -197,7 +197,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_pLinkData(nullptr), m_pAllocator(pAllocator), m_dwRefCount(0) { - FXSYS_assert(m_pAllocator); + ASSERT(m_pAllocator); if (m_pStyle) m_pStyle->AddRef(); } @@ -208,7 +208,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_pLinkData(pLinkData), m_pAllocator(pAllocator), m_dwRefCount(0) { - FXSYS_assert(m_pAllocator); + ASSERT(m_pAllocator); if (m_pStyle) m_pStyle->AddRef(); } |