diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 17:04:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 17:22:09 +0100 |
commit | 78bea877ff9471d7308041e65e0d6864a862c91b (patch) | |
tree | f4edfd125043242992c12ffc14e5214c0469affd /sw | |
parent | b733d208b02facaaad8c4925277b34b9f7fd928f (diff) |
OSL_ENSURE->assert where guaranteed deref follows
Change-Id: I6e007cc3a9fd222c1c1381c8b4f890966c05cbab
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/findfrm.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/fldui/fldwrap.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 8 |
5 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 8b4b1e4f6779..749fa8469c78 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1365,13 +1365,13 @@ static SwCellFrm* lcl_FindCorrespondingCellFrm( const SwRowFrm& rOrigRow, pCorrCell = (SwCellFrm*)pCorrCell->GetNext(); } - OSL_ENSURE( pCell && pCorrCell, "lcl_FindCorrespondingCellFrm does not work" ); + assert(pCell && pCorrCell && "lcl_FindCorrespondingCellFrm does not work"); if ( pCell != &rOrigCell ) { // rOrigCell must be a lower of pCell. We need to recurse into the rows: - OSL_ENSURE( pCell->Lower() && pCell->Lower()->IsRowFrm(), - "lcl_FindCorrespondingCellFrm does not work" ); + assert(pCell->Lower() && pCell->Lower()->IsRowFrm() && + "lcl_FindCorrespondingCellFrm does not work"); SwRowFrm* pRow = (SwRowFrm*)pCell->Lower(); while ( !pRow->IsAnLower( &rOrigCell ) ) diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 68826222762a..94376a035ce7 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -1342,7 +1342,7 @@ static void ParseCSS1_column_count( const CSS1Expression *pExpr, SvxCSS1PropertyInfo &rPropInfo, const SvxCSS1Parser& /*rParser*/ ) { - OSL_ENSURE( pExpr, "no expression" ); + assert(pExpr && "no expression"); if ( pExpr->GetType() == CSS1_NUMBER ) { @@ -1359,7 +1359,7 @@ static void ParseCSS1_direction( const CSS1Expression *pExpr, SvxCSS1PropertyInfo& /*rPropInfo*/, const SvxCSS1Parser& /*rParser*/ ) { - OSL_ENSURE( pExpr, "no expression" ); + assert(pExpr && "no expression"); sal_uInt16 nDir; switch( pExpr->GetType() ) diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index f9a14fd049dd..6e612528df7e 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -701,7 +701,7 @@ void SwXMLTableCellContext_Impl::EndElement() "missing XUnoTunnel for Cursor" ); OTextCursorHelper *pDstTxtCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xDstCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() )) ); - OSL_ENSURE( pDstTxtCrsr, "SwXTextCursor missing" ); + assert(pDstTxtCrsr && "SwXTextCursor missing"); SwPaM aSrcPaM( *pSrcPaM->GetPoint(), *pSrcPaM->GetMark() ); SwPosition aDstPos( *pDstTxtCrsr->GetPaM()->GetPoint() ); diff --git a/sw/source/uibase/fldui/fldwrap.cxx b/sw/source/uibase/fldui/fldwrap.cxx index b3e71d39aa1c..522d50f3214a 100644 --- a/sw/source/uibase/fldui/fldwrap.cxx +++ b/sw/source/uibase/fldui/fldwrap.cxx @@ -82,10 +82,9 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId, : SwChildWinWrapper( _pParent, nId ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - + assert(pFact && "SwAbstractDialogFactory fail!"); AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent); - OSL_ENSURE(pDlg, "Dialogdiet fail!"); + assert(pDlg && "Dialogdiet fail!"); pDlgInterface = pDlg; pWindow = pDlg->GetWindow(); pDlg->Start(); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index ed80e0b2d535..bc140f7c66ba 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -565,25 +565,25 @@ void SwView::SetActMark(sal_Int32 nSet) void SwView::ShowHScrollbar(bool bShow) { - OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid"); + assert(m_pHScrollbar && "Scrollbar invalid"); m_pHScrollbar->ExtendedShow(bShow); } bool SwView::IsHScrollbarVisible()const { - OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid"); + assert(m_pHScrollbar && "Scrollbar invalid"); return m_pHScrollbar->IsVisible( false ) || m_pHScrollbar->IsAuto(); } void SwView::ShowVScrollbar(bool bShow) { - OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid"); + assert(m_pVScrollbar && "Scrollbar invalid"); m_pVScrollbar->ExtendedShow(bShow); } bool SwView::IsVScrollbarVisible()const { - OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid"); + assert(m_pVScrollbar && "Scrollbar invalid"); return m_pVScrollbar->IsVisible( false ); } |