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 | |
parent | b733d208b02facaaad8c4925277b34b9f7fd928f (diff) |
OSL_ENSURE->assert where guaranteed deref follows
Change-Id: I6e007cc3a9fd222c1c1381c8b4f890966c05cbab
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 12 | ||||
-rw-r--r-- | svtools/source/control/valueacc.cxx | 16 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 4 | ||||
-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 |
8 files changed, 21 insertions, 36 deletions
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index fe9cf60359e5..a884eb2fbd39 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -700,24 +700,22 @@ void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) const SfxItemSet& ImpEditEngine::GetParaAttribs( sal_Int32 nPara ) const { const ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node not found: GetParaAttribs" ); + assert(pNode && "Node not found: GetParaAttribs"); return pNode->GetContentAttribs().GetItems(); } bool ImpEditEngine::HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const { const ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node not found: HasParaAttrib" ); - + assert(pNode && "Node not found: HasParaAttrib"); return pNode->GetContentAttribs().HasItem( nWhich ); } const SfxPoolItem& ImpEditEngine::GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const { - const ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node not found: GetParaAttrib" ); - - return pNode->GetContentAttribs().GetItem( nWhich ); + const ContentNode* pNode = aEditDoc.GetObject(nPara); + assert(pNode && "Node not found: GetParaAttrib"); + return pNode->GetContentAttribs().GetItem(nWhich); } void ImpEditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index f0d7ede91cc7..585908b4a0e8 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -776,35 +776,23 @@ void ValueSetAcc::ThrowIfDisposed (void) } } - - -bool ValueSetAcc::HasNoneField (void) const +bool ValueSetAcc::HasNoneField() const { - DBG_ASSERT (mpParent!=NULL, "ValueSetAcc::HasNoneField called with mpParent==NULL"); + assert(mpParent && "ValueSetAcc::HasNoneField called with mpParent==NULL"); return ((mpParent->GetStyle() & WB_NONEFIELD) != 0); } - - - - // - ValueItemAcc - - - ValueItemAcc::ValueItemAcc( ValueSetItem* pParent, bool bIsTransientChildrenDisabled ) : mpParent( pParent ), mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled ) { } - - ValueItemAcc::~ValueItemAcc() { } - - void ValueItemAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue, const uno::Any& rNewValue ) { if( nEventId ) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index ddb6bfa9d7be..3705fa960963 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -272,9 +272,9 @@ void GalleryBrowser1::ImplGalleryThemeProperties( const OUString & rThemeName, b ImplFillExchangeData( pTheme, *mpExchangeData ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Got no AbstractDialogFactory!"); + assert(pFact && "Got no AbstractDialogFactory!"); VclAbstractDialog2* pThemeProps = pFact->CreateGalleryThemePropertiesDialog( NULL, mpExchangeData, mpThemePropsDlgItemSet ); - DBG_ASSERT(pThemeProps, "Got no GalleryThemePropertiesDialog!"); + assert(pThemeProps && "Got no GalleryThemePropertiesDialog!"); if ( bCreateNew ) { 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 ); } |