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 | |
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')
-rw-r--r-- | package/source/manifest/ManifestExport.cxx | 14 | ||||
-rw-r--r-- | package/source/manifest/ManifestWriter.cxx | 8 | ||||
-rw-r--r-- | package/source/xstor/xfactory.cxx | 12 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 1186 | ||||
-rw-r--r-- | package/source/zipapi/ByteGrabber.cxx | 14 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 14 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 84 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageBuffer.cxx | 12 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageEntry.cxx | 10 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 28 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolderEnumeration.cxx | 8 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 74 | ||||
-rw-r--r-- | package/source/zippackage/wrapstreamforshare.cxx | 24 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 58 |
14 files changed, 815 insertions, 731 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 >() ); } } 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" ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 16483d6f3944..9a6d45f05708 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -55,6 +55,12 @@ using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + typedef ::std::list< uno::WeakReference< lang::XComponent > > WeakComponentList; struct StorInternalData_Impl @@ -98,15 +104,15 @@ void OStorage_Impl::completeStorageStreamCopy_Impl( uno::Reference< beans::XPropertySet > xSourceProps( xSource, uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xDestProps( xDest, uno::UNO_QUERY ); if ( !xSourceProps.is() || !xDestProps.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XOutputStream > xDestOutStream = xDest->getOutputStream(); if ( !xDestOutStream.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XInputStream > xSourceInStream = xSource->getInputStream(); if ( !xSourceInStream.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: headers of encripted streams should be copied also ::comphelper::OStorageHelper::CopyInputToOutput( xSourceInStream, xDestOutStream ); @@ -143,7 +149,7 @@ uno::Reference< io::XInputStream > GetSeekableTempCopy( uno::Reference< io::XInp uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream(); if ( !xTempOut.is() || !xTempIn.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); ::comphelper::OStorageHelper::CopyInputToOutput( xInStream, xTempOut ); xTempOut->closeOutput(); @@ -305,7 +311,7 @@ OStorage_Impl::~OStorage_Impl() catch ( const uno::Exception& rException ) { AddLog( rException.Message ); - AddLog( OSL_LOG_PREFIX "Quiet exception" ); + AddLog( THROW_WHERE "Quiet exception" ); } m_pAntiImpl = NULL; } @@ -321,7 +327,7 @@ OStorage_Impl::~OStorage_Impl() } catch( const uno::Exception& rException ) { AddLog( rException.Message ); - AddLog( OSL_LOG_PREFIX "Quiet exception" ); + AddLog( THROW_WHERE "Quiet exception" ); } } @@ -381,7 +387,7 @@ OStorage_Impl::~OStorage_Impl() } catch( const uno::Exception& rException ) { - AddLog( OSL_LOG_PREFIX "Quiet exception" ); + AddLog( THROW_WHERE "Quiet exception" ); AddLog( rException.Message ); } } @@ -426,7 +432,7 @@ void OStorage_Impl::RemoveReadOnlyWrap( OStorage& aStorage ) pStorageIter->m_pPointer->InternalDispose( sal_False ); } catch( const uno::Exception& rException ) { - AddLog( OSL_LOG_PREFIX "Quiet exception" ); + AddLog( THROW_WHERE "Quiet exception" ); AddLog( rException.Message ); } @@ -519,7 +525,7 @@ void OStorage_Impl::OpenOwnPackage() SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "The package root folder can not be opened!" ); if ( !m_xPackageFolder.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } uno::Reference< uno::XComponentContext > OStorage_Impl::GetComponentContext() @@ -612,11 +618,11 @@ void OStorage_Impl::ReadContents() uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xPackageFolder, uno::UNO_QUERY ); if ( !xEnumAccess.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration(); if ( !xEnum.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_bListCreated = sal_True; @@ -629,7 +635,7 @@ void OStorage_Impl::ReadContents() if ( !xNamed.is() ) { SAL_WARN( "package.xstor", "XNamed is not supported!" ); - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } OUString aName = xNamed->getName(); @@ -641,7 +647,7 @@ void OStorage_Impl::ReadContents() if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" ) { if ( !pNewElement->m_bIsStorage ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: Unexpected format + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Unexpected format m_pRelStorElement = pNewElement; CreateRelStorage(); @@ -660,7 +666,7 @@ void OStorage_Impl::ReadContents() catch( const container::NoSuchElementException& rNoSuchElementException ) { AddLog( rNoSuchElementException.Message ); - AddLog( OSL_LOG_PREFIX "NoSuchElement" ); + AddLog( THROW_WHERE "NoSuchElement" ); SAL_WARN( "package.xstor", "hasMoreElements() implementation has problems!" ); break; @@ -684,18 +690,18 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes uno::Reference< beans::XPropertySet > xPropSet( xDest, uno::UNO_QUERY ); if ( !xPropSet.is() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); sal_Int32 nDestMode = embed::ElementModes::READ; xPropSet->getPropertyValue( "OpenMode" ) >>= nDestMode; if ( !( nDestMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied ReadContents(); if ( !m_xPackageFolder.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); for ( SotElementList_Impl::iterator pElementIter = m_aChildrenList.begin(); pElementIter != m_aChildrenList.end(); ++pElementIter ) @@ -737,7 +743,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes catch( const packages::NoEncryptionException& rNoEncryptionException ) { AddLog( rNoEncryptionException.Message ); - AddLog( OSL_LOG_PREFIX "No Encryption" ); + AddLog( THROW_WHERE "No Encryption" ); } } } @@ -757,7 +763,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes uno::Reference< embed::XRelationshipAccess > xRels( xDest, uno::UNO_QUERY ); if ( !xRels.is() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); xRels->insertRelationships( GetAllRelationshipsIfAny(), sal_False ); } @@ -780,7 +786,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, uno::Reference< container::XNameAccess > xDestAccess( xDest, uno::UNO_QUERY ); if ( !xDestAccess.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( xDestAccess->hasByName( aName ) && !( pElement->m_bIsStorage && xDest->isStorageElement( aName ) ) ) @@ -798,7 +804,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, { OpenSubStorage( pElement, embed::ElementModes::READ ); if ( !pElement->m_pStorage ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } pElement->m_pStorage->CopyToStorage( xSubDest, bDirect ); @@ -809,7 +815,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, { OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !pElement->m_pStream->IsEncrypted() ) @@ -849,7 +855,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, uno::Reference< embed::XRelationshipAccess > xRels( xDest, uno::UNO_QUERY ); if ( !xRels.is() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); xRels->insertRelationships( GetAllRelationshipsIfAny(), sal_False ); } @@ -873,7 +879,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, } if ( !xInputToInsert.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); xOptDest->insertStreamElementDirect( aName, xInputToInsert, aStrProps ); } @@ -890,7 +896,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, else if ( m_nStorageType != embed::StorageFormats::PACKAGE ) { SAL_WARN( "package.xstor", "Encryption is only supported in package storage!" ); - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } else if ( pElement->m_pStream->HasCachedEncryptionData() && ( pElement->m_pStream->IsModified() || pElement->m_pStream->HasWriteOwner_Impl() ) ) @@ -905,7 +911,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, catch( const packages::NoEncryptionException& rNoEncryptionException ) { AddLog( rNoEncryptionException.Message ); - AddLog( OSL_LOG_PREFIX "No Encryption" ); + AddLog( THROW_WHERE "No Encryption" ); } if ( bHasCommonEncryptionData && ::package::PackageEncryptionDatasEqual( pElement->m_pStream->GetCachedEncryptionData(), aCommonEncryptionData ) ) @@ -960,7 +966,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, catch( const packages::WrongPasswordException& rWrongPasswordException ) { AddLog( rWrongPasswordException.Message ); - AddLog( OSL_LOG_PREFIX "Handled exception" ); + AddLog( THROW_WHERE "Handled exception" ); // If the common storage password does not allow to open the stream // it could be copyed in raw way, the problem is that the StartKey should be the same @@ -985,7 +991,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelatio || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED ) return m_aRelInfo; else // m_nRelInfoStatus == RELINFO_CHANGED_BROKEN || m_nRelInfoStatus == RELINFO_BROKEN - throw io::IOException( OSL_LOG_PREFIX "Wrong relinfo stream!", + throw io::IOException( THROW_WHERE "Wrong relinfo stream!", uno::Reference< uno::XInterface >() ); } @@ -995,7 +1001,7 @@ void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& x SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "A commited storage is incomplete!" ); if ( !m_xPackageFolder.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OStorage_Impl aTempRepresent( NULL, embed::ElementModes::READ, @@ -1016,7 +1022,7 @@ void OStorage_Impl::InsertIntoPackageFolder( const OUString& aName, SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "An inserted storage is incomplete!" ); uno::Reference< lang::XUnoTunnel > xTunnel( m_xPackageFolder, uno::UNO_QUERY ); if ( !xTunnel.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); xParentPackageFolder->insertByName( aName, uno::makeAny( xTunnel ) ); @@ -1038,7 +1044,7 @@ void OStorage_Impl::Commit() // if storage is commited it should have a valid Package representation SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "The package representation should exist!" ); if ( !m_xPackageFolder.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OSL_ENSURE( m_nStorageMode & embed::ElementModes::WRITE, "Commit of readonly storage, should be detected before!\n" ); @@ -1169,7 +1175,7 @@ void OStorage_Impl::Commit() { OpenSubStream( *pElementIter ); if ( !(*pElementIter)->m_pStream ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } CommitStreamRelInfo( *pElementIter ); @@ -1194,7 +1200,7 @@ void OStorage_Impl::Commit() { OSL_ENSURE( (*pElementIter)->m_pStorage, "An inserted storage is incomplete!\n" ); if ( !(*pElementIter)->m_pStorage ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); (*pElementIter)->m_pStorage->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); @@ -1205,7 +1211,7 @@ void OStorage_Impl::Commit() { OSL_ENSURE( (*pElementIter)->m_pStream, "An inserted stream is incomplete!\n" ); if ( !(*pElementIter)->m_pStream ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !(*pElementIter)->m_pStream->IsTransacted() ) (*pElementIter)->m_pStream->Commit(); @@ -1228,7 +1234,7 @@ void OStorage_Impl::Commit() // move properties to the destination package folder uno::Reference< beans::XPropertySet > xProps( xNewPackageFolder, uno::UNO_QUERY ); if ( !xProps.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); xProps->setPropertyValue( "MediaType", uno::makeAny( m_aMediaType ) ); xProps->setPropertyValue( "Version", uno::makeAny( m_aVersion ) ); @@ -1243,7 +1249,7 @@ void OStorage_Impl::Commit() SAL_WARN_IF( !xChangesBatch.is(), "package.xstor", "Impossible to commit package!" ); if ( !xChangesBatch.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); try { @@ -1261,7 +1267,7 @@ void OStorage_Impl::Commit() } AddLog( aException.Message ); - AddLog( OSL_LOG_PREFIX "Rethrow" ); + AddLog( THROW_WHERE "Rethrow" ); throw; } } @@ -1342,19 +1348,19 @@ void OStorage_Impl::Revert() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; if ( m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_bIsRoot ) { if ( !m_bHasCommonEncryptionData ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_aCommonEncryptionData; } else { if ( !m_pParent ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_pParent->GetCommonRootEncryptionData(); } @@ -1382,7 +1388,7 @@ SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr ) { SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" ); if ( !m_xPackage.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Any > aSeq( 1 ); aSeq[0] <<= sal_False; @@ -1391,15 +1397,15 @@ SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr ) SAL_WARN_IF( !xNewElement.is(), "package.xstor", "Not possible to create a new stream!" ); if ( !xNewElement.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE || !bEncr, "Only package storage supports encryption!\n" ); if ( m_nStorageType != embed::StorageFormats::PACKAGE && bEncr ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the mode is not needed for storage stream internal implementation SotElement_Impl* pNewElement = InsertElement( aName, sal_False ); @@ -1417,10 +1423,10 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( OUString aName, const uno::Refe // insert of raw stream means insert and commit SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" ); if ( !m_xPackage.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); uno::Reference< io::XInputStream > xInStrToInsert = xSeek.is() ? xInStream : @@ -1433,11 +1439,11 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( OUString aName, const uno::Refe SAL_WARN_IF( !xNewElement.is(), "package.xstor", "Not possible to create a new stream!" ); if ( !xNewElement.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); xPackageSubStream->setRawStream( xInStrToInsert ); @@ -1458,7 +1464,7 @@ OStorage_Impl* OStorage_Impl::CreateNewStorageImpl( sal_Int32 nStorageMode ) { SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" ); if ( !m_xPackage.is() ) - throw embed::InvalidStorageException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Any > aSeq( 1 ); aSeq[0] <<= sal_True; @@ -1467,11 +1473,11 @@ OStorage_Impl* OStorage_Impl::CreateNewStorageImpl( sal_Int32 nStorageMode ) SAL_WARN_IF( !xNewElement.is(), "package.xstor", "Not possible to create a new storage!" ); if ( !xNewElement.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< container::XNameContainer > xPackageSubFolder( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubFolder.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OStorage_Impl* pResult = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType ); @@ -1543,14 +1549,14 @@ void OStorage_Impl::OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorag uno::Reference< lang::XUnoTunnel > xTunnel; m_xPackageFolder->getByName( pElement->m_aOriginalName ) >>= xTunnel; if ( !xTunnel.is() ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< container::XNameContainer > xPackageSubFolder( xTunnel, uno::UNO_QUERY ); SAL_WARN_IF( !xPackageSubFolder.is(), "package.xstor", "Can not get XNameContainer interface from folder!" ); if ( !xPackageSubFolder.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); pElement->m_pStorage = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType ); } @@ -1570,11 +1576,11 @@ void OStorage_Impl::OpenSubStream( SotElement_Impl* pElement ) uno::Reference< lang::XUnoTunnel > xTunnel; m_xPackageFolder->getByName( pElement->m_aOriginalName ) >>= xTunnel; if ( !xTunnel.is() ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xTunnel, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the stream can never be inserted here, because inserted stream element holds the stream till commit or destruction pElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xContext, sal_False, m_nStorageType, sal_False, GetRelInfoStreamForName( pElement->m_aOriginalName ) ); @@ -1611,7 +1617,7 @@ void OStorage_Impl::RemoveElement( SotElement_Impl* pElement ) if ( (pElement->m_pStorage && ( pElement->m_pStorage->m_pAntiImpl || !pElement->m_pStorage->m_aReadOnlyWrapList.empty() )) || (pElement->m_pStream && ( pElement->m_pStream->m_pAntiImpl || !pElement->m_pStream->m_aInputStreamsList.empty() )) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: Access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Access denied if ( pElement->m_bIsInserted ) { @@ -1657,10 +1663,10 @@ void OStorage_Impl::CloneStreamElement( const OUString& aStreamName, if ( !pElement ) { // element does not exist, throw exception - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied } else if ( pElement->m_bIsStorage ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStream ) OpenSubStream( pElement ); @@ -1682,7 +1688,7 @@ void OStorage_Impl::CloneStreamElement( const OUString& aStreamName, pElement->m_pStream->GetCopyOfLastCommit( xTargetStream ); } else - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error } void OStorage_Impl::RemoveStreamRelInfo( const OUString& aOriginalName ) @@ -1719,7 +1725,7 @@ void OStorage_Impl::CreateRelStorage() OpenSubStorage( m_pRelStorElement, embed::ElementModes::WRITE ); if ( !m_pRelStorElement->m_pStorage ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OStorage* pResultStorage = new OStorage( m_pRelStorElement->m_pStorage, sal_False ); m_xRelStorage = uno::Reference< embed::XStorage >( (embed::XStorage*) pResultStorage ); @@ -1732,7 +1738,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) // the stream element must be provided if ( !pStreamElement ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_nStorageType == embed::StorageFormats::OFOPXML && pStreamElement->m_pStream ) { @@ -1775,12 +1781,12 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain OUString aRelsStorName("_rels"); if ( !xNewPackageFolder.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_nRelInfoStatus == RELINFO_CHANGED || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ @@ -1798,7 +1804,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain uno::Reference< io::XOutputStream > xOutStream = xRelsStream->getOutputStream(); if ( !xOutStream.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, m_xContext ); @@ -1824,7 +1830,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain uno::Reference< io::XOutputStream > xOutputStream = xRelsStream->getOutputStream(); if ( !xOutputStream.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XSeekable > xSeek( m_xNewRelInfoStream, uno::UNO_QUERY_THROW ); xSeek->seek( 0 ); @@ -1925,7 +1931,7 @@ OStorage::~OStorage() catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Handled exception" ); + m_pImpl->AddLog( THROW_WHERE "Handled exception" ); } } } @@ -1954,8 +1960,8 @@ void SAL_CALL OStorage::InternalDispose( sal_Bool bNotifyImpl ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } // the source object is also a kind of locker for the current object @@ -1991,7 +1997,7 @@ void SAL_CALL OStorage::InternalDispose( sal_Bool bNotifyImpl ) } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Quiet exception" ); + m_pImpl->AddLog( THROW_WHERE "Quiet exception" ); } } } @@ -2052,8 +2058,8 @@ void OStorage::BroadcastModifiedIfNecessary() // no need to lock mutex here for the checking of m_pImpl, and m_pData is alive until the object is destructed if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !m_pImpl->m_bBroadcastModified ) @@ -2089,8 +2095,8 @@ void OStorage::BroadcastTransaction( sal_Int8 nMessage ) // no need to lock mutex here for the checking of m_pImpl, and m_pData is alive until the object is destructed if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } SAL_WARN_IF( m_pData->m_bReadOnlyWrap, "package.xstor", "The storage can not be modified at all!" ); @@ -2151,7 +2157,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, } else if ( pElement->m_bIsStorage ) { - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } SAL_WARN_IF( !pElement, "package.xstor", "In case element can not be created an exception must be thrown!" ); @@ -2160,7 +2166,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return pElement; } @@ -2168,7 +2174,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, void OStorage::MakeLinkToSubComponent_Impl( const uno::Reference< lang::XComponent >& xComponent ) { if ( !xComponent.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pData->m_pSubElDispListener ) { @@ -2346,12 +2352,12 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject*> ( this ), uno::UNO_QUERY ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); try { m_pImpl->CopyToStorage( xDest, sal_False ); @@ -2359,40 +2365,40 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy storage!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy storage!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2413,18 +2419,18 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied uno::Reference< io::XStream > xResult; try @@ -2440,7 +2446,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( // before the storage disposes the stream it must deregister itself as listener uno::Reference< lang::XComponent > xStreamComponent( xResult, uno::UNO_QUERY ); if ( !xStreamComponent.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); MakeLinkToSubComponent_Impl( xStreamComponent ); } @@ -2448,46 +2454,46 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::WrongPasswordException& rWrongPasswordException ) { m_pImpl->AddLog( rWrongPasswordException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException(OSL_LOG_PREFIX "Can't open stream element!", + throw embed::StorageWrappedTargetException(THROW_WHERE "Can't open stream element!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2528,22 +2534,22 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStorName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name if ( ( nStorageMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) && !( nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied // it's always possible to read written storage in this implementation nStorageMode |= embed::ElementModes::READ; @@ -2558,26 +2564,26 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) || (( nStorageMode & embed::ElementModes::WRITE ) != embed::ElementModes::WRITE ) || ( nStorageMode & embed::ElementModes::NOCREATE ) == embed::ElementModes::NOCREATE ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied // create a new StorageElement and insert it into the list pElement = m_pImpl->InsertStorage( aStorName, nStorageMode ); } else if ( !pElement->m_bIsStorage ) { - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } else if ( pElement->m_pStorage ) { // storage has already been opened; it may be opened another time, if it the mode allows to do so if ( pElement->m_pStorage->m_pAntiImpl ) { - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied } else if ( !pElement->m_pStorage->m_aReadOnlyWrapList.empty() && ( nStorageMode & embed::ElementModes::WRITE ) ) { - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied } else { @@ -2604,7 +2610,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( m_pImpl->OpenSubStorage( pElement, nStorageMode ); if ( !pElement->m_pStorage ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error sal_Bool bReadOnlyWrap = ( ( nStorageMode & embed::ElementModes::WRITE ) != embed::ElementModes::WRITE ); OStorage* pResultStorage = new OStorage( pElement->m_pStorage, bReadOnlyWrap ); @@ -2618,7 +2624,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( // before the storage disposes the stream it must deregister itself as listener uno::Reference< lang::XComponent > xStorageComponent( xResult, uno::UNO_QUERY ); if ( !xStorageComponent.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); MakeLinkToSubComponent_Impl( xStorageComponent ); } @@ -2626,40 +2632,40 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't open storage!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open storage!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2681,67 +2687,67 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUStr if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name try { uno::Reference< io::XStream > xResult; m_pImpl->CloneStreamElement( aStreamName, sal_False, ::comphelper::SequenceAsHashMap(), xResult ); if ( !xResult.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return xResult; } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::WrongPasswordException& rWrongPasswordException ) { m_pImpl->AddLog( rWrongPasswordException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't clone stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2777,8 +2783,8 @@ void SAL_CALL OStorage::copyLastCommitTo( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } try @@ -2788,40 +2794,40 @@ void SAL_CALL OStorage::copyLastCommitTo( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy last commit version!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit version!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2843,15 +2849,15 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!"); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!"); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStorName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name // it's always possible to read written storage in this implementation sal_Int32 nStorageMode = embed::ElementModes::READ; @@ -2862,11 +2868,11 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !pElement ) { // element does not exist, throw exception - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied } else if ( !pElement->m_bIsStorage ) { - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !pElement->m_pStorage ) @@ -2881,45 +2887,45 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( pElement->m_pStorage->CopyLastCommitTo( xTargetStorage ); } else - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy last commit element version!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit element version!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -2935,15 +2941,15 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable name SotElement_Impl* pElement = NULL; @@ -2954,40 +2960,40 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can't detect whether it is a stream!", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can't detect whether it is a stream!", uno::Reference< io::XInputStream >(), aCaught ); } if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? return !pElement->m_bIsStorage; } @@ -3002,15 +3008,15 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); SotElement_Impl* pElement = NULL; @@ -3021,40 +3027,40 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "can't detect whether it is a storage", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "can't detect whether it is a storage", uno::Reference< io::XInputStream >(), aCaught ); } if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? return pElement->m_bIsStorage; } @@ -3073,25 +3079,25 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? m_pImpl->RemoveElement( pElement ); @@ -3101,46 +3107,46 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't remove element!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't remove element!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3165,29 +3171,29 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) || aNewName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName == "_rels" || aNewName == "_rels" ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); // TODO: unacceptable element name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); // TODO: unacceptable element name if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied try { SotElement_Impl* pRefElement = m_pImpl->FindElement( aNewName ); if ( pRefElement ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? pElement->m_aName = aNewName; @@ -3197,52 +3203,52 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't rename element!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't rename element!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3269,85 +3275,85 @@ void SAL_CALL OStorage::copyElementTo( const OUString& aElementName, if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) || aNewName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !xDest.is() ) // || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName == "_rels" || aNewName == "_rels" ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_pImpl->CopyStorageElement( pElement, xDest, aNewName, sal_False ); } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy element!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3370,35 +3376,35 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) || aNewName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName == "_rels" || aNewName == "_rels" ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_pImpl->CopyStorageElement( pElement, xDest, aNewName, sal_False ); @@ -3410,52 +3416,52 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't move element!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't move element!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3482,18 +3488,18 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied if ( !aEncryptionData.getLength() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 3 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 3 ); uno::Reference< io::XStream > xResult; try @@ -3509,7 +3515,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( // before the storage disposes the stream it must deregister itself as listener uno::Reference< lang::XComponent > xStreamComponent( xResult, uno::UNO_QUERY ); if ( !xStreamComponent.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); MakeLinkToSubComponent_Impl( xStreamComponent ); } @@ -3517,52 +3523,52 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::NoEncryptionException& rNoEncryptionException ) { m_pImpl->AddLog( rNoEncryptionException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::WrongPasswordException& rWrongPasswordException ) { m_pImpl->AddLog( rWrongPasswordException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't open encrypted stream stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open encrypted stream stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3591,73 +3597,73 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( !aEncryptionData.getLength() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); try { uno::Reference< io::XStream > xResult; m_pImpl->CloneStreamElement( aStreamName, sal_True, aEncryptionData, xResult ); if ( !xResult.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return xResult; } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::NoEncryptionException& rNoEncryptionException ) { m_pImpl->AddLog( rNoEncryptionException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::WrongPasswordException& rWrongPasswordException ) { m_pImpl->AddLog( rWrongPasswordException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't clone encrypted stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone encrypted stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3679,33 +3685,33 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible if ( sStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); uno::Reference < io::XInputStream > xTempIn; try { SotElement_Impl* pElement = m_pImpl->FindElement( sStreamName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStream ) { m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } uno::Reference< io::XInputStream > xRawInStream = pElement->m_pStream->GetPlainRawInStream(); if ( !xRawInStream.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference < io::XTempFile > xTempFile = io::TempFile::create( m_pImpl->GetComponentContext() ); uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); @@ -3713,7 +3719,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY ); if ( !xTempOut.is() || !xTempIn.is() || !xSeek.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Copy temporary file to a new one ::comphelper::OStorageHelper::CopyInputToOutput( xRawInStream, xTempOut ); @@ -3723,46 +3729,46 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't get plain raw stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get plain raw stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3786,36 +3792,36 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( sStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); uno::Reference < io::XInputStream > xTempIn; try { SotElement_Impl* pElement = m_pImpl->FindElement( sStreamName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStream ) { m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !pElement->m_pStream->IsEncrypted() ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XInputStream > xRawInStream = pElement->m_pStream->GetRawInStream(); if ( !xRawInStream.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(m_pImpl->GetComponentContext()); uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); @@ -3823,7 +3829,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY ); if ( !xTempOut.is() || !xTempIn.is() || !xSeek.is() ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Copy temporary file to a new one ::comphelper::OStorageHelper::CopyInputToOutput( xRawInStream, xTempOut ); @@ -3834,52 +3840,52 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::NoEncryptionException& rNoEncryptionException ) { m_pImpl->AddLog( rNoEncryptionException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't get raw stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get raw stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3903,79 +3909,79 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName, if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !xInStream.is() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aStreamName ); if ( pElement ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_pImpl->InsertRawStream( aStreamName, xInStream ); } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::NoRawFormatException& rNoRawFormatException ) { m_pImpl->AddLog( rNoRawFormatException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't insert raw stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert raw stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -3998,12 +4004,12 @@ void SAL_CALL OStorage::commit() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_bReadOnlyWrap ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied m_pImpl->Commit(); // the root storage initiates the storing to source @@ -4014,28 +4020,28 @@ void SAL_CALL OStorage::commit() catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Problems on commit!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on commit!", uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ), aCaught ); } @@ -4062,8 +4068,8 @@ void SAL_CALL OStorage::revert() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } for ( SotElementList_Impl::iterator pElementIter = m_pImpl->m_aChildrenList.begin(); @@ -4073,7 +4079,7 @@ void SAL_CALL OStorage::revert() && ( (*pElementIter)->m_pStorage->m_pAntiImpl || !(*pElementIter)->m_pStorage->m_aReadOnlyWrapList.empty() )) || ((*pElementIter)->m_pStream && ( (*pElementIter)->m_pStream->m_pAntiImpl || !(*pElementIter)->m_pStream->m_aInputStreamsList.empty()) ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied } if ( m_pData->m_bReadOnlyWrap || !m_pImpl->m_bListCreated ) @@ -4087,28 +4093,28 @@ void SAL_CALL OStorage::revert() catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Problems on revert!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on revert!", uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ), aCaught ); } @@ -4127,8 +4133,8 @@ void SAL_CALL OStorage::addTransactionListener( const uno::Reference< embed::XTr if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } m_pData->m_aListenersContainer.addInterface( ::getCppuType((const uno::Reference< embed::XTransactionListener >*)0), @@ -4142,8 +4148,8 @@ void SAL_CALL OStorage::removeTransactionListener( const uno::Reference< embed:: if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } m_pData->m_aListenersContainer.removeInterface( ::getCppuType((const uno::Reference< embed::XTransactionListener >*)0), @@ -4162,8 +4168,8 @@ sal_Bool SAL_CALL OStorage::isModified() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } return m_pImpl->m_bIsModified; @@ -4177,12 +4183,12 @@ void SAL_CALL OStorage::setModified( sal_Bool bModified ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_bReadOnlyWrap ) - throw beans::PropertyVetoException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied if ( m_pImpl->m_bIsModified != bModified ) m_pImpl->m_bIsModified = bModified; @@ -4203,8 +4209,8 @@ void SAL_CALL OStorage::addModifyListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } osl_atomic_increment( &m_pImpl->m_nModifiedListenerCount ); @@ -4220,8 +4226,8 @@ void SAL_CALL OStorage::removeModifyListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } osl_atomic_decrement( &m_pImpl->m_nModifiedListenerCount ); @@ -4242,22 +4248,22 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name uno::Any aResult; try { SotElement_Impl* pElement = m_pImpl->FindElement( aName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( pElement->m_bIsStorage ) aResult <<= openStorageElement( aName, embed::ElementModes::READ ); @@ -4267,28 +4273,28 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::WrappedTargetException& rWrappedTargetException ) { m_pImpl->AddLog( rWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( OSL_LOG_PREFIX "Can not open storage!\n", + throw lang::WrappedTargetException( THROW_WHERE "Can not open storage!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4306,8 +4312,8 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } try @@ -4317,16 +4323,16 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open storage!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4342,8 +4348,8 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aName.isEmpty() ) @@ -4360,16 +4366,16 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open storage!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4385,8 +4391,8 @@ uno::Type SAL_CALL OStorage::getElementType() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } // it is a multitype container @@ -4402,8 +4408,8 @@ sal_Bool SAL_CALL OStorage::hasElements() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } try @@ -4413,16 +4419,16 @@ sal_Bool SAL_CALL OStorage::hasElements() catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open storage!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4437,8 +4443,8 @@ void SAL_CALL OStorage::dispose() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } try @@ -4448,16 +4454,16 @@ void SAL_CALL OStorage::dispose() catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open storage!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4472,8 +4478,8 @@ void SAL_CALL OStorage::addEventListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } m_pData->m_aListenersContainer.addInterface( @@ -4488,8 +4494,8 @@ void SAL_CALL OStorage::removeEventListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } m_pData->m_aListenersContainer.removeInterface( @@ -4516,12 +4522,12 @@ void SAL_CALL OStorage::removeEncryption() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "removeEncryption() method is not available for nonroot storages!" ); if ( m_pData->m_bIsRoot ) @@ -4532,16 +4538,16 @@ void SAL_CALL OStorage::removeEncryption() catch ( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open package!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4562,7 +4568,7 @@ void SAL_CALL OStorage::removeEncryption() catch( const uno::RuntimeException& rRException ) { m_pImpl->AddLog( rRException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); SAL_WARN( "package.xstor", "The call must not fail, it is pretty simple!" ); throw; @@ -4570,10 +4576,10 @@ void SAL_CALL OStorage::removeEncryption() catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); SAL_WARN( "package.xstor", "The call must not fail, it is pretty simple!" ); - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } } } @@ -4590,15 +4596,15 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage if ( !aEncryptionData.getLength() ) - throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected empty encryption data!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption data!", uno::Reference< uno::XInterface >() ); SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "setEncryptionData() method is not available for nonroot storages!" ); if ( m_pData->m_bIsRoot ) @@ -4609,16 +4615,16 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu catch ( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( OSL_LOG_PREFIX "Can not open package!\n", + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); } @@ -4636,9 +4642,9 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } } } @@ -4662,15 +4668,15 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage if ( !aAlgorithms.getLength() ) - throw uno::RuntimeException( OSL_LOG_PREFIX "Unexpected empty encryption algorithms list!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption algorithms list!", uno::Reference< uno::XInterface >() ); SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "setEncryptionAlgorithms() method is not available for nonroot storages!" ); if ( m_pData->m_bIsRoot ) @@ -4681,16 +4687,16 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( OSL_LOG_PREFIX "Can not open package!\n", + throw lang::WrappedTargetException( THROW_WHERE "Can not open package!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4705,15 +4711,15 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } } } @@ -4727,12 +4733,12 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage uno::Sequence< beans::NamedValue > aResult; SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "getEncryptionAlgorithms() method is not available for nonroot storages!" ); @@ -4744,16 +4750,16 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( OSL_LOG_PREFIX "Can not open package!\n", + throw lang::WrappedTargetException( THROW_WHERE "Can not open package!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -4767,15 +4773,15 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() catch ( const uno::RuntimeException& aRuntimeException ) { m_pImpl->AddLog( aRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } } @@ -4791,8 +4797,8 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OStorage::getPropertySetInfo( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: @@ -4812,8 +4818,8 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: think about interaction handler @@ -4822,10 +4828,10 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u // The old document might have no version in the manifest.xml, so we have to allow to set the version // even for readonly storages, so that the version from content.xml can be used. if ( m_pData->m_bReadOnlyWrap && aPropertyName != "Version" ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: Access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Access denied if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) - throw beans::UnknownPropertyException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( aPropertyName == "MediaType" ) @@ -4855,9 +4861,9 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u || aPropertyName == "RepairPackage" ) ) || aPropertyName == "IsRoot" || aPropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY ) - throw beans::PropertyVetoException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); else - throw beans::UnknownPropertyException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { @@ -4872,7 +4878,7 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u // currently this is an internal property that is used for optimization // and the stream must support XSeekable interface // TODO/LATER: in future it can be changed if property is used from outside - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); } m_pImpl->m_xNewRelInfoStream = xInRelStream; @@ -4882,7 +4888,7 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u m_pImpl->m_bIsModified = sal_True; } else - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); } else if ( aPropertyName == "RelationsInfo" ) { @@ -4894,16 +4900,16 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u m_pImpl->m_bIsModified = sal_True; } else - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); } else if ( ( m_pData->m_bIsRoot && ( aPropertyName == "URL" || aPropertyName == "RepairPackage") ) || aPropertyName == "IsRoot" ) - throw beans::PropertyVetoException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); else - throw beans::UnknownPropertyException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } else - throw beans::UnknownPropertyException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); BroadcastModifiedIfNecessary(); } @@ -4919,8 +4925,8 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE @@ -4933,13 +4939,13 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) catch ( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); throw lang::WrappedTargetException( @@ -4988,23 +4994,23 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) m_pImpl->ReadContents(); uno::Reference< beans::XPropertySet > xPackPropSet( m_pImpl->m_xPackage, uno::UNO_QUERY ); if ( !xPackPropSet.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return xPackPropSet->getPropertyValue( aPropertyName ); } catch ( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch ( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( OSL_LOG_PREFIX "Can not open package!\n", + throw lang::WrappedTargetException( THROW_WHERE "Can not open package!\n", uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -5012,7 +5018,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) } } - throw beans::UnknownPropertyException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } void SAL_CALL OStorage::addPropertyChangeListener( @@ -5026,8 +5032,8 @@ void SAL_CALL OStorage::addPropertyChangeListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: @@ -5044,8 +5050,8 @@ void SAL_CALL OStorage::removePropertyChangeListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: @@ -5062,8 +5068,8 @@ void SAL_CALL OStorage::addVetoableChangeListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: @@ -5080,8 +5086,8 @@ void SAL_CALL OStorage::removeVetoableChangeListener( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } //TODO: @@ -5099,12 +5105,12 @@ sal_Bool SAL_CALL OStorage::hasByID( const OUString& sID ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); try { @@ -5114,7 +5120,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const OUString& sID ) catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Quiet exception" ); + m_pImpl->AddLog( THROW_WHERE "Quiet exception" ); } return sal_False; @@ -5129,12 +5135,12 @@ OUString SAL_CALL OStorage::getTargetByID( const OUString& sID ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) @@ -5153,12 +5159,12 @@ OUString SAL_CALL OStorage::getTypeByID( const OUString& sID ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) @@ -5177,12 +5183,12 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO/LATER: in future the unification of the ID could be checked uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5195,7 +5201,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons break; } - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelationshipsByType( const OUString& sType ) @@ -5206,12 +5212,12 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; sal_Int32 nEntriesNum = 0; @@ -5241,12 +5247,12 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_pImpl->GetAllRelationshipsIfAny(); } @@ -5260,12 +5266,12 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OUString aIDTag( "Id" ); @@ -5307,7 +5313,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: aSeq[nIDInd].realloc( nIndTarget ); } else - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_pImpl->m_aRelInfo = aSeq; m_pImpl->m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -5323,12 +5329,12 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) @@ -5352,7 +5358,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) break; } - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence< beans::StringPair > >& aEntries, ::sal_Bool bReplace ) @@ -5364,12 +5370,12 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); OUString aIDTag( "Id" ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5390,7 +5396,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence if ( aEntries[nIndSource1][nIndSource2].Second.equals( aSeq[nIndTarget1][nIndTarget2].Second ) ) { if ( !bReplace ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); nIndSourceSame = nIndSource1; } @@ -5423,10 +5429,10 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence else if ( nResInd2 < aResultSeq[nResultInd].getLength() ) aResultSeq[nResultInd][nResInd2++] = aEntries[nIndSource1][nIndSource2]; else - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: illegal relation ( no ID ) + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: illegal relation ( no ID ) if ( !bHasID ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: illegal relations + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: illegal relations nResultInd++; } @@ -5445,12 +5451,12 @@ void SAL_CALL OStorage::clearRelationships() if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); m_pImpl->m_aRelInfo.realloc( 0 ); m_pImpl->m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -5471,7 +5477,7 @@ void SAL_CALL OStorage::insertRawNonEncrStreamElementDirect( { // not implemented currently because there is still no demand // might need to be implemented if direct copying of compressed streams is used - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } void SAL_CALL OStorage::insertStreamElementDirect( @@ -5491,25 +5497,25 @@ void SAL_CALL OStorage::insertStreamElementDirect( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name if ( m_pData->m_bReadOnlyWrap ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aStreamName ); if ( pElement ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); pElement = OpenStreamElement_Impl( aStreamName, embed::ElementModes::READWRITE, sal_False ); OSL_ENSURE( pElement && pElement->m_pStream, "In case element can not be created an exception must be thrown!" ); @@ -5519,46 +5525,46 @@ void SAL_CALL OStorage::insertStreamElementDirect( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't insert stream directly!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert stream directly!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -5582,32 +5588,32 @@ void SAL_CALL OStorage::copyElementDirectlyTo( if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) || aNewName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName == "_rels" || aNewName == "_rels" ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); // unacceptable name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); // unacceptable name try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // let the element be copied directly uno::Reference< embed::XStorage > xStorDest( xDest, uno::UNO_QUERY_THROW ); @@ -5616,52 +5622,52 @@ void SAL_CALL OStorage::copyElementDirectlyTo( catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::ElementExistException& rElementExistException ) { m_pImpl->AddLog( rElementExistException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy element direcly!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element direcly!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -5680,15 +5686,15 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !m_pData->m_bIsRoot ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); if ( !m_pImpl->m_pSwitchStream ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); try { @@ -5697,40 +5703,40 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't write and attach to stream!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't write and attach to stream!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -5751,15 +5757,15 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL, if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( !m_pData->m_bIsRoot ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); if ( !m_pImpl->m_pSwitchStream ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference < ucb::XSimpleFileAccess3 > xAccess( ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); @@ -5780,40 +5786,40 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL, catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't attach to URL!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't attach to URL!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -5835,31 +5841,31 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name try { SotElement_Impl *pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO/LATER: Currently it is only implemented for MediaType property of substorages, might be changed in future if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || aPropertyName != "MediaType" ) - throw beans::PropertyVetoException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStorage ) m_pImpl->OpenSubStorage( pElement, embed::ElementModes::READ ); if ( !pElement->m_pStorage ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error pElement->m_pStorage->ReadContents(); return uno::makeAny( pElement->m_pStorage->m_aMediaType ); @@ -5867,58 +5873,58 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const container::NoSuchElementException& rNoSuchElementException ) { m_pImpl->AddLog( rNoSuchElementException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const beans::UnknownPropertyException& rUnknownPropertyException ) { m_pImpl->AddLog( rUnknownPropertyException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const beans::PropertyVetoException& rPropertyVetoException ) { m_pImpl->AddLog( rPropertyVetoException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't get element property!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get element property!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -5936,18 +5942,18 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName == "_rels" ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); // unacceptable name + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable name if ( !xTargetStream.is() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); try { @@ -5956,51 +5962,51 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons SAL_WARN_IF( xNonconstRef != xTargetStream, "package.xstor", "The provided stream reference seems not be filled in correctly!" ); if ( xNonconstRef != xTargetStream ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // if the stream reference is set it must not be changed! + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // if the stream reference is set it must not be changed! } catch( const embed::InvalidStorageException& rInvalidStorageException ) { m_pImpl->AddLog( rInvalidStorageException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const lang::IllegalArgumentException& rIllegalArgumentException ) { m_pImpl->AddLog( rIllegalArgumentException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const packages::WrongPasswordException& rWrongPasswordException ) { m_pImpl->AddLog( rWrongPasswordException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const io::IOException& rIOException ) { m_pImpl->AddLog( rIOException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException ) { m_pImpl->AddLog( rStorageWrappedTargetException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::RuntimeException& rRuntimeException ) { m_pImpl->AddLog( rRuntimeException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); throw; } catch( const uno::Exception& rException ) { m_pImpl->AddLog( rException.Message ); - m_pImpl->AddLog( OSL_LOG_PREFIX "Rethrow" ); + m_pImpl->AddLog( THROW_WHERE "Rethrow" ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( OSL_LOG_PREFIX "Can't copy stream data!", + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy stream data!", uno::Reference< io::XInputStream >(), aCaught ); } @@ -6020,16 +6026,16 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) && ( nOpenMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -6061,7 +6067,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle } if ( !xResult.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return xResult; } @@ -6090,15 +6096,15 @@ void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const OUString& a if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -6124,22 +6130,22 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted if ( !m_pImpl ) { - ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" ); - throw lang::DisposedException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + ::package::StaticAddLog( THROW_WHERE "Disposed!" ); + throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); if ( !aEncryptionData.getLength() ) - throw lang::IllegalArgumentException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 3 ); + throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 3 ); if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) && ( nOpenMode & embed::ElementModes::WRITE ) ) - throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -6172,7 +6178,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted } if ( !xResult.is() ) - throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); return xResult; } diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 65a8b8f66f18..2b0b049a4c04 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.cxx @@ -23,6 +23,12 @@ using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + /** ByteGrabber implements the >> operators on an XOutputStream. This is * potentially quite slow and may need to be optimised */ @@ -64,14 +70,14 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) { sal_Int64 nLen = xSeek->getLength(); if ( location < 0 || location > nLen ) - throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); if (location > nLen ) location = nLen; xSeek->seek( location ); return location; } else - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } sal_Int64 SAL_CALL ByteGrabber::getPosition( ) @@ -81,7 +87,7 @@ sal_Int64 SAL_CALL ByteGrabber::getPosition( ) if (xSeek.is() ) return xSeek->getPosition(); else - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } sal_Int64 SAL_CALL ByteGrabber::getLength( ) @@ -91,7 +97,7 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( ) if (xSeek.is() ) return xSeek->getLength(); else - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } ByteGrabber& ByteGrabber::operator >> (sal_Int8& rInt8) diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 588a14c842c8..5c80be490de6 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -57,6 +57,12 @@ using namespace com::sun::star::packages::zip::ZipConstants; using ZipUtils::Inflater; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + /** This class is used to read entries from a zip file */ ZipFile::ZipFile( uno::Reference < XInputStream > &xInput, const uno::Reference < XComponentContext > & rxContext, sal_Bool bInitialise ) @@ -382,7 +388,7 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R uno::Reference< XInterface >() ); if ( !rData->m_aKey.getLength() ) - throw packages::WrongPasswordException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) @@ -408,7 +414,7 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R xStream->readBytes( aReadBuffer, nSize ); if ( !StaticHasValidPassword( rxContext, aReadBuffer, rData ) ) - throw packages::WrongPasswordException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } return new XUnbufferedStream( rxContext, xStream, rData ); @@ -581,7 +587,7 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry // check if we can decrypt it or not OSL_ENSURE( rData->m_aDigest.getLength(), "Can't detect password correctness without digest!\n" ); if ( rData->m_aDigest.getLength() && !hasValidPassword ( rEntry, rData ) ) - throw packages::WrongPasswordException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } else bNeedRawStream = ( rEntry.nMethod == STORED ); @@ -620,7 +626,7 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream( ::osl::MutexGuard aGuard( m_aMutex ); if ( !rData.is() ) - throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( rEntry.nOffset <= 0 ) readLOC( rEntry ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index f20b1f07414c..c3b56ed10e0f 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -97,6 +97,12 @@ using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::manifest; using namespace com::sun::star::packages::zip::ZipConstants; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + class ActiveDataStreamer : public ::cppu::WeakImplHelper1< XActiveDataStreamer > { uno::Reference< XStream > mStream; @@ -347,7 +353,7 @@ void ZipPackage::parseManifest() if ( !bManifestParsed && !m_bForceRecovery ) throw ZipIOException( - OSL_LOG_PREFIX "Could not parse manifest.xml\n", + THROW_WHERE "Could not parse manifest.xml\n", uno::Reference< uno::XInterface >() ); const OUString sMimetype ("mimetype"); @@ -389,7 +395,7 @@ void ZipPackage::parseManifest() // the mimetype stream should contain the information from manifest.xml if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) ) throw ZipIOException( - (OSL_LOG_PREFIX + (THROW_WHERE "mimetype conflicts with manifest.xml, \"" + m_pRootFolder->GetMediaType() + "\" vs. \"" + aPackageMediatype + "\""), @@ -410,7 +416,7 @@ void ZipPackage::parseManifest() // in case of ODF1.2 documents without version in manifest.xml the property IsInconsistent // should be checked later throw ZipIOException( - OSL_LOG_PREFIX "there are streams not referred in manifest.xml\n", + THROW_WHERE "there are streams not referred in manifest.xml\n", uno::Reference< uno::XInterface >() ); } else if ( bDifferentStartKeyAlgorithm ) @@ -418,7 +424,7 @@ void ZipPackage::parseManifest() // all the streams should be encrypted with the same StartKey in ODF1.2 // TODO/LATER: in future the exception should be thrown OSL_ENSURE( false, "ODF1.2 contains different StartKey Algorithms" ); - // throw ZipIOException( OSL_LOG_PREFIX "More than one Start Key Generation algorithm is specified!", uno::Reference< uno::XInterface >() ); + // throw ZipIOException( THROW_WHERE "More than one Start Key Generation algorithm is specified!", uno::Reference< uno::XInterface >() ); } } @@ -437,7 +443,7 @@ void ZipPackage::parseContentType() try { // the content type must exist in OFOPXML format! if ( !m_xRootFolder->hasByName( aContentTypes ) ) - throw io::IOException(OSL_LOG_PREFIX "Wrong format!", + throw io::IOException(THROW_WHERE "Wrong format!", uno::Reference< uno::XInterface >() ); uno::Reference< lang::XUnoTunnel > xTunnel; @@ -455,7 +461,7 @@ void ZipPackage::parseContentType() ::comphelper::OFOPXMLHelper::ReadContentTypeSequence( xInStream, m_xContext ); if ( aContentTypeInfo.getLength() != 2 ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // set the implicit types fist for ( nInd = 0; nInd < aContentTypeInfo[0].getLength(); nInd++ ) @@ -682,19 +688,19 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) m_nFormat = 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 ( aNamedValue.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 ); m_nFormat = nFormatID; } else - throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } @@ -710,7 +716,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) else { // The URL is not acceptable - throw com::sun::star::uno::Exception (OSL_LOG_PREFIX "Bad arguments.", + throw com::sun::star::uno::Exception (THROW_WHERE "Bad arguments.", static_cast < ::cppu::OWeakObject * > ( this ) ); } } @@ -723,7 +729,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) m_xContentStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( m_xContentStream, m_xContext ); m_xContentSeek = uno::Reference < XSeekable > ( m_xContentStream, UNO_QUERY ); if ( ! m_xContentSeek.is() ) - throw com::sun::star::uno::Exception (OSL_LOG_PREFIX "The package component _requires_ an XSeekable interface!", + throw com::sun::star::uno::Exception (THROW_WHERE "The package component _requires_ an XSeekable interface!", static_cast < ::cppu::OWeakObject * > ( this ) ); if ( !m_xContentSeek->getLength() ) @@ -770,7 +776,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; } throw com::sun::star::packages::zip::ZipIOException ( - OSL_LOG_PREFIX "Bad Zip File, " + message, + THROW_WHERE "Bad Zip File, " + message, static_cast < ::cppu::OWeakObject * > ( this ) ); } } @@ -834,7 +840,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) pCurrent = pCurrent->doGetByName( sTemp ).pFolder; } else - throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); nOldIndex = nIndex+1; } if ( bFolder ) @@ -853,7 +859,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) return pCurrent->getByName( sTemp ); } else - throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } } } @@ -989,7 +995,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) catch ( const ::com::sun::star::io::IOException & r ) { throw WrappedTargetException( - OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!", + THROW_WHERE "Error adding mimetype to the ZipOutputStream!", static_cast < OWeakObject * > ( this ), makeAny( r ) ); } @@ -1261,7 +1267,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() throw aException; throw WrappedTargetException( - OSL_LOG_PREFIX "Problem writing the original content!", + THROW_WHERE "Problem writing the original content!", static_cast < OWeakObject * > ( this ), aCaught ); } @@ -1269,7 +1275,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() { // the document is written directly, although it was empty it is important to notify that the writing has failed // TODO/LATER: let the package be able to recover in this situation - OUString aErrTxt(OSL_LOG_PREFIX "This package is unusable!"); + OUString aErrTxt(THROW_WHERE "This package is unusable!"); embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), OUString() ); throw WrappedTargetException( aErrTxt, static_cast < OWeakObject * > ( this ), @@ -1342,7 +1348,7 @@ void SAL_CALL ZipPackage::commitChanges() if ( m_eMode == e_IMode_XInputStream ) { IOException aException; - throw WrappedTargetException(OSL_LOG_PREFIX "This package is read only!", + throw WrappedTargetException(THROW_WHERE "This package is read only!", static_cast < OWeakObject * > ( this ), makeAny ( aException ) ); } // first the writeTempFile is called, if it returns a stream the stream should be written to the target @@ -1359,7 +1365,7 @@ void SAL_CALL ZipPackage::commitChanges() } catch( const uno::Exception& r ) { - throw WrappedTargetException(OSL_LOG_PREFIX "Temporary file should be seekable!", + throw WrappedTargetException(THROW_WHERE "Temporary file should be seekable!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1377,14 +1383,14 @@ void SAL_CALL ZipPackage::commitChanges() xOutputStream = m_xStream->getOutputStream(); uno::Reference < XTruncate > xTruncate ( xOutputStream, UNO_QUERY ); if ( !xTruncate.is() ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // after successful truncation the original file contents are already lost xTruncate->truncate(); } catch( const uno::Exception& r ) { - throw WrappedTargetException(OSL_LOG_PREFIX "This package is read only!", + throw WrappedTargetException(THROW_WHERE "This package is read only!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1459,7 +1465,7 @@ void SAL_CALL ZipPackage::commitChanges() uno::Reference < XPropertySet > xPropSet ( xTempInStream, UNO_QUERY ); OSL_ENSURE( xPropSet.is(), "This is a temporary file that must implement XPropertySet!\n" ); if ( !xPropSet.is() ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ); Content aContent( @@ -1488,7 +1494,7 @@ void SAL_CALL ZipPackage::commitChanges() DisconnectFromTargetAndThrowException_Impl( xTempInStream ); throw WrappedTargetException( - OSL_LOG_PREFIX "This package may be read only!", + THROW_WHERE "This package may be read only!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1521,7 +1527,7 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc OSL_FAIL( "These calls are pretty simple, they should not fail!\n" ); } - OUString aErrTxt(OSL_LOG_PREFIX "This package is read only!"); + OUString aErrTxt(THROW_WHERE "This package is read only!"); embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), aTempURL ); throw WrappedTargetException( aErrTxt, static_cast < OWeakObject * > ( this ), @@ -1540,7 +1546,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey() else if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA1 ) aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA1UTF8; else - throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -1549,7 +1555,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey() // empty keys are not allowed here // so it is not important whether there is no key, or the key is empty, it is an error if ( !aResult.getLength() ) - throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); } else aResult = m_aEncryptionKey; @@ -1648,17 +1654,17 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException ) { if ( m_nFormat != embed::StorageFormats::PACKAGE ) - throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if (aPropertyName == HAS_ENCRYPTED_ENTRIES_PROPERTY ||aPropertyName == HAS_NONENCRYPTED_ENTRIES_PROPERTY ||aPropertyName == IS_INCONSISTENT_PROPERTY ||aPropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY) - throw PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( !( aValue >>= m_aEncryptionKey ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); m_aStorageEncryptionKeys.realloc( 0 ); } @@ -1670,7 +1676,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const // TODO/LATER: Get rid of this property as well as of support of raw passwords in storages uno::Sequence< beans::NamedValue > aKeys; if ( !( aValue >>= aKeys ) || ( aKeys.getLength() && aKeys.getLength() < 2 ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( aKeys.getLength() ) { @@ -1685,7 +1691,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const } if ( !bHasSHA256 || !bHasSHA1 ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Expected keys are not provided!", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "Expected keys are not provided!", uno::Reference< uno::XInterface >(), 2 ); } m_aStorageEncryptionKeys = aKeys; @@ -1697,7 +1703,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const if ( m_pZipFile || !( aValue >>= aAlgorithms ) || aAlgorithms.getLength() == 0 ) { // the algorithms can not be changed if the file has a persistence based on the algorithms ( m_pZipFile ) - throw IllegalArgumentException(OSL_LOG_PREFIX "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); } for ( sal_Int32 nInd = 0; nInd < aAlgorithms.getLength(); nInd++ ) @@ -1707,7 +1713,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::DigestID::SHA256 && nID != xml::crypto::DigestID::SHA1 ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nStartKeyGenerationID = nID; } @@ -1716,7 +1722,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::CipherID::AES_CBC_W3C_PADDING && nID != xml::crypto::CipherID::BLOWFISH_CFB_8 ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nCommonEncryptionID = nID; } @@ -1725,19 +1731,19 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::DigestID::SHA1_1K && nID != xml::crypto::DigestID::SHA256_1K ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nChecksumDigestID = nID; } else { OSL_ENSURE( sal_False, "Unexpected encryption algorithm is provided!" ); - throw IllegalArgumentException(OSL_LOG_PREFIX "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(THROW_WHERE "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); } } } else - throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) @@ -1745,7 +1751,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) { // TODO/LATER: Activate the check when zip-ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); Any aAny; if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) @@ -1787,7 +1793,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) aAny <<= m_bMediaTypeFallbackUsed; return aAny; } - throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } void SAL_CALL ZipPackage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) diff --git a/package/source/zippackage/ZipPackageBuffer.cxx b/package/source/zippackage/ZipPackageBuffer.cxx index 6574fda14ae9..579896248428 100644 --- a/package/source/zippackage/ZipPackageBuffer.cxx +++ b/package/source/zippackage/ZipPackageBuffer.cxx @@ -25,6 +25,12 @@ using namespace com::sun::star::uno; using namespace com::sun::star::io; using com::sun::star::lang::IllegalArgumentException; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + ZipPackageBuffer::ZipPackageBuffer(sal_Int64 nNewBufferSize ) : m_nBufferSize (nNewBufferSize) , m_nEnd(0) @@ -40,7 +46,7 @@ sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToRead < 0) - throw BufferSizeExceededException(OSL_LOG_PREFIX, *this ); + throw BufferSizeExceededException(THROW_WHERE, *this ); if (nBytesToRead + m_nCurrent > m_nEnd) nBytesToRead = static_cast < sal_Int32 > (m_nEnd - m_nCurrent); @@ -60,7 +66,7 @@ void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToSkip < 0) - throw BufferSizeExceededException(OSL_LOG_PREFIX, *this ); + throw BufferSizeExceededException(THROW_WHERE, *this ); if (nBytesToSkip + m_nCurrent > m_nEnd) nBytesToSkip = static_cast < sal_Int32 > (m_nEnd - m_nCurrent); @@ -111,7 +117,7 @@ void SAL_CALL ZipPackageBuffer::seek( sal_Int64 location ) throw( IllegalArgumentException, IOException, RuntimeException) { if ( location > m_nEnd || location < 0 ) - throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); m_nCurrent = location; } sal_Int64 SAL_CALL ZipPackageBuffer::getPosition( ) diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index c109c196f0b0..8087c3b98452 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.cxx @@ -34,6 +34,12 @@ using namespace com::sun::star::container; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + ZipPackageEntry::ZipPackageEntry ( bool bNewFolder ) : mbIsFolder ( bNewFolder ) , mbAllowRemoveOnInsert( sal_True ) @@ -62,7 +68,7 @@ void SAL_CALL ZipPackageEntry::setName( const OUString& aName ) // unfortunately no other exception than RuntimeException can be thrown here // usually the package is used through storage implementation, the problem should be detected there if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_True ) ) - throw RuntimeException(OSL_LOG_PREFIX "Unexpected character is used in file name.", uno::Reference< XInterface >() ); + throw RuntimeException(THROW_WHERE "Unexpected character is used in file name.", uno::Reference< XInterface >() ); msName = aName; @@ -90,7 +96,7 @@ void SAL_CALL ZipPackageEntry::setParent( const uno::Reference< XInterface >& xN sal_Int64 nTest(0); uno::Reference < XUnoTunnel > xTunnel ( xNewParent, UNO_QUERY ); if ( !xNewParent.is() || ( nTest = xTunnel->getSomething ( ZipPackageFolder::static_getImplementationId () ) ) == 0 ) - throw NoSupportException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSupportException(THROW_WHERE, uno::Reference< uno::XInterface >() ); ZipPackageFolder *pNewParent = reinterpret_cast < ZipPackageFolder * > ( nTest ); diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index ca441b009369..047dbc08afd7 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -51,6 +51,12 @@ using namespace cppu; using namespace std; using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + namespace { struct lcl_CachedImplId : public rtl::Static< uno::Sequence < sal_Int8 >, lcl_CachedImplId > {}; } ZipPackageFolder::ZipPackageFolder ( sal_Int32 nFormat, @@ -182,7 +188,7 @@ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const uno:: throw(IllegalArgumentException, ElementExistException, WrappedTargetException, uno::RuntimeException) { if (hasByName(aName)) - throw ElementExistException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw ElementExistException(THROW_WHERE, uno::Reference< uno::XInterface >() ); else { uno::Reference < XUnoTunnel > xRef; @@ -202,14 +208,14 @@ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const uno:: pEntry = static_cast < ZipPackageEntry * > ( pStream ); } else - throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); if (pEntry->getName() != aName ) pEntry->setName (aName); doInsertByName ( pEntry, sal_True ); } else - throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); } } void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) @@ -217,7 +223,7 @@ void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) { ContentHash::iterator aIter = maContents.find ( Name ); if ( aIter == maContents.end() ) - throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); maContents.erase( aIter ); } // XEnumerationAccess @@ -243,7 +249,7 @@ ContentInfo& ZipPackageFolder::doGetByName( const OUString& aName ) { ContentHash::iterator aIter = maContents.find ( aName ); if ( aIter == maContents.end()) - throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return *(*aIter).second; } uno::Any SAL_CALL ZipPackageFolder::getByName( const OUString& aName ) @@ -274,7 +280,7 @@ void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const uno: if ( hasByName( aName ) ) removeByName( aName ); else - throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); insertByName(aName, aElement); } @@ -725,7 +731,7 @@ void ZipPackageFolder::saveContents( OUString &rPath, std::vector < uno::Sequenc } if( bWritingFailed ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } void ZipPackageFolder::releaseUpwardRef( void ) @@ -773,7 +779,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); aValue >>= sMediaType; } @@ -782,7 +788,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == "Size" ) aValue >>= aEntry.nSize; else - throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, uno::RuntimeException) @@ -791,7 +797,7 @@ uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyNa { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return uno::makeAny ( sMediaType ); } @@ -800,7 +806,7 @@ uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyNa else if ( PropertyName == "Size" ) return uno::makeAny ( aEntry.nSize ); else - throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } void ZipPackageFolder::doInsertByName ( ZipPackageEntry *pEntry, sal_Bool bSetParent ) diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx index 64b48b33eeec..06d5f93cf573 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.cxx @@ -23,6 +23,12 @@ using namespace com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + ZipPackageFolderEnumeration::ZipPackageFolderEnumeration ( ContentHash &rInput) : rContents (rInput) , aIterator (rContents.begin()) @@ -43,7 +49,7 @@ uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) { uno::Any aAny; if (aIterator == rContents.end() ) - throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); aAny <<= (*aIterator).second->xTunnel; aIterator++; return aAny; diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index c4f7d3a10f2f..37c0e6dde7a7 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -54,6 +54,12 @@ using namespace com::sun::star::lang; using namespace com::sun::star; using namespace cppu; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; } const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId() @@ -146,7 +152,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() xStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( xStream, m_xContext ); uno::Reference< io::XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) - throw RuntimeException( OSL_LOG_PREFIX "The stream must support XSeekable!", + throw RuntimeException( THROW_WHERE "The stream must support XSeekable!", uno::Reference< XInterface >() ); m_bHasSeekable = sal_True; @@ -158,15 +164,15 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCopy() { if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_xBaseEncryptionData.is() ) - throw ZipIOException(OSL_LOG_PREFIX "Encrypted stream without encryption data!\n", + throw ZipIOException(THROW_WHERE "Encrypted stream without encryption data!\n", uno::Reference< XInterface >() ); uno::Reference< io::XSeekable > xSeek( GetOwnSeekStream(), UNO_QUERY ); if ( !xSeek.is() ) - throw ZipIOException(OSL_LOG_PREFIX "The stream must be seekable!\n", + throw ZipIOException(THROW_WHERE "The stream must be seekable!\n", uno::Reference< XInterface >() ); // skip header @@ -228,7 +234,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi aNameToFind = bUseWinEncoding ? PACKAGE_ENCRYPTIONDATA_SHA1MS1252 : PACKAGE_ENCRYPTIONDATA_SHA1UTF8; } else - throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -237,7 +243,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi // empty keys are not allowed here // so it is not important whether there is no key, or the key is empty, it is an error if ( !aResult.getLength() ) - throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); } else aResult = m_aEncryptionKey; @@ -258,7 +264,7 @@ sal_Int32 ZipPackageStream::GetStartKeyGenID() uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( sal_Bool bAddHeaderForEncr ) { if ( m_nStreamMode != PACKAGE_STREAM_DATA || !GetOwnSeekStream().is() || ( bAddHeaderForEncr && !bToBeEncrypted ) ) - throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); Sequence< sal_Int8 > aKey; @@ -266,7 +272,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { aKey = GetEncryptionKey(); if ( !aKey.getLength() ) - throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } try @@ -280,7 +286,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( ZipPackage* pPackage = new ZipPackage( m_xContext ); uno::Reference< XSingleServiceFactory > xPackageAsFactory( static_cast< XSingleServiceFactory* >( pPackage ) ); if ( !xPackageAsFactory.is() ) - throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); Sequence< Any > aArgs( 1 ); aArgs[0] <<= xTempStream; @@ -289,14 +295,14 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( // create a new package stream uno::Reference< XDataSinkEncrSupport > xNewPackStream( xPackageAsFactory->createInstance(), UNO_QUERY ); if ( !xNewPackStream.is() ) - throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); xNewPackStream->setDataStream( static_cast< io::XInputStream* >( new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() ) ) ); uno::Reference< XPropertySet > xNewPSProps( xNewPackStream, UNO_QUERY ); if ( !xNewPSProps.is() ) - throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // copy all the properties of this stream to the new stream xNewPSProps->setPropertyValue("MediaType", makeAny( sMediaType ) ); @@ -313,7 +319,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( aRoot >>= xTunnel; uno::Reference< container::XNameContainer > xRootNameContainer( xTunnel, UNO_QUERY ); if ( !xRootNameContainer.is() ) - throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< XUnoTunnel > xNPSTunnel( xNewPackStream, UNO_QUERY ); xRootNameContainer->insertByName("dummy", makeAny( xNPSTunnel ) ); @@ -359,7 +365,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { } - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } sal_Bool ZipPackageStream::ParsePackageRawStream() @@ -527,7 +533,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream() // this method can not be used together with old approach if ( m_nStreamMode == PACKAGE_STREAM_DETECT ) - throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { @@ -594,12 +600,12 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream() // this method can not be used together with old approach if ( m_nStreamMode == PACKAGE_STREAM_DETECT ) - throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { if ( !bIsEncrypted || !GetEncryptionData().is() ) - throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return rZipPackage.getZipFile().getWrappedRawStream( aEntry, GetEncryptionData(), sMediaType, rZipPackage.GetSharedMutexRef() ); } @@ -613,7 +619,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream() return TryToGetRawFromDataStream( sal_True ); } - throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } void SAL_CALL ZipPackageStream::setDataStream( const uno::Reference< io::XInputStream >& aStream ) @@ -634,7 +640,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt uno::Reference< io::XInputStream > xNewStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( aStream, m_xContext ); uno::Reference< io::XSeekable > xSeek( xNewStream, UNO_QUERY ); if ( !xSeek.is() ) - throw RuntimeException(OSL_LOG_PREFIX "The stream must support XSeekable!", + throw RuntimeException(THROW_WHERE "The stream must support XSeekable!", uno::Reference< XInterface >() ); xSeek->seek( 0 ); @@ -643,7 +649,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt if ( !ParsePackageRawStream() ) { xStream = xOldStream; - throw packages::NoRawFormatException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::NoRawFormatException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } // the raw stream MUST have seekable access @@ -664,7 +670,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getPlainRawStream( // this method can not be used together with old approach if ( m_nStreamMode == PACKAGE_STREAM_DETECT ) - throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { @@ -703,7 +709,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, if ( aPropertyName == "MediaType" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML ) - throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( aValue >>= sMediaType ) { @@ -717,7 +723,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } } else - throw IllegalArgumentException(OSL_LOG_PREFIX "MediaType must be a string!\n", + throw IllegalArgumentException(THROW_WHERE "MediaType must be a string!\n", uno::Reference< XInterface >(), 2 ); @@ -725,21 +731,21 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == "Size" ) { if ( !( aValue >>= aEntry.nSize ) ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Size property!\n", + throw IllegalArgumentException(THROW_WHERE "Wrong type for Size property!\n", uno::Reference< XInterface >(), 2 ); } else if ( aPropertyName == "Encrypted" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); sal_Bool bEnc = sal_False; if ( aValue >>= bEnc ) { // In case of new raw stream, the stream must not be encrypted on storing if ( bEnc && m_nStreamMode == PACKAGE_STREAM_RAW ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Raw stream can not be encrypted on storing", + throw IllegalArgumentException(THROW_WHERE "Raw stream can not be encrypted on storing", uno::Reference< XInterface >(), 2 ); @@ -748,7 +754,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_xBaseEncryptionData = new BaseEncryptionData; } else - throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Encrypted property!\n", + throw IllegalArgumentException(THROW_WHERE "Wrong type for Encrypted property!\n", uno::Reference< XInterface >(), 2 ); @@ -756,7 +762,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< sal_Int8 > aNewKey; @@ -774,7 +780,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, aNewKey = aSequence; } else - throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for EncryptionKey property!\n", + throw IllegalArgumentException(THROW_WHERE "Wrong type for EncryptionKey property!\n", uno::Reference< XInterface >(), 2 ); } @@ -801,12 +807,12 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< beans::NamedValue > aKeys; if ( !( aValue >>= aKeys ) ) { - throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for StorageEncryptionKeys property!\n", + throw IllegalArgumentException(THROW_WHERE "Wrong type for StorageEncryptionKeys property!\n", uno::Reference< XInterface >(), 2 ); } @@ -839,7 +845,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, { // In case of new raw stream, the stream must not be encrypted on storing if ( bCompr && m_nStreamMode == PACKAGE_STREAM_RAW ) - throw IllegalArgumentException(OSL_LOG_PREFIX "Raw stream can not be encrypted on storing", + throw IllegalArgumentException(THROW_WHERE "Raw stream can not be encrypted on storing", uno::Reference< XInterface >(), 2 ); @@ -847,12 +853,12 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_bCompressedIsSetFromOutside = sal_True; } else - throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Compressed property!\n", + throw IllegalArgumentException(THROW_WHERE "Wrong type for Compressed property!\n", uno::Reference< XInterface >(), 2 ); } else - throw beans::UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) @@ -895,7 +901,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) return aAny; } else - throw beans::UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } void ZipPackageStream::setSize ( const sal_Int64 nNewSize ) diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index 8e181294dfcf..674d20aaea7e 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -23,6 +23,12 @@ using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + WrapStreamForShare::WrapStreamForShare( const uno::Reference< io::XInputStream >& xInStream, const SotMutexHolderRef& rMutexRef ) : m_rMutexRef( rMutexRef ) @@ -33,7 +39,7 @@ WrapStreamForShare::WrapStreamForShare( const uno::Reference< io::XInputStream > if ( !m_rMutexRef.Is() || !m_xInStream.is() || !m_xSeekable.is() ) { OSL_FAIL( "Wrong initialization of wrapping stream!\n" ); - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } } @@ -51,7 +57,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::readBytes( uno::Sequence< sal_Int8 >& aDa ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -70,7 +76,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::readSomeBytes( uno::Sequence< sal_Int8 >& ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -89,7 +95,7 @@ void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -105,7 +111,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::available() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_xInStream->available(); } @@ -118,7 +124,7 @@ void SAL_CALL WrapStreamForShare::closeInput() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // the package is the owner so it will close the stream // m_xInStream->closeInput(); @@ -135,7 +141,7 @@ void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // let stream implementation do all the checking m_xSeekable->seek( location ); @@ -150,7 +156,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getPosition() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_nCurPos; } @@ -162,7 +168,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getLength() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return m_xSeekable->getLength(); } diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 44a27b4cbb6f..7648beeb901a 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -37,6 +37,12 @@ using namespace ::com::sun::star; +#if OSL_DEBUG_LEVEL > 0 +#define THROW_WHERE SAL_WHERE +#else +#define THROW_WHERE "" +#endif + OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >& rxContext ) : m_aMutexHolder( new SotMutexHolder ) , m_xContext( rxContext ) @@ -46,7 +52,7 @@ OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >& , m_bOwnContent( false ) { if ( !rxContext.is() ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } OZipFileAccess::~OZipFileAccess() @@ -165,13 +171,13 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_pZipFile ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // initialization is allowed only one time + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // initialization is allowed only one time if ( !aArguments.getLength() ) - throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); OSL_ENSURE( aArguments.getLength() == 1, "Too many arguments are provided, only the first one will be used!\n" ); @@ -204,15 +210,15 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu xSeekable = uno::Reference< io::XSeekable >( m_xContentStream, uno::UNO_QUERY ); } else - throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); if ( !m_xContentStream.is() ) - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !xSeekable.is() ) { // TODO: after fwkbugfix02 is integrated a helper class can be used to make the stream seekable - throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } // TODO: in case xSeekable is implemented on separated XStream implementation a wrapper is required @@ -231,14 +237,14 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); EntryHash::iterator aIter = m_pZipFile->GetEntryHash().find( aName ); if ( aIter == m_pZipFile->GetEntryHash().end() ) - throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, ::rtl::Reference< EncryptionData >(), @@ -246,7 +252,7 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return uno::makeAny ( xEntryStream ); } @@ -257,10 +263,10 @@ uno::Sequence< OUString > SAL_CALL OZipFileAccess::getElementNames() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); uno::Sequence< OUString > aNames( m_pZipFile->GetEntryHash().size() ); sal_Int32 nLen = 0; @@ -291,10 +297,10 @@ sal_Bool SAL_CALL OZipFileAccess::hasByName( const OUString& aName ) ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); EntryHash::iterator aIter = m_pZipFile->GetEntryHash().find( aName ); @@ -307,10 +313,10 @@ uno::Type SAL_CALL OZipFileAccess::getElementType() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ); } @@ -321,10 +327,10 @@ sal_Bool SAL_CALL OZipFileAccess::hasElements() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return ( m_pZipFile->GetEntryHash().size() != 0 ); } @@ -338,10 +344,10 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // Code to compare strings by patterns uno::Sequence< OUString > aPattern = GetPatternsFromString_Impl( aPatternString ); @@ -356,12 +362,12 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); return xEntryStream; } } - throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); } // XComponent @@ -371,7 +377,7 @@ void SAL_CALL OZipFileAccess::dispose() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_pListenersContainer ) { @@ -402,7 +408,7 @@ void SAL_CALL OZipFileAccess::addEventListener( const uno::Reference< lang::XEve ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( !m_pListenersContainer ) m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutexHolder->GetMutex() ); @@ -415,7 +421,7 @@ void SAL_CALL OZipFileAccess::removeEventListener( const uno::Reference< lang::X ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); if ( m_pListenersContainer ) m_pListenersContainer->removeInterface( xListener ); |