diff options
27 files changed, 90 insertions, 106 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 55f4f8010dbd..8fd1b942fec7 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -287,7 +287,7 @@ void MacroChooser::DeleteMacro() // mark current doc as modified: StarBASIC* pBasic = FindBasic(pMethod); - DBG_ASSERT( pBasic, "Basic?!" ); + assert(pBasic && "Basic?!"); BasicManager* pBasMgr = FindBasicManager( pBasic ); DBG_ASSERT( pBasMgr, "BasMgr?" ); ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) ); diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx index 8a3c31190cd0..04d9f621e315 100644 --- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx +++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx @@ -446,7 +446,8 @@ void SAL_CALL java_sql_PreparedStatement::setCharacterStream( sal_Int32 paramete ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); - SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); + SDBThreadAttach t; + assert(t.pEnv && "Java Enviroment geloescht worden!"); { createStatement(t.pEnv); diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index be5a91db7256..77cb02340194 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -165,7 +165,7 @@ bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDes if (bCase(strFieldName,OUString(m_pListBox->GetEntryText(pEntry)))) { OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(pEntry->GetUserData()); - OSL_ENSURE(pInf != NULL, "OQueryTableWindow::ExistsField : field doesn't have FieldInfo !"); + assert(pInf && "OQueryTableWindow::ExistsField : field doesn't have FieldInfo !"); rInfo->SetTabWindow(this); rInfo->SetField(strFieldName); diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 961898e93700..874c6b116156 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -422,11 +422,8 @@ void SvxEditSourceAdapter::SetEditSource( ::std::auto_ptr< SvxEditSource > pAdap } SAL_WNODEPRECATED_DECLARATIONS_POP - - - - -SvxAccessibleTextAdapter::SvxAccessibleTextAdapter() : mpTextForwarder( NULL ) +SvxAccessibleTextAdapter::SvxAccessibleTextAdapter() + : mpTextForwarder(NULL) { } @@ -436,15 +433,13 @@ SvxAccessibleTextAdapter::~SvxAccessibleTextAdapter() sal_Int32 SvxAccessibleTextAdapter::GetParagraphCount() const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetParagraphCount(); } sal_Int32 SvxAccessibleTextAdapter::GetTextLen( sal_Int32 nParagraph ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); - SvxAccessibleTextIndex aIndex; aIndex.SetEEIndex( nParagraph, mpTextForwarder->GetTextLen( nParagraph ), *this ); @@ -453,7 +448,7 @@ sal_Int32 SvxAccessibleTextAdapter::GetTextLen( sal_Int32 nParagraph ) const OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -522,7 +517,7 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -535,33 +530,32 @@ SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, EditEng SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetParaAttribs( nPara ); } void SvxAccessibleTextAdapter::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); mpTextForwarder->SetParaAttribs( nPara, rSet ); } void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , bool , sal_uInt16 ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); } void SvxAccessibleTextAdapter::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); mpTextForwarder->GetPortions( nPara, rList ); } sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -575,14 +569,14 @@ sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_u sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetItemState( nPara, nWhich ); } void SvxAccessibleTextAdapter::QuickInsertText( const OUString& rText, const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -596,7 +590,7 @@ void SvxAccessibleTextAdapter::QuickInsertText( const OUString& rText, const ESe void SvxAccessibleTextAdapter::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -610,7 +604,7 @@ void SvxAccessibleTextAdapter::QuickInsertField( const SvxFieldItem& rFld, const void SvxAccessibleTextAdapter::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -624,7 +618,7 @@ void SvxAccessibleTextAdapter::QuickSetAttribs( const SfxItemSet& rSet, const ES void SvxAccessibleTextAdapter::QuickInsertLineBreak( const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -637,39 +631,37 @@ void SvxAccessibleTextAdapter::QuickInsertLineBreak( const ESelection& rSel ) SfxItemPool* SvxAccessibleTextAdapter::GetPool() const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetPool(); } OUString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); mpTextForwarder->FieldClicked( rField, nPara, nPos ); } sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; aIndex.SetIndex(nPara, nLogicalIndex, *mpTextForwarder); return aIndex.GetEEIndex(); } - - bool SvxAccessibleTextAdapter::IsValid() const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); if( mpTextForwarder ) return mpTextForwarder->IsValid(); @@ -679,7 +671,7 @@ bool SvxAccessibleTextAdapter::IsValid() const LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; @@ -690,21 +682,21 @@ LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_Int32 nPara, sal_Int32 n sal_Int32 SvxAccessibleTextAdapter::GetFieldCount( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetFieldCount( nPara ); } EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetFieldInfo( nPara, nField ); } EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetBulletInfo( nPara ); } @@ -721,7 +713,7 @@ bool SvxAccessibleTextAdapter::GetUpdateModeForAcc( ) const Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; aIndex.SetIndex( nPara, nIndex, *this ); @@ -779,7 +771,7 @@ Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_Int32 nPara, sal_Int32 nI Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); EBulletInfo aBulletInfo = GetBulletInfo( nPara ); @@ -800,21 +792,21 @@ Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_Int32 nPara ) const MapMode SvxAccessibleTextAdapter::GetMapMode() const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetMapMode(); } OutputDevice* SvxAccessibleTextAdapter::GetRefDevice() const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetRefDevice(); } bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& nPara, sal_Int32& nIndex ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); if( !mpTextForwarder->GetIndexAtPoint( rPoint, nPara, nIndex ) ) return false; @@ -889,7 +881,7 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& bool SvxAccessibleTextAdapter::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; aIndex.SetIndex(nPara, nIndex, *this); @@ -944,7 +936,7 @@ bool SvxAccessibleTextAdapter::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex bool SvxAccessibleTextAdapter::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool /* bInCell */ ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; aIndex.SetIndex(nPara, nIndex, *this); @@ -996,14 +988,14 @@ bool SvxAccessibleTextAdapter::GetAttributeRun( sal_Int32& nStartIndex, sal_Int3 sal_Int32 SvxAccessibleTextAdapter::GetLineCount( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetLineCount( nPara ); } sal_Int32 SvxAccessibleTextAdapter::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -1039,7 +1031,7 @@ sal_Int32 SvxAccessibleTextAdapter::GetLineNumberAtIndex( sal_Int32 nPara, sal_I bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -1052,7 +1044,7 @@ bool SvxAccessibleTextAdapter::Delete( const ESelection& rSel ) bool SvxAccessibleTextAdapter::InsertText( const OUString& rStr, const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -1065,21 +1057,21 @@ bool SvxAccessibleTextAdapter::InsertText( const OUString& rStr, const ESelectio bool SvxAccessibleTextAdapter::QuickFormatDoc( bool bFull ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->QuickFormatDoc( bFull ); } sal_Int16 SvxAccessibleTextAdapter::GetDepth( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->GetDepth( nPara ); } bool SvxAccessibleTextAdapter::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); return mpTextForwarder->SetDepth( nPara, nNewDepth ); } @@ -1091,8 +1083,6 @@ void SvxAccessibleTextAdapter::SetForwarder( SvxTextForwarder& rForwarder ) bool SvxAccessibleTextAdapter::HaveImageBullet( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); - EBulletInfo aBulletInfo = GetBulletInfo( nPara ); return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && @@ -1102,8 +1092,6 @@ bool SvxAccessibleTextAdapter::HaveImageBullet( sal_Int32 nPara ) const bool SvxAccessibleTextAdapter::HaveTextBullet( sal_Int32 nPara ) const { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); - EBulletInfo aBulletInfo = GetBulletInfo( nPara ); return ( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && @@ -1113,8 +1101,6 @@ bool SvxAccessibleTextAdapter::HaveTextBullet( sal_Int32 nPara ) const bool SvxAccessibleTextAdapter::IsEditable( const ESelection& rSel ) { - DBG_ASSERT(mpTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); - SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; @@ -1152,10 +1138,6 @@ void SvxAccessibleTextAdapter::CopyText(const SvxTextForwarder&) OSL_FAIL( "not implemented" ); } - - - - SvxAccessibleTextEditViewAdapter::SvxAccessibleTextEditViewAdapter() : mpViewForwarder(NULL) , mpTextForwarder(NULL) diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx index 600a795e5288..4dd5e59c2014 100644 --- a/forms/source/xforms/computedexpression.cxx +++ b/forms/source/xforms/computedexpression.cxx @@ -83,7 +83,7 @@ void ComputedExpression::setExpression( const OUString& rExpression ) bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const { - OSL_ENSURE( pExpression != NULL, "no expression?" ); + assert(pExpression && "no expression?"); // call RegExp engine SearchOptions aSearchOptions; diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index eac3bc1bf80b..96d8645a7f49 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -44,7 +44,7 @@ ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr, const , rOutAttrs(*pAttr) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); + assert(pFact && "Dialogdiet fail!"); if (rDialog == "BackgroundDialog") { diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 766125cec96e..e8719fcffff5 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1818,13 +1818,13 @@ void ScDocument::CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest) const ScDocOptions& ScDocument::GetDocOptions() const { - OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); + assert(pDocOptions && "No DocOptions! :-("); return *pDocOptions; } void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) { - OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); + assert(pDocOptions && "No DocOptions! :-("); *pDocOptions = rOpt; xPoolHelper->SetFormTableOpt(rOpt); @@ -1832,13 +1832,13 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) const ScViewOptions& ScDocument::GetViewOptions() const { - OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); + assert(pViewOptions && "No ViewOptions! :-("); return *pViewOptions; } void ScDocument::SetViewOptions( const ScViewOptions& rOpt ) { - OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); + assert(pViewOptions && "No ViewOptions! :-("); *pViewOptions = rOpt; } diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 77db4fbc121c..f6507e4319d2 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -140,7 +140,7 @@ ExcelToSc& XclImpRoot::GetOldFmlaConverter() const XclImpSst& XclImpRoot::GetSst() const { - OSL_ENSURE( mrImpData.mxSst, "XclImpRoot::GetSst - invalid call, wrong BIFF" ); + assert(mrImpData.mxSst && "XclImpRoot::GetSst - invalid call, wrong BIFF"); return *mrImpData.mxSst; } @@ -193,7 +193,7 @@ XclImpNameManager& XclImpRoot::GetNameManager() const XclImpLinkManager& XclImpRoot::GetLinkManager() const { - OSL_ENSURE( mrImpData.mxLinkMgr, "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxLinkMgr && "XclImpRoot::GetLinkManager - invalid call, wrong BIFF"); return *mrImpData.mxLinkMgr; } @@ -210,44 +210,44 @@ XclImpSheetDrawing& XclImpRoot::GetCurrSheetDrawing() const XclImpCondFormatManager& XclImpRoot::GetCondFormatManager() const { - OSL_ENSURE( mrImpData.mxCondFmtMgr, "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxCondFmtMgr && "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF"); return *mrImpData.mxCondFmtMgr; } XclImpValidationManager& XclImpRoot::GetValidationManager() const { - OSL_ENSURE( mrImpData.mxValidMgr, "XclImpRoot::GetValidationManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxValidMgr && "XclImpRoot::GetValidationManager - invalid call, wrong BIFF"); return *mrImpData.mxValidMgr; } XclImpAutoFilterBuffer& XclImpRoot::GetFilterManager() const { // TODO still in old RootData - OSL_ENSURE( GetOldRoot().pAutoFilterBuffer, "XclImpRoot::GetFilterManager - invalid call, wrong BIFF" ); + assert(GetOldRoot().pAutoFilterBuffer && "XclImpRoot::GetFilterManager - invalid call, wrong BIFF"); return *GetOldRoot().pAutoFilterBuffer; } XclImpWebQueryBuffer& XclImpRoot::GetWebQueryBuffer() const { - OSL_ENSURE( mrImpData.mxWebQueryBfr, "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxWebQueryBfr && "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF"); return *mrImpData.mxWebQueryBfr; } XclImpPivotTableManager& XclImpRoot::GetPivotTableManager() const { - OSL_ENSURE( mrImpData.mxPTableMgr, "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxPTableMgr && "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF"); return *mrImpData.mxPTableMgr; } XclImpSheetProtectBuffer& XclImpRoot::GetSheetProtectBuffer() const { - OSL_ENSURE( mrImpData.mxTabProtect, "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxTabProtect && "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF"); return *mrImpData.mxTabProtect; } XclImpDocProtectBuffer& XclImpRoot::GetDocProtectBuffer() const { - OSL_ENSURE( mrImpData.mxDocProtect, "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxDocProtect && "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF"); return *mrImpData.mxDocProtect; } diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 3aa3fbb818f5..f860224ef900 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -190,7 +190,7 @@ void ScAccessibleCsvControl::ensureAlive() const throw( DisposedException ) ScCsvControl& ScAccessibleCsvControl::implGetControl() const { - OSL_ENSURE( mpControl, "ScAccessibleCsvControl::implGetControl - missing control" ); + assert(mpControl && "ScAccessibleCsvControl::implGetControl - missing control"); return *mpControl; } diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index b88b982fce42..d364ef2f4d4e 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -45,12 +45,12 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, SfxItemSet& rOutSet , sal_uInt16 nSlot) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); + assert(pFact && "ScAbstractFactory create fail!"); boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( pViewData->GetDialogParent(), &rArgs, pViewData->GetSfxDocShell())); - OSL_ENSURE(pDlg, "Dialog create fail!"); + assert(pDlg && "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { pDlg->SetCurPageId(RID_SVXPAGE_CHAR_EFFECTS); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 233a46f6fd60..2797222dd85e 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2795,8 +2795,8 @@ void ScCellShell::ExecuteFillSingleEdit() IMPL_LINK_NOARG(ScCellShell, DialogClosed) { - OSL_ENSURE( pImpl->m_pLinkedDlg, "ScCellShell::DialogClosed(): invalid request" ); - OSL_ENSURE( pImpl->m_pRequest, "ScCellShell::DialogClosed(): invalid request" ); + assert(pImpl->m_pLinkedDlg && "ScCellShell::DialogClosed(): invalid request"); + assert(pImpl->m_pRequest && "ScCellShell::DialogClosed(): invalid request"); OUString sFile, sFilter, sOptions, sSource; sal_uLong nRefresh = 0; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index d79de14e17d5..f0ffb70b76eb 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -1245,11 +1245,11 @@ void ScEditShell::ExecuteTrans( SfxRequest& rReq ) if ( nType ) { ScInputHandler* pHdl = GetMyInputHdl(); - OSL_ENSURE( pHdl, "no ScInputHandler" ); + assert(pHdl && "no ScInputHandler"); EditView* pTopView = pHdl->GetTopView(); EditView* pTableView = pHdl->GetTableView(); - OSL_ENSURE( pTableView, "no EditView" ); + assert(pTableView && "no EditView"); pHdl->DataChanging(); diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 95d00d884e69..1d2d1b072eb0 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -456,7 +456,7 @@ bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const while (pParent) { pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); - OSL_ASSERT(pUserData); + assert(pUserData); if (pUserData->maLinkedPos.IsValid()) { // This parent is already linked. diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index e6fe17e579e9..d0292106df00 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1083,7 +1083,7 @@ bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, bool ) const { OutlinerView* pOlView = GetViewByWindow( mrOutlineViewShell.GetActiveWindow()); - DBG_ASSERT(pOlView, "keine OutlinerView gefunden"); + assert(pOlView && "keine OutlinerView gefunden"); rTargetSet.Put( pOlView->GetAttribs(), false ); return true; diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 4009d6a8d5fd..738aac2bbb07 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -403,7 +403,7 @@ SfxItemPool& SmDocShell::GetEditEngineItemPool() { if (!pEditEngineItemPool) GetEditEngine(); - OSL_ENSURE( pEditEngineItemPool, "EditEngineItemPool missing" ); + assert(pEditEngineItemPool && "EditEngineItemPool missing"); return *pEditEngineItemPool; } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index e60f22df460d..95a6a65686fb 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2007,8 +2007,8 @@ void SmViewShell::Activate( bool bIsMDIActivate ) IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) { - SAL_WARN_IF( !_pFileDlg, "starmath", "SmViewShell::DialogClosedHdl(): no file dialog" ); - SAL_WARN_IF( !pImpl->pDocInserter, "starmath", "ScDocShell::DialogClosedHdl(): no document inserter" ); + assert(_pFileDlg && "SmViewShell::DialogClosedHdl(): no file dialog"); + assert(pImpl->pDocInserter && "ScDocShell::DialogClosedHdl(): no document inserter"); if ( ERRCODE_NONE == _pFileDlg->GetError() ) { diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx index fdcfef7fe87a..dd014a1c4226 100644 --- a/svx/source/form/tbxform.cxx +++ b/svx/source/form/tbxform.cxx @@ -267,7 +267,7 @@ void SvxFmTbxCtlAbsRec::StateChanged( sal_uInt16 nSID, SfxItemState eState, cons ToolBox* pToolBox = &GetToolBox(); SvxFmAbsRecWin* pWin = (SvxFmAbsRecWin*)( pToolBox->GetItemWindow(nId) ); - DBG_ASSERT( pWin, "Control not found!" ); + assert(pWin && "Control not found!"); if (pState) { diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 7910135c2951..db3ae50b0cfd 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1735,7 +1735,7 @@ void MakeNxt( SwFrm *pFrm, SwFrm *pNxt ) /// between the pFrm's FtnBoss and the pNxt's FtnBoss. static bool lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt ) { - OSL_ENSURE( pFrm && pNxt, "lcl_IsNextFtnBoss: No Frames?" ); + assert(pFrm && pNxt && "lcl_IsNextFtnBoss: No Frames?"); pFrm = pFrm->FindFtnBossFrm(); pNxt = pNxt->FindFtnBossFrm(); // If pFrm is a last column, we use the page instead. diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index d8ff9576af8d..f712fd0c6c60 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1584,7 +1584,7 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren } } - OSL_ENSURE( pRet, "SwCellFrm::FindStartRowSpanCell: No result" ); + assert(pRet && "SwCellFrm::FindStartRowSpanCell: No result"); return *pRet; } diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 70d79fc7ce9c..88157ccba55b 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2823,7 +2823,7 @@ const SwCntntFrm* SwFtnFrm::GetRefFromAttr() const SwCntntFrm* SwFtnFrm::GetRefFromAttr() { - OSL_ENSURE( pAttr, "invalid Attribute" ); + assert(pAttr && "invalid Attribute"); SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode(); SwPosition aPos( rTNd, SwIndex( &rTNd, pAttr->GetStart() )); SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, false ); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index a1c29b5e5b2d..79db5385608d 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -78,16 +78,16 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj() // determine contact object { mpContact = static_cast<SwContact*>(GetUserCall( &mrDrawObj )); - OSL_ENSURE( mpContact, - "SwAnchoredObjectPosition::_GetInfoAboutObj() - missing SwContact-object." ); + assert(mpContact && + "SwAnchoredObjectPosition::_GetInfoAboutObj() - missing SwContact-object."); } // determine anchored object, the object belongs to { // #i26791# mpAnchoredObj = mpContact->GetAnchoredObj( &mrDrawObj ); - OSL_ENSURE( mpAnchoredObj, - "SwAnchoredObjectPosition::_GetInfoAboutObj() - missing anchored object." ); + assert(mpAnchoredObj && + "SwAnchoredObjectPosition::_GetInfoAboutObj() - missing anchored object."); } // determine frame, the object is anchored at @@ -102,8 +102,8 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj() { // #i28701# mpFrmFmt = &mpAnchoredObj->GetFrmFmt(); - OSL_ENSURE( mpFrmFmt, - "<SwAnchoredObjectPosition::_GetInfoAboutObj() - missing frame format." ); + assert(mpFrmFmt && + "<SwAnchoredObjectPosition::_GetInfoAboutObj() - missing frame format."); } // #i62875# - determine attribute value of <Follow-Text-Flow> diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 856729fead92..fd40d7886327 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -136,7 +136,7 @@ SwContourCache::~SwContourCache() void SwContourCache::ClrObject( MSHORT nPos ) { - OSL_ENSURE( pTextRanger[ nPos ], "ClrObject: Already cleared. Good Bye!" ); + assert(pTextRanger[nPos] && "ClrObject: Already cleared. Good Bye!"); nPntCnt -= pTextRanger[ nPos ]->GetPointCount(); delete pTextRanger[ nPos ]; --nObjCnt; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index b1c1f82f720b..1f7d39d3e382 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1047,7 +1047,8 @@ sal_uInt8 *WW8_WrFkp::CopyLastSprms(sal_uInt8 &rLen, bool bVer8) bool WW8_WrFkp::Append( WW8_FC nEndFc, sal_uInt16 nVarLen, const sal_uInt8* pSprms ) { - OSL_ENSURE( !nVarLen || pSprms, "Item pointer missing" ); + assert((!nVarLen || pSprms) && "Item pointer missing"); + OSL_ENSURE( nVarLen < ( ( ePlc == PAP ) ? 497U : 502U ), "Sprms too long !" ); if( bCombined ) diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index af3ce1488189..2fc0e6bf0bc2 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -722,10 +722,10 @@ void SwXMLImport::endDocument( void ) { Reference<XUnoTunnel> xCrsrTunnel( GetTextImport()->GetCursor(), UNO_QUERY); - OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" ); + assert(xCrsrTunnel.is() && "missing XUnoTunnel for Cursor"); OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper *>( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); + assert(pTxtCrsr && "SwXTextCursor missing"); SwPaM *pPaM = pTxtCrsr->GetPaM(); if( IsInsertMode() && pSttNdIdx->GetIndex() ) { diff --git a/sw/source/uibase/index/idxmrk.cxx b/sw/source/uibase/index/idxmrk.cxx index f81f63b7ee3d..306f55448e69 100644 --- a/sw/source/uibase/index/idxmrk.cxx +++ b/sw/source/uibase/index/idxmrk.cxx @@ -61,9 +61,9 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow, SfxChildWindow(pParentWindow, nId) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); + assert(pFact && "SwAbstractDialogFactory fail!"); pAbstDlg = pFact->CreateIndexMarkFloatDlg(pBindings, this, pParentWindow, pInfo); - OSL_ENSURE(pAbstDlg, "Dialogdiet fail!"); + assert(pAbstDlg && "Dialogdiet fail!"); pWindow = pAbstDlg->GetWindow(); pWindow->Show(); // at this point,because before pSh has to be initialized in ReInitDlg() // -> Show() will invoke StateChanged() and save pos diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 416f9447ae33..3852fc191a58 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -54,10 +54,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq) case FN_INSERT_CAPTION: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); + assert(pFact && "SwAbstractDialogFactory fail!"); boost::scoped_ptr<VclAbstractDialog> pDialog(pFact->CreateSwCaptionDialog( pMDI, *this, DLG_CAPTION )); - OSL_ENSURE(pDialog, "Dialogdiet fail!"); + assert(pDialog && "Dialogdiet fail!"); if ( pDialog ) { pDialog->Execute(); @@ -67,10 +67,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq) case FN_EDIT_FOOTNOTE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); + assert(pFact && "Dialogdiet fail!"); boost::scoped_ptr<AbstractInsFootNoteDlg> pDlg(pFact->CreateInsFootNoteDlg( pMDI, *m_pWrtShell, true)); - OSL_ENSURE(pDlg, "Dialogdiet fail!"); + assert(pDlg && "Dialogdiet fail!"); pDlg->SetHelpId(GetStaticInterface()->GetSlot(FN_EDIT_FOOTNOTE)->GetCommand()); pDlg->SetText( SW_RESSTR(STR_EDIT_FOOTNOTE) ); diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 5ace0a7d341f..f1d715565445 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -363,7 +363,7 @@ sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId ) const OUString& GetPropertyName( sal_uInt16 nPropertyId ) { const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId ); - DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" ); + assert(pImplPropertyInfo && "Invalid PropertyId!"); return pImplPropertyInfo->aName; } |