diff options
author | Jacek Wolszczak <shutdownrunner@gmail.com> | 2011-05-21 15:04:26 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-27 06:03:37 +0200 |
commit | 8b569e74d6b671c13a57c5ad72ed360d194b2dda (patch) | |
tree | 3c29b626bd0638fd13cfdfec0be976116de61f91 /sc/source/ui/docshell | |
parent | 45df4e385910e1006d4bad4f674167c495b75673 (diff) |
Replace DBG_* with OSL_* in sc/source/ui
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/arealink.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/docshell/autostyl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/pagedata.cxx | 6 |
13 files changed, 75 insertions, 80 deletions
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 3ce2236bb4ad..a028a5129b70 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -90,7 +90,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile, bInCreate (false), bDoInsert (true) { - DBG_ASSERT(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell"); + OSL_ENSURE(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell"); pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell ); SetRefreshHandler( LINK( this, ScAreaLink, RefreshHdl ) ); SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() ); @@ -109,10 +109,10 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ ) // ein Optionen-Dialog kommt... ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); AbstractScLinkedAreaDlg* pDlg = pFact->CreateScLinkedAreaDlg( pParent, RID_SCDLG_LINKAREA); - DBG_ASSERT(pDlg, "Dialog create fail!"); + OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, GetRefreshDelay() ); pImpl->m_pDialog = pDlg; pDlg->StartExecuteModal( LINK( this, ScAreaLink, AreaEndEditHdl ) ); diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index bfb7c8f3c9a1..a1f70a138137 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -115,7 +115,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const if (!aEntries.empty() && nNow != nTimerStart) { - DBG_ASSERT(nNow>nTimerStart, "Zeit laeuft rueckwaerts?"); + OSL_ENSURE(nNow>nTimerStart, "Zeit laeuft rueckwaerts?"); AdjustEntries((nNow-nTimerStart)*1000); } diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index afe4a6ac2633..750810c08a50 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -903,7 +903,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, { const ScPatternAttr* pSrcPattern = pAttribDoc->GetPattern( nCol, nAttrRow, nDestTab ); - DBG_ASSERT(pSrcPattern,"Pattern ist 0"); + OSL_ENSURE(pSrcPattern,"Pattern ist 0"); if (pSrcPattern) { pDoc->ApplyPatternAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2, @@ -1286,7 +1286,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN pNewObj->WriteSourceDataTo( *pOldObj ); // copy source data ScDPSaveData* pData = pNewObj->GetSaveData(); - DBG_ASSERT( pData, "no SaveData from living DPObject" ); + OSL_ENSURE( pData, "no SaveData from living DPObject" ); if ( pData ) pOldObj->SetSaveData( *pData ); // copy SaveData } @@ -1348,7 +1348,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN if ( bOverflow ) { // like with STR_PROTECTIONERR, use undo to reverse everything - DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" ); + OSL_ENSURE( bRecord, "DataPilotUpdate: can't undo" ); bUndoSelf = sal_True; nErrId = STR_PIVOT_ERROR; } @@ -1362,7 +1362,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN // quick solution: proceed to end, use undo action // to reverse everything: - DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" ); + OSL_ENSURE( bRecord, "DataPilotUpdate: can't undo" ); bUndoSelf = sal_True; nErrId = aTester.GetMessageId(); } @@ -1386,7 +1386,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN if (aBox.Execute() == RET_NO) { //! like above (not editable), use undo to reverse everything - DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" ); + OSL_ENSURE( bRecord, "DataPilotUpdate: can't undo" ); bUndoSelf = sal_True; } } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index bdc22acb9ae3..1fb2bd39b6ab 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -36,7 +36,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/types.hxx> #include <vcl/msgbox.hxx> -#include <tools/debug.hxx> #include <svx/dataaccessdescriptor.hxx> #include <sfx2/viewfrm.hxx> @@ -191,7 +190,7 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos, //! merge this with SID_SBA_IMPORT execute in docsh4.cxx ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, SC_DBSEL_KEEP ); - DBG_ASSERT(pDBData, "can't create DB data"); + OSL_ENSURE(pDBData, "can't create DB data"); String sTarget = pDBData->GetName(); //! change UpdateImport to use only one of rTableName, rStatement @@ -291,7 +290,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRowProp.is(), "can't get RowSet" ); + OSL_ENSURE( xRowProp.is(), "can't get RowSet" ); if ( xRowProp.is() ) { // diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 2f04f83934a9..e4b020d7848f 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2650,7 +2650,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String { SfxObjectShell& rDocSh = *rDoc.GetDocumentShell(); uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer(); - DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" ); + OSL_ENSURE( xLibContainer.is(), "No BasicContainer!" ); uno::Reference< container::XNameContainer > xLib; if( xLibContainer.is() ) @@ -2696,7 +2696,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName ) { uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer(); - DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" ); + OSL_ENSURE( xLibContainer.is(), "No BasicContainer!" ); uno::Reference< container::XNameContainer > xLib; if( xLibContainer.is() ) @@ -3421,7 +3421,7 @@ void ScDocFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ) if (pDoc->IsUndoEnabled()) { ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); - DBG_ASSERT(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); + OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); if (pProtect) { ::std::auto_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); @@ -3451,7 +3451,7 @@ sal_Bool ScDocFunc::Protect( SCTAB nTab, const String& rPassword, sal_Bool /*bAp if (pDoc->IsUndoEnabled()) { ScDocProtection* pProtect = pDoc->GetDocProtection(); - DBG_ASSERT(pProtect, "ScDocFunc::Unprotect: ScDocProtection pointer is NULL!"); + OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScDocProtection pointer is NULL!"); if (pProtect) { ::std::auto_ptr<ScDocProtection> p(new ScDocProtection(*pProtect)); @@ -3473,7 +3473,7 @@ sal_Bool ScDocFunc::Protect( SCTAB nTab, const String& rPassword, sal_Bool /*bAp if (pDoc->IsUndoEnabled()) { ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); - DBG_ASSERT(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); + OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!"); if (pProtect) { ::std::auto_ptr<ScTableProtection> p(new ScTableProtection(*pProtect)); @@ -4515,7 +4515,7 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc ) { ScDocShellModificator aModificator( rDocShell ); - DBG_ASSERT( pNewRanges, "pNewRanges is 0" ); + OSL_ENSURE( pNewRanges, "pNewRanges is 0" ); ScDocument* pDoc = rDocShell.GetDocument(); sal_Bool bUndo(pDoc->IsUndoEnabled()); @@ -4630,7 +4630,7 @@ sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_B SCCOL nEndCol = rRange.aEnd.Col(); SCROW nEndRow = rRange.aEnd.Row(); SCTAB nTab = rRange.aStart.Tab(); - DBG_ASSERT(rRange.aEnd.Tab() == nTab, "CreateNames: mehrere Tabellen geht nicht"); + OSL_ENSURE(rRange.aEnd.Tab() == nTab, "CreateNames: mehrere Tabellen geht nicht"); sal_Bool bValid = sal_True; if ( nFlags & ( NAME_TOP | NAME_BOTTOM ) ) diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index b7771b938286..b99be8b508c5 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -289,7 +289,7 @@ void ScDocShell::BeforeXMLLoading() aDocument.DisableIdle( sal_True ); // prevent unnecessary broadcasts and updates - DBG_ASSERT(pModificator == NULL, "The Modificator should not exist"); + OSL_ENSURE(pModificator == NULL, "The Modificator should not exist"); pModificator = new ScDocShellModificator( *this ); aDocument.SetImportingXML( sal_True ); @@ -2059,7 +2059,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed ) if (GetCreateMode()== SFX_CREATE_MODE_STANDARD) SfxObjectShell::SetVisArea( Rectangle() ); // normal bearbeitet -> keine VisArea - DBG_ASSERT( rMed.GetFilter(), "Filter == 0" ); + OSL_ENSURE( rMed.GetFilter(), "Filter == 0" ); sal_Bool bRet = false; String aFltName = rMed.GetFilter()->GetFilterName(); @@ -2735,9 +2735,9 @@ SfxDocumentInfoDialog* ScDocShell::CreateDocumentInfoDialog( if( pDocSh == this ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); ::CreateTabPage ScDocStatPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_STAT ); - DBG_ASSERT(ScDocStatPageCreate, "Tabpage create fail!"); + OSL_ENSURE(ScDocStatPageCreate, "Tabpage create fail!"); pDlg->AddTabPage( 42, ScGlobal::GetRscString( STR_DOC_STAT ), ScDocStatPageCreate, diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 010c8171f9b7..9034e39114ab 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -725,7 +725,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc ) GetModel(), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> xDocProps( xDPS->getDocumentProperties()); - DBG_ASSERT(xDocProps.is(), "no DocumentProperties"); + OSL_ENSURE(xDocProps.is(), "no DocumentProperties"); String aDocUser = xDocProps->getModifiedBy(); if ( aDocUser.Len() ) @@ -810,7 +810,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck { // anschalten aDocument.StartChangeTracking(); pThisTrack = aDocument.GetChangeTrack(); - DBG_ASSERT(pThisTrack,"ChangeTracking nicht angeschaltet?"); + OSL_ENSURE(pThisTrack,"ChangeTracking nicht angeschaltet?"); if ( !bShared ) { // visuelles RedLining einschalten @@ -951,7 +951,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck // -> wird weggelassen //! ??? Loesch-Aktion rueckgaengig machen ??? //! ??? Aktion irgendwo anders speichern ??? -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 String aValue; if ( eSourceType == SC_CAT_CONTENT ) ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue ); @@ -1015,7 +1015,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck //! Test, ob es ganz unten im Dokument war, dann automatisches //! Zeilen-Einfuegen ??? - DBG_ASSERT( aSourceRange.aStart == aSourceRange.aEnd, "huch?" ); + OSL_ENSURE( aSourceRange.aStart == aSourceRange.aEnd, "huch?" ); ScAddress aPos = aSourceRange.aStart; String aValue; ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue ); @@ -1045,7 +1045,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck case MM_REFERENCE : // do nothing break; case MM_FAKE : - DBG_WARNING( "MergeDocument: MatrixFlag MM_FAKE" ); + OSL_FAIL( "MergeDocument: MatrixFlag MM_FAKE" ); pViewSh->EnterData( aPos.Col(), aPos.Row(), aPos.Tab(), aValue ); break; default: @@ -1119,10 +1119,8 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck ScChangeAction* pAct = pThisTrack->GetLast(); if ( pAct && pAct->GetActionNumber() > nOldActionMax ) pAct->SetComment( rComment ); -#ifdef DBG_UTIL else OSL_FAIL( "MergeDocument: wohin mit dem Kommentar?!?" ); -#endif } // Referenzen anpassen diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 5da6df7c4433..3fe423dc8190 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -260,7 +260,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) } ScDBData* pDBData = GetDBData( ScRange(aPos), SC_DB_IMPORT, SC_DBSEL_KEEP ); - DBG_ASSERT(pDBData, "kann DB-Daten nicht anlegen"); + OSL_ENSURE(pDBData, "kann DB-Daten nicht anlegen"); sTarget = pDBData->GetName(); } } @@ -378,10 +378,10 @@ void ScDocShell::Execute( SfxRequest& rReq ) bRowHeaders = aChartPositioner.HasRowHeaders(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); AbstractScColRowLabelDlg* pDlg = pFact->CreateScColRowLabelDlg( pParent, RID_SCDLG_CHARTCOLROW, bRowHeaders, bColHeaders); - DBG_ASSERT(pDlg, "Dialog create fail!"); + OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { bColHeaders = pDlg->IsRow(); @@ -517,7 +517,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) { ScRange aRange; ScTabViewShell* pViewSh = GetBestViewShell(); - DBG_ASSERT(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View"); + OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View"); if (pViewSh && pDBColl) { QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), @@ -900,10 +900,10 @@ void ScDocShell::Execute( SfxRequest& rReq ) sal_Bool bSheetProtected = aDocument.IsTabProtected(nActualTab); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, true,bSheetProtected); - DBG_ASSERT(pNewDlg, "Dialog create fail!"); + OSL_ENSURE(pNewDlg, "Dialog create fail!"); pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags ); if ( pNewDlg->Execute() == RET_OK ) { @@ -1306,7 +1306,7 @@ void ScDocShell::DoAutoStyle( const ScRange& rRange, const String& rStyle ) pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ); if (pStyleSheet) { - DBG_ASSERT(rRange.aStart.Tab() == rRange.aEnd.Tab(), + OSL_ENSURE(rRange.aStart.Tab() == rRange.aEnd.Tab(), "DoAutoStyle mit mehreren Tabellen"); SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); @@ -1398,7 +1398,7 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages String aStyleName = aDocument.GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { ScDocShellModificator aModificator( *this ); @@ -1433,7 +1433,7 @@ sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange ) String aStyleName = aDocument.GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { SfxItemSet& rSet = pStyleSheet->GetItemSet(); @@ -1566,7 +1566,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found! :-/" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pStyleSheet ) { @@ -1577,10 +1577,10 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, SfxItemSet& rStyleSet = pStyleSheet->GetItemSet(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE ); - DBG_ASSERT(pDlg, "Dialog create fail!"); + OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { @@ -1642,7 +1642,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStr, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found! :-/" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pStyleSheet ) { @@ -1732,14 +1732,14 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, } ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateScHFEditDlg( SfxViewFrame::Current(), GetActiveDialogParent(), rStyleSet, aStr, RID_SCDLG_HFEDIT, nResId); - DBG_ASSERT(pDlg, "Dialog create fail!"); + OSL_ENSURE(pDlg, "Dialog create fail!"); if ( pDlg->Execute() == RET_OK ) { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); @@ -1781,7 +1781,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStr, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found! :-/" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pStyleSheet ) { @@ -1986,7 +1986,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, Find( aDocument.GetPageStyle( nCurTab ), SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found! :-/" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pStyleSheet ) pStyleSet = &pStyleSheet->GetItemSet(); @@ -1994,7 +1994,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, rbHeader = rbFooter = false; } - DBG_ASSERT( pStyleSet, "PageStyle-Set not found! :-(" ); + OSL_ENSURE( pStyleSet, "PageStyle-Set not found! :-(" ); //-------------------------------------------------------------------- @@ -2211,8 +2211,8 @@ ScDocShell* ScDocShell::GetShellByNum( sal_uInt16 nDocNo ) // static IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) { - DBG_ASSERT( _pFileDlg, "ScDocShell::DialogClosedHdl(): no file dialog" ); - DBG_ASSERT( pImpl->pDocInserter, "ScDocShell::DialogClosedHdl(): no document inserter" ); + OSL_ENSURE( _pFileDlg, "ScDocShell::DialogClosedHdl(): no file dialog" ); + OSL_ENSURE( pImpl->pDocInserter, "ScDocShell::DialogClosedHdl(): no document inserter" ); if ( ERRCODE_NONE == _pFileDlg->GetError() ) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 07bc6e4c5d35..d2f72271dfce 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -213,7 +213,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize ) if (GetCreateMode() == SFX_CREATE_MODE_STANDARD) return; - DBG_ASSERT(pViewData,"pViewData==0 bei ScDocShell::UpdateOle"); + OSL_ENSURE(pViewData,"pViewData==0 bei ScDocShell::UpdateOle"); Rectangle aOldArea = SfxObjectShell::GetVisArea(); Rectangle aNewArea = aOldArea; diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 1d7ec23e50e9..1cf3a34d54a0 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -132,7 +132,7 @@ namespace _rDrvMgr.set( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_DRVMAN )) ), uno::UNO_QUERY); - DBG_ASSERT( _rDrvMgr.is(), "can't get DriverManager" ); + OSL_ENSURE( _rDrvMgr.is(), "can't get DriverManager" ); if (!_rDrvMgr.is()) return SCERR_EXPORT_CONNECT; // get connection @@ -146,7 +146,7 @@ namespace ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(),(rtl_TextEncoding) eCharSet); if ( aIter == aEncodings.end() ) { - DBG_ERRORFILE( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" ); + OSL_FAIL( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" ); return SCERR_IMPORT_CONNECT; } // if ( aIter == aMap.end() ) rtl::OUString aCharSetStr; @@ -199,7 +199,7 @@ sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObj } else { - DBG_ERRORFILE( "transfer command not available" ); + OSL_FAIL( "transfer command not available" ); } } catch( uno::Exception& ) @@ -246,7 +246,7 @@ sal_Bool ScDocShell::IsDocument( const INetURLObject& rURL ) catch( uno::Exception& ) { // ucb may throw different exceptions on failure now - warning only - DBG_WARNING( "Any other exception" ); + OSL_FAIL( "Any other exception" ); } return bRet; @@ -333,7 +333,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet uno::UNO_QUERY); ::utl::DisposableComponent aRowSetHelper(xRowSet); uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRowProp.is(), "can't get RowSet" ); + OSL_ENSURE( xRowProp.is(), "can't get RowSet" ); if (!xRowProp.is()) return SCERR_IMPORT_CONNECT; sal_Int32 nType = sdb::CommandType::TABLE; @@ -376,7 +376,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet static_cast<SCSIZE>(nRowCount) + 1 ); uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRow.is(), "can't get Row" ); + OSL_ENSURE( xRow.is(), "can't get Row" ); if (!xRow.is()) return SCERR_IMPORT_CONNECT; // currency flag is not needed for dBase @@ -853,23 +853,23 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet // create table uno::Reference<sdbcx::XTablesSupplier> xTablesSupp =xDDSup->getDataDefinitionByConnection( xConnection ); - DBG_ASSERT( xTablesSupp.is(), "can't get Data Definition" ); + OSL_ENSURE( xTablesSupp.is(), "can't get Data Definition" ); if (!xTablesSupp.is()) return SCERR_EXPORT_CONNECT; uno::Reference<container::XNameAccess> xTables = xTablesSupp->getTables(); - DBG_ASSERT( xTables.is(), "can't get Tables" ); + OSL_ENSURE( xTables.is(), "can't get Tables" ); if (!xTables.is()) return SCERR_EXPORT_CONNECT; uno::Reference<sdbcx::XDataDescriptorFactory> xTablesFact( xTables, uno::UNO_QUERY ); - DBG_ASSERT( xTablesFact.is(), "can't get tables factory" ); + OSL_ENSURE( xTablesFact.is(), "can't get tables factory" ); if (!xTablesFact.is()) return SCERR_EXPORT_CONNECT; uno::Reference<sdbcx::XAppend> xTablesAppend( xTables, uno::UNO_QUERY ); - DBG_ASSERT( xTablesAppend.is(), "can't get tables XAppend" ); + OSL_ENSURE( xTablesAppend.is(), "can't get tables XAppend" ); if (!xTablesAppend.is()) return SCERR_EXPORT_CONNECT; uno::Reference<beans::XPropertySet> xTableDesc = xTablesFact->createDataDescriptor(); - DBG_ASSERT( xTableDesc.is(), "can't get table descriptor" ); + OSL_ENSURE( xTableDesc.is(), "can't get table descriptor" ); if (!xTableDesc.is()) return SCERR_EXPORT_CONNECT; aAny <<= rtl::OUString( aTabName ); @@ -878,19 +878,19 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet // create columns uno::Reference<sdbcx::XColumnsSupplier> xColumnsSupp( xTableDesc, uno::UNO_QUERY ); - DBG_ASSERT( xColumnsSupp.is(), "can't get columns supplier" ); + OSL_ENSURE( xColumnsSupp.is(), "can't get columns supplier" ); if (!xColumnsSupp.is()) return SCERR_EXPORT_CONNECT; uno::Reference<container::XNameAccess> xColumns = xColumnsSupp->getColumns(); - DBG_ASSERT( xColumns.is(), "can't get columns" ); + OSL_ENSURE( xColumns.is(), "can't get columns" ); if (!xColumns.is()) return SCERR_EXPORT_CONNECT; uno::Reference<sdbcx::XDataDescriptorFactory> xColumnsFact( xColumns, uno::UNO_QUERY ); - DBG_ASSERT( xColumnsFact.is(), "can't get columns factory" ); + OSL_ENSURE( xColumnsFact.is(), "can't get columns factory" ); if (!xColumnsFact.is()) return SCERR_EXPORT_CONNECT; uno::Reference<sdbcx::XAppend> xColumnsAppend( xColumns, uno::UNO_QUERY ); - DBG_ASSERT( xColumnsAppend.is(), "can't get columns XAppend" ); + OSL_ENSURE( xColumnsAppend.is(), "can't get columns XAppend" ); if (!xColumnsAppend.is()) return SCERR_EXPORT_CONNECT; const rtl::OUString* pColNames = aColNames.getConstArray(); @@ -902,7 +902,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet for (nCol=0; nCol<nColCount; nCol++) { uno::Reference<beans::XPropertySet> xColumnDesc = xColumnsFact->createDataDescriptor(); - DBG_ASSERT( xColumnDesc.is(), "can't get column descriptor" ); + OSL_ENSURE( xColumnDesc.is(), "can't get column descriptor" ); if (!xColumnDesc.is()) return SCERR_EXPORT_CONNECT; aAny <<= pColNames[nCol]; @@ -929,7 +929,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet uno::UNO_QUERY); ::utl::DisposableComponent aRowSetHelper(xRowSet); uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRowProp.is(), "can't get RowSet" ); + OSL_ENSURE( xRowProp.is(), "can't get RowSet" ); if (!xRowProp.is()) return SCERR_EXPORT_CONNECT; aAny <<= xConnection; @@ -949,11 +949,11 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet // write data rows uno::Reference<sdbc::XResultSetUpdate> xResultUpdate( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xResultUpdate.is(), "can't get XResultSetUpdate" ); + OSL_ENSURE( xResultUpdate.is(), "can't get XResultSetUpdate" ); if (!xResultUpdate.is()) return SCERR_EXPORT_CONNECT; uno::Reference<sdbc::XRowUpdate> xRowUpdate( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRowUpdate.is(), "can't get XRowUpdate" ); + OSL_ENSURE( xRowUpdate.is(), "can't get XRowUpdate" ); if (!xRowUpdate.is()) return SCERR_EXPORT_CONNECT; SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow ); @@ -1075,7 +1075,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet // SQL error 22001: String length exceeds field width (after encoding). bool bEncErr = (nError == 22018); bool bIsOctetTextEncoding = rtl_isOctetTextEncoding( eCharSet); - DBG_ASSERT( !bEncErr || bIsOctetTextEncoding, "ScDocShell::DBaseExport: encoding error and not an octect textencoding"); + OSL_ENSURE( !bEncErr || bIsOctetTextEncoding, "ScDocShell::DBaseExport: encoding error and not an octect textencoding"); SCCOL nDocCol = nFirstCol; const sal_Int32* pColTypes = aColTypes.getConstArray(); const sal_Int32* pColLengths = aColLengths.getConstArray(); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index b503897ffa58..d8ed36826a91 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2287,7 +2287,7 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId) ScDocumentLoader::GetFilterName(*pFileName, aFilter, aOptions, true, false); sfx2::LinkManager* pLinkMgr = mpDoc->GetLinkManager(); ScExternalRefLink* pLink = new ScExternalRefLink(mpDoc, nFileId, aFilter); - DBG_ASSERT(pFileName, "ScExternalRefManager::insertExternalFileLink: file name pointer is NULL"); + OSL_ENSURE(pFileName, "ScExternalRefManager::insertExternalFileLink: file name pointer is NULL"); pLinkMgr->InsertFileLink(*pLink, OBJECT_CLIENT_FILE, *pFileName, &aFilter); pLink->SetDoReferesh(false); diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 2df30a6f090e..7bec48d4846c 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -294,7 +294,7 @@ void ScImportExport::EndPaste() sal_Bool ScImportExport::ImportData( const String& /* rMimeType */, const ::com::sun::star::uno::Any & /* rValue */ ) { - DBG_ASSERT( !this, "Implementation is missing" ); + OSL_ENSURE( !this, "Implementation is missing" ); return false; } @@ -343,7 +343,7 @@ sal_Bool ScImportExport::ImportString( const ::rtl::OUString& rText, sal_uLong n sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt ) { - DBG_ASSERT( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" ); + OSL_ENSURE( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" ); if ( nFmt != FORMAT_STRING ) { rtl_TextEncoding eEnc = gsl_getSystemTextEncoding(); @@ -375,7 +375,7 @@ sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt ) sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt ) { - DBG_ASSERT( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" ); + OSL_ENSURE( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" ); if ( eEnc == RTL_TEXTENCODING_UNICODE ) eEnc = gsl_getSystemTextEncoding(); @@ -472,7 +472,7 @@ sal_Bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, aDocName = pShell->GetTitle( SFX_TITLE_FULLNAME ); } - DBG_ASSERT( aDocName.Len(), "ClipBoard document has no name! :-/" ); + OSL_ENSURE( aDocName.Len(), "ClipBoard document has no name! :-/" ); if( aDocName.Len() ) { // Always use Calc A1 syntax for paste link. diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx index b3ec3e31d010..8bcd02e7204a 100644 --- a/sc/source/ui/docshell/pagedata.cxx +++ b/sc/source/ui/docshell/pagedata.cxx @@ -31,8 +31,6 @@ #include <string.h> -#include <tools/debug.hxx> - #include "pagedata.hxx" @@ -98,11 +96,11 @@ ScPageBreakData::~ScPageBreakData() ScPrintRangeData& ScPageBreakData::GetData(size_t nPos) { - DBG_ASSERT(nPos < nAlloc, "ScPageBreakData::GetData bumm"); + OSL_ENSURE(nPos < nAlloc, "ScPageBreakData::GetData bumm"); if ( nPos >= nUsed ) { - DBG_ASSERT(nPos == nUsed, "ScPageBreakData::GetData falsche Reihenfolge"); + OSL_ENSURE(nPos == nUsed, "ScPageBreakData::GetData falsche Reihenfolge"); nUsed = nPos+1; } |