summaryrefslogtreecommitdiffstats
path: root/ucb
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-01-27 22:51:45 +0100
committerJan Holesovsky <kendy@collabora.com>2014-01-27 23:21:43 +0100
commitcb64711136fff661f60d679db1e391866cc6fe10 (patch)
treea20bd51b7403699acdfae425514434b5c45209a1 /ucb
parentTypo decendant => descendant in winaccessibility/MAccessible (diff)
downloadcore-cb64711136fff661f60d679db1e391866cc6fe10.tar.gz
core-cb64711136fff661f60d679db1e391866cc6fe10.zip
Don't use OSL_LOG_PREFIX when throwing exceptions in non-debug builds.
Using OSL_LOG_PREFIX in the exceptions is not a good idea; it blows the size of the string literals tremendously - full build path for every line that uses that, including the line. Let's not remove it for good, but hide it for non-debug builds (OSL_DEBUG_LEVEL == 0) so that anybody who would like to use this during debugging could still do (but I doubt it has any value for anybody). Change-Id: Icc8db95ae0862671a206e681f92c60cdf51ffc32
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/file/bc.cxx17
-rw-r--r--ucb/source/ucp/file/filcmd.cxx10
-rw-r--r--ucb/source/ucp/file/filinpstr.cxx21
-rw-r--r--ucb/source/ucp/file/filprp.cxx8
-rw-r--r--ucb/source/ucp/file/filrow.cxx45
-rw-r--r--ucb/source/ucp/file/filrset.cxx28
-rw-r--r--ucb/source/ucp/file/filstr.cxx27
-rw-r--r--ucb/source/ucp/file/prov.cxx15
-rw-r--r--ucb/source/ucp/file/shell.cxx22
9 files changed, 116 insertions, 77 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index eb392fc3e6ab..738aaf039360 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -42,12 +42,17 @@
#include "filerror.hxx"
#include "filinsreq.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+
// PropertyListeners
@@ -596,7 +601,7 @@ BaseContent::addProperty(
{
if( ( m_nState & JustInserted ) || ( m_nState & Deleted ) || Name.isEmpty() )
{
- throw lang::IllegalArgumentException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), 0 );
+ throw lang::IllegalArgumentException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), 0 );
}
m_pMyShell->associate( m_aUncPath,Name,DefaultValue,Attributes );
@@ -612,7 +617,7 @@ BaseContent::removeProperty(
{
if( m_nState & Deleted )
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
m_pMyShell->deassociate( m_aUncPath, Name );
}
@@ -758,7 +763,7 @@ BaseContent::setParent(
throw( lang::NoSupportException,
RuntimeException)
{
- throw lang::NoSupportException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw lang::NoSupportException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -939,12 +944,12 @@ BaseContent::setPropertyValues(
OUString NewTitle;
if( !( Values[i].Value >>= NewTitle ) )
{
- ret[i] <<= beans::IllegalTypeException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ ret[i] <<= beans::IllegalTypeException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
break;
}
else if( NewTitle.isEmpty() )
{
- ret[i] <<= lang::IllegalArgumentException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), 0 );
+ ret[i] <<= lang::IllegalArgumentException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), 0 );
break;
}
diff --git a/ucb/source/ucp/file/filcmd.cxx b/ucb/source/ucp/file/filcmd.cxx
index 2d96f2de05aa..467d31ed0584 100644
--- a/ucb/source/ucp/file/filcmd.cxx
+++ b/ucb/source/ucp/file/filcmd.cxx
@@ -21,11 +21,15 @@
#include "shell.hxx"
#include "prov.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::ucb;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
XCommandInfo_impl::XCommandInfo_impl( shell* pMyShell )
: m_pMyShell( pMyShell ),
@@ -87,7 +91,7 @@ XCommandInfo_impl::getCommandInfoByName(
if( m_pMyShell->m_sCommandInfo[i].Name == aName )
return m_pMyShell->m_sCommandInfo[i];
- throw UnsupportedCommandException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw UnsupportedCommandException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -101,7 +105,7 @@ XCommandInfo_impl::getCommandInfoByHandle(
if( m_pMyShell->m_sCommandInfo[i].Handle == Handle )
return m_pMyShell->m_sCommandInfo[i];
- throw UnsupportedCommandException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw UnsupportedCommandException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index bc48d8a567d7..15e0edb3ed1a 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -22,12 +22,15 @@
#include "shell.hxx"
#include "prov.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::ucb;
-
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
XInputStream_impl::XInputStream_impl( shell* pMyShell,const OUString& aUncPath, sal_Bool bLock )
: m_xProvider( pMyShell->m_pProvider ),
@@ -136,7 +139,7 @@ XInputStream_impl::readBytes(
io::IOException,
uno::RuntimeException)
{
- if( ! m_nIsOpen ) throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ if( ! m_nIsOpen ) throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
aData.realloc(nBytesToRead);
//TODO! translate memory exhaustion (if it were detectable...) into
@@ -145,7 +148,7 @@ XInputStream_impl::readBytes(
sal_uInt64 nrc(0);
if(m_aFile.read( aData.getArray(),sal_uInt64(nBytesToRead),nrc )
!= osl::FileBase::E_None)
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
// Shrink aData in case we read less than nBytesToRead (XInputStream
// documentation does not tell whether this is required, and I do not know
@@ -202,7 +205,7 @@ XInputStream_impl::closeInput(
{
osl::FileBase::RC err = m_aFile.close();
if( err != osl::FileBase::E_None )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
m_nIsOpen = false;
}
}
@@ -216,9 +219,9 @@ XInputStream_impl::seek(
uno::RuntimeException )
{
if( location < 0 )
- throw lang::IllegalArgumentException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), 0 );
+ throw lang::IllegalArgumentException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), 0 );
if( osl::FileBase::E_None != m_aFile.setPos( osl_Pos_Absolut, sal_uInt64( location ) ) )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -230,7 +233,7 @@ XInputStream_impl::getPosition(
{
sal_uInt64 uPos;
if( osl::FileBase::E_None != m_aFile.getPos( uPos ) )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
return sal_Int64( uPos );
}
@@ -242,7 +245,7 @@ XInputStream_impl::getLength(
{
sal_uInt64 uEndPos;
if ( m_aFile.getSize(uEndPos) != osl::FileBase::E_None )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
else
return sal_Int64( uEndPos );
}
diff --git a/ucb/source/ucp/file/filprp.cxx b/ucb/source/ucp/file/filprp.cxx
index 5b79d5a8b112..cf8461c21e59 100644
--- a/ucb/source/ucp/file/filprp.cxx
+++ b/ucb/source/ucp/file/filprp.cxx
@@ -26,9 +26,13 @@ using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;
-
#include "filinl.hxx"
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
XPropertySetInfo_impl::XPropertySetInfo_impl( shell* pMyShell,const OUString& aUnqPath )
: m_pMyShell( pMyShell ),
@@ -116,7 +120,7 @@ XPropertySetInfo_impl::getPropertyByName(
for( sal_Int32 i = 0; i < m_seq.getLength(); ++i )
if( m_seq[i].Name == aName ) return m_seq[i];
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx
index 282b7685558b..8cb010223ec7 100644
--- a/ucb/source/ucp/file/filrow.cxx
+++ b/ucb/source/ucp/file/filrow.cxx
@@ -27,8 +27,13 @@ using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::uno;
-// Funktion for TypeConverting
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+// Function for TypeConverting
template< class _type_ >
sal_Bool convert( shell* pShell,
@@ -134,7 +139,7 @@ XRow_impl::getString(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
OUString Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<OUString>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -148,7 +153,7 @@ XRow_impl::getBoolean(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
sal_Bool Value( false );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<sal_Bool>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -163,7 +168,7 @@ XRow_impl::getByte(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
sal_Int8 Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<sal_Int8>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -177,7 +182,7 @@ XRow_impl::getShort(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
sal_Int16 Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<sal_Int16>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -192,7 +197,7 @@ XRow_impl::getInt(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
sal_Int32 Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<sal_Int32>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -206,7 +211,7 @@ XRow_impl::getLong(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
sal_Int64 Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<sal_Int64>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -220,7 +225,7 @@ XRow_impl::getFloat(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
float Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<float>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -234,7 +239,7 @@ XRow_impl::getDouble(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
double Value( 0 );
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<double>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -248,7 +253,7 @@ XRow_impl::getBytes(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Sequence< sal_Int8 > Value(0);
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Sequence< sal_Int8 > >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -262,7 +267,7 @@ XRow_impl::getDate(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
util::Date Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<util::Date>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -276,7 +281,7 @@ XRow_impl::getTime(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
util::Time Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<util::Time>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -290,7 +295,7 @@ XRow_impl::getTimestamp(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
util::DateTime Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<util::DateTime>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -305,7 +310,7 @@ XRow_impl::getBinaryStream(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< io::XInputStream > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Reference< io::XInputStream > >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -320,7 +325,7 @@ XRow_impl::getCharacterStream(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< io::XInputStream > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert< uno::Reference< io::XInputStream> >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -336,7 +341,7 @@ XRow_impl::getObject(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Any Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Any>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
@@ -350,7 +355,7 @@ XRow_impl::getRef(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< sdbc::XRef > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Reference< sdbc::XRef> >( m_pMyShell,
@@ -367,7 +372,7 @@ XRow_impl::getBlob(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< sdbc::XBlob > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Reference< sdbc::XBlob> >( m_pMyShell,
@@ -384,7 +389,7 @@ XRow_impl::getClob(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< sdbc::XClob > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Reference< sdbc::XClob> >( m_pMyShell,
@@ -402,7 +407,7 @@ XRow_impl::getArray(
uno::RuntimeException)
{
if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
uno::Reference< sdbc::XArray > Value;
osl::MutexGuard aGuard( m_aMutex );
m_nWasNull = ::convert<uno::Reference< sdbc::XArray> >( m_pMyShell,
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index 8c6618f6233d..edf959a5a33a 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -35,6 +35,12 @@
using namespace fileaccess;
using namespace com::sun::star;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+
XResultSet_impl::XResultSet_impl(
shell* pMyShell,
const OUString& aUnqPath,
@@ -340,7 +346,7 @@ XResultSet_impl::OneMore(
}
else // error fetching anything
{
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
}
}
}
@@ -498,7 +504,7 @@ XResultSet_impl::relative(
uno::RuntimeException)
{
if( isAfterLast() || isBeforeFirst() )
- throw sdbc::SQLException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
+ throw sdbc::SQLException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
if( row > 0 )
while( row-- ) next();
else if( row < 0 )
@@ -650,7 +656,7 @@ XResultSet_impl::getStaticResultSet()
osl::MutexGuard aGuard( m_aMutex );
if ( m_xListener.is() )
- throw ucb::ListenerAlreadySetException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw ucb::ListenerAlreadySetException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
return uno::Reference< sdbc::XResultSet >( this );
}
@@ -666,7 +672,7 @@ XResultSet_impl::setListener(
osl::ClearableMutexGuard aGuard( m_aMutex );
if ( m_xListener.is() )
- throw ucb::ListenerAlreadySetException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw ucb::ListenerAlreadySetException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
m_xListener = Listener;
@@ -706,9 +712,9 @@ XResultSet_impl::connectToCache(
uno::RuntimeException )
{
if( m_xListener.is() )
- throw ucb::ListenerAlreadySetException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw ucb::ListenerAlreadySetException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
if( m_bStatic )
- throw ucb::ListenerAlreadySetException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw ucb::ListenerAlreadySetException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
uno::Reference< ucb::XSourceInitialization > xTarget(
xCache, uno::UNO_QUERY );
@@ -732,7 +738,7 @@ XResultSet_impl::connectToCache(
return;
}
}
- throw ucb::ServiceNotFoundException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw ucb::ServiceNotFoundException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
//=========================================================================
@@ -816,7 +822,7 @@ void SAL_CALL XResultSet_impl::setPropertyValue(
if( aPropertyName == "IsRowCountFinal" ||
aPropertyName == "RowCount" )
return;
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -840,7 +846,7 @@ uno::Any SAL_CALL XResultSet_impl::getPropertyValue(
return aAny;
}
else
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -869,7 +875,7 @@ void SAL_CALL XResultSet_impl::addPropertyChangeListener(
m_pRowCountListeners->addInterface( xListener );
}
else
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -894,7 +900,7 @@ void SAL_CALL XResultSet_impl::removePropertyChangeListener(
m_pRowCountListeners->removeInterface( aListener );
}
else
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
void SAL_CALL XResultSet_impl::addVetoableChangeListener(
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 298adc16a593..4f731d5a7617 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -24,12 +24,15 @@
#include "shell.hxx"
#include "prov.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::ucb;
-
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
/******************************************************************************/
/* */
@@ -175,10 +178,10 @@ void SAL_CALL XStream_impl::truncate(void)
throw( io::IOException, uno::RuntimeException )
{
if (osl::FileBase::E_None != m_aFile.setSize(0))
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
if (osl::FileBase::E_None != m_aFile.setPos(osl_Pos_Absolut,sal_uInt64(0)))
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -197,7 +200,7 @@ XStream_impl::readBytes(
uno::RuntimeException)
{
if( ! m_nIsOpen )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
sal_Int8 * buffer;
try
@@ -207,7 +210,7 @@ XStream_impl::readBytes(
catch (const std::bad_alloc&)
{
if( m_nIsOpen ) m_aFile.close();
- throw io::BufferSizeExceededException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::BufferSizeExceededException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
sal_uInt64 nrc(0);
@@ -215,7 +218,7 @@ XStream_impl::readBytes(
!= osl::FileBase::E_None)
{
delete[] buffer;
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
aData = uno::Sequence< sal_Int8 > ( buffer, (sal_uInt32)nrc );
delete[] buffer;
@@ -273,7 +276,7 @@ XStream_impl::writeBytes( const uno::Sequence< sal_Int8 >& aData )
const sal_Int8* p = aData.getConstArray();
if(osl::FileBase::E_None != m_aFile.write(((void*)(p)),sal_uInt64(length),nWrittenBytes) ||
nWrittenBytes != length )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
}
@@ -337,9 +340,9 @@ XStream_impl::seek(
uno::RuntimeException )
{
if( location < 0 )
- throw lang::IllegalArgumentException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), 0 );
+ throw lang::IllegalArgumentException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >(), 0 );
if( osl::FileBase::E_None != m_aFile.setPos( osl_Pos_Absolut, sal_uInt64( location ) ) )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -351,7 +354,7 @@ XStream_impl::getPosition(
{
sal_uInt64 uPos;
if( osl::FileBase::E_None != m_aFile.getPos( uPos ) )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
return sal_Int64( uPos );
}
@@ -363,7 +366,7 @@ XStream_impl::getLength(
{
sal_uInt64 uEndPos;
if ( m_aFile.getSize(uEndPos) != osl::FileBase::E_None )
- throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw io::IOException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
else
return sal_Int64( uEndPos );
}
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 83ad168f67b3..1945b5e0a020 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -31,7 +31,6 @@
#include "bc.hxx"
#include "prov.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -40,6 +39,12 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::ucb;
using namespace com::sun::star::container;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+
//=========================================================================
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpfile_component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
@@ -268,7 +273,7 @@ FileProvider::queryContent(
aUnc );
if( err )
- throw IllegalIdentifierException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw IllegalIdentifierException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
return Reference< XContent >( new BaseContent( m_pMyShell,xIdentifier,aUnc ) );
}
@@ -459,7 +464,7 @@ XPropertySetInfoImpl2::getPropertyByName(
if( m_seq[i].Name == aName )
return m_seq[i];
- throw UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -541,7 +546,7 @@ FileProvider::setPropertyValue( const OUString& aPropertyName,
aPropertyName.equalsAscii( "HostName" ) )
return;
else
- throw UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
@@ -573,7 +578,7 @@ FileProvider::getPropertyValue(
return aAny;
}
else
- throw UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 75991125df70..12bd57abcf52 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -59,11 +59,15 @@
#include "prov.hxx"
#include "bc.hxx"
-
using namespace fileaccess;
using namespace com::sun::star;
using namespace com::sun::star::ucb;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
shell::UnqPathData::UnqPathData()
: properties( 0 ),
@@ -485,7 +489,7 @@ shell::associate( const OUString& aUnqPath,
shell::PropertySet::iterator it1 = m_aDefaultProperties.find( newProperty );
if( it1 != m_aDefaultProperties.end() )
- throw beans::PropertyExistException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::PropertyExistException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
{
osl::MutexGuard aGuard( m_aMutex );
@@ -498,7 +502,7 @@ shell::associate( const OUString& aUnqPath,
PropertySet& properties = *(it->second.properties);
it1 = properties.find( newProperty );
if( it1 != properties.end() )
- throw beans::PropertyExistException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::PropertyExistException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
// Property does not exist
properties.insert( newProperty );
@@ -521,7 +525,7 @@ shell::deassociate( const OUString& aUnqPath,
shell::PropertySet::iterator it1 = m_aDefaultProperties.find( oldProperty );
if( it1 != m_aDefaultProperties.end() )
- throw beans::NotRemoveableException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::NotRemoveableException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
osl::MutexGuard aGuard( m_aMutex );
@@ -533,7 +537,7 @@ shell::deassociate( const OUString& aUnqPath,
it1 = properties.find( oldProperty );
if( it1 == properties.end() )
- throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ throw beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
properties.erase( it1 );
@@ -829,7 +833,7 @@ shell::setv( const OUString& aUnqPath,
it1 = properties.find( toset );
if( it1 == properties.end() )
{
- ret[i] <<= beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ ret[i] <<= beans::UnknownPropertyException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
continue;
}
@@ -839,7 +843,7 @@ shell::setv( const OUString& aUnqPath,
if( it1->getAttributes() & beans::PropertyAttribute::READONLY )
{
- ret[i] <<= lang::IllegalAccessException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ ret[i] <<= lang::IllegalAccessException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
continue;
}
@@ -910,7 +914,7 @@ shell::setv( const OUString& aUnqPath,
}
}
else
- ret[i] <<= beans::IllegalTypeException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ ret[i] <<= beans::IllegalTypeException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
else if(values[i].Name == IsReadOnly ||
values[i].Name == IsHidden)
@@ -1018,7 +1022,7 @@ shell::setv( const OUString& aUnqPath,
}
}
else
- ret[i] <<= beans::IllegalTypeException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
+ ret[i] <<= beans::IllegalTypeException( OUString(THROW_WHERE), uno::Reference< uno::XInterface >() );
}
}
} // end for