summaryrefslogtreecommitdiff
path: root/package/source/manifest
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 /package/source/manifest
parentc1503da35d8879366da13258837cf0084a536809 (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/manifest')
-rw-r--r--package/source/manifest/ManifestExport.cxx14
-rw-r--r--package/source/manifest/ManifestWriter.cxx8
2 files changed, 17 insertions, 5 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 7e55a28147d9..0572cf73f0bc 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -35,6 +35,12 @@
using namespace ::com::sun::star;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+
ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHandler, const uno::Sequence< uno::Sequence < beans::PropertyValue > >& rManList )
{
const OUString sFileEntryElement ( ELEMENT_FILE_ENTRY );
@@ -257,7 +263,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
else if ( nDigestAlgID == xml::crypto::DigestID::SHA1_1K )
sChecksumType = sSHA1_1k_Name;
else
- throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected digest algorithm is provided!", uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( THROW_WHERE "Unexpected digest algorithm is provided!", uno::Reference< uno::XInterface >() );
pNewAttrList->AddAttribute ( sChecksumTypeAttribute, sCdataAttribute, sChecksumType );
*pDigest >>= aSequence;
@@ -280,7 +286,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
{
OSL_ENSURE( nDerivedKeySize, "Unexpected key size is provided!" );
if ( nDerivedKeySize != 32 )
- throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected key size is provided!", uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( THROW_WHERE "Unexpected key size is provided!", uno::Reference< uno::XInterface >() );
sEncAlgName = sAES256_URL;
}
@@ -289,7 +295,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
sEncAlgName = sBlowfish_Name;
}
else
- throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected encryption algorithm is provided!", uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( THROW_WHERE "Unexpected encryption algorithm is provided!", uno::Reference< uno::XInterface >() );
pNewAttrList->AddAttribute ( sAlgorithmNameAttribute, sCdataAttribute, sEncAlgName );
@@ -353,7 +359,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
sStartKeySize = aBuffer.makeStringAndClear();
}
else
- throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected start key algorithm is provided!", uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!", uno::Reference< uno::XInterface >() );
pNewAttrList->AddAttribute ( sStartKeyGenerationNameAttribute, sCdataAttribute, sStartKeyAlg );
pNewAttrList->AddAttribute ( sKeySizeAttribute, sCdataAttribute, sStartKeySize );
diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx
index 7d69b37261b6..2c32bc994d68 100644
--- a/package/source/manifest/ManifestWriter.cxx
+++ b/package/source/manifest/ManifestWriter.cxx
@@ -41,6 +41,12 @@ using namespace ::com::sun::star::packages;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::packages::manifest;
+#if OSL_DEBUG_LEVEL > 0
+#define THROW_WHERE SAL_WHERE
+#else
+#define THROW_WHERE ""
+#endif
+
ManifestWriter::ManifestWriter( const Reference < XComponentContext > & xContext )
: m_xContext ( xContext )
{
@@ -60,7 +66,7 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr
}
catch( SAXException& )
{
- throw RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
+ throw RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() );
}
}