diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-01-27 22:51:45 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-01-27 23:21:43 +0100 |
commit | cb64711136fff661f60d679db1e391866cc6fe10 (patch) | |
tree | a20bd51b7403699acdfae425514434b5c45209a1 /package/source/xstor/xfactory.cxx | |
parent | c1503da35d8879366da13258837cf0084a536809 (diff) |
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 'package/source/xstor/xfactory.cxx')
-rw-r--r-- | package/source/xstor/xfactory.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index 0b5978551569..74c7b7f43cb7 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -33,6 +33,12 @@ using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + sal_Bool CheckPackageSignature_Impl( const uno::Reference< io::XInputStream >& xInputStream, const uno::Reference< io::XSeekable >& xSeekable ) { @@ -203,19 +209,19 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) nStorageType = embed::StorageFormats::OFOPXML; else - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); } else if ( aDescr[nInd].Value >>= nFormatID ) { if ( nFormatID != embed::StorageFormats::PACKAGE && nFormatID != embed::StorageFormats::ZIP && nFormatID != embed::StorageFormats::OFOPXML ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); nStorageType = nFormatID; } else - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); } else OSL_FAIL( "Unacceptable property, will be ignored!\n" ); |