Hi,
this patch replaces all occurrences of DBG_ASSERT with OSL_ENSURE in
dbacces.
Btw, i couldn't find any reference to VOS_ASSERT (see Easy Hack: align
ASSERT (& friends) macro foo)
So i guess this could be removed from the backgroud description.
-- Kenneth
From 30d723ca1d6c681c0db26923c4c9333a31f79384 Mon Sep 17 00:00:00 2001
From: Kenneth Venken <kenneth.venken@gmail.com>
Date: Thu, 3 Feb 2011 00:33:36 +0100
Subject: [PATCH] replaced DGB_ASSERT with OSL_ENSURE
---
dbaccess/source/core/api/RowSetCache.cxx | 3 +-
.../source/core/api/SingleSelectQueryComposer.cxx | 7 ++-
dbaccess/source/core/api/TableDeco.cxx | 3 +-
dbaccess/source/core/api/query.cxx | 9 ++--
dbaccess/source/core/api/querycontainer.cxx | 13 +++---
dbaccess/source/core/api/table.cxx | 5 +-
.../source/core/dataaccess/ComponentDefinition.cxx | 3 +-
dbaccess/source/core/dataaccess/ModelImpl.cxx | 3 +-
.../source/core/dataaccess/bookmarkcontainer.cxx | 3 +-
dbaccess/source/core/dataaccess/connection.cxx | 3 +-
.../source/core/dataaccess/databasedocument.cxx | 7 ++-
dbaccess/source/core/dataaccess/datasource.cxx | 7 ++-
.../source/core/dataaccess/definitioncontainer.cxx | 3 +-
.../source/core/dataaccess/documentdefinition.cxx | 7 ++-
dbaccess/source/core/misc/dsntypes.cxx | 15 ++++---
dbaccess/source/ext/adabas/Acomponentmodule.cxx | 5 +-
dbaccess/source/filter/xml/xmlStyleImport.cxx | 3 +-
dbaccess/source/filter/xml/xmlfilter.cxx | 15 ++++---
dbaccess/source/ui/app/AppController.cxx | 7 ++-
dbaccess/source/ui/app/AppControllerDnD.cxx | 3 +-
dbaccess/source/ui/app/AppControllerGen.cxx | 3 +-
dbaccess/source/ui/app/AppDetailView.cxx | 19 +++++----
dbaccess/source/ui/browser/brwctrlr.cxx | 43 ++++++++++----------
dbaccess/source/ui/browser/brwview.cxx | 5 +-
dbaccess/source/ui/browser/dsEntriesNoExp.cxx | 3 +-
dbaccess/source/ui/browser/dsbrowserDnD.cxx | 3 +-
dbaccess/source/ui/browser/formadapter.cxx | 17 ++++----
dbaccess/source/ui/browser/genericcontroller.cxx | 7 ++-
dbaccess/source/ui/browser/sbagrid.cxx | 15 ++++---
dbaccess/source/ui/browser/unodatbr.cxx | 33 ++++++++-------
dbaccess/source/ui/control/FieldDescControl.cxx | 3 +-
dbaccess/source/ui/control/RelationControl.cxx | 5 +-
dbaccess/source/ui/control/charsetlistbox.cxx | 3 +-
dbaccess/source/ui/control/curledit.cxx | 3 +-
dbaccess/source/ui/control/opendoccontrols.cxx | 7 ++-
dbaccess/source/ui/control/tabletree.cxx | 9 ++--
dbaccess/source/ui/dlg/AdabasStat.cxx | 3 +-
dbaccess/source/ui/dlg/ConnectionHelper.cxx | 7 ++-
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 3 +-
dbaccess/source/ui/dlg/DbAdminImpl.cxx | 31 +++++++-------
dbaccess/source/ui/dlg/dbfindex.cxx | 3 +-
dbaccess/source/ui/dlg/dbwizsetup.cxx | 3 +-
dbaccess/source/ui/dlg/finteraction.cxx | 3 +-
dbaccess/source/ui/dlg/generalpage.cxx | 7 ++-
dbaccess/source/ui/dlg/indexdialog.cxx | 27 ++++++------
dbaccess/source/ui/dlg/paramdialog.cxx | 15 ++++---
dbaccess/source/ui/dlg/queryfilter.cxx | 6 +-
dbaccess/source/ui/dlg/sqlmessage.cxx | 5 +-
dbaccess/source/ui/dlg/tablespage.cxx | 9 ++--
dbaccess/source/ui/misc/HtmlReader.cxx | 3 +-
dbaccess/source/ui/misc/TokenWriter.cxx | 3 +-
dbaccess/source/ui/misc/WColumnSelect.cxx | 5 +-
dbaccess/source/ui/misc/WNameMatch.cxx | 5 +-
dbaccess/source/ui/misc/WTypeSelect.cxx | 3 +-
dbaccess/source/ui/misc/charsets.cxx | 11 +++--
dbaccess/source/ui/misc/singledoccontroller.cxx | 7 ++-
dbaccess/source/ui/querydesign/ConnectionLine.cxx | 3 +-
dbaccess/source/ui/querydesign/JoinController.cxx | 3 +-
dbaccess/source/ui/querydesign/JoinTableView.cxx | 5 +-
.../source/ui/querydesign/QTableConnection.cxx | 3 +-
dbaccess/source/ui/querydesign/QTableWindow.cxx | 11 +++--
dbaccess/source/ui/querydesign/QueryDesignView.cxx | 19 +++++----
dbaccess/source/ui/querydesign/QueryTableView.cxx | 15 ++++---
.../source/ui/querydesign/SelectionBrowseBox.cxx | 39 +++++++++---------
.../source/ui/querydesign/TableConnectionData.cxx | 5 +-
dbaccess/source/ui/querydesign/TableWindow.cxx | 3 +-
.../source/ui/querydesign/TableWindowListBox.cxx | 3 +-
dbaccess/source/ui/querydesign/querycontroller.cxx | 3 +-
dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx | 3 +-
.../source/ui/tabledesign/TableFieldDescWin.cxx | 3 +-
dbaccess/source/ui/uno/composerdialogs.cxx | 3 +-
dbaccess/source/ui/uno/dbinteraction.cxx | 7 ++-
72 files changed, 330 insertions(+), 259 deletions(-)
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index f795ce7..a7b6460 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -62,6 +62,7 @@
#include <connectivity/sqlparse.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <algorithm>
@@ -1452,7 +1453,7 @@ sal_Bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode
*pNode
else if (SQL_ISRULE(pNode,comparison_predicate))
{
// only the comparison of columns is allowed
- DBG_ASSERT(pNode->count() == 3,"checkInnerJoin: Fehler im Parse Tree");
+ OSL_ENSURE(pNode->count() == 3,"checkInnerJoin: 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))
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 8af1be2..80138ee 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -63,6 +63,7 @@
#include <unotools/syslocale.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <unotools/configmgr.hxx>
#include <unotools/sharedunocomponent.hxx>
@@ -578,7 +579,7 @@ void SAL_CALL OSingleSelectQueryComposer::appendGroupByColumn( const Reference<
::rtl::OUString OSingleSelectQueryComposer::composeStatementFromParts( const ::std::vector<
::rtl::OUString >& _rParts )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com",
"OSingleSelectQueryComposer::composeStatementFromParts" );
- DBG_ASSERT( _rParts.size() == (size_t)SQLPartCount,
"OSingleSelectQueryComposer::composeStatementFromParts: invalid parts array!" );
+ OSL_ENSURE( _rParts.size() == (size_t)SQLPartCount,
"OSingleSelectQueryComposer::composeStatementFromParts: invalid parts array!" );
::rtl::OUStringBuffer aSql( m_aPureSelectSQL );
for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) )
@@ -810,7 +811,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr
// normalize the statement so that it doesn't contain any application-level features
anymore
::rtl::OUString sError;
const ::std::auto_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError,
sSQL, false ) );
- DBG_ASSERT( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse
the column retrieval statement!" );
+ OSL_ENSURE( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse
the column retrieval statement!" );
if ( pStatementTree.get() )
if ( !pStatementTree->parseNodeToExecutableStatement( sSQL, m_xConnection,
m_aSqlParser, NULL ) )
break;
@@ -1130,7 +1131,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode *
pCon
::std::vector < PropertyValue >& rFilter, const
Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com",
"OSingleSelectQueryComposer::setComparsionPredicate" );
- DBG_ASSERT(SQL_ISRULE(pCondition, comparison_predicate),"setComparsionPredicate: pCondition
ist kein ComparsionPredicate");
+ OSL_ENSURE(SQL_ISRULE(pCondition, comparison_predicate),"setComparsionPredicate: pCondition
ist kein ComparsionPredicate");
if (SQL_ISRULE(pCondition->getChild(0), column_ref) ||
SQL_ISRULE(pCondition->getChild(pCondition->count()-1), column_ref))
{
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index 2bb86e4..e7f9a0c 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -35,6 +35,7 @@
#include "core_resource.hxx"
#include "core_resource.hrc"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/enumhelper.hxx>
@@ -571,7 +572,7 @@ Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( ) t
::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
Reference< XDataDescriptorFactory > xFactory( m_xTable, UNO_QUERY );
- DBG_ASSERT( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" );
+ OSL_ENSURE( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" );
Reference< XColumnsSupplier > xColsSupp;
if ( xFactory.is() )
xColsSupp = xColsSupp.query( xFactory->createDataDescriptor() );
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index 847e2d8..0a79bdb 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -39,6 +39,7 @@
#include <cppuhelper/queryinterface.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <comphelper/propagg.hxx>
#include <comphelper/sequence.hxx>
@@ -101,7 +102,7 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition
ODataSettings::registerPropertiesFor(this);
osl_incrementInterlockedCount(&m_refCount);
- DBG_ASSERT(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !");
+ OSL_ENSURE(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !");
if ( m_xCommandDefinition.is() )
{
try
@@ -117,7 +118,7 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition
// m_xCommandDefinition->addPropertyChangeListener(PROPERTY_NAME, this);
m_xCommandPropInfo = m_xCommandDefinition->getPropertySetInfo();
}
- DBG_ASSERT(m_xConnection.is(), "OQuery::OQuery : invalid connection !");
+ OSL_ENSURE(m_xConnection.is(), "OQuery::OQuery : invalid connection !");
osl_decrementInterlockedCount(&m_refCount);
}
@@ -238,7 +239,7 @@ void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) thro
{
MutexGuard aGuard(m_aMutex);
- DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition,
UNO_QUERY).get(),
+ OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition,
UNO_QUERY).get(),
"OQuery::propertyChange : where did this call come from ?");
if (m_eDoingCurrently == SETTING_PROPERTIES)
@@ -269,7 +270,7 @@ void SAL_CALL OQuery::disposing( const EventObject& _rSource ) throw (RuntimeExc
MutexGuard aGuard(m_aMutex);
(void)_rSource;
- DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition,
UNO_QUERY).get(),
+ OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition,
UNO_QUERY).get(),
"OQuery::disposing : where did this call come from ?");
m_xCommandDefinition->removePropertyChangeListener(::rtl::OUString(), this);
diff --git a/dbaccess/source/core/api/querycontainer.cxx
b/dbaccess/source/core/api/querycontainer.cxx
index 82a49f1..dc24490 100644
--- a/dbaccess/source/core/api/querycontainer.cxx
+++ b/dbaccess/source/core/api/querycontainer.cxx
@@ -46,6 +46,7 @@
#include <connectivity/dbexception.hxx>
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <comphelper/enumhelper.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/property.hxx>
@@ -241,8 +242,8 @@ void SAL_CALL OQueryContainer::elementInserted( const ::com::sun::star::containe
// nothing to do, we're inserting via an "appendByDescriptor"
return;
- DBG_ASSERT(sElementName.getLength(), "OQueryContainer::elementInserted : invalid name !");
- DBG_ASSERT(m_aDocumentMap.find(sElementName) == m_aDocumentMap.end(),
"OQueryContainer::elementInserted : oops .... we're inconsistent with our master container
!");
+ OSL_ENSURE(sElementName.getLength(), "OQueryContainer::elementInserted : invalid name !");
+ OSL_ENSURE(m_aDocumentMap.find(sElementName) == m_aDocumentMap.end(),
"OQueryContainer::elementInserted : oops .... we're inconsistent with our master container
!");
if (!sElementName.getLength() || hasByName(sElementName))
return;
@@ -257,8 +258,8 @@ void SAL_CALL OQueryContainer::elementRemoved( const ::com::sun::star::container
::rtl::OUString sAccessor;
_rEvent.Accessor >>= sAccessor;
{
- DBG_ASSERT(sAccessor.getLength(), "OQueryContainer::elementRemoved : invalid name !");
- DBG_ASSERT(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(),
"OQueryContainer::elementRemoved : oops .... we're inconsistent with our master container !");
+ OSL_ENSURE(sAccessor.getLength(), "OQueryContainer::elementRemoved : invalid name !");
+ OSL_ENSURE(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(),
"OQueryContainer::elementRemoved : oops .... we're inconsistent with our master container !");
if ( !sAccessor.getLength() || !hasByName(sAccessor) )
return;
}
@@ -274,8 +275,8 @@ void SAL_CALL OQueryContainer::elementReplaced( const ::com::sun::star::containe
{
MutexGuard aGuard(m_aMutex);
- DBG_ASSERT(sAccessor.getLength(), "OQueryContainer::elementReplaced : invalid name !");
- DBG_ASSERT(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(),
"OQueryContainer::elementReplaced : oops .... we're inconsistent with our master container
!");
+ OSL_ENSURE(sAccessor.getLength(), "OQueryContainer::elementReplaced : invalid name !");
+ OSL_ENSURE(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(),
"OQueryContainer::elementReplaced : oops .... we're inconsistent with our master container
!");
if (!sAccessor.getLength() || !hasByName(sAccessor))
return;
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index c25bdbe..bb369a3 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -37,6 +37,7 @@
#include "CIndexes.hxx"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/enumhelper.hxx>
#include <comphelper/container.hxx>
@@ -91,8 +92,8 @@ ODBTable::ODBTable(connectivity::sdbcx::OCollection* _pTables
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::ODBTable"
);
DBG_CTOR(ODBTable, NULL);
- DBG_ASSERT(getMetaData().is(), "ODBTable::ODBTable : invalid conn !");
- DBG_ASSERT(_rName.getLength(), "ODBTable::ODBTable : name !");
+ OSL_ENSURE(getMetaData().is(), "ODBTable::ODBTable : invalid conn !");
+ OSL_ENSURE(_rName.getLength(), "ODBTable::ODBTable : name !");
// TODO : think about collecting the privileges here, as we can't ensure that in
getFastPropertyValue, where
// we do this at the moment, the statement needed can be supplied by the connection (for
example the SQL-Server
// ODBC driver does not allow more than one statement per connection, and in
getFastPropertyValue it's more
diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
index df7a854..b8b0ee8 100644
--- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
+++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
@@ -35,6 +35,7 @@
#include "module_dba.hxx"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -151,7 +152,7 @@ OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxCo
registerProperties();
m_pImpl->m_aProps.aTitle = _rElementName;
- DBG_ASSERT(m_pImpl->m_aProps.aTitle.getLength() != 0,
"OComponentDefinition::OComponentDefinition : invalid name !");
+ OSL_ENSURE(m_pImpl->m_aProps.aTitle.getLength() != 0,
"OComponentDefinition::OComponentDefinition : invalid name !");
}
IMPLEMENT_IMPLEMENTATION_ID(OComponentDefinition);
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index d3f7c77..1cf3c18 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -64,6 +64,7 @@
#include <sfx2/signaturestate.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <tools/errcode.hxx>
#include <tools/urlobj.hxx>
#include <unotools/sharedunocomponent.hxx>
@@ -777,7 +778,7 @@ const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormats
m_xNumberFormatsSupplier.set(
m_aContext.createComponentWithArguments( "com.sun.star.util.NumberFormatsSupplier",
aArguments ), UNO_QUERY_THROW );
- DBG_ASSERT(m_xNumberFormatsSupplier.is(), "ODatabaseModelImpl::getNumberFormatsSupplier :
could not instantiate the formats supplier !");
+ OSL_ENSURE(m_xNumberFormatsSupplier.is(), "ODatabaseModelImpl::getNumberFormatsSupplier :
could not instantiate the formats supplier !");
}
return m_xNumberFormatsSupplier;
}
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index dba19b0..43002e3 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -36,6 +36,7 @@
#include "core_resource.hrc"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <comphelper/enumhelper.hxx>
#include <comphelper/extract.hxx>
@@ -348,7 +349,7 @@ void OBookmarkContainer::implAppend(const ::rtl::OUString& _rName, const ::rtl::
void OBookmarkContainer::implReplace(const ::rtl::OUString& _rName, const ::rtl::OUString&
_rNewLink)
{
MutexGuard aGuard(m_rMutex);
- DBG_ASSERT(checkExistence(_rName), "OBookmarkContainer::implReplace : invalid name !");
+ OSL_ENSURE(checkExistence(_rName), "OBookmarkContainer::implReplace : invalid name !");
m_aBookmarks[_rName] = _rNewLink;
}
diff --git a/dbaccess/source/core/dataaccess/connection.cxx
b/dbaccess/source/core/dataaccess/connection.cxx
index f5fdd75..e3de136 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -54,6 +54,7 @@
#include <connectivity/dbexception.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <comphelper/extract.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
@@ -321,7 +322,7 @@ OConnection::OConnection(ODatabaseSource& _rDB
_rxORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster.get());
setDelegation(xAgg,m_refCount);
- DBG_ASSERT(m_xConnection.is(), "OConnection::OConnection : invalid master connection !");
+ OSL_ENSURE(m_xConnection.is(), "OConnection::OConnection : invalid master connection !");
}
catch(const Exception&)
{
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 7a7e6c7..c16a81e 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -85,6 +85,7 @@
#include <unotools/saveopt.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <tools/errcode.hxx>
#include <tools/urlobj.hxx>
@@ -1668,7 +1669,7 @@ void ODatabaseDocument::disposing()
if ( !m_pImpl.is() )
{
// this means that we're already disposed
- DBG_ASSERT( ODatabaseDocument_OfficeDocument::rBHelper.bDisposed,
"ODatabaseDocument::disposing: no impl anymore, but not yet disposed!" );
+ OSL_ENSURE( ODatabaseDocument_OfficeDocument::rBHelper.bDisposed,
"ODatabaseDocument::disposing: no impl anymore, but not yet disposed!" );
return;
}
@@ -1694,7 +1695,7 @@ void ODatabaseDocument::disposing()
// SYNCHRONIZED ->
::osl::ClearableMutexGuard aGuard( m_aMutex );
- DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are
controllers!" );
+ OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are
controllers!" );
// normally, nobody should explicitly dispose, but only XCloseable::close the document.
And upon
// closing, our controllers are closed, too
@@ -1717,7 +1718,7 @@ void ODatabaseDocument::disposing()
// now, at the latest, the controller array should be empty. Controllers are
// expected to listen for our disposal, and disconnect then
- DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are
controllers!" );
+ OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are
controllers!" );
impl_disposeControllerFrames_nothrow();
aKeepAlive.push_back( m_xModuleManager );
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx
b/dbaccess/source/core/dataaccess/datasource.cxx
index c866902..b82b179 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -74,6 +74,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <tools/urlobj.hxx>
#include <typelib/typedescription.hxx>
#include <unotools/confignode.hxx>
@@ -152,7 +153,7 @@ FlushNotificationAdapter::FlushNotificationAdapter( const Reference< XFlushable
,m_aListener( _rxListener )
{
DBG_CTOR( FlushNotificationAdapter, NULL );
- DBG_ASSERT( _rxBroadcaster.is(), "FlushNotificationAdapter::FlushNotificationAdapter: invalid
flushable!" );
+ OSL_ENSURE( _rxBroadcaster.is(), "FlushNotificationAdapter::FlushNotificationAdapter: invalid
flushable!" );
osl_incrementInterlockedCount( &m_refCount );
{
@@ -160,7 +161,7 @@ FlushNotificationAdapter::FlushNotificationAdapter( const Reference< XFlushable
_rxBroadcaster->addFlushListener( this );
}
osl_decrementInterlockedCount( &m_refCount );
- DBG_ASSERT( m_refCount == 1, "FlushNotificationAdapter::FlushNotificationAdapter: broadcaster
isn't holding by hard ref!?" );
+ OSL_ENSURE( m_refCount == 1, "FlushNotificationAdapter::FlushNotificationAdapter: broadcaster
isn't holding by hard ref!?" );
}
//------------------------------------------------------------
@@ -1201,7 +1202,7 @@ Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const
rtl::OUS
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com",
"ODatabaseSource::buildIsolatedConnection" );
Reference< XConnection > xConn;
Reference< XConnection > xSdbcConn = buildLowLevelConnection(user, password);
- DBG_ASSERT( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of
buildLowLevelConnection!" );
+ OSL_ENSURE( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of
buildLowLevelConnection!" );
// buildLowLevelConnection is expected to always succeed
if ( xSdbcConn.is() )
{
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index 2a040d3..4d6e13a 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -37,6 +37,7 @@
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <comphelper/enumhelper.hxx>
#include <comphelper/extract.hxx>
@@ -562,7 +563,7 @@ void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Refer
void ODefinitionContainer::implReplace(const ::rtl::OUString& _rName, const Reference< XContent >&
_rxNewObject)
{
- DBG_ASSERT(checkExistence(_rName), "ODefinitionContainer::implReplace : invalid name !");
+ OSL_ENSURE(checkExistence(_rName), "ODefinitionContainer::implReplace : invalid name !");
Documents::iterator aFind = m_aDocumentMap.find(_rName);
removeObjectListener(aFind->second);
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx
b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 22cfc09..5c0dc5d 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -34,6 +34,7 @@
#include "sdbcoretools.hxx"
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/mediadescriptor.hxx>
@@ -338,13 +339,13 @@ namespace dbaccess
inline LifetimeCoupler( const Reference< XInterface >& _rxClient, const Reference<
XComponent >& _rxActor )
:m_xClient( _rxClient )
{
- DBG_ASSERT( _rxActor.is(), "LifetimeCoupler::LifetimeCoupler: this will crash!" );
+ OSL_ENSURE( _rxActor.is(), "LifetimeCoupler::LifetimeCoupler: this will crash!" );
osl_incrementInterlockedCount( &m_refCount );
{
_rxActor->addEventListener( this );
}
osl_decrementInterlockedCount( &m_refCount );
- DBG_ASSERT( m_refCount, "LifetimeCoupler::LifetimeCoupler: the actor is not holding us
by hard ref - this won't work!" );
+ OSL_ENSURE( m_refCount, "LifetimeCoupler::LifetimeCoupler: the actor is not holding us
by hard ref - this won't work!" );
}
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw
(RuntimeException);
@@ -716,7 +717,7 @@ namespace
public:
inline LayoutManagerLock( const Reference< XController >& _rxController )
{
- DBG_ASSERT( _rxController.is(), "LayoutManagerLock::LayoutManagerLock: this will
crash!" );
+ OSL_ENSURE( _rxController.is(), "LayoutManagerLock::LayoutManagerLock: this will
crash!" );
Reference< XFrame > xFrame( _rxController->getFrame() );
try
{
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 324d139..cb58a24 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -35,6 +35,7 @@
#include "dbamiscres.hrc"
#include <unotools/confignode.hxx>
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <tools/wldcrd.hxx>
#include <osl/file.hxx>
#include "dbastrings.hrc"
@@ -85,7 +86,7 @@ ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< :
m_aDsnTypesDisplayNames.push_back(m_aDriverConfig.getDriverTypeDisplayName(*pIter));
}
- DBG_ASSERT(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(),
+ OSL_ENSURE(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(),
"ODsnTypeCollection::ODsnTypeCollection : invalid resources !");
}
@@ -93,7 +94,7 @@ ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< :
ODsnTypeCollection::~ODsnTypeCollection()
{
DBG_DTOR(ODsnTypeCollection,NULL);
- DBG_ASSERT(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still
living iterator objects!");
+ OSL_ENSURE(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still
living iterator objects!");
}
//-------------------------------------------------------------------------
String ODsnTypeCollection::getTypeDisplayName(const ::rtl::OUString& _sURL) const
@@ -565,7 +566,7 @@ ODsnTypeCollection::TypeIterator::TypeIterator(const ODsnTypeCollection* _pConta
:m_pContainer(_pContainer)
,m_nPosition(_nInitialPos)
{
- DBG_ASSERT(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid
container!");
+ OSL_ENSURE(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid
container!");
#ifdef DBG_UTIL
++const_cast<ODsnTypeCollection*>(m_pContainer)->m_nLivingIterators;
#endif
@@ -592,19 +593,19 @@ ODsnTypeCollection::TypeIterator::~TypeIterator()
//-------------------------------------------------------------------------
String ODsnTypeCollection::TypeIterator::getDisplayName() const
{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(),
"ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!");
+ OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(),
"ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!");
return m_pContainer->m_aDsnTypesDisplayNames[m_nPosition];
}
// -----------------------------------------------------------------------------
::rtl::OUString ODsnTypeCollection::TypeIterator::getURLPrefix() const
{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnPrefixes.size(),
"ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!");
+ OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnPrefixes.size(),
"ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!");
return m_pContainer->m_aDsnPrefixes[m_nPosition];
}
//-------------------------------------------------------------------------
const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator++()
{
- DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(),
"ODsnTypeCollection::TypeIterator::operator++ : invalid position!");
+ OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(),
"ODsnTypeCollection::TypeIterator::operator++ : invalid position!");
if (m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size())
++m_nPosition;
return *this;
@@ -613,7 +614,7 @@ const ODsnTypeCollection::TypeIterator&
ODsnTypeCollection::TypeIterator::operat
//-------------------------------------------------------------------------
const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator--()
{
- DBG_ASSERT(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid
position!");
+ OSL_ENSURE(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid
position!");
if (m_nPosition >= 0)
--m_nPosition;
return *this;
diff --git a/dbaccess/source/ext/adabas/Acomponentmodule.cxx
b/dbaccess/source/ext/adabas/Acomponentmodule.cxx
index a1d147e..bce39a0 100644
--- a/dbaccess/source/ext/adabas/Acomponentmodule.cxx
+++ b/dbaccess/source/ext/adabas/Acomponentmodule.cxx
@@ -33,6 +33,7 @@
#include <svl/solar.hrc>
#include <comphelper/sequence.hxx>
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#define ENTER_MOD_METHOD() \
::osl::MutexGuard aGuard(s_aMutex); \
@@ -90,12 +91,12 @@ namespace COMPMOD_NAMESPACE
// note that this method is not threadsafe, which counts for the whole class !
if (!m_pRessources && !m_bInitialized)
{
- DBG_ASSERT(m_sFilePrefix.Len(), "OModuleImpl::getResManager: no resource file
prefix!");
+ OSL_ENSURE(m_sFilePrefix.Len(), "OModuleImpl::getResManager: no resource file
prefix!");
// create a manager with a fixed prefix
ByteString aMgrName = m_sFilePrefix;
m_pRessources = ResMgr::CreateResMgr(aMgrName.GetBuffer());
- DBG_ASSERT(m_pRessources,
+ OSL_ENSURE(m_pRessources,
(ByteString("OModuleImpl::getResManager: could not create the resource manager
(file name: ")
+= aMgrName
+= ByteString(")!")).GetBuffer());
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx
b/dbaccess/source/filter/xml/xmlStyleImport.cxx
index 8609dc9..525928b 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.cxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx
@@ -44,6 +44,7 @@
#include <xmloff/xmlprcon.hxx>
#include <xmloff/xmluconv.hxx>
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include "xmlfilter.hxx"
#include "xmlHelper.hxx"
#include <tools/debug.hxx>
@@ -146,7 +147,7 @@ void OTableStyleContext::SetDefaults()
void OTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue)
{
sal_Int32 nIndex(static_cast<OTableStylesContext *>(pStyles)->GetIndex(nContextID));
- DBG_ASSERT(nIndex != -1, "Property not found in Map");
+ OSL_ENSURE(nIndex != -1, "Property not found in Map");
XMLPropertyState aPropState(nIndex, rValue);
GetProperties().push_back(aPropState); // has to be insertes in a sort order later
}
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 99519b3..b4e8c5a 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -66,6 +66,7 @@
#include <unotools/moduleoptions.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/mimeconfighelper.hxx>
#include <comphelper/documentconstants.hxx>
@@ -228,9 +229,9 @@ sal_Int32 ReadThroughComponent(
const uno::Reference<XMultiServiceFactory> & rFactory,
const uno::Reference< XDocumentHandler >& _xFilter )
{
- DBG_ASSERT(xInputStream.is(), "input stream missing");
- DBG_ASSERT(xModelComponent.is(), "document missing");
- DBG_ASSERT(rFactory.is(), "factory missing");
+ OSL_ENSURE(xInputStream.is(), "input stream missing");
+ OSL_ENSURE(xModelComponent.is(), "document missing");
+ OSL_ENSURE(rFactory.is(), "factory missing");
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "dbaxml", "oj", "ReadThroughComponent" );
@@ -243,13 +244,13 @@ sal_Int32 ReadThroughComponent(
rFactory->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))),
UNO_QUERY );
- DBG_ASSERT( xParser.is(), "Can't create parser" );
+ OSL_ENSURE( xParser.is(), "Can't create parser" );
if( !xParser.is() )
return 1;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" );
// get filter
- DBG_ASSERT( _xFilter.is(), "Can't instantiate filter component." );
+ OSL_ENSURE( _xFilter.is(), "Can't instantiate filter component." );
if( !_xFilter.is() )
return 1;
@@ -311,8 +312,8 @@ sal_Int32 ReadThroughComponent(
const uno::Reference<XMultiServiceFactory> & rFactory,
const uno::Reference< XDocumentHandler >& _xFilter)
{
- DBG_ASSERT( xStorage.is(), "Need storage!");
- DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
+ OSL_ENSURE( xStorage.is(), "Need storage!");
+ OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!");
if ( xStorage.is() )
{
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 40b46f2..0f12105 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -80,6 +80,7 @@
/** === 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 +484,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 +509,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 +2720,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 b22b28f..557e8ac 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -91,6 +91,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 +681,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 f84b229..317647d 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 4623aaa..851869b 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -30,6 +30,7 @@
#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 +139,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 +152,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 +169,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 +213,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 +235,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 +275,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 +316,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 1be4f4d..b8a9d1b 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 4788172..50fd4de 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 95c280f..edff16a 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -34,6 +34,7 @@
#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 +51,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 3e0452f..6c92c71 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 70fb1ad..d5d5c0d 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 b0a6a2e..9a09a5f 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -37,6 +37,7 @@
#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 +263,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 +679,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 +915,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 e09f224..f77e386 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(/*(0 == m_nPeerCreationLevel) && */!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 ff04d82..1d40c91 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 f85af16..012f6a1 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -71,6 +71,7 @@
#include <memory>
#include "dbu_control.hrc"
#include "dbu_tbl.hrc"
+#include <osl/diagnose.h>
using namespace dbaui;
@@ -1759,7 +1760,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 85e7cb2..d2c08b4 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -46,6 +46,7 @@
#include "dbu_control.hrc"
#include "dbaccess_helpid.hrc"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <algorithm>
@@ -496,7 +497,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 +584,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 df1d626..2213611 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 ec8c6e3..0e0b1a6 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 f8c03ee..c95a48c 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 cd0a0b6..8b242f9 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 2402f90..238eacf 100644
--- a/dbaccess/source/ui/dlg/AdabasStat.cxx
+++ b/dbaccess/source/ui/dlg/AdabasStat.cxx
@@ -32,6 +32,7 @@
#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 +85,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 b1d0971..3ba82df 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 2bc0954..8bc1464 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 23d8053..c118e01 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 0b0b88c..2fb924a 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -37,6 +37,7 @@
#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 +167,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 3e64f82..034c7cd 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 cdb9195..6ce3ec1 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 7876596..d03a568 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 79a0b68..7dc9fbe 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 29d0460..76f116a 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -41,6 +41,7 @@
#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 +106,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 +299,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 +344,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 +362,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 +412,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 5f973e8..3992310 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -44,7 +44,7 @@
#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 +465,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 +754,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 22bb460..be67af8 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 0f87e99..7d19c58 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/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 41847da..508e347 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -37,6 +37,7 @@
#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 +437,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 79c112b..69268fa 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"
@@ -1089,7 +1090,7 @@ 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
m_bCheckFont = FALSE;
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 4231a92..d2b4370 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -32,6 +32,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 +342,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 +392,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 f60b6ec..545e000 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -30,6 +30,7 @@
#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 +156,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 +167,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 de188ed..7c1a886 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -33,6 +33,7 @@
#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 +98,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 ff3ee96..6ed982f 100644
--- a/dbaccess/source/ui/misc/charsets.cxx
+++ b/dbaccess/source/ui/misc/charsets.cxx
@@ -31,6 +31,7 @@
#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 +123,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 +134,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 +147,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 +159,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 +168,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 3162ae8..21add22 100644
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -58,6 +58,7 @@
#include <toolkit/unohlp.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
//........................................................................
@@ -264,7 +265,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 +305,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 +382,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 04018de..76e9f91 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -38,6 +38,7 @@
#include <math.h>
#endif
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <vcl/lineinfo.hxx>
@@ -64,7 +65,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 1af538a..eb938fa 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 ded10e7..6127b83 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -30,6 +30,7 @@
#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 +1090,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 +1293,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 fff4d5b..eed5367 100644
--- a/dbaccess/source/ui/querydesign/QTableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx
@@ -30,6 +30,7 @@
#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 +74,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 cde173a..aeba237 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx
@@ -32,6 +32,7 @@
#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 +127,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 +164,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 +187,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 +204,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 ab89750..efd1911 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 ff2da95..1583736 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -34,6 +34,7 @@
#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 +285,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 +478,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 +754,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 +782,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 +849,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 +930,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 +997,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 e0993e9..36d466b 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -51,6 +51,7 @@
#include <comphelper/extract.hxx>
#include "sqlmessage.hxx"
#include "UITools.hxx"
+#include <osl/diagnose.h>
using namespace ::svt;
using namespace ::dbaui;
@@ -451,7 +452,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 +489,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 +713,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 +1297,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 +1552,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 +1722,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 +1804,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 +1897,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 +1990,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 +2110,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 +2118,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 +2168,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 +2215,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 +2339,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 +2367,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 +2450,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 +2475,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 fca8f9f..bd9ca53 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 cf7428e..43e0165 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -36,6 +36,7 @@
#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 +294,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 8d18c73..67635e2 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -35,6 +35,7 @@
#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 +378,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 cab14b3..c75f5ce 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 b0fc9c5..527ae0f 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -30,6 +30,7 @@
#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 +63,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 bf506d1..62111ae 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
@@ -31,6 +31,7 @@
#include "TableFieldDescWin.hxx"
#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include "FieldDescriptions.hxx"
#include "dbu_tbl.hrc"
#include "FieldDescriptions.hxx"
@@ -111,7 +112,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 45a7dba..dd34b29 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -41,6 +41,7 @@
#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 +131,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 d4abfe2..c8aa82f 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -33,6 +33,7 @@
#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 +100,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 +147,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 +278,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();
--
1.7.1
Context
- [Libreoffice] [PATCH] DBG_ASSERT -> OSL_ENSURE (dbaccess) · Kenneth Venken
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.