diff options
Diffstat (limited to 'dbaccess/source/ui')
56 files changed, 269 insertions, 246 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 7ba35ca39d21..3d88509ebdc2 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -78,8 +78,8 @@ #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <com/sun/star/container/XHierarchicalName.hpp> /** === end UNO includes === **/ -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/string.hxx> #include <svl/urihelper.hxx> @@ -483,7 +483,7 @@ sal_Bool OApplicationController::Construct(Window* _pParent) return sal_False; } - DBG_ASSERT( getView(), "OApplicationController::Construct: have no view!" ); + OSL_ENSURE( getView(), "OApplicationController::Construct: have no view!" ); if ( getView() ) getView()->enableSeparator( ); @@ -508,7 +508,7 @@ void SAL_CALL OApplicationController::disposing(const EventObject& _rSource) thr Reference<XConnection> xCon(_rSource.Source, UNO_QUERY); if ( xCon.is() ) { - DBG_ASSERT( m_xDataSourceConnection == xCon, + OSL_ENSURE( m_xDataSourceConnection == xCon, "OApplicationController::disposing: which connection does this come from?" ); if ( getContainer() && getContainer()->getElementType() == E_TABLE ) @@ -2719,7 +2719,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > return sal_False; } - DBG_ASSERT( !( m_xModel.is() && ( m_xModel != _rxModel ) ), + OSL_ENSURE( !( m_xModel.is() && ( m_xModel != _rxModel ) ), "OApplicationController::attachModel: missing implementation: setting a new model while we have another one!" ); // at least: remove as property change listener from the old model/data source diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index d2613c93c66d..7d5745ccfcb1 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -51,7 +51,6 @@ #include <com/sun/star/sdbcx/XViewsSupplier.hpp> #include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp> #include <com/sun/star/sdbcx/XDrop.hpp> -#include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbhelper.hxx> #include "dlgsave.hxx" @@ -91,6 +90,7 @@ #include <sfx2/docfilt.hxx> #include <svtools/fileview.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "defaultobjectnamecheck.hxx" #include <osl/mutex.hxx> #include "subcomponentmanager.hxx" @@ -680,7 +680,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc // create a new object Reference< XPropertySet > xNewQuery(xQueryFactory->createInstance(), UNO_QUERY); - DBG_ASSERT(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); + OSL_ENSURE(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); if (xNewQuery.is()) { // initialize diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 906607406e3a..1af86b65d2d7 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -75,6 +75,7 @@ #include <svx/dbaexchange.hxx> #include <toolkit/unohlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> #include <vcl/mnemonic.hxx> @@ -226,7 +227,7 @@ void OApplicationController::openDialog( const ::rtl::OUString& _sServiceName ) Reference< ::com::sun::star::awt::XWindow> xWindow = getTopMostContainerWindow(); if ( !xWindow.is() ) { - DBG_ASSERT( getContainer(), "OApplicationController::Construct: have no view!" ); + OSL_ENSURE( getContainer(), "OApplicationController::Construct: have no view!" ); if ( getContainer() ) xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent()); } diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index c104799aa2cc..4e629c52d1ed 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "AppDetailView.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "dbu_app.hrc" #include "AppView.hxx" @@ -138,7 +138,7 @@ void OCreationList::PreparePaint( SvLBoxEntry* _pEntry ) void OCreationList::SelectSearchEntry( const void* _pEntry ) { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); - DBG_ASSERT( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" ); + OSL_ENSURE( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" ); if ( pEntry ) setCurrentEntryInvalidate( pEntry ); @@ -151,8 +151,8 @@ void OCreationList::SelectSearchEntry( const void* _pEntry ) void OCreationList::ExecuteSearchEntry( const void* _pEntry ) { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); - DBG_ASSERT( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); - DBG_ASSERT( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" ); + OSL_ENSURE( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); + OSL_ENSURE( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" ); if ( pEntry ) onSelected( pEntry ); @@ -168,7 +168,7 @@ Rectangle OCreationList::GetFocusRect( SvLBoxEntry* _pEntry, long _nLine ) SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ); SvLBoxTab* pTab = pBitmapItem ? GetTab( _pEntry, pBitmapItem ) : NULL; SvViewDataItem* pItemData = pBitmapItem ? GetViewDataItem( _pEntry, pBitmapItem ) : NULL; - DBG_ASSERT( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" ); + OSL_ENSURE( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" ); if ( pTab && pItemData ) aRect.Left() = pTab->GetPos() - pItemData->aSize.Width() / 2; @@ -212,7 +212,7 @@ void OCreationList::MouseButtonDown( const MouseEvent& rMEvt ) { SvTreeListBox::MouseButtonDown( rMEvt ); - DBG_ASSERT( !m_pMouseDownEntry, "OCreationList::MouseButtonDown: I missed some mouse event!" ); + OSL_ENSURE( !m_pMouseDownEntry, "OCreationList::MouseButtonDown: I missed some mouse event!" ); m_pMouseDownEntry = GetCurEntry(); if ( m_pMouseDownEntry ) { @@ -234,14 +234,14 @@ void OCreationList::MouseMove( const MouseEvent& rMEvt ) if ( m_pMouseDownEntry ) { // we're currently in a "mouse down" phase - DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseMove: inconsistence (1)!" ); + OSL_ENSURE( IsMouseCaptured(), "OCreationList::MouseMove: inconsistence (1)!" ); if ( pEntry == m_pMouseDownEntry ) { setCurrentEntryInvalidate( m_pMouseDownEntry ); } else { - DBG_ASSERT( ( GetCurEntry() == m_pMouseDownEntry ) || !GetCurEntry(), + OSL_ENSURE( ( GetCurEntry() == m_pMouseDownEntry ) || !GetCurEntry(), "OCreationList::MouseMove: inconsistence (2)!" ); setCurrentEntryInvalidate( NULL ); } @@ -274,7 +274,7 @@ void OCreationList::MouseButtonUp( const MouseEvent& rMEvt ) if ( m_pMouseDownEntry ) { - DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseButtonUp: hmmm .... no mouse captured, but an active entry?" ); + OSL_ENSURE( IsMouseCaptured(), "OCreationList::MouseButtonUp: hmmm .... no mouse captured, but an active entry?" ); ReleaseMouse(); InvalidateEntry( m_pMouseDownEntry ); @@ -315,7 +315,7 @@ void OCreationList::updateHelpText() // ----------------------------------------------------------------------------- void OCreationList::onSelected( SvLBoxEntry* _pEntry ) const { - DBG_ASSERT( _pEntry, "OCreationList::onSelected: invalid entry!" ); + OSL_ENSURE( _pEntry, "OCreationList::onSelected: invalid entry!" ); URL aCommand; aCommand.Complete = reinterpret_cast< TaskEntry* >( _pEntry->GetUserData() )->sUNOCommand; m_rTaskWindow.getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index d713059a3fcf..ea1776f3f957 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -95,6 +95,7 @@ #include <svx/svxdlg.hxx> #include <tools/color.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> @@ -874,7 +875,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) // set the callbacks for the grid control SbaGridControl* pVclGrid = getBrowserView()->getVclControl(); - DBG_ASSERT(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); + OSL_ENSURE(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); pVclGrid->SetMasterListener(this); // -------------------------- @@ -1245,7 +1246,7 @@ void SbaXDataBrowserController::modified(const ::com::sun::star::lang::EventObje void SbaXDataBrowserController::elementInserted(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementInserted" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementInserted: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xNewColumn(evt.Element,UNO_QUERY); if ( xNewColumn.is() ) @@ -1256,7 +1257,7 @@ void SbaXDataBrowserController::elementInserted(const ::com::sun::star::containe void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementRemoved" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementRemoved: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.Element,UNO_QUERY); if ( xOldColumn.is() ) @@ -1267,7 +1268,7 @@ void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementReplaced" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementReplaced: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.ReplacedElement,UNO_QUERY); if ( xOldColumn.is() ) @@ -1282,7 +1283,7 @@ void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::containe sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::suspend" ); - DBG_ASSERT(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); + OSL_ENSURE(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); m_aAsyncGetCellFocus.CancelCall(); m_aAsyncDisplayError.CancelCall(); @@ -1483,13 +1484,13 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for { Reference< XPropertySet > xParam; ::cppu::extractInterface(xParam, aRequest.Parameters->getByIndex(i)); - DBG_ASSERT(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); + OSL_ENSURE(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); if (xParam.is()) { #ifdef DBG_UTIL ::rtl::OUString sName; xParam->getPropertyValue(PROPERTY_NAME) >>= sName; - DBG_ASSERT(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); + OSL_ENSURE(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); #endif try { xParam->setPropertyValue(PROPERTY_VALUE, pFinalValues->Value); } catch(Exception&) @@ -1519,7 +1520,7 @@ sal_Bool SbaXDataBrowserController::approveReset(const ::com::sun::star::lang::E void SbaXDataBrowserController::resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::resetted" ); - DBG_ASSERT(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); + OSL_ENSURE(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); (void)rEvent; setCurrentModified( sal_False ); } @@ -1944,11 +1945,11 @@ void SbaXDataBrowserController::ExecuteSearch() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::ExecuteSearch" ); // calculate the control source of the active field Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); - DBG_ASSERT(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); + OSL_ENSURE(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); Reference< ::com::sun::star::form::XGridPeer > xGridPeer(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY); Reference< ::com::sun::star::container::XIndexContainer > xColumns = xGridPeer->getColumns(); - DBG_ASSERT(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); + OSL_ENSURE(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); sal_Int16 nViewCol = xGrid->getCurrentColumnPosition(); sal_Int16 nModelCol = getBrowserView()->View2ModelPos(nViewCol); @@ -1966,7 +1967,7 @@ void SbaXDataBrowserController::ExecuteSearch() // prohibit the synchronization of the grid's display with the cursor's position Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_False))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), makeAny(sal_Int32(COL_LIGHTRED))); @@ -1981,7 +1982,7 @@ void SbaXDataBrowserController::ExecuteSearch() aContextNames.push_back( String::CreateFromAscii("Standard") ); pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); } - DBG_ASSERT( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); + OSL_ENSURE( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); if ( pDialog ) { pDialog->SetActiveField( sActiveField ); @@ -2499,9 +2500,9 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // check all grid columns for their control source Reference< ::com::sun::star::container::XIndexAccess > xModelColumns(getFormComponent(), UNO_QUERY); - DBG_ASSERT(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); + OSL_ENSURE(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); // the case 'no columns' should be indicated with an empty container, I think ... - DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); + OSL_ENSURE(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); String sFieldList; for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos) @@ -2530,7 +2531,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // if the cursor is in a mode other than STANDARD -> reset Reference< XPropertySet > xCursorSet(pContext->xCursor, UNO_QUERY); - DBG_ASSERT(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), + OSL_ENSURE(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), "SbaXDataBrowserController::OnSearchContextRequest : please do not call for cursors with modified rows !"); if (xCursorSet.is() && ::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISNEW))) { @@ -2544,14 +2545,14 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pInfo) { Reference< ::com::sun::star::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY); - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); // let the grid snyc it's display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); @@ -2585,7 +2586,7 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio try { - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); } @@ -2598,7 +2599,7 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio { // let the grid snyc its display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); @@ -2752,7 +2753,7 @@ void SbaXDataBrowserController::enterFormAction() //------------------------------------------------------------------------------ void SbaXDataBrowserController::leaveFormAction() { - DBG_ASSERT( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); + OSL_ENSURE( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); if ( --m_nFormActionNestingLevel > 0 ) return; @@ -2877,7 +2878,7 @@ void LoadFormHelper::implDispose() void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); - DBG_ASSERT(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); + OSL_ENSURE(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); if (m_eState == STARTED) m_eState = LOADED; } diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 6929a9ee162b..1e4b8350aa72 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/awt/XControlContainer.hpp> #include "UITools.hxx" +#include <osl/diagnose.h> using namespace dbaui; @@ -105,7 +106,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont // create the (UNO-) control m_xGrid = new SbaXGridControl(getORB()); - DBG_ASSERT(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); + OSL_ENSURE(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); // in design mode (for the moment) m_xGrid->setDesignMode(sal_True); @@ -123,7 +124,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont m_pVclControl = NULL; getVclControl(); - DBG_ASSERT(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); + OSL_ENSURE(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); } catch(Exception&) { diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 27854f3c69f2..1990ab422ec2 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -33,7 +33,7 @@ #include "browserids.hxx" #include "listviewitems.hxx" #include "imageprovider.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbtreeview.hxx" #include "dbtreelistbox.hxx" #include "dbu_brw.hrc" @@ -50,7 +50,7 @@ namespace dbaui // ----------------------------------------------------------------------------- SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getChildType( SvLBoxEntry* _pEntry ) const { - DBG_ASSERT(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); + OSL_ENSURE(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); switch (getEntryType(_pEntry)) { case etTableContainer: diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index 9497d08f5076..b9c9e8211642 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -51,6 +51,7 @@ #include <svtools/treelist.hxx> #include <svx/dataaccessdescriptor.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <functional> // ......................................................................... @@ -278,7 +279,7 @@ namespace dbaui if ( pData->xConnection.is() ) { - DBG_ASSERT( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); + OSL_ENSURE( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); // connections are to be stored *only* at the data source entries impl_releaseConnection( pData->xConnection ); } diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index 2a02d3827f56..bf69025fa344 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -31,6 +31,7 @@ #include "formadapter.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/types.hxx> #include <comphelper/enumhelper.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -192,7 +193,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe if (xNewMaster == m_xMainForm) return; - DBG_ASSERT(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); + OSL_ENSURE(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); if (m_xMainForm.is()) { @@ -1188,7 +1189,7 @@ void SAL_CALL SbaXFormAdapter::removeEventListener(const Reference< ::com::sun:: void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any& aValue) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) { @@ -1221,7 +1222,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any Any SAL_CALL SbaXFormAdapter::getFastPropertyValue(sal_Int32 nHandle) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) return makeAny(m_sName); @@ -1315,7 +1316,7 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< ::rt // search for (and fake) the NAME property const ::rtl::OUString* pNames = aPropertyNames.getConstArray(); Any* pValues = aReturn.getArray(); - DBG_ASSERT(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); + OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i, ++pNames, ++pValues) if (pNames->equals(PROPERTY_NAME)) { @@ -1497,7 +1498,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const :: if (sal::static_int_cast< sal_uInt32 >(nIndex) > m_aChildren.size()) nIndex = m_aChildren.size(); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); m_aChildren.insert(m_aChildren.begin() + nIndex, xElement); m_aChildNames.insert(m_aChildNames.begin() + nIndex, sName); @@ -1616,7 +1617,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( ::com::su Reference< ::com::sun::star::form::XFormComponent > xAffected = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); m_aChildren.erase(m_aChildren.begin() + _rIndex); m_aChildNames.erase(m_aChildNames.begin() + _rIndex); @@ -1675,7 +1676,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem Reference< ::com::sun::star::form::XFormComponent > xOld = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); *(m_aChildren.begin() + _rIndex) = xElement; *(m_aChildNames.begin() + _rIndex) = sName; @@ -1750,7 +1751,7 @@ void SAL_CALL SbaXFormAdapter::propertyChange(const ::com::sun::star::beans::Pro if(aIter != m_aChildren.end()) { sal_Int32 nPos = aIter - m_aChildren.begin(); - DBG_ASSERT(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); + OSL_ENSURE(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); *(m_aChildNames.begin() + nPos) = ::comphelper::getString(evt.NewValue); } } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index fda42e1afa80..43dbaeb30555 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -35,8 +35,8 @@ #include <vcl/svapp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include "dataview.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "dbustrings.hrc" #include <vcl/stdtext.hxx> #include <cppuhelper/typeprovider.hxx> @@ -262,7 +262,7 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/) fillSupportedFeatures(); // create the database context - DBG_ASSERT(getORB().is(), "OGenericUnoController::Construct need a service factory!"); + OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!"); try { m_xDatabaseContext = Reference< XNameAccess >(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); @@ -678,7 +678,7 @@ void OGenericUnoController::InvalidateAll_Impl() { ::osl::MutexGuard aGuard( m_aFeatureMutex); - DBG_ASSERT(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); + OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); m_aFeaturesToInvalidate.pop_front(); if(!m_aFeaturesToInvalidate.empty()) m_aAsyncInvalidateAll.Call(); @@ -914,7 +914,7 @@ void OGenericUnoController::implDescribeSupportedFeature( const sal_Char* _pAsci sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup ) { #ifdef DBG_UTIL - DBG_ASSERT( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); + OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); #endif OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" ); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index e8c78a5eca70..3d160de6a8e1 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -110,6 +110,7 @@ #include <vcl/stdtext.hxx> #include "UITools.hxx" #include "TokenWriter.hxx" +#include <osl/diagnose.h> using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; @@ -251,7 +252,7 @@ void SAL_CALL SbaXGridControl::createPeer(const Reference< ::com::sun::star::awt { FmXGridControl::createPeer(rToolkit, rParentPeer); - DBG_ASSERT(/*(0 == m_nPeerCreationLevel) && */!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); + OSL_ENSURE(!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); // see the base class' createPeer for a comment on this // 14.05.2001 - 86836 - frank.schoenheit@germany.sun.com @@ -544,7 +545,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnAttribs: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColAttrs(nColId); @@ -553,7 +554,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnWidth: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColWidth(nColId); @@ -1266,7 +1267,7 @@ void SbaGridControl::Command(const CommandEvent& rEvt) void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); - DBG_ASSERT(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); + OSL_ENSURE(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); Reference< XPropertySet > xAffectedCol; Reference< XPropertySet > xAffectedField; @@ -1302,7 +1303,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) // ----------------------------------------------------------------------- void SbaGridControl::CopySelectedRowsToClipboard() { - DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + OSL_ENSURE( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); } @@ -1316,7 +1317,7 @@ void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xForm( getDataSource(), UNO_QUERY ); - DBG_ASSERT( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); + OSL_ENSURE( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); // build the sequence of numbers of selected rows Sequence< Any > aSelectedRows; @@ -1531,7 +1532,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) if (IsCurrentAppending()) --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one - DBG_ASSERT((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); + OSL_ENSURE((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); // AcceptDrop should have caught this // from now we work with ids instead of positions diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 915fc3688c07..be53d24074c5 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -124,6 +124,7 @@ #include <svx/databaseregistrationui.hxx> #include <toolkit/unohlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/multisel.hxx> #include <tools/urlobj.hxx> #include <unotools/confignode.hxx> @@ -903,7 +904,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv { if ( _rEvent.FeatureURL.Complete == aLoop->second.aURL.Complete) { - DBG_ASSERT( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); + OSL_ENSURE( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); // update the enabled state aLoop->second.bEnabled = _rEvent.IsEnabled; @@ -941,7 +942,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv } } - DBG_ASSERT(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); + OSL_ENSURE(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); } // ------------------------------------------------------------------------- @@ -1034,11 +1035,11 @@ namespace // ------------------------------------------------------------------------- String SbaTableQueryBrowser::getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const { - DBG_ASSERT( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); + OSL_ENSURE( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); - DBG_ASSERT( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); - DBG_ASSERT( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); + OSL_ENSURE( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); + OSL_ENSURE( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); return pData->sAccessor.Len() ? pData->sAccessor : GetEntryText( _pDataSourceEntry ); } @@ -1071,7 +1072,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS // add new entries to the list box model implAddDatasource( _rDataSource, _rxConnection ); pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); - DBG_ASSERT( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); + OSL_ENSURE( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } } if (_ppDataSourceEntry) @@ -1174,7 +1175,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri void SbaTableQueryBrowser::connectExternalDispatches() { Reference< XDispatchProvider > xProvider( getFrame(), UNO_QUERY ); - DBG_ASSERT(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); + OSL_ENSURE(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); if (xProvider.is()) { if ( m_aExternalFeatures.empty() ) @@ -1719,7 +1720,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const case CommandType::COMMAND: sTitle = String(ModuleRes(STR_QRY_TITLE)); break; default: - DBG_ASSERT(sal_False, "SbaTableQueryBrowser::GetState: unknown command type!"); + OSL_ENSURE(sal_False, "SbaTableQueryBrowser::GetState: unknown command type!"); } ::rtl::OUString aName; xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; @@ -2190,7 +2191,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) { - DBG_ASSERT(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); + OSL_ENSURE(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); if (!_pEntry) return sal_False; @@ -2864,8 +2865,8 @@ void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnecti // ------------------------------------------------------------------------- void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) { - DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); + OSL_ENSURE( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); if ( _pDSEntry ) { @@ -2878,8 +2879,8 @@ void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) // ------------------------------------------------------------------------- void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDisposeConnection) { - DBG_ASSERT(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); + OSL_ENSURE(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); // if one of the entries of the given DS is displayed currently, unload the form if (m_pCurrentlyDisplayed && (m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) == _pDSEntry)) @@ -3255,7 +3256,7 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection( SvLBoxEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) { - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); if(_pDSEntry) { DBTreeListUserData* pTreeListData = static_cast<DBTreeListUserData*>(pDSData); @@ -3294,7 +3295,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); SvLBoxEntry* pRHS = static_cast<SvLBoxEntry*>(_pSortData->pRight); - DBG_ASSERT(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); + OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); // we want the table entry and the end so we have to do a check if (isContainer(pRHS)) @@ -3330,7 +3331,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); + OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); String sRightText = pRightTextItem->GetText(); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index db5bc13ac1e3..2ba20cbe44cd 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -36,7 +36,6 @@ #include "FieldDescControl.hxx" #include "FieldControls.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "TableDesignHelpBar.hxx" #include <vcl/scrbar.hxx> @@ -71,6 +70,7 @@ #include <memory> #include "dbu_control.hrc" #include "dbu_tbl.hrc" +#include <osl/diagnose.h> using namespace dbaui; @@ -1759,7 +1759,7 @@ void OFieldDescControl::GetFocus() void OFieldDescControl::implFocusLost(Window* _pWhich) { DBG_CHKTHIS(OFieldDescControl,NULL); - DBG_ASSERT(!_pWhich || IsChild(_pWhich), "OFieldDescControl::implFocusLost : invalid window !"); + OSL_ENSURE(!_pWhich || IsChild(_pWhich), "OFieldDescControl::implFocusLost : invalid window !"); ////////////////////////////////////////////////////////////////////// // Das aktive Control merken diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index b92fa0014b36..2c9ab0b8b841 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -33,7 +33,6 @@ #include <svtools/editbrowsebox.hxx> #include <com/sun/star/beans/XPropertySet.hpp> -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "TableConnectionData.hxx" #include "TableConnection.hxx" @@ -45,7 +44,7 @@ #include "RelControliFace.hxx" #include "dbu_control.hrc" #include "dbaccess_helpid.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <algorithm> @@ -496,7 +495,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent // ----------------------------------------------------------------------------- void OTableListBoxControl::fillListBoxes() { - DBG_ASSERT( !m_pTableMap->empty(), "OTableListBoxControl::fillListBoxes: no table window!"); + OSL_ENSURE( !m_pTableMap->empty(), "OTableListBoxControl::fillListBoxes: no table window!"); OTableWindow* pInitialLeft = NULL; OTableWindow* pInitialRight = NULL; @@ -583,7 +582,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent OTableWindow* pLoop = NULL; if( aFind != m_pTableMap->end() ) pLoop = aFind->second; - DBG_ASSERT(pLoop != NULL, "ORelationDialog::OnTableChanged : ungueltiger Eintrag in ListBox !"); + OSL_ENSURE(pLoop != NULL, "ORelationDialog::OnTableChanged : ungueltiger Eintrag in ListBox !"); // da ich die ListBoxen selber mit eben diesen Tabellennamen, mit denen ich sie jetzt vergleiche, gefuellt habe, // MUSS ich strSelected finden if (pListBox == &m_lmbLeftTable) diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index bd72946958ca..35f3440575b7 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -36,6 +36,7 @@ #include <svl/itemset.hxx> #include <svl/stritem.hxx> +#include <osl/diagnose.h> //........................................................................ namespace dbaui @@ -104,7 +105,7 @@ namespace dbaui if ( GetSelectEntryPos() != GetSavedValue() ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findDisplayName( GetSelectEntry() ); - DBG_ASSERT( aFind != m_aCharSets.end(), "CharSetListBox::StoreSelectedCharSet: could not translate the selected character set!" ); + OSL_ENSURE( aFind != m_aCharSets.end(), "CharSetListBox::StoreSelectedCharSet: could not translate the selected character set!" ); if ( aFind != m_aCharSets.end() ) { _rSet.Put( SfxStringItem( _nItemId, (*aFind).getIanaName() ) ); diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 43f8ae2e6a57..70d7a6450448 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -31,6 +31,7 @@ #include "curledit.hxx" #include <vcl/svapp.hxx> +#include <osl/diagnose.h> //......................................................................... namespace dbaui @@ -63,7 +64,7 @@ OConnectionURLEdit::~OConnectionURLEdit() //------------------------------------------------------------------------- void OConnectionURLEdit::SetTextNoPrefix(const String& _rText) { - DBG_ASSERT(GetSubEdit(), "OConnectionURLEdit::SetTextNoPrefix: have no current type, not changing the text!"); + OSL_ENSURE(GetSubEdit(), "OConnectionURLEdit::SetTextNoPrefix: have no current type, not changing the text!"); if (GetSubEdit()) GetSubEdit()->SetText(_rText); } diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index f8c03ee4516b..c95a48c84079 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -49,6 +49,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <tools/urlobj.hxx> #include <svl/filenotation.hxx> +#include <osl/diagnose.h> //........................................................................ namespace dbaui @@ -185,7 +186,7 @@ namespace dbaui //-------------------------------------------------------------------- void OpenDocumentButton::impl_init( const sal_Char* _pAsciiModuleName ) { - DBG_ASSERT( _pAsciiModuleName, "OpenDocumentButton::impl_init: invalid module name!" ); + OSL_ENSURE( _pAsciiModuleName, "OpenDocumentButton::impl_init: invalid module name!" ); m_sModule = ::rtl::OUString::createFromAscii( _pAsciiModuleName ); // our label should equal the UI text of the "Open" command @@ -215,7 +216,7 @@ namespace dbaui //-------------------------------------------------------------------- void OpenDocumentListBox::impl_init( const sal_Char* _pAsciiModuleName ) { - DBG_ASSERT( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" ); + OSL_ENSURE( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" ); Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( ePICKLIST ); Reference< XNameAccess > xFilterFactory; @@ -291,7 +292,7 @@ namespace dbaui OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( USHORT _nListIndex, bool _bSystemNotation ) const { MapIndexToStringPair::const_iterator pos = m_aURLs.find( _nListIndex ); - DBG_ASSERT( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); + OSL_ENSURE( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); StringPair aDocumentDescriptor; if ( pos != m_aURLs.end() ) diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 9503c88d9746..db0ede9f73e0 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -50,6 +50,7 @@ #include "commontypes.hxx" #include "listviewitems.hxx" #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <connectivity/dbmetadata.hxx> @@ -387,14 +388,14 @@ void OTableTreeListBox::checkedButton_noBroadcast(SvLBoxEntry* _pEntry) // So we track explicit (un)checking SvButtonState eState = GetCheckButtonState(_pEntry); - DBG_ASSERT(SV_BUTTON_TRISTATE != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?"); + OSL_ENSURE(SV_BUTTON_TRISTATE != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?"); implEmphasize(_pEntry, SV_BUTTON_CHECKED == eState); } //------------------------------------------------------------------------ void OTableTreeListBox::implEmphasize(SvLBoxEntry* _pEntry, sal_Bool _bChecked, sal_Bool _bUpdateDescendants, sal_Bool _bUpdateAncestors) { - DBG_ASSERT(_pEntry, "OTableTreeListBox::implEmphasize: invalid entry (NULL)!"); + OSL_ENSURE(_pEntry, "OTableTreeListBox::implEmphasize: invalid entry (NULL)!"); // special emphasizing handling for the "all objects" entry // 89709 - 16.07.2001 - frank.schoenheit@sun.com @@ -438,9 +439,9 @@ void OTableTreeListBox::InitEntry(SvLBoxEntry* _pEntry, const XubString& _rStrin // replace the text item with our own one SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING); - DBG_ASSERT(pTextItem, "OTableTreeListBox::InitEntry: no text item!?"); + OSL_ENSURE(pTextItem, "OTableTreeListBox::InitEntry: no text item!?"); sal_uInt16 nTextPos = _pEntry->GetPos(pTextItem); - DBG_ASSERT(((sal_uInt16)-1) != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); + OSL_ENSURE(((sal_uInt16)-1) != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); _pEntry->ReplaceItem(new OBoldListboxString(_pEntry, 0, _rString), nTextPos); } diff --git a/dbaccess/source/ui/dlg/AdabasStat.cxx b/dbaccess/source/ui/dlg/AdabasStat.cxx index 59b453d80fcc..26f6d9537086 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.cxx +++ b/dbaccess/source/ui/dlg/AdabasStat.cxx @@ -29,9 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#include <tools/debug.hxx> #include <cppuhelper/exc_hlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "AdabasStat.hxx" #include <comphelper/types.hxx> #include <com/sun/star/sdbc/XStatement.hpp> @@ -84,7 +84,7 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, FreeResource(); - DBG_ASSERT(m_xConnection.is(),"No connection"); + OSL_ENSURE(m_xConnection.is(),"No connection"); if(m_xConnection.is()) { Reference<XStatement> xStmt; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index d9e52edeaa1b..f3272593a4ac 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -45,6 +45,7 @@ #include "dbaccess_helpid.hrc" #include "localresaccess.hxx" #include <osl/process.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <sfx2/filedlghelper.hxx> #include "dbadmin.hxx" @@ -119,7 +120,7 @@ DBG_NAME(OConnectionHelper) if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); m_aPB_Connection.SetClickHdl(LINK(this, OConnectionHelper, OnBrowseConnections)); - DBG_ASSERT(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !"); m_aConnectionURL.SetTypeCollection(m_pCollection); } @@ -438,7 +439,7 @@ DBG_NAME(OConnectionHelper) void OConnectionHelper::impl_setURL( const String& _rURL, sal_Bool _bPrefix ) { String sURL( _rURL ); - DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); + OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); if ( m_pCollection && sURL.Len() ) { @@ -484,7 +485,7 @@ DBG_NAME(OConnectionHelper) // get the pure text String sURL = _bPrefix ? m_aConnectionURL.GetText() : m_aConnectionURL.GetTextNoPrefix(); - DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" ); + OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" ); if ( m_pCollection && sURL.Len() ) { diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index dbb348fe1cb2..9d16da80cb26 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -66,6 +66,7 @@ #include <unotools/pathoptions.hxx> #include <svtools/roadmapwizard.hxx> #include "TextConnectionHelper.hxx" +#include <osl/diagnose.h> //......................................................................... @@ -202,7 +203,7 @@ DBG_NAME(OTextConnectionPageSetup) ::dbaccess::ODsnTypeCollection* pCollection = NULL; if (pCollectionItem) pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); + OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); String sUrl = pCollection->getPrefix( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap:"))); sUrl += m_aETHostServer.GetText(); diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 83e42119c1e5..b1d6ae683a5e 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -76,6 +76,7 @@ #include <svl/stritem.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <typelib/typedescription.hxx> #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> @@ -110,7 +111,7 @@ namespace sal_Bool bCorrectType = sal_False; SfxItemPool* pPool = _rSet.GetPool(); - DBG_ASSERT( pPool, "implCheckItemType: invalid item pool!" ); + OSL_ENSURE( pPool, "implCheckItemType: invalid item pool!" ); if ( pPool ) { const SfxPoolItem& rDefItem = pPool->GetDefaultItem( _nId ); @@ -238,12 +239,12 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer ShowServiceNotAvailableError(_pParent->GetParent(), String(SERVICE_SDB_DATABASECONTEXT), sal_True); } - DBG_ASSERT(m_xDynamicContext.is(), "ODbAdminDialog::ODbAdminDialog : no XNamingService interface !"); + OSL_ENSURE(m_xDynamicContext.is(), "ODbAdminDialog::ODbAdminDialog : no XNamingService interface !"); } //------------------------------------------------------------------------- sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyValue >& _rDriverParam) { - DBG_ASSERT(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::getCurrentSettings : not to be called without an example set!"); + OSL_ENSURE(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::getCurrentSettings : not to be called without an example set!"); if (!m_pItemSetHelper->getOutputSet()) return sal_False; @@ -356,7 +357,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert //------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::successfullyConnected() { - DBG_ASSERT(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::successfullyConnected: not to be called without an example set!"); + OSL_ENSURE(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::successfullyConnected: not to be called without an example set!"); if (!m_pItemSetHelper->getOutputSet()) return; @@ -422,7 +423,7 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::O try { xDriverManager = Reference< XDriverAccess >(getORB()->createInstance(SERVICE_SDBC_CONNECTIONPOOL), UNO_QUERY); - DBG_ASSERT(xDriverManager.is(), "ODbDataSourceAdministrationHelper::getDriver: could not instantiate the driver manager, or it does not provide the necessary interface!"); + OSL_ENSURE(xDriverManager.is(), "ODbDataSourceAdministrationHelper::getDriver: could not instantiate the driver manager, or it does not provide the necessary interface!"); } catch (Exception& e) { @@ -477,16 +478,16 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc } - DBG_ASSERT(m_xDatasource.is(), "ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!"); + OSL_ENSURE(m_xDatasource.is(), "ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!"); return m_xDatasource; } //------------------------------------------------------------------------- ::rtl::OUString ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) { SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True ); - DBG_ASSERT( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); + OSL_ENSURE( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); SFX_ITEMSET_GET(_rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); - DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); return pCollection->getType(pConnectURL->GetValue()); } @@ -507,9 +508,9 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); - DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); - DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); + OSL_ENSURE(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); switch( pCollection->determineType(eType) ) { @@ -706,7 +707,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr //------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _rSource, const Reference< XPropertySet >& _rxDest) { - DBG_ASSERT(_rxDest.is(), "ODbDataSourceAdministrationHelper::translateProperties: invalid property set!"); + OSL_ENSURE(_rxDest.is(), "ODbDataSourceAdministrationHelper::translateProperties: invalid property set!"); if (!_rxDest.is()) return; @@ -1058,7 +1059,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet TypeDescription aTD(_rValue.getValueType()); typelib_IndirectTypeDescription* pSequenceTD = reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get()); - DBG_ASSERT(pSequenceTD && pSequenceTD->pType, "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid sequence type!"); + OSL_ENSURE(pSequenceTD && pSequenceTD->pType, "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid sequence type!"); Type aElementType(pSequenceTD->pType); switch (aElementType.getTypeClass()) @@ -1111,9 +1112,9 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); - DBG_ASSERT(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); - DBG_ASSERT(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); + OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); USHORT nPortNumberId = 0; sal_Int32 nPortNumber = -1; @@ -1175,7 +1176,7 @@ sal_Bool ODbDataSourceAdministrationHelper::saveChanges(const SfxItemSet& _rSour // ----------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::setDataSourceOrName( const Any& _rDataSourceOrName ) { - DBG_ASSERT( !m_aDataSourceOrName.hasValue(), "ODbDataSourceAdministrationHelper::setDataSourceOrName: already have one!" ); + OSL_ENSURE( !m_aDataSourceOrName.hasValue(), "ODbDataSourceAdministrationHelper::setDataSourceOrName: already have one!" ); // hmm. We could reset m_xDatasource/m_xModel, probably, and continue working m_aDataSourceOrName = _rDataSourceOrName; } diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 432b45a3d3eb..5c71bf0bc6b3 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -36,7 +36,7 @@ #include "moduledbu.hxx" #include "dbu_dlg.hrc" #include "dbfindex.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <unotools/localfilehelper.hxx> #include <tools/urlobj.hxx> #include <unotools/pathoptions.hxx> @@ -166,7 +166,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const String& _rName, TableIndexL } (void)_bMustExist; - DBG_ASSERT(!_bMustExist || (aSearch != _rList.end()), "ODbaseIndexDialog::implRemoveIndex : did not find the index!"); + OSL_ENSURE(!_bMustExist || (aSearch != _rList.end()), "ODbaseIndexDialog::implRemoveIndex : did not find the index!"); return aReturn; } diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index c09b34bb151f..75e0cc73a71d 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -92,6 +92,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/sequenceashashmap.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <connectivity/DriversConfig.hxx> #include <memory> @@ -171,7 +172,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !"); FreeResource(); diff --git a/dbaccess/source/ui/dlg/finteraction.cxx b/dbaccess/source/ui/dlg/finteraction.cxx index aee6876e8ebc..562ebf435223 100644 --- a/dbaccess/source/ui/dlg/finteraction.cxx +++ b/dbaccess/source/ui/dlg/finteraction.cxx @@ -31,6 +31,7 @@ #include "finteraction.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/ucb/InteractiveIOException.hpp> //........................................................................ @@ -51,7 +52,7 @@ namespace dbaui ,m_bDoesNotExist(sal_False) { DBG_CTOR( OFilePickerInteractionHandler, NULL ); - DBG_ASSERT( m_xMaster.is(), "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); + OSL_ENSURE( m_xMaster.is(), "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 1c164b0de875..311bea0cc1ad 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -52,6 +52,7 @@ #include "UITools.hxx" #include <comphelper/processfactory.hxx> #include <unotools/confignode.hxx> +#include <osl/diagnose.h> //......................................................................... namespace dbaui @@ -100,7 +101,7 @@ namespace dbaui DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rItems.GetItem(DSID_TYPECOLLECTION)); if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); @@ -360,8 +361,8 @@ namespace dbaui // collect some items and some values SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); - DBG_ASSERT(pUrlItem, "OGeneralPage::implInitControls : missing the type attribute !"); - DBG_ASSERT(pNameItem, "OGeneralPage::implInitControls : missing the type attribute !"); + OSL_ENSURE(pUrlItem, "OGeneralPage::implInitControls : missing the type attribute !"); + OSL_ENSURE(pNameItem, "OGeneralPage::implInitControls : missing the type attribute !"); sName = pNameItem->GetValue(); sConnectURL = pUrlItem->GetValue(); } diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 9d7a1a2759c3..1b0a647e0f06 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -41,6 +41,7 @@ #include <svtools/imgdef.hxx> #include "browserids.hxx" #include <connectivity/dbtools.hxx> +#include <osl/diagnose.h> //...................................................................... namespace dbaui { @@ -145,14 +146,14 @@ namespace dbaui //------------------------------------------------------------------ void DbaIndexList::enableSelectHandler() { - DBG_ASSERT(m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); + OSL_ENSURE(m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); m_bSuspendSelectHdl = sal_False; } //------------------------------------------------------------------ void DbaIndexList::disableSelectHandler() { - DBG_ASSERT(!m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); + OSL_ENSURE(!m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); m_bSuspendSelectHdl = sal_True; } @@ -340,7 +341,7 @@ DBG_NAME(DbaIndexDialog) //------------------------------------------------------------------ sal_Bool DbaIndexDialog::implCommit(SvLBoxEntry* _pEntry) { - DBG_ASSERT(_pEntry, "DbaIndexDialog::implCommit: invalid entry!"); + OSL_ENSURE(_pEntry, "DbaIndexDialog::implCommit: invalid entry!"); Indexes::iterator aCommitPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); @@ -408,7 +409,7 @@ DBG_NAME(DbaIndexDialog) for (SvLBoxEntry* pAdjust = m_aIndexes.First(); pAdjust; pAdjust = m_aIndexes.Next(pAdjust)) { Indexes::iterator aAfterInsertPos = m_pIndexes->find(m_aIndexes.GetEntryText(pAdjust)); - DBG_ASSERT(aAfterInsertPos != m_pIndexes->end(), "DbaIndexDialog::OnNewIndex: problems with on of the entries!"); + OSL_ENSURE(aAfterInsertPos != m_pIndexes->end(), "DbaIndexDialog::OnNewIndex: problems with on of the entries!"); pAdjust->SetUserData(reinterpret_cast< void* >(sal_Int32(aAfterInsertPos - m_pIndexes->begin()))); } @@ -424,7 +425,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnDropIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnDropIndex: invalid call!"); if (pSelected) { // let the user confirm the drop @@ -450,7 +451,7 @@ DBG_NAME(DbaIndexDialog) { // do the drop Indexes::iterator aDropPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); - DBG_ASSERT(aDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: did not find the index in my collection!"); + OSL_ENSURE(aDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: did not find the index in my collection!"); SQLExceptionInfo aExceptionInfo; sal_Bool bSuccess = sal_False; @@ -480,7 +481,7 @@ DBG_NAME(DbaIndexDialog) for (SvLBoxEntry* pAdjust = m_aIndexes.First(); pAdjust; pAdjust = m_aIndexes.Next(pAdjust)) { Indexes::iterator aAfterDropPos = m_pIndexes->find(m_aIndexes.GetEntryText(pAdjust)); - DBG_ASSERT(aAfterDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: problems with on of the remaining entries!"); + OSL_ENSURE(aAfterDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: problems with on of the remaining entries!"); pAdjust->SetUserData(reinterpret_cast< void* >(sal_Int32(aAfterDropPos - m_pIndexes->begin()))); } @@ -501,7 +502,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnRenameIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnRenameIndex: invalid call!"); // save the changes made 'til here // Upon leaving the edit mode, the control will be re-initialized with the @@ -530,7 +531,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnResetIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnResetIndex: invalid call!"); Indexes::iterator aResetPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(pSelected->GetUserData()); @@ -588,7 +589,7 @@ DBG_NAME(DbaIndexDialog) { if (m_aIndexes.IsEditingActive()) { - DBG_ASSERT(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody was faster than hell!"); + OSL_ENSURE(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody was faster than hell!"); // this means somebody entered a new name, which was invalid, which cause us to posted us an event, // and before the event arrived the user clicked onto "close". VERY fast, this user .... m_aIndexes.EndEditing(sal_False); @@ -599,7 +600,7 @@ DBG_NAME(DbaIndexDialog) // the currently selected entry const SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected == m_pPreviousSelection, "DbaIndexDialog::OnCloseDialog: inconsistence!"); + OSL_ENSURE(pSelected == m_pPreviousSelection, "DbaIndexDialog::OnCloseDialog: inconsistence!"); sal_Int32 nResponse = RET_NO; if (pSelected) @@ -644,7 +645,7 @@ DBG_NAME(DbaIndexDialog) { Indexes::iterator aPosition = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); - DBG_ASSERT(aPosition >= m_pIndexes->begin() && aPosition < m_pIndexes->end(), + OSL_ENSURE(aPosition >= m_pIndexes->begin() && aPosition < m_pIndexes->end(), "DbaIndexDialog::OnEntryEdited: invalid entry!"); String sNewName = m_aIndexes.GetEntryText(_pEntry); @@ -768,7 +769,7 @@ DBG_NAME(DbaIndexDialog) //------------------------------------------------------------------ IMPL_LINK( DbaIndexDialog, OnModified, void*, /*NOTINTERESTEDIN*/ ) { - DBG_ASSERT(m_pPreviousSelection, "DbaIndexDialog, OnModified: invalid call!"); + OSL_ENSURE(m_pPreviousSelection, "DbaIndexDialog, OnModified: invalid call!"); Indexes::iterator aPosition = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(m_pPreviousSelection->GetUserData()); aPosition->setModified(sal_True); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 21023208a4d7..dd5817c88f58 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -40,7 +40,7 @@ #include "dbustrings.hrc" #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/diagnose_ex.h> #include "localresaccess.hxx" #include <unotools/syslocale.hxx> @@ -105,7 +105,7 @@ DBG_NAME(OParameterDialog) m_xFormatter->attachNumberFormatsSupplier(xNumberFormats); try { - DBG_ASSERT(rParamContainer->getCount(), "OParameterDialog::OParameterDialog : can't handle empty containers !"); + OSL_ENSURE(rParamContainer->getCount(), "OParameterDialog::OParameterDialog : can't handle empty containers !"); m_aFinalValues.realloc(rParamContainer->getCount()); PropertyValue* pValues = m_aFinalValues.getArray(); @@ -298,7 +298,7 @@ DBG_NAME(OParameterDialog) { sal_uInt16 nCurrent = m_aAllParams.GetSelectEntryPos(); sal_uInt16 nCount = m_aAllParams.GetEntryCount(); - DBG_ASSERT(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); + OSL_ENSURE(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); // search the next entry in list we haven't visited yet sal_uInt16 nNext = (nCurrent + 1) % nCount; @@ -343,13 +343,13 @@ DBG_NAME(OParameterDialog) // initialize the controls with the new values sal_uInt16 nSelected = m_aAllParams.GetSelectEntryPos(); - DBG_ASSERT(nSelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnEntrySelected : no current entry !"); + OSL_ENSURE(nSelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnEntrySelected : no current entry !"); m_aParam.SetText(::comphelper::getString(m_aFinalValues[nSelected].Value)); m_nCurrentlySelected = nSelected; // with this the value isn't dirty - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; m_aResetVisitFlag.SetTimeout(1000); @@ -361,10 +361,10 @@ DBG_NAME(OParameterDialog) //------------------------------------------------------------------------------ IMPL_LINK(OParameterDialog, OnVisitedTimeout, Timer*, /*pTimer*/) { - DBG_ASSERT(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); + OSL_ENSURE(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); // mark the currently selected entry as visited - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_VISITED; // was it the last "not visited yet" entry ? @@ -411,7 +411,7 @@ DBG_NAME(OParameterDialog) IMPL_LINK(OParameterDialog, OnValueModified, Control*, /*pBox*/) { // mark the currently selected entry as dirty - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; m_bNeedErrorOnCurrent = sal_True; diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 98e54ca522f5..9107f34e3911 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -42,9 +42,8 @@ #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "moduledbu.hxx" #include <connectivity/sqliterator.hxx> #include <connectivity/dbtools.hxx> @@ -465,7 +464,7 @@ Reference< XPropertySet > DlgFilterCrit::getMatchingColumn( const Edit& _rValueI //------------------------------------------------------------------------------ IMPL_LINK( DlgFilterCrit, PredicateLoseFocus, Edit*, _pField ) { - DBG_ASSERT( _pField, "DlgFilterCrit::PredicateLoseFocus: invalid event source!" ); + OSL_ENSURE( _pField, "DlgFilterCrit::PredicateLoseFocus: invalid event source!" ); if ( _pField ) { // retrieve the field affected @@ -754,7 +753,7 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) } else { - DBG_ASSERT(0,"DlgFilterCrit::ListSelectHdl: Diese Column d�rfte garnicht vorhanden sein!"); + OSL_ENSURE(0,"DlgFilterCrit::ListSelectHdl: Diese Column d�rfte garnicht vorhanden sein!"); } } pComp->SelectEntryPos(0); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 2299c82f8425..db55c80da176 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <vcl/fixed.hxx> +#include <osl/diagnose.h> #include <svtools/svtreebx.hxx> #include <svtools/svmedit.hxx> #include <connectivity/dbexception.hxx> @@ -259,7 +260,7 @@ namespace iter.next( aCurrentElement ); const SQLException* pCurrentError = (const SQLException*)aCurrentElement; - DBG_ASSERT( pCurrentError, "lcl_buildExceptionChain: iterator failure!" ); + OSL_ENSURE( pCurrentError, "lcl_buildExceptionChain: iterator failure!" ); // hasMoreElements should not have returned <TRUE/> in this case ExceptionDisplayInfo aDisplayInfo( aCurrentElement.getType() ); @@ -399,7 +400,7 @@ OExceptionChainDialog::~OExceptionChainDialog() IMPL_LINK(OExceptionChainDialog, OnExceptionSelected, void*, EMPTYARG) { SvLBoxEntry* pSelected = m_aExceptionList.FirstSelected(); - DBG_ASSERT(!pSelected || !m_aExceptionList.NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?"); + OSL_ENSURE(!pSelected || !m_aExceptionList.NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?"); String sText; diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 46894150bfed..45e2f7ca6fe6 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -55,6 +55,7 @@ #include "dbaccess_helpid.hrc" #include "UITools.hxx" #include <osl/mutex.hxx> +#include <osl/diagnose.h> #include <svtools/imgdef.hxx> #include "TablesSingleDlg.hxx" #include <tools/diagnose_ex.h> @@ -256,7 +257,7 @@ DBG_NAME(OTableSubscriptionPage) // get the name of the data source we're working for SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); - DBG_ASSERT(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); + OSL_ENSURE(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); String sDSName = pNameItem->GetValue(); if (bValid && sDSName.Len() && !m_xCurrentConnection.is() ) @@ -264,7 +265,7 @@ DBG_NAME(OTableSubscriptionPage) // the PropertyValues for the current dialog settings Sequence< PropertyValue > aConnectionParams; - DBG_ASSERT(m_pTablesDlg, "OTableSubscriptionPage::implInitControls: need a parent dialog doing the translation!"); + OSL_ENSURE(m_pTablesDlg, "OTableSubscriptionPage::implInitControls: need a parent dialog doing the translation!"); if ( m_pTablesDlg ) { if (!m_pTablesDlg->getCurrentSettings(aConnectionParams)) @@ -446,11 +447,11 @@ DBG_NAME(OTableSubscriptionPage) { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); SvLBoxEntry* pRHS = static_cast<SvLBoxEntry*>(_pSortData->pRight); - DBG_ASSERT(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); + OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); + OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); String sRightText = pRightTextItem->GetText(); diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 6a6c1f2e054d..58d47dd1d22b 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -181,7 +181,7 @@ namespace dbaui static const char sIndentSource[]; char sIndent[nIndentMax+1]; sal_Int16 m_nIndent; - #ifdef DBG_UTIL + #if OSL_DEBUG_LEVEL > 0 BOOL m_bCheckFont; #endif diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 9ec12527ffa5..be184aa8acc2 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -451,7 +451,7 @@ namespace dbaui void* _pTreeListUserData // in rela a DBTreeListUserData*, but we do not know this class here .... ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 // checks whether the given tree entry denotes a data source bool impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const; #endif diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 2d0c9b64606d..414fc9e6cb4e 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -36,7 +36,7 @@ #include "dbu_misc.hrc" #include "dbustrings.hrc" #include <sfx2/sfxhtml.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/tenccvt.hxx> #include "moduledbu.hxx" #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> @@ -436,7 +436,7 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption* pOption ) const String& rOptVal = pOption->GetString(); if ( rOptVal.Search('%') != STRING_NOTFOUND ) { // Prozent - DBG_ASSERT( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" ); + OSL_ENSURE( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" ); return (sal_Int16)((pOption->GetNumber() * m_nColumnWidth) / 100); } else diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index cabe082fdaa9..9bf56d9934bb 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -31,6 +31,7 @@ #include "TokenWriter.hxx" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "RtfReader.hxx" #include "HtmlReader.hxx" #include "dbustrings.hrc" @@ -693,7 +694,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD const String& rExchange) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ,m_bCheckFont(FALSE) #endif { @@ -1058,7 +1059,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I void OHTMLImportExport::FontOn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOn" ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 m_bCheckFont = TRUE; #endif @@ -1089,9 +1090,9 @@ void OHTMLImportExport::FontOn() inline void OHTMLImportExport::FontOff() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOff" ); - DBG_ASSERT(m_bCheckFont,"Kein FontOn() gerufen"); + OSL_ENSURE(m_bCheckFont,"Kein FontOn() gerufen"); TAG_OFF( OOO_STRING_SVTOOLS_HTML_font ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 m_bCheckFont = FALSE; #endif } diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 9d143636b3a8..3d678a8035fc 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -31,7 +31,7 @@ #include "WColumnSelect.hxx" #include "dbu_misc.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "WizardPages.hrc" #include "WCopyTable.hxx" #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> @@ -341,7 +341,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, ::std::select2nd<OCopyTableWizard::TNameMapping::value_type>()) ); - DBG_ASSERT(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); + OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); if ( aIter == m_pParent->m_mNameMapping.end() ) return; // do nothing const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns(); @@ -391,7 +391,7 @@ USHORT OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, ::std::select2nd<OCopyTableWizard::TNameMapping::value_type>()) ); - DBG_ASSERT(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); + OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns(); ODatabaseExport::TColumns::const_iterator aSrcIter = pSrcColumns->find((*aIter).first); if ( aSrcIter != pSrcColumns->end() ) diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 356f8176a0ef..779c8f4d7c92 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "WNameMatch.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "WCopyTable.hxx" #include "dbaccess_helpid.hrc" @@ -155,7 +155,7 @@ sal_Bool OWizNameMatching::LeavePage() while(pLeftEntry && pRightEntry) { OFieldDescription* pSrcField = static_cast<OFieldDescription*>(pLeftEntry->GetUserData()); - DBG_ASSERT(pSrcField,"OWizNameMatching: OColumn can not be null!"); + OSL_ENSURE(pSrcField,"OWizNameMatching: OColumn can not be null!"); ODatabaseExport::TColumnVector::const_iterator aSrcIter = pSrcColumns->begin(); ODatabaseExport::TColumnVector::const_iterator aSrcEnd = pSrcColumns->end(); @@ -166,7 +166,7 @@ sal_Bool OWizNameMatching::LeavePage() if(m_CTRL_LEFT.GetCheckButtonState(pLeftEntry) == SV_BUTTON_CHECKED) { OFieldDescription* pDestField = static_cast<OFieldDescription*>(pRightEntry->GetUserData()); - DBG_ASSERT(pDestField,"OWizNameMatching: OColumn can not be null!"); + OSL_ENSURE(pDestField,"OWizNameMatching: OColumn can not be null!"); const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector(); ODatabaseExport::TColumnVector::const_iterator aDestIter = pDestColumns->begin(); ODatabaseExport::TColumnVector::const_iterator aDestEnd = pDestColumns->end(); diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 68bf316c33dd..86007e933533 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -31,8 +31,8 @@ #include "WTypeSelect.hxx" #include "WizardPages.hrc" #include "dbustrings.hrc" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "WCopyTable.hxx" #include "dbaccess_helpid.hrc" @@ -97,7 +97,7 @@ void OWizTypeSelectControl::DeactivateAggregate( EControlType eType ) // ----------------------------------------------------------------------- void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) { - DBG_ASSERT(nRow == -1,"nRow muss -1 sein!"); + OSL_ENSURE(nRow == -1,"nRow muss -1 sein!"); (void)nRow; MultiListBox &aListBox = ((OWizTypeSelect*)GetParent())->m_lbColumnNames; diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx index 2ce044be43c9..425aef75db87 100644 --- a/dbaccess/source/ui/misc/charsets.cxx +++ b/dbaccess/source/ui/misc/charsets.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "charsets.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbu_misc.hrc" #include <rtl/tencinfo.h> #include <tools/rcid.h> @@ -122,7 +122,7 @@ namespace dbaui :CharsetDisplayDerefHelper_Base(_rBase) ,m_sDisplayName(_rDisplayName) { - DBG_ASSERT( m_sDisplayName.getLength(), "CharsetDisplayDerefHelper::CharsetDisplayDerefHelper: invalid display name!" ); + OSL_ENSURE( m_sDisplayName.getLength(), "CharsetDisplayDerefHelper::CharsetDisplayDerefHelper: invalid display name!" ); } //========================================================================= @@ -133,7 +133,7 @@ namespace dbaui :m_pContainer(_pContainer) ,m_aPosition(_rPosition) { - DBG_ASSERT(m_pContainer, "OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator : invalid container!"); + OSL_ENSURE(m_pContainer, "OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator : invalid container!"); } //------------------------------------------------------------------------- @@ -146,7 +146,7 @@ namespace dbaui //------------------------------------------------------------------------- CharsetDisplayDerefHelper OCharsetDisplay::ExtendedCharsetIterator::operator*() const { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator* : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator* : invalid position!"); rtl_TextEncoding eEncoding = (*m_aPosition).getEncoding(); return CharsetDisplayDerefHelper( @@ -158,7 +158,7 @@ namespace dbaui //------------------------------------------------------------------------- const OCharsetDisplay::ExtendedCharsetIterator& OCharsetDisplay::ExtendedCharsetIterator::operator++() { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator++ : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator++ : invalid position!"); if ( m_aPosition != m_pContainer->OCharsetDisplay_Base::end() ) ++m_aPosition; return *this; @@ -167,7 +167,7 @@ namespace dbaui //------------------------------------------------------------------------- const OCharsetDisplay::ExtendedCharsetIterator& OCharsetDisplay::ExtendedCharsetIterator::operator--() { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin(), "OCharsetDisplay::ExtendedCharsetIterator::operator-- : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin(), "OCharsetDisplay::ExtendedCharsetIterator::operator-- : invalid position!"); if ( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin() ) --m_aPosition; return *this; diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 13ec3dfd716b..590403c49fa9 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -56,8 +56,8 @@ #include <cppuhelper/typeprovider.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/unohlp.hxx> -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> //........................................................................ @@ -264,7 +264,7 @@ namespace dbaui //-------------------------------------------------------------------- void OSingleDocumentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) { - DBG_ASSERT( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" ); + OSL_ENSURE( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" ); // usually this gets called from within initialize of derived classes ... if ( isConnected() ) disconnect(); @@ -304,7 +304,7 @@ namespace dbaui // get a number formatter Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; - DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" ); + OSL_ENSURE( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" ); Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); if(xSupplier.is()) { @@ -381,7 +381,7 @@ namespace dbaui //-------------------------------------------------------------------- sal_Bool OSingleDocumentController::Construct(Window* _pParent) { - DBG_ASSERT( getView(), "OSingleDocumentController::Construct: have no view!" ); + OSL_ENSURE( getView(), "OSingleDocumentController::Construct: have no view!" ); if ( getView() ) getView()->enableSeparator( ); diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 4c119ca15c78..7e44ea1c256f 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -37,7 +37,7 @@ #ifndef _INC_MATH #include <math.h> #endif -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <vcl/lineinfo.hxx> @@ -64,7 +64,7 @@ namespace Rectangle GetTextPos(const OTableWindow* _pWin, const Point& _aConnPos,const Point& _aDescrLinePos) { OTableWindowListBox* pListBox = _pWin ? _pWin->GetListBox() : NULL; - DBG_ASSERT(_pWin && pListBox, "OConnectionLine::GetSourceTextPos : invalid call !"); + OSL_ENSURE(_pWin && pListBox, "OConnectionLine::GetSourceTextPos : invalid call !"); Rectangle aReturn; if ( pListBox ) diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 759616d4c05c..1cfa991c5b7e 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -66,6 +66,7 @@ #include <vcl/svapp.hxx> #include <osl/mutex.hxx> #include "UITools.hxx" +#include <osl/diagnose.h> #include <boost/optional.hpp> @@ -334,7 +335,7 @@ void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabW // Wenn die TabWins ein SetData haetten, koennte ich mir das sparen ... haben sie aber nicht, ausserdem muesste ich dann immer // noch Informationen, die sich eigentlich nicht geaendert haben, auch neu setzen. // Also loesche ich die TabWinDatas nicht, sondern aktualisiere sie nur. - DBG_ASSERT(m_vTableData.size() == pTabWinList->size(), + OSL_ENSURE(m_vTableData.size() == pTabWinList->size(), "OJoinController::SaveTabWinsPosSize : inkonsistenter Zustand : sollte genausviel TabWinDatas haben wie TabWins !"); OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->begin(); diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 017347595520..dd96976aea4e 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "JoinTableView.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "querycontroller.hxx" #include "JoinDesignView.hxx" #include "dbu_qry.hrc" @@ -1089,7 +1089,7 @@ void OJoinTableView::ClearAll() BOOL OJoinTableView::ScrollWhileDragging() { DBG_CHKTHIS(OJoinTableView,NULL); - DBG_ASSERT(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); + OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); // den Timer schon mal killen if (m_aDragScrollTimer.IsActive()) @@ -1292,7 +1292,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,bool _bSupressCrossOrNaturalJoin,const OTableConnection* _rpFirstAfter) const { OTableConnection* pConn = NULL; - DBG_ASSERT(pRhs || pLhs, "OJoinTableView::GetTabConn : invalid args !"); + OSL_ENSURE(pRhs || pLhs, "OJoinTableView::GetTabConn : invalid args !"); // only one NULL-arg allowed if ((!pLhs || pLhs->ExistsAConn()) && (!pRhs || pRhs->ExistsAConn())) diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx index 98a21fbb21ea..8e18232e02ff 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "QTableConnection.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "QueryTableView.hxx" #include "ConnectionLine.hxx" using namespace dbaui; @@ -73,7 +73,7 @@ OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnect //------------------------------------------------------------------------ sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare) { - DBG_ASSERT(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : einer der beiden Teilnehmer hat keine Daten !"); + OSL_ENSURE(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : einer der beiden Teilnehmer hat keine Daten !"); // allzuviel brauche ich nicht vergleichen (schon gar nicht alle Member) : lediglich die Fenster, an denen wir haengen, und // die Indizies in der entsprechenden Tabelle muessen uebereinstimmen diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index 60fc544a276f..e20ca59c5494 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -31,7 +31,7 @@ #include "QTableWindow.hxx" #include "QueryTableView.hxx" #include "dbustrings.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "QueryDesignView.hxx" #include "browserids.hxx" @@ -126,7 +126,7 @@ sal_Bool OQueryTableWindow::Init() if (!bSuccess) { // es soll nur ein Dummy-Window aufgemacht werden ... - DBG_ASSERT(GetAliasName().getLength(), "OQueryTableWindow::Init : kein Alias- UND kein Tabellenname geht nicht !"); + OSL_ENSURE(GetAliasName().getLength(), "OQueryTableWindow::Init : kein Alias- UND kein Tabellenname geht nicht !"); // .. aber das braucht wenigstens einen Alias // ::com::sun::star::form::ListBox anlegen @@ -163,14 +163,14 @@ void OQueryTableWindow::deleteUserData(void*& _pUserData) //------------------------------------------------------------------------------ void OQueryTableWindow::OnEntryDoubleClicked(SvLBoxEntry* pEntry) { - DBG_ASSERT(pEntry != NULL, "OQueryTableWindow::OnEntryDoubleClicked : pEntry darf nicht NULL sein !"); + OSL_ENSURE(pEntry != NULL, "OQueryTableWindow::OnEntryDoubleClicked : pEntry darf nicht NULL sein !"); // man koennte das auch abfragen und dann ein return hinsetzen, aber so weist es vielleicht auf Fehler bei Aufrufer hin if (getTableView()->getDesignView()->getController().isReadOnly()) return; OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(pEntry->GetUserData()); - DBG_ASSERT(pInf != NULL, "OQueryTableWindow::OnEntryDoubleClicked : Feld hat keine FieldInfo !"); + OSL_ENSURE(pInf != NULL, "OQueryTableWindow::OnEntryDoubleClicked : Feld hat keine FieldInfo !"); // eine DragInfo aufbauen OTableFieldDescRef aInfo = new OTableFieldDesc(GetTableName(),m_pListBox->GetEntryText(pEntry)); @@ -186,7 +186,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(SvLBoxEntry* pEntry) //------------------------------------------------------------------------------ sal_Bool OQueryTableWindow::ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo) { - DBG_ASSERT(m_pListBox != NULL, "OQueryTableWindow::ExistsField : habe keine ::com::sun::star::form::ListBox !"); + OSL_ENSURE(m_pListBox != NULL, "OQueryTableWindow::ExistsField : habe keine ::com::sun::star::form::ListBox !"); OSL_ENSURE(rInfo.is(),"OQueryTableWindow::ExistsField: invlid argument for OTableFieldDescRef!"); Reference< XConnection> xConnection = getTableView()->getDesignView()->getController().getConnection(); sal_Bool bExists = sal_False; @@ -203,7 +203,7 @@ sal_Bool OQueryTableWindow::ExistsField(const ::rtl::OUString& strFieldName, OTa if (bCase(strFieldName,::rtl::OUString(m_pListBox->GetEntryText(pEntry)))) { OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(pEntry->GetUserData()); - DBG_ASSERT(pInf != NULL, "OQueryTableWindow::ExistsField : Feld hat keine FieldInfo !"); + OSL_ENSURE(pInf != NULL, "OQueryTableWindow::ExistsField : Feld hat keine FieldInfo !"); rInfo->SetTabWindow(this); rInfo->SetField(strFieldName); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index cd4fd7c016fc..cd5eb8763809 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -36,6 +36,7 @@ #include <vcl/split.hxx> #include <svl/undo.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "adtabdlg.hxx" #include <vcl/svapp.hxx> #include <vcl/combobox.hxx> @@ -558,7 +559,7 @@ namespace else if (SQL_ISRULE(pNode,comparison_predicate)) { // only the comparison of columns is allowed - DBG_ASSERT(pNode->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree"); + OSL_ENSURE(pNode->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree"); if (!(SQL_ISRULE(pNode->getChild(0),column_ref) && SQL_ISRULE(pNode->getChild(2),column_ref) && pNode->getChild(1)->getNodeType() == SQL_NODE_EQUAL)) @@ -677,7 +678,7 @@ namespace if ( pEntryField->isAggreateFunction() ) { - DBG_ASSERT(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); ::rtl::OUStringBuffer aTmpStr2( pEntryField->GetFunction()); aTmpStr2.appendAscii("("); aTmpStr2.append(aTmpStr.makeStringAndClear()); @@ -930,7 +931,7 @@ namespace } else if ( pEntryField->isNumericOrAggreateFunction() ) { - DBG_ASSERT(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); aWorkStr += pEntryField->GetFunction(); aWorkStr += ::rtl::OUString('('); aWorkStr += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote); @@ -1168,7 +1169,7 @@ namespace OTableFieldDescRef pEntryField = *aIter; if ( pEntryField->IsGroupBy() ) { - DBG_ASSERT(pEntryField->GetField().getLength(),"Kein FieldName vorhanden!;-("); + OSL_ENSURE(pEntryField->GetField().getLength(),"Kein FieldName vorhanden!;-("); ::rtl::OUString sGroupByPart = quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote); // only quote the field name when it isn't calculated @@ -1613,7 +1614,7 @@ namespace SqlParseError eErrorCode = eOk; OQueryController& rController = static_cast<OQueryController&>(_pView->getController()); - DBG_ASSERT(SQL_ISRULE( pCondition, comparison_predicate),"ComparisonPredicate: pCondition ist kein ComparisonPredicate"); + OSL_ENSURE(SQL_ISRULE( pCondition, comparison_predicate),"ComparisonPredicate: pCondition ist kein ComparisonPredicate"); if ( SQL_ISRULE(pCondition->getChild(0), column_ref ) || SQL_ISRULE(pCondition->getChild(pCondition->count()-1), column_ref) ) { @@ -1797,7 +1798,7 @@ namespace rParseIter.getColumnRange( pColumnRef, aColumnName, aTableRange ); sal_Bool bFound(sal_False); - DBG_ASSERT(aColumnName.getLength(),"Columnname darf nicht leer sein"); + OSL_ENSURE(aColumnName.getLength(),"Columnname darf nicht leer sein"); if (!aTableRange.getLength()) { // SELECT column, ... @@ -1850,7 +1851,7 @@ namespace sal_Bool InsertJoin(const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode *pNode) { - DBG_ASSERT( SQL_ISRULE( pNode, qualified_join ) || SQL_ISRULE( pNode, joined_table ) || SQL_ISRULE( pNode, cross_union ), + OSL_ENSURE( SQL_ISRULE( pNode, qualified_join ) || SQL_ISRULE( pNode, joined_table ) || SQL_ISRULE( pNode, cross_union ), "OQueryDesignView::InsertJoin: Fehler im Parse Tree"); if (SQL_ISRULE(pNode,joined_table)) @@ -2755,7 +2756,7 @@ sal_Int32 OQueryDesignView::getColWidth(sal_uInt16 _nColPos) const //------------------------------------------------------------------------------ void OQueryDesignView::fillValidFields(const ::rtl::OUString& sAliasName, ComboBox* pFieldList) { - DBG_ASSERT(pFieldList != NULL, "OQueryDesignView::FillValidFields : What the hell do you think I can do with a NULL-ptr ? This will crash !"); + OSL_ENSURE(pFieldList != NULL, "OQueryDesignView::FillValidFields : What the hell do you think I can do with a NULL-ptr ? This will crash !"); pFieldList->Clear(); sal_Bool bAllTables = sAliasName.getLength() == 0; @@ -2874,7 +2875,7 @@ sal_Bool OQueryDesignView::checkStatement() const ::std::vector<OTableConnection*>* pConnList = m_pTableView->getTableConnections(); Reference< XConnection> xConnection = rController.getConnection(); ::rtl::OUString aTableListStr(GenerateFromClause(xConnection,pTabList,pConnList)); - DBG_ASSERT(aTableListStr.getLength(), "OQueryDesignView::getStatement() : unerwartet : habe Felder, aber keine Tabellen !"); + OSL_ENSURE(aTableListStr.getLength(), "OQueryDesignView::getStatement() : unerwartet : habe Felder, aber keine Tabellen !"); // wenn es Felder gibt, koennen die nur durch Einfuegen aus einer schon existenten Tabelle entstanden sein; wenn andererseits // eine Tabelle geloescht wird, verschwinden auch die zugehoerigen Felder -> ergo KANN es das nicht geben, dass Felder // existieren, aber keine Tabellen (und aFieldListStr hat schon eine Laenge, das stelle ich oben sicher) diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index dcdc0b139c22..6e302825fdda 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -32,8 +32,8 @@ #include "QueryTableView.hxx" #include "TableFieldInfo.hxx" #include "TableFieldDescription.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "QTableWindow.hxx" #include "QTableConnection.hxx" @@ -284,7 +284,7 @@ void OQueryTableView::ReSync() { DBG_CHKTHIS(OQueryTableView,NULL); TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData(); - DBG_ASSERT((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0), + OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0), "vor OQueryTableView::ReSync() bitte ClearAll aufrufen !"); // ich brauche eine Sammlung aller Fensternamen, deren Anlegen schief geht, damit ich die entsprechenden Connections @@ -477,7 +477,7 @@ Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKey void OQueryTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& _rTableName, const ::rtl::OUString& strAlias, sal_Bool bNewTable) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !"); + OSL_ENSURE(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !"); // wenn der Tabellenname nicht gesetzt ist, steht das fuer ein Dummy-Fenster, das braucht aber wenigstens einen Alias-Namen // neue Datenstruktur erzeugen @@ -753,7 +753,7 @@ void OQueryTableView::KeyInput( const KeyEvent& rEvt ) OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !"); + OSL_ENSURE(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !"); // (nicht dass es schadet, aber es ist sinnlos und weist vielleicht auf Fehler beim Aufrufer hin) OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName); if(aIter != GetTabWinMap()->end()) @@ -781,7 +781,7 @@ sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFie void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !"); + OSL_ENSURE(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !"); // mein Parent brauche ich, da es vom Loeschen erfahren soll OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView()); @@ -848,7 +848,7 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc { DBG_CHKTHIS(OQueryTableView,NULL); OTableWindowMap* pTabWins = GetTabWinMap(); - DBG_ASSERT(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !"); + OSL_ENSURE(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !"); if (pTabWin) { @@ -929,7 +929,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn if (pTabWin->Init()) { TTableWindowData::value_type pData = pTabWin->GetData(); - DBG_ASSERT(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !"); + OSL_ENSURE(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !"); // Wenn die Daten schon PosSize haben, diese benutzen if (pData->HasPosition() && pData->HasSize()) { @@ -996,7 +996,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !"); + OSL_ENSURE(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !"); static_cast<OQueryDesignView*>(getDesignView())->InsertField(rInfo); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index a3763deafc02..ca1f4d52bdb9 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -39,7 +39,6 @@ #include "TableFieldInfo.hxx" #include "dbu_qry.hrc" #include "dbaccess_helpid.hrc" -#include <tools/debug.hxx> #include <com/sun/star/container/XNameAccess.hpp> #include "dbustrings.hrc" #include "QTableWindow.hxx" @@ -51,6 +50,7 @@ #include <comphelper/extract.hxx> #include "sqlmessage.hxx" #include "UITools.hxx" +#include <osl/diagnose.h> using namespace ::svt; using namespace ::dbaui; @@ -451,7 +451,7 @@ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) if ( nColId > getFields().size() ) return NULL; OTableFieldDescRef pEntry = getFields()[nColId-1]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::GetController : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetController : keine FieldDescription !"); if (!pEntry.is()) return NULL; @@ -488,7 +488,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() ) return; OTableFieldDescRef pEntry = getFields()[nPos-1]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::InitController : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::InitController : keine FieldDescription !"); long nCellIndex = GetRealRow(nRow); switch (nCellIndex) @@ -712,7 +712,7 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes if ( _pEntry->isAggreateFunction() ) { - DBG_ASSERT(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); ::rtl::OUStringBuffer aTmpStr2( _pEntry->GetFunction()); aTmpStr2.appendAscii("("); aTmpStr2.append(sSql); @@ -1296,7 +1296,7 @@ void OSelectionBrowseBox::RemoveColumn(USHORT _nColumnId) USHORT nPos = GetColumnPos(_nColumnId); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn - DBG_ASSERT((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::RemoveColumn : invalid parameter nColId"); + OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::RemoveColumn : invalid parameter nColId"); // ColId ist bei mir gleichbedeutend mit Position, und da sollte die Bedingung natuerlich zutreffen sal_uInt16 nCurCol = GetCurColumnId(); @@ -1551,7 +1551,7 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu { DBG_CHKTHIS(OSelectionBrowseBox,NULL); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn - DBG_ASSERT(_nColumnPostion == BROWSER_INVALIDID || (_nColumnPostion <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); + OSL_ENSURE(_nColumnPostion == BROWSER_INVALIDID || (_nColumnPostion <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); // -1 heisst ganz hinten, Count heisst ganz hinten, der Rest bezeichnet eine richtige Position sal_uInt16 nCurCol = GetCurColumnId(); @@ -1721,7 +1721,7 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(!rInfo->IsEmpty(),"AddGroupBy:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(!rInfo->IsEmpty(),"AddGroupBy:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pEntry; const Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); const ::comphelper::UStringMixEqual bCase(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); @@ -1803,7 +1803,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(rInfo.is() && !rInfo->IsEmpty(),"AddCondition:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(rInfo.is() && !rInfo->IsEmpty(),"AddCondition:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pLastEntry; Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); @@ -1896,7 +1896,7 @@ void OSelectionBrowseBox::AddOrder( const OTableFieldDescRef& rInfo, const EOrde if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(!rInfo->IsEmpty(),"AddOrder:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(!rInfo->IsEmpty(),"AddOrder:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pEntry; Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); ::comphelper::UStringMixEqual bCase(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); @@ -1989,7 +1989,7 @@ void OSelectionBrowseBox::CellModified() void OSelectionBrowseBox::Fill() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(ColCount() >= 1, "OSelectionBrowseBox::Fill : please call only after inserting the handle column !"); + OSL_ENSURE(ColCount() >= 1, "OSelectionBrowseBox::Fill : please call only after inserting the handle column !"); sal_uInt16 nColCount = ColCount() - 1; if (nColCount < DEFAULT_QUERY_COLS) @@ -2109,7 +2109,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) //------------------------------------------------------------------------------ sal_Bool OSelectionBrowseBox::IsRowVisible(sal_uInt16 _nWhich) const { - DBG_ASSERT(_nWhich<(m_bVisibleRow.size()), "OSelectionBrowseBox::IsRowVisible : invalid parameter !"); + OSL_ENSURE(_nWhich<(m_bVisibleRow.size()), "OSelectionBrowseBox::IsRowVisible : invalid parameter !"); return m_bVisibleRow[_nWhich]; } @@ -2117,7 +2117,7 @@ sal_Bool OSelectionBrowseBox::IsRowVisible(sal_uInt16 _nWhich) const void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(_nWhich<m_bVisibleRow.size(), "OSelectionBrowseBox::SetRowVisible : invalid parameter !"); + OSL_ENSURE(_nWhich<m_bVisibleRow.size(), "OSelectionBrowseBox::SetRowVisible : invalid parameter !"); sal_Bool bWasEditing = IsEditing(); if (bWasEditing) @@ -2167,7 +2167,7 @@ long OSelectionBrowseBox::GetRealRow(long nRowId) const break; } } - DBG_ASSERT(nErg <= long(m_bVisibleRow.size()),"nErg kann nicht groesser als BROW_ROW_CNT sein!"); + OSL_ENSURE(nErg <= long(m_bVisibleRow.size()),"nErg kann nicht groesser als BROW_ROW_CNT sein!"); return i; } static long nVisibleRowMask[] = @@ -2214,7 +2214,7 @@ String OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const USHORT nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos-1]; - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); if ( pEntry->IsEmpty() ) return String(); @@ -2338,7 +2338,7 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, USHORT nColId) USHORT nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos - 1]; - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); switch (nCellIndex) { @@ -2366,7 +2366,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, USHORT nColId, const S USHORT nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getEntry(nPos - 1); - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); switch (nRow) @@ -2449,9 +2449,9 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) DBG_CHKTHIS(OSelectionBrowseBox,NULL); USHORT nPos = GetColumnPos(nColId); - DBG_ASSERT(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); + OSL_ENSURE(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); OTableFieldDescRef pEntry = getEntry(nPos-1); - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); static_cast<OQueryController&>(getDesignView()->getController()).setModified( sal_True ); EditBrowseBox::ColumnResized(nColId); @@ -2474,10 +2474,10 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId { DBG_CHKTHIS(OSelectionBrowseBox,NULL); USHORT nPos = GetColumnPos(nColId); - DBG_ASSERT((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); + OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); OTableFieldDescRef pEntry = getFields()[nPos-1]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !"); long nRow = GetRealRow(nRowId); String strText(GetCellText(nRow, nColId)); diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 263dab0e9593..4679f686bd51 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -30,6 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "TableConnectionData.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/stl_types.hxx> using namespace dbaui; @@ -60,7 +61,7 @@ void OTableConnectionData::Init() { ////////////////////////////////////////////////////////////////////// // LineDataList mit Defaults initialisieren - DBG_ASSERT(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); + OSL_ENSURE(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); ResetConnLines(TRUE); // das legt Defaults an } @@ -120,7 +121,7 @@ BOOL OTableConnectionData::SetConnLine( USHORT nIndex, const String& rSourceFiel return AppendConnLine(rSourceFieldName, rDestFieldName); OConnectionLineDataRef pConnLineData = m_vConnLineData[nIndex]; - DBG_ASSERT(pConnLineData != NULL, "OTableConnectionData::SetConnLine : habe ungueltiges LineData-Objekt"); + OSL_ENSURE(pConnLineData != NULL, "OTableConnectionData::SetConnLine : habe ungueltiges LineData-Objekt"); pConnLineData->SetSourceFieldName( rSourceFieldName ); pConnLineData->SetDestFieldName( rDestFieldName ); diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 13c0797033ed..3f3134254322 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -34,8 +34,8 @@ #include "QueryDesignView.hxx" #include "TableWindowData.hxx" #include "imageprovider.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/svapp.hxx> #include <vcl/wall.hxx> @@ -293,7 +293,7 @@ BOOL OTableWindow::Init() if ( !m_pListBox ) { m_pListBox = CreateListBox(); - DBG_ASSERT( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox hat NULL geliefert !" ); + OSL_ENSURE( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox hat NULL geliefert !" ); m_pListBox->SetSelectionMode( MULTIPLE_SELECTION ); } diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index b324c9263097..98580150dcf9 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -34,7 +34,7 @@ #include "QueryTableView.hxx" #include "querycontroller.hxx" #include "JoinExchange.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <svx/dbexch.hrc> #include <vcl/svapp.hxx> @@ -377,7 +377,7 @@ IMPL_LINK( OTableWindowListBox, OnDoubleClick, SvTreeListBox *, /*pBox*/ ) { // meinem Elter Bescheid sagen Window* pParent = Window::GetParent(); - DBG_ASSERT(pParent != NULL, "OTableWindowListBox::OnDoubleClick : habe kein Parent !"); + OSL_ENSURE(pParent != NULL, "OTableWindowListBox::OnDoubleClick : habe kein Parent !"); static_cast<OTableWindow*>(pParent)->OnEntryDoubleClicked(GetHdlEntry()); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index cc8777a8e854..a16b288bcca1 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -90,6 +90,7 @@ #include <svtools/localresaccess.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -1832,7 +1833,7 @@ bool OQueryController::allowViews() const // ----------------------------------------------------------------------------- bool OQueryController::allowQueries() const { - DBG_ASSERT( getSdbMetaData().isConnected(), "OQueryController::allowQueries: illegal call!" ); + OSL_ENSURE( getSdbMetaData().isConnected(), "OQueryController::allowQueries: illegal call!" ); if ( !getSdbMetaData().supportsSubqueriesInFrom() ) return false; diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx index b61e97b06f1e..45165c16605f 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "FieldDescGenWin.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "TableDesignHelpBar.hxx" #include "TableFieldControl.hxx" @@ -62,7 +62,7 @@ OFieldDescGenWin::~OFieldDescGenWin() //------------------------------------------------------------------------------ void OFieldDescGenWin::Init() { - DBG_ASSERT(GetEditorCtrl() != NULL, "OFieldDescGenWin::Init : have no editor control !"); + OSL_ENSURE(GetEditorCtrl() != NULL, "OFieldDescGenWin::Init : have no editor control !"); m_pFieldControl->Init(); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index 4b5815ea6e81..3e8548a32a50 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "TableFieldDescWin.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "dbu_tbl.hrc" #include "FieldDescriptions.hxx" @@ -111,7 +111,7 @@ OTableFieldDescWin::~OTableFieldDescWin() //------------------------------------------------------------------------------ void OTableFieldDescWin::Init() { - DBG_ASSERT(getGenPage() != NULL, "OTableFieldDescWin::Init : ups ... no GenericPage ... this will crash ..."); + OSL_ENSURE(getGenPage() != NULL, "OTableFieldDescWin::Init : ups ... no GenericPage ... this will crash ..."); getGenPage()->Init(); } diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index f816faf95777..72c4ccf7c178 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -39,8 +39,8 @@ #include "queryfilter.hxx" #include "queryorder.hxx" #include <connectivity/dbtools.hxx> -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> extern "C" void SAL_CALL createRegistryInfo_ComposerDialogs() { @@ -130,7 +130,7 @@ namespace dbaui xColumns = xSuppColumns->getColumns(); } - DBG_ASSERT( xColumns.is() && xColumns->hasElements(), "ComposerDialog::createDialog: not much fun without any columns!" ); + OSL_ENSURE( xColumns.is() && xColumns->hasElements(), "ComposerDialog::createDialog: not much fun without any columns!" ); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index f665ce5f2cf0..42d1f3ad1234 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -31,8 +31,8 @@ #include "dbinteraction.hxx" #include "dbu_reghelper.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <connectivity/dbexception.hxx> #include "sqlmessage.hxx" @@ -99,7 +99,7 @@ namespace dbaui sal_Bool BasicInteractionHandler::impl_handle_throw( const Reference< XInteractionRequest >& i_Request ) { Any aRequest( i_Request->getRequest() ); - DBG_ASSERT(aRequest.hasValue(), "BasicInteractionHandler::handle: invalid request!"); + OSL_ENSURE(aRequest.hasValue(), "BasicInteractionHandler::handle: invalid request!"); if ( !aRequest.hasValue() ) // no request -> no handling return sal_False; @@ -146,7 +146,7 @@ namespace dbaui Reference< XInteractionSupplyParameters > xParamCallback; if (-1 != nParamPos) xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY); - DBG_ASSERT(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); + OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xORB); sal_Int16 nResult = aDlg.Execute(); @@ -277,7 +277,7 @@ namespace dbaui if (-1 != nDocuPos) { Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY); - DBG_ASSERT(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s"); + OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s"); OCollectionView aDlg(NULL,_rDocuRequest.Content,_rDocuRequest.Name,m_xORB); sal_Int16 nResult = aDlg.Execute(); |