diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-23 12:03:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-23 15:06:00 +0200 |
commit | e7bc3cab019fbf040f9fb8b53ae2cf3f977d200b (patch) | |
tree | bc507bccee9fb71134e362b72d22991561e32aa0 /package | |
parent | c5d47c327a57df55fa3dac0fff6b65888d0345e4 (diff) |
remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.
Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
Diffstat (limited to 'package')
-rw-r--r-- | package/source/manifest/ManifestExport.cxx | 8 | ||||
-rw-r--r-- | package/source/manifest/ManifestWriter.cxx | 2 | ||||
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 6 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 452 | ||||
-rw-r--r-- | package/source/zipapi/ByteGrabber.cxx | 6 | ||||
-rw-r--r-- | package/source/zipapi/XUnbufferedStream.cxx | 20 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 79 | ||||
-rw-r--r-- | package/source/zipapi/ZipOutputStream.cxx | 13 | ||||
-rw-r--r-- | package/source/zipapi/blowfishcontext.cxx | 9 | ||||
-rw-r--r-- | package/source/zipapi/sha1context.cxx | 3 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 44 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageEntry.cxx | 4 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 18 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolderEnumeration.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 56 | ||||
-rw-r--r-- | package/source/zippackage/wrapstreamforshare.cxx | 18 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 48 |
17 files changed, 378 insertions, 410 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index ddfe008381b5..82ce37fd322e 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -263,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( THROW_WHERE "Unexpected digest algorithm is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected digest algorithm is provided!" ); pNewAttrList->AddAttribute ( sChecksumTypeAttribute, sCdataAttribute, sChecksumType ); *pDigest >>= aSequence; @@ -286,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( THROW_WHERE "Unexpected key size is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected key size is provided!" ); sEncAlgName = sAES256_URL; } @@ -295,7 +295,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa sEncAlgName = sBlowfish_Name; } else - throw uno::RuntimeException( THROW_WHERE "Unexpected encryption algorithm is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected encryption algorithm is provided!" ); pNewAttrList->AddAttribute ( sAlgorithmNameAttribute, sCdataAttribute, sEncAlgName ); @@ -359,7 +359,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa sStartKeySize = aBuffer.makeStringAndClear(); } else - throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!" ); 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 458b1f16591c..a6cb28f0838c 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.cxx @@ -66,7 +66,7 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr } catch( SAXException& ) { - throw RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw RuntimeException( THROW_WHERE ); } } diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index e7eb58005f58..4ec30e962931 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -980,8 +980,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED ) aValue <<= m_aNewRelInfo; else // m_nRelInfoStatus == RELINFO_CHANGED_BROKEN || m_nRelInfoStatus == RELINFO_BROKEN - throw io::IOException( "Wrong relinfo stream!", - uno::Reference< uno::XInterface >() ); + throw io::IOException( "Wrong relinfo stream!" ); for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) if ( aResult[nInd].Name == "RelationsInfo" ) @@ -1152,8 +1151,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRel else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED ) return m_aNewRelInfo; else // m_nRelInfoStatus == RELINFO_CHANGED_BROKEN || m_nRelInfoStatus == RELINFO_BROKEN - throw io::IOException( "Wrong relinfo stream!", - uno::Reference< uno::XInterface >() ); + throw io::IOException( "Wrong relinfo stream!" ); } void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream >& xDestStream ) diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 1858d76c3dcf..0a6adcd0e08b 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -102,15 +102,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Reference< io::XOutputStream > xDestOutStream = xDest->getOutputStream(); if ( !xDestOutStream.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference< io::XInputStream > xSourceInStream = xSource->getInputStream(); if ( !xSourceInStream.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); // TODO: headers of encripted streams should be copied also ::comphelper::OStorageHelper::CopyInputToOutput( xSourceInStream, xDestOutStream ); @@ -147,7 +147,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); ::comphelper::OStorageHelper::CopyInputToOutput( xInStream, xTempOut ); xTempOut->closeOutput(); @@ -523,7 +523,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE ); } uno::Reference< uno::XComponentContext > OStorage_Impl::GetComponentContext() @@ -622,11 +622,11 @@ void OStorage_Impl::ReadContents() uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xPackageFolder, uno::UNO_QUERY ); if ( !xEnumAccess.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration(); if ( !xEnum.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); m_bListCreated = true; @@ -639,7 +639,7 @@ void OStorage_Impl::ReadContents() if ( !xNamed.is() ) { SAL_WARN( "package.xstor", "XNamed is not supported!" ); - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); } OUString aName = xNamed->getName(); @@ -651,7 +651,7 @@ void OStorage_Impl::ReadContents() if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" ) { if ( !pNewElement->m_bIsStorage ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Unexpected format + throw io::IOException( THROW_WHERE ); // TODO: Unexpected format m_pRelStorElement = pNewElement; CreateRelStorage(); @@ -700,12 +700,12 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes xPropSet->getPropertyValue( "OpenMode" ) >>= nDestMode; if ( !( nDestMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied ReadContents(); if ( !m_xPackageFolder.is() ) - throw embed::InvalidStorageException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE ); for ( SotElementList_Impl::iterator pElementIter = m_aChildrenList.begin(); pElementIter != m_aChildrenList.end(); ++pElementIter ) @@ -790,7 +790,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, uno::Reference< container::XNameAccess > xDestAccess( xDest, uno::UNO_QUERY ); if ( !xDestAccess.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( xDestAccess->hasByName( aName ) && !( pElement->m_bIsStorage && xDest->isStorageElement( aName ) ) ) @@ -808,7 +808,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, { OpenSubStorage( pElement, embed::ElementModes::READ ); if ( !pElement->m_pStorage ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } pElement->m_pStorage->CopyToStorage( xSubDest, bDirect ); @@ -819,7 +819,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, { OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } if ( !pElement->m_pStream->IsEncrypted() ) @@ -883,7 +883,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, } if ( !xInputToInsert.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); xOptDest->insertStreamElementDirect( aName, xInputToInsert, aStrProps ); } @@ -900,7 +900,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } else if ( pElement->m_pStream->HasCachedEncryptionData() && ( pElement->m_pStream->IsModified() || pElement->m_pStream->HasWriteOwner_Impl() ) ) @@ -995,8 +995,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( THROW_WHERE "Wrong relinfo stream!", - uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE "Wrong relinfo stream!" ); } void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& xNewStor ) @@ -1005,7 +1004,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OStorage_Impl aTempRepresent( NULL, embed::ElementModes::READ, @@ -1026,7 +1025,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); xParentPackageFolder->insertByName( aName, uno::makeAny( xTunnel ) ); @@ -1048,7 +1047,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE ); OSL_ENSURE( m_nStorageMode & embed::ElementModes::WRITE, "Commit of readonly storage, should be detected before!\n" ); @@ -1179,7 +1178,7 @@ void OStorage_Impl::Commit() { OpenSubStream( *pElementIter ); if ( !(*pElementIter)->m_pStream ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); } CommitStreamRelInfo( *pElementIter ); @@ -1204,7 +1203,7 @@ void OStorage_Impl::Commit() { OSL_ENSURE( (*pElementIter)->m_pStorage, "An inserted storage is incomplete!\n" ); if ( !(*pElementIter)->m_pStorage ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); (*pElementIter)->m_pStorage->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); @@ -1215,7 +1214,7 @@ void OStorage_Impl::Commit() { OSL_ENSURE( (*pElementIter)->m_pStream, "An inserted stream is incomplete!\n" ); if ( !(*pElementIter)->m_pStream ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( !(*pElementIter)->m_pStream->IsTransacted() ) (*pElementIter)->m_pStream->Commit(); @@ -1238,7 +1237,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); xProps->setPropertyValue( "MediaType", uno::makeAny( m_aMediaType ) ); xProps->setPropertyValue( "Version", uno::makeAny( m_aVersion ) ); @@ -1253,7 +1252,7 @@ void OStorage_Impl::Commit() SAL_WARN_IF( !xChangesBatch.is(), "package.xstor", "Impossible to commit package!" ); if ( !xChangesBatch.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); try { @@ -1352,19 +1351,19 @@ void OStorage_Impl::Revert() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; if ( m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); if ( m_bIsRoot ) { if ( !m_bHasCommonEncryptionData ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); return m_aCommonEncryptionData; } else { if ( !m_pParent ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); return m_pParent->GetCommonRootEncryptionData(); } @@ -1392,7 +1391,7 @@ SotElement_Impl* OStorage_Impl::InsertStream( const OUString& aName, 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE); uno::Sequence< uno::Any > aSeq( 1 ); aSeq[0] <<= sal_False; @@ -1401,15 +1400,15 @@ SotElement_Impl* OStorage_Impl::InsertStream( const OUString& aName, bool bEncr SAL_WARN_IF( !xNewElement.is(), "package.xstor", "Not possible to create a new stream!" ); if ( !xNewElement.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE || !bEncr, "Only package storage supports encryption!\n" ); if ( m_nStorageType != embed::StorageFormats::PACKAGE && bEncr ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); // the mode is not needed for storage stream internal implementation SotElement_Impl* pNewElement = InsertElement( aName, false ); @@ -1427,10 +1426,10 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( const OUString& aName, const un // 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE ); if ( m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); uno::Reference< io::XInputStream > xInStrToInsert = xSeek.is() ? xInStream : @@ -1443,11 +1442,11 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( const OUString& aName, const un SAL_WARN_IF( !xNewElement.is(), "package.xstor", "Not possible to create a new stream!" ); if ( !xNewElement.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); xPackageSubStream->setRawStream( xInStrToInsert ); @@ -1468,7 +1467,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw embed::InvalidStorageException( THROW_WHERE ); uno::Sequence< uno::Any > aSeq( 1 ); aSeq[0] <<= sal_True; @@ -1477,11 +1476,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference< container::XNameContainer > xPackageSubFolder( xNewElement, uno::UNO_QUERY ); if ( !xPackageSubFolder.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OStorage_Impl* pResult = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType ); @@ -1553,14 +1552,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); pElement->m_pStorage = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType ); } @@ -1580,11 +1579,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); uno::Reference< packages::XDataSinkEncrSupport > xPackageSubStream( xTunnel, uno::UNO_QUERY ); if ( !xPackageSubStream.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); // 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, false, m_nStorageType, false, GetRelInfoStreamForName( pElement->m_aOriginalName ) ); @@ -1621,7 +1620,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Access denied + throw io::IOException( THROW_WHERE ); // TODO: Access denied if ( pElement->m_bIsInserted ) { @@ -1667,10 +1666,10 @@ void OStorage_Impl::CloneStreamElement( const OUString& aStreamName, if ( !pElement ) { // element does not exist, throw exception - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied } else if ( pElement->m_bIsStorage ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); if ( !pElement->m_pStream ) OpenSubStream( pElement ); @@ -1692,7 +1691,7 @@ void OStorage_Impl::CloneStreamElement( const OUString& aStreamName, pElement->m_pStream->GetCopyOfLastCommit( xTargetStream ); } else - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE ); // TODO: general_error } void OStorage_Impl::RemoveStreamRelInfo( const OUString& aOriginalName ) @@ -1729,7 +1728,7 @@ void OStorage_Impl::CreateRelStorage() OpenSubStorage( m_pRelStorElement, embed::ElementModes::WRITE ); if ( !m_pRelStorElement->m_pStorage ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OStorage* pResultStorage = new OStorage( m_pRelStorElement->m_pStorage, false ); m_xRelStorage = uno::Reference< embed::XStorage >( (embed::XStorage*) pResultStorage ); @@ -1742,7 +1741,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) // the stream element must be provided if ( !pStreamElement ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( m_nStorageType == embed::StorageFormats::OFOPXML && pStreamElement->m_pStream ) { @@ -1785,12 +1784,12 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain OUString aRelsStorName("_rels"); if ( !xNewPackageFolder.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); if ( m_nRelInfoStatus == RELINFO_CHANGED || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ @@ -1808,7 +1807,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain uno::Reference< io::XOutputStream > xOutStream = xRelsStream->getOutputStream(); if ( !xOutStream.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, m_xContext ); @@ -1834,7 +1833,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain uno::Reference< io::XOutputStream > xOutputStream = xRelsStream->getOutputStream(); if ( !xOutputStream.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Reference< io::XSeekable > xSeek( m_xNewRelInfoStream, uno::UNO_QUERY_THROW ); xSeek->seek( 0 ); @@ -1963,7 +1962,7 @@ void SAL_CALL OStorage::InternalDispose( bool bNotifyImpl ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } // the source object is also a kind of locker for the current object @@ -2061,7 +2060,7 @@ void OStorage::BroadcastModifiedIfNecessary() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( !m_pImpl->m_bBroadcastModified ) @@ -2098,7 +2097,7 @@ void OStorage::BroadcastTransaction( sal_Int8 nMessage ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } SAL_WARN_IF( m_pData->m_bReadOnlyWrap, "package.xstor", "The storage can not be modified at all!" ); @@ -2150,8 +2149,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, || ( nOpenMode & embed::ElementModes::NOCREATE ) == embed::ElementModes::NOCREATE ) { throw io::IOException("Element does not exist and cannot be " - "created: \"" + aStreamName + "\"", - uno::Reference< uno::XInterface >()); // TODO: access_denied + "created: \"" + aStreamName + "\""); // TODO: access_denied } // create a new StreamElement and insert it into the list @@ -2159,7 +2157,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, } else if ( pElement->m_bIsStorage ) { - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } SAL_WARN_IF( !pElement, "package.xstor", "In case element can not be created an exception must be thrown!" ); @@ -2168,7 +2166,7 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); return pElement; } @@ -2176,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( !m_pData->m_pSubElDispListener ) { @@ -2352,7 +2350,7 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject*> ( this ), uno::UNO_QUERY ) ) @@ -2417,7 +2415,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, false ) ) @@ -2427,7 +2425,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied uno::Reference< io::XStream > xResult; try @@ -2443,7 +2441,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); MakeLinkToSubComponent_Impl( xStreamComponent ); } @@ -2528,7 +2526,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStorName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, false ) ) @@ -2538,11 +2536,11 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) && !( nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied // it's always possible to read written storage in this implementation nStorageMode |= embed::ElementModes::READ; @@ -2557,26 +2555,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied } else if ( !pElement->m_pStorage->m_aReadOnlyWrapList.empty() && ( nStorageMode & embed::ElementModes::WRITE ) ) { - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied } else { @@ -2603,7 +2601,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( m_pImpl->OpenSubStorage( pElement, nStorageMode ); if ( !pElement->m_pStorage ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE ); // TODO: general_error bool bReadOnlyWrap = ( ( nStorageMode & embed::ElementModes::WRITE ) != embed::ElementModes::WRITE ); OStorage* pResultStorage = new OStorage( pElement->m_pStorage, bReadOnlyWrap ); @@ -2617,7 +2615,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); MakeLinkToSubComponent_Impl( xStorageComponent ); } @@ -2679,7 +2677,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUStr if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, false ) ) @@ -2693,7 +2691,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUStr uno::Reference< io::XStream > xResult; m_pImpl->CloneStreamElement( aStreamName, false, ::comphelper::SequenceAsHashMap(), xResult ); if ( !xResult.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return xResult; } catch( const embed::InvalidStorageException& rInvalidStorageException ) @@ -2771,7 +2769,7 @@ void SAL_CALL OStorage::copyLastCommitTo( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } try @@ -2835,7 +2833,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStorName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, false ) ) @@ -2853,11 +2851,11 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !pElement ) { // element does not exist, throw exception - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied } else if ( !pElement->m_bIsStorage ) { - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } if ( !pElement->m_pStorage ) @@ -2872,7 +2870,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( pElement->m_pStorage->CopyLastCommitTo( xTargetStorage ); } else - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE ); // TODO: general_error } catch( const embed::InvalidStorageException& rInvalidStorageException ) { @@ -2927,7 +2925,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) ) @@ -2978,7 +2976,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) } if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE ); //??? return !pElement->m_bIsStorage; } @@ -2994,7 +2992,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) ) @@ -3045,7 +3043,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) } if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE ); //??? return pElement->m_bIsStorage; } @@ -3063,7 +3061,7 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) ) @@ -3073,14 +3071,14 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE ); //??? m_pImpl->RemoveElement( pElement ); @@ -3153,7 +3151,7 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) @@ -3164,17 +3162,17 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied try { SotElement_Impl* pRefElement = m_pImpl->FindElement( aNewName ); if ( pRefElement ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::ElementExistException( THROW_WHERE ); //??? SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE ); //??? pElement->m_aName = aNewName; @@ -3255,7 +3253,7 @@ void SAL_CALL OStorage::copyElementTo( const OUString& aElementName, if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) @@ -3273,14 +3271,14 @@ void SAL_CALL OStorage::copyElementTo( const OUString& aElementName, { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); m_pImpl->CopyStorageElement( pElement, xDest, aNewName, false ); } @@ -3354,7 +3352,7 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) @@ -3368,20 +3366,20 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); //??? + throw container::NoSuchElementException( THROW_WHERE ); //??? uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); m_pImpl->CopyStorageElement( pElement, xDest, aNewName, false ); @@ -3464,14 +3462,14 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied if ( !aEncryptionData.getLength() ) throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 3 ); @@ -3490,7 +3488,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); MakeLinkToSubComponent_Impl( xStreamComponent ); } @@ -3571,7 +3569,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) @@ -3585,7 +3583,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( uno::Reference< io::XStream > xResult; m_pImpl->CloneStreamElement( aStreamName, true, aEncryptionData, xResult ); if ( !xResult.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return xResult; } catch( const embed::InvalidStorageException& rInvalidStorageException ) @@ -3657,11 +3655,11 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible + throw uno::RuntimeException( THROW_WHERE ); // the interface is not supported and must not be accessible if ( sStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, false ) ) throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); @@ -3671,18 +3669,18 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( { SotElement_Impl* pElement = m_pImpl->FindElement( sStreamName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); if ( !pElement->m_pStream ) { m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } uno::Reference< io::XInputStream > xRawInStream = pElement->m_pStream->GetPlainRawInStream(); if ( !xRawInStream.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference < io::XTempFile > xTempFile = io::TempFile::create( m_pImpl->GetComponentContext() ); uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); @@ -3690,7 +3688,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); // Copy temporary file to a new one ::comphelper::OStorageHelper::CopyInputToOutput( xRawInStream, xTempOut ); @@ -3762,11 +3760,11 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); if ( sStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, false ) ) throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); @@ -3776,21 +3774,21 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( { SotElement_Impl* pElement = m_pImpl->FindElement( sStreamName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); if ( !pElement->m_pStream ) { m_pImpl->OpenSubStream( pElement ); if ( !pElement->m_pStream ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } if ( !pElement->m_pStream->IsEncrypted() ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); uno::Reference< io::XInputStream > xRawInStream = pElement->m_pStream->GetRawInStream(); if ( !xRawInStream.is() ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(m_pImpl->GetComponentContext()); uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); @@ -3798,7 +3796,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); // Copy temporary file to a new one ::comphelper::OStorageHelper::CopyInputToOutput( xRawInStream, xTempOut ); @@ -3877,11 +3875,11 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName, if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, false ) ) throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); @@ -3890,13 +3888,13 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName, throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 2 ); if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aStreamName ); if ( pElement ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); m_pImpl->InsertRawStream( aStreamName, xInStream ); } @@ -3970,11 +3968,11 @@ void SAL_CALL OStorage::commit() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_bReadOnlyWrap ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access_denied + throw io::IOException( THROW_WHERE ); // TODO: access_denied m_pImpl->Commit(); // the root storage initiates the storing to source @@ -4032,7 +4030,7 @@ void SAL_CALL OStorage::revert() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } for ( SotElementList_Impl::iterator pElementIter = m_pImpl->m_aChildrenList.begin(); @@ -4042,7 +4040,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied } if ( m_pData->m_bReadOnlyWrap || !m_pImpl->m_bListCreated ) @@ -4097,7 +4095,7 @@ void SAL_CALL OStorage::addTransactionListener( const uno::Reference< embed::XTr if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } m_pData->m_aListenersContainer.addInterface( ::getCppuType((const uno::Reference< embed::XTransactionListener >*)0), @@ -4112,7 +4110,7 @@ void SAL_CALL OStorage::removeTransactionListener( const uno::Reference< embed:: if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } m_pData->m_aListenersContainer.removeInterface( ::getCppuType((const uno::Reference< embed::XTransactionListener >*)0), @@ -4132,7 +4130,7 @@ sal_Bool SAL_CALL OStorage::isModified() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } return m_pImpl->m_bIsModified; @@ -4147,11 +4145,11 @@ void SAL_CALL OStorage::setModified( sal_Bool bModified ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_bReadOnlyWrap ) - throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw beans::PropertyVetoException( THROW_WHERE ); // TODO: access denied if ( (m_pImpl->m_bIsModified ? 1 : 0) != bModified ) m_pImpl->m_bIsModified = bModified; @@ -4173,7 +4171,7 @@ void SAL_CALL OStorage::addModifyListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } osl_atomic_increment( &m_pImpl->m_nModifiedListenerCount ); @@ -4190,7 +4188,7 @@ void SAL_CALL OStorage::removeModifyListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } osl_atomic_decrement( &m_pImpl->m_nModifiedListenerCount ); @@ -4210,7 +4208,7 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, false ) ) @@ -4224,7 +4222,7 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) { SotElement_Impl* pElement = m_pImpl->FindElement( aName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); if ( pElement->m_bIsStorage ) aResult <<= openStorageElement( aName, embed::ElementModes::READ ); @@ -4272,7 +4270,7 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } try @@ -4306,7 +4304,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aName.isEmpty() ) @@ -4349,7 +4347,7 @@ uno::Type SAL_CALL OStorage::getElementType() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } // it is a multitype container @@ -4364,7 +4362,7 @@ sal_Bool SAL_CALL OStorage::hasElements() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } try @@ -4399,7 +4397,7 @@ void SAL_CALL OStorage::dispose() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } try @@ -4434,7 +4432,7 @@ void SAL_CALL OStorage::addEventListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } m_pData->m_aListenersContainer.addInterface( @@ -4450,7 +4448,7 @@ void SAL_CALL OStorage::removeEventListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } m_pData->m_aListenersContainer.removeInterface( @@ -4475,11 +4473,11 @@ void SAL_CALL OStorage::removeEncryption() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE ); // 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 ) @@ -4531,7 +4529,7 @@ void SAL_CALL OStorage::removeEncryption() m_pImpl->AddLog( THROW_WHERE "Rethrow" ); SAL_WARN( "package.xstor", "The call must not fail, it is pretty simple!" ); - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } } } @@ -4547,14 +4545,14 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE ); // the interface must be visible only for package storage if ( !aEncryptionData.getLength() ) - throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption data!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption data!" ); SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "setEncryptionData() method is not available for nonroot storages!" ); if ( m_pData->m_bIsRoot ) @@ -4594,7 +4592,7 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu m_pImpl->AddLog( rException.Message ); m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } } } @@ -4617,14 +4615,14 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE ); // the interface must be visible only for package storage if ( !aAlgorithms.getLength() ) - throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption algorithms list!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE "Unexpected empty encryption algorithms list!" ); SAL_WARN_IF( !m_pData->m_bIsRoot, "package.xstor", "setEncryptionAlgorithms() method is not available for nonroot storages!" ); if ( m_pData->m_bIsRoot ) @@ -4667,7 +4665,7 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } } } @@ -4680,11 +4678,11 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage + throw uno::RuntimeException( THROW_WHERE ); // 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!" ); @@ -4727,7 +4725,7 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() m_pImpl->AddLog( aException.Message ); m_pImpl->AddLog( THROW_WHERE "Rethrow" ); - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } } @@ -4744,7 +4742,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OStorage::getPropertySetInfo( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: @@ -4763,7 +4761,7 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: think about interaction handler @@ -4772,10 +4770,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: Access denied + throw io::IOException( THROW_WHERE ); // TODO: Access denied if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) - throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE ); else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( aPropertyName == "MediaType" ) @@ -4805,9 +4803,9 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u || aPropertyName == "RepairPackage" ) ) || aPropertyName == "IsRoot" || aPropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY ) - throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE ); else - throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { @@ -4848,12 +4846,12 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u } else if ( ( m_pData->m_bIsRoot && ( aPropertyName == "URL" || aPropertyName == "RepairPackage") ) || aPropertyName == "IsRoot" ) - throw beans::PropertyVetoException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE ); else - throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE ); } else - throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE ); BroadcastModifiedIfNecessary(); } @@ -4868,7 +4866,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE @@ -4936,7 +4934,7 @@ 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return xPackPropSet->getPropertyValue( aPropertyName ); } @@ -4960,7 +4958,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) } } - throw beans::UnknownPropertyException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException( THROW_WHERE ); } void SAL_CALL OStorage::addPropertyChangeListener( @@ -4975,7 +4973,7 @@ void SAL_CALL OStorage::addPropertyChangeListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: @@ -4993,7 +4991,7 @@ void SAL_CALL OStorage::removePropertyChangeListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: @@ -5011,7 +5009,7 @@ void SAL_CALL OStorage::addVetoableChangeListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: @@ -5029,7 +5027,7 @@ void SAL_CALL OStorage::removeVetoableChangeListener( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } //TODO: @@ -5048,11 +5046,11 @@ sal_Bool SAL_CALL OStorage::hasByID( const OUString& sID ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); try { @@ -5078,11 +5076,11 @@ OUString SAL_CALL OStorage::getTargetByID( const OUString& sID ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) @@ -5102,11 +5100,11 @@ OUString SAL_CALL OStorage::getTypeByID( const OUString& sID ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) @@ -5126,11 +5124,11 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); // TODO/LATER: in future the unification of the ID could be checked uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5143,7 +5141,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons break; } - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); } uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelationshipsByType( const OUString& sType ) @@ -5155,11 +5153,11 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; sal_Int32 nEntriesNum = 0; @@ -5190,11 +5188,11 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return m_pImpl->GetAllRelationshipsIfAny(); } @@ -5209,11 +5207,11 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OUString aIDTag( "Id" ); @@ -5255,7 +5253,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: aSeq[nIDInd].realloc( nIndTarget ); } else - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); m_pImpl->m_aRelInfo = aSeq; m_pImpl->m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -5272,11 +5270,11 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) @@ -5300,7 +5298,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) break; } - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); } void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence< beans::StringPair > >& aEntries, sal_Bool bReplace ) @@ -5313,11 +5311,11 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); OUString aIDTag( "Id" ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5338,7 +5336,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); nIndSourceSame = nIndSource1; } @@ -5371,10 +5369,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: illegal relation ( no ID ) + throw io::IOException( THROW_WHERE ); // TODO: illegal relation ( no ID ) if ( !bHasID ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: illegal relations + throw io::IOException( THROW_WHERE ); // TODO: illegal relations nResultInd++; } @@ -5394,11 +5392,11 @@ void SAL_CALL OStorage::clearRelationships() if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); m_pImpl->m_aRelInfo.realloc( 0 ); m_pImpl->m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -5419,7 +5417,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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException( THROW_WHERE ); } void SAL_CALL OStorage::insertStreamElementDirect( @@ -5438,7 +5436,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, false ) ) @@ -5448,14 +5446,14 @@ void SAL_CALL OStorage::insertStreamElementDirect( throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name if ( m_pData->m_bReadOnlyWrap ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: access denied + throw io::IOException( THROW_WHERE ); // TODO: access denied try { SotElement_Impl* pElement = m_pImpl->FindElement( aStreamName ); if ( pElement ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); pElement = OpenStreamElement_Impl( aStreamName, embed::ElementModes::READWRITE, false ); OSL_ENSURE( pElement && pElement->m_pStream, "In case element can not be created an exception must be thrown!" ); @@ -5527,7 +5525,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) @@ -5544,14 +5542,14 @@ void SAL_CALL OStorage::copyElementDirectlyTo( { SotElement_Impl* pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); uno::Reference< XNameAccess > xNameAccess( xDest, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); if ( xNameAccess->hasByName( aNewName ) ) - throw container::ElementExistException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::ElementExistException( THROW_WHERE ); // let the element be copied directly uno::Reference< embed::XStorage > xStorDest( xDest, uno::UNO_QUERY_THROW ); @@ -5623,14 +5621,14 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( !m_pData->m_bIsRoot ) throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); if ( !m_pImpl->m_pSwitchStream ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); try { @@ -5692,14 +5690,14 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL, if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( !m_pData->m_bIsRoot ) throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 ); if ( !m_pImpl->m_pSwitchStream ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); uno::Reference < ucb::XSimpleFileAccess3 > xAccess( ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); @@ -5774,7 +5772,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aElementName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, false ) ) @@ -5787,17 +5785,17 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam { SotElement_Impl *pElement = m_pImpl->FindElement( aElementName ); if ( !pElement ) - throw container::NoSuchElementException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException( THROW_WHERE ); // 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException( THROW_WHERE ); if ( !pElement->m_pStorage ) m_pImpl->OpenSubStorage( pElement, embed::ElementModes::READ ); if ( !pElement->m_pStorage ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // TODO: general_error + throw io::IOException( THROW_WHERE ); // TODO: general_error pElement->m_pStorage->ReadContents(); return uno::makeAny( pElement->m_pStorage->m_aMediaType ); @@ -5875,7 +5873,7 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamName.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, false ) ) @@ -5894,7 +5892,7 @@ 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // if the stream reference is set it must not be changed! + throw uno::RuntimeException( THROW_WHERE ); // if the stream reference is set it must not be changed! } catch( const embed::InvalidStorageException& rInvalidStorageException ) { @@ -5959,7 +5957,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, true ) ) @@ -5967,7 +5965,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) && ( nOpenMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -5999,7 +5997,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle } if ( !xResult.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return xResult; } @@ -6029,14 +6027,14 @@ void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const OUString& a if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, true ) ) 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( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -6063,11 +6061,11 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted if ( !m_pImpl ) { SAL_INFO("package.xstor", THROW_WHERE "Disposed!"); - throw lang::DisposedException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException( THROW_WHERE ); } if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) - throw packages::NoEncryptionException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException( THROW_WHERE ); if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, true ) ) throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 ); @@ -6077,7 +6075,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) && ( nOpenMode & embed::ElementModes::WRITE ) ) - throw io::IOException( THROW_WHERE, uno::Reference< uno::XInterface >() ); // Access denied + throw io::IOException( THROW_WHERE ); // Access denied OStringList_Impl aListPath = OHierarchyHolder_Impl::GetListPathFromString( aStreamPath ); OSL_ENSURE( aListPath.size(), "The result list must not be empty!" ); @@ -6110,7 +6108,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted } if ( !xResult.is() ) - throw uno::RuntimeException( THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( THROW_WHERE ); return xResult; } diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 2b0b049a4c04..8b670ff80726 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.cxx @@ -77,7 +77,7 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) return location; } else - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); } sal_Int64 SAL_CALL ByteGrabber::getPosition( ) @@ -87,7 +87,7 @@ sal_Int64 SAL_CALL ByteGrabber::getPosition( ) if (xSeek.is() ) return xSeek->getPosition(); else - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); } sal_Int64 SAL_CALL ByteGrabber::getLength( ) @@ -97,7 +97,7 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( ) if (xSeek.is() ) return xSeek->getLength(); else - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); } ByteGrabber& ByteGrabber::operator >> (sal_Int8& rInt8) diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index 1488c3b9d7af..ff1e15135dfd 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -78,7 +78,7 @@ XUnbufferedStream::XUnbufferedStream( } if (mnZipSize < 0) - throw ZipIOException("The stream seems to be broken!", uno::Reference< XInterface >()); + throw ZipIOException("The stream seems to be broken!"); bool bHaveEncryptData = ( rData.is() && rData->m_aSalt.getLength() && rData->m_aInitVector.getLength() && rData->m_nIterationCount != 0 ) ? sal_True : sal_False; bool bMustDecrypt = ( nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False; @@ -229,16 +229,13 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa if ( nRead > nRequestedBytes ) throw RuntimeException( - "Should not be possible to read more then requested!", - Reference< XInterface >() ); + "Should not be possible to read more then requested!" ); if ( maInflater.finished() || maInflater.getLastInflateError() ) - throw ZipIOException("The stream seems to be broken!", - Reference< XInterface >() ); + throw ZipIOException("The stream seems to be broken!" ); if ( maInflater.needsDictionary() ) - throw ZipIOException("Dictionaries are not supported!", - Reference< XInterface >() ); + throw ZipIOException("Dictionaries are not supported!" ); sal_Int32 nDiff = static_cast< sal_Int32 >( mnZipEnd - mnZipCurrent ); if ( nDiff > 0 ) @@ -252,8 +249,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa sal_Int32 nZipRead = mxZipStream->readBytes( maCompBuffer, nToRead ); if ( nZipRead < nToRead ) - throw ZipIOException("No expected data!", - Reference< XInterface >() ); + throw ZipIOException("No expected data!" ); mnZipCurrent += nZipRead; // maCompBuffer now has the data, check if we need to decrypt @@ -279,8 +275,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa } else { - throw ZipIOException("The stream seems to be broken!", - Reference< XInterface >() ); + throw ZipIOException("The stream seems to be broken!" ); } } } @@ -296,8 +291,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa maCRC.update( aData ); if ( mnZipSize + maHeader.getLength() == mnMyCurrent && maCRC.getValue() != maEntry.nCrc ) - throw ZipIOException("The stream seems to be broken!", - Reference< XInterface >() ); + throw ZipIOException("The stream seems to be broken!" ); } } diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 2c8d7e856454..493a6cb49622 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -79,7 +79,7 @@ ZipFile::ZipFile( uno::Reference < XInputStream > &xInput, const uno::Reference if ( readCEN() == -1 ) { aEntries.clear(); - throw ZipException( "stream data looks to be broken", uno::Reference < XInterface > () ); + throw ZipException( "stream data looks to be broken" ); } } } @@ -103,7 +103,7 @@ ZipFile::ZipFile( uno::Reference < XInputStream > &xInput, const uno::Reference else if ( readCEN() == -1 ) { aEntries.clear(); - throw ZipException("stream data looks to be broken", uno::Reference < XInterface > () ); + throw ZipException("stream data looks to be broken" ); } } } @@ -149,8 +149,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un { if (xEncryptionData->m_nDerivedKeySize < 0) { - throw ZipIOException("Invalid derived key length!", - uno::Reference< XInterface >() ); + throw ZipIOException("Invalid derived key length!" ); } uno::Sequence< sal_Int8 > aDerivedKey( xEncryptionData->m_nDerivedKeySize ); @@ -162,8 +161,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un xEncryptionData->m_aSalt.getLength(), xEncryptionData->m_nIterationCount ) ) { - throw ZipIOException("Can not create derived key!", - uno::Reference< XInterface >() ); + throw ZipIOException("Can not create derived key!" ); } if ( xEncryptionData->m_nEncAlg == xml::crypto::CipherID::AES_CBC_W3C_PADDING ) @@ -182,8 +180,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un } else { - throw ZipIOException("Unknown cipher algorithm is requested!", - uno::Reference< XInterface >() ); + throw ZipIOException("Unknown cipher algorithm is requested!" ); } } catch( ... ) @@ -384,16 +381,14 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R throw ( packages::WrongPasswordException, ZipIOException, RuntimeException ) { if ( !rData.is() ) - throw ZipIOException("Encrypted stream without encryption data!\n", - uno::Reference< XInterface >() ); + throw ZipIOException("Encrypted stream without encryption data!\n" ); if ( !rData->m_aKey.getLength() ) - throw packages::WrongPasswordException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE ); uno::Reference< XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) - throw ZipIOException("The stream must be seekable!\n", - uno::Reference< XInterface >() ); + throw ZipIOException("The stream must be seekable!\n" ); // if we have a digest, then this file is an encrypted one and we should // check if we can decrypt it or not @@ -414,7 +409,7 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R xStream->readBytes( aReadBuffer, nSize ); if ( !StaticHasValidPassword( rxContext, aReadBuffer, rData ) ) - throw packages::WrongPasswordException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE ); } return new XUnbufferedStream( rxContext, xStream, rData ); @@ -580,14 +575,13 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry // in case no digest is provided there is no way // to detect password correctness if ( !rData.is() ) - throw ZipException("Encrypted stream without encryption data!\n", - uno::Reference< XInterface >() ); + throw ZipException("Encrypted stream without encryption data!" ); // if we have a digest, then this file is an encrypted one and we should // 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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::WrongPasswordException(THROW_WHERE ); } else bNeedRawStream = ( rEntry.nMethod == STORED ); @@ -626,7 +620,7 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream( ::osl::MutexGuard aGuard( m_aMutex ); if ( !rData.is() ) - throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE ); if ( rEntry.nOffset <= 0 ) readLOC( rEntry ); @@ -647,7 +641,7 @@ bool ZipFile::readLOC( ZipEntry &rEntry ) aGrabber >> nTestSig; if (nTestSig != LOCSIG) - throw ZipIOException("Invalid LOC header (bad signature)", uno::Reference < XInterface > () ); + throw ZipIOException("Invalid LOC header (bad signature)" ); aGrabber >> nVersion; aGrabber >> nFlag; aGrabber >> nHow; @@ -701,8 +695,7 @@ bool ZipFile::readLOC( ZipEntry &rEntry ) } if ( bBroken && !bRecoveryMode ) - throw ZipIOException("The stream seems to be broken!", - uno::Reference< XInterface >() ); + throw ZipIOException("The stream seems to be broken!" ); return true; } @@ -736,17 +729,17 @@ sal_Int32 ZipFile::findEND( ) } catch ( IllegalArgumentException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } catch ( NotConnectedException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } catch ( BufferSizeExceededException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } sal_Int32 ZipFile::readCEN() @@ -767,25 +760,25 @@ sal_Int32 ZipFile::readCEN() aGrabber >> nCenOff; if ( nTotal * CENHDR > nCenLen ) - throw ZipException("invalid END header (bad entry count)", uno::Reference < XInterface > () ); + throw ZipException("invalid END header (bad entry count)" ); if ( nTotal > ZIP_MAXENTRIES ) - throw ZipException("too many entries in ZIP File", uno::Reference < XInterface > () ); + throw ZipException("too many entries in ZIP File" ); if ( nCenLen < 0 || nCenLen > nEndPos ) - throw ZipException("Invalid END header (bad central directory size)", uno::Reference < XInterface > () ); + throw ZipException("Invalid END header (bad central directory size)" ); nCenPos = nEndPos - nCenLen; if ( nCenOff < 0 || nCenOff > nCenPos ) - throw ZipException("Invalid END header (bad central directory size)", uno::Reference < XInterface > () ); + throw ZipException("Invalid END header (bad central directory size)" ); nLocPos = nCenPos - nCenOff; aGrabber.seek( nCenPos ); Sequence < sal_Int8 > aCENBuffer ( nCenLen ); sal_Int64 nRead = aGrabber.readBytes ( aCENBuffer, nCenLen ); if ( static_cast < sal_Int64 > ( nCenLen ) != nRead ) - throw ZipException ("Error reading CEN into memory buffer!", uno::Reference < XInterface > () ); + throw ZipException ("Error reading CEN into memory buffer!" ); MemoryByteGrabber aMemGrabber ( aCENBuffer ); @@ -797,19 +790,19 @@ sal_Int32 ZipFile::readCEN() { aMemGrabber >> nTestSig; if ( nTestSig != CENSIG ) - throw ZipException("Invalid CEN header (bad signature)", uno::Reference < XInterface > () ); + throw ZipException("Invalid CEN header (bad signature)" ); aMemGrabber.skipBytes ( 2 ); aMemGrabber >> aEntry.nVersion; if ( ( aEntry.nVersion & 1 ) == 1 ) - throw ZipException("Invalid CEN header (encrypted entry)", uno::Reference < XInterface > () ); + throw ZipException("Invalid CEN header (encrypted entry)" ); aMemGrabber >> aEntry.nFlag; aMemGrabber >> aEntry.nMethod; if ( aEntry.nMethod != STORED && aEntry.nMethod != DEFLATED) - throw ZipException("Invalid CEN header (bad compression method)", uno::Reference < XInterface > () ); + throw ZipException("Invalid CEN header (bad compression method)" ); aMemGrabber >> aEntry.nTime; aMemGrabber >> aEntry.nCrc; @@ -828,7 +821,7 @@ sal_Int32 ZipFile::readCEN() if ( nSize == 0xffffffff || nOffset == 0xffffffff || nCompressedSize == 0xffffffff ) { - throw ZipException("PK64 zip file entry", uno::Reference < XInterface > () ); + throw ZipException("PK64 zip file entry" ); } else { aEntry.nCompressedSize = nCompressedSize; aEntry.nSize = nSize; @@ -839,13 +832,13 @@ sal_Int32 ZipFile::readCEN() aEntry.nOffset *= -1; if ( aEntry.nPathLen < 0 ) - throw ZipException("unexpected name length", uno::Reference < XInterface > () ); + throw ZipException("unexpected name length" ); if ( nCommentLen < 0 ) - throw ZipException("unexpected comment length", uno::Reference < XInterface > () ); + throw ZipException("unexpected comment length" ); if ( aEntry.nExtraLen < 0 ) - throw ZipException("unexpected extra header info length", uno::Reference < XInterface > () ); + throw ZipException("unexpected extra header info length" ); // read always in UTF8, some tools seem not to set UTF8 bit aEntry.sPath = OUString::intern ( (sal_Char *) aMemGrabber.getCurrentPos(), @@ -853,14 +846,14 @@ sal_Int32 ZipFile::readCEN() RTL_TEXTENCODING_UTF8 ); if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( aEntry.sPath, true ) ) - throw ZipException("Zip entry has an invalid name.", uno::Reference < XInterface > () ); + throw ZipException("Zip entry has an invalid name." ); aMemGrabber.skipBytes( aEntry.nPathLen + aEntry.nExtraLen + nCommentLen ); aEntries[aEntry.sPath] = aEntry; } if (nCount != nTotal) - throw ZipException("Count != Total", uno::Reference < XInterface > () ); + throw ZipException("Count != Total" ); } catch ( IllegalArgumentException & ) { @@ -924,7 +917,7 @@ sal_Int32 ZipFile::recover() // FIXME64: need to read the 64bit header instead if ( nSize == 0xffffffff || nCompressedSize == 0xffffffff ) { - throw ZipException("PK64 zip file entry", uno::Reference < XInterface > () ); + throw ZipException("PK64 zip file entry" ); } else { aEntry.nCompressedSize = nCompressedSize; aEntry.nSize = nSize; @@ -1040,15 +1033,15 @@ sal_Int32 ZipFile::recover() } catch ( IllegalArgumentException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } catch ( NotConnectedException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } catch ( BufferSizeExceededException& ) { - throw ZipException("Zip END signature not found!", uno::Reference < XInterface > () ); + throw ZipException("Zip END signature not found!" ); } } diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index b6bc5cfaf494..cd4f9e797f64 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -319,7 +319,7 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry ) throw(IOException, RuntimeException) { if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( rEntry.sPath, true ) ) - throw IOException("Unexpected character is used in file name.", uno::Reference< XInterface >() ); + throw IOException("Unexpected character is used in file name." ); OString sUTF8Name = OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 ); sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); @@ -359,8 +359,7 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry ) // FIXME64: need to append a ZIP64 header instead of throwing // We're about to silently lose people's data - which they are // unlikely to appreciate so fail instead: - throw IOException( "File contains streams that are too large.", - uno::Reference< XInterface >() ); + throw IOException( "File contains streams that are too large." ); } Sequence < sal_Int8 > aSequence( (sal_Int8*)sUTF8Name.getStr(), sUTF8Name.getLength() ); @@ -381,8 +380,7 @@ void ZipOutputStream::writeEXT( const ZipEntry &rEntry ) // FIXME64: need to append a ZIP64 header instead of throwing // We're about to silently lose people's data - which they are // unlikely to appreciate so fail instead: - throw IOException( "File contains streams that are too large.", - uno::Reference< XInterface >() ); + throw IOException( "File contains streams that are too large." ); } } @@ -390,7 +388,7 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry ) throw(IOException, RuntimeException) { if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( rEntry.sPath, true ) ) - throw IOException("Unexpected character is used in file name.", uno::Reference< XInterface >() ); + throw IOException("Unexpected character is used in file name." ); OString sUTF8Name = OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 ); sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); @@ -435,8 +433,7 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry ) // FIXME64: need to append a ZIP64 header instead of throwing // We're about to silently lose people's data - which they are // unlikely to appreciate so fail instead: - throw IOException( "File contains streams that are too large.", - uno::Reference< XInterface >() ); + throw IOException( "File contains streams that are too large." ); } Sequence < sal_Int8 > aSequence( (sal_Int8*)sUTF8Name.getStr(), sUTF8Name.getLength() ); diff --git a/package/source/zipapi/blowfishcontext.cxx b/package/source/zipapi/blowfishcontext.cxx index fac26fba52d6..f60f299d7bca 100644 --- a/package/source/zipapi/blowfishcontext.cxx +++ b/package/source/zipapi/blowfishcontext.cxx @@ -30,8 +30,7 @@ uno::Reference< xml::crypto::XCipherContext > BlowfishCFB8CipherContext::Create( ::rtl::Reference< BlowfishCFB8CipherContext > xResult = new BlowfishCFB8CipherContext(); xResult->m_pCipher = rtl_cipher_create( rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream ); if ( !xResult->m_pCipher ) - throw uno::RuntimeException("Can not create cipher!", - uno::Reference< XInterface >() ); + throw uno::RuntimeException("Can not create cipher!" ); if ( rtl_Cipher_E_None != rtl_cipher_init( xResult->m_pCipher, @@ -41,8 +40,7 @@ uno::Reference< xml::crypto::XCipherContext > BlowfishCFB8CipherContext::Create( reinterpret_cast< const sal_uInt8* >( aInitVector.getConstArray() ), aInitVector.getLength() ) ) { - throw uno::RuntimeException("Can not initialize cipher!", - uno::Reference< XInterface >() ); + throw uno::RuntimeException("Can not initialize cipher!" ); } xResult->m_bEncrypt = bEncrypt; @@ -88,8 +86,7 @@ uno::Sequence< sal_Int8 > SAL_CALL BlowfishCFB8CipherContext::convertWithCipherC if ( rtl_Cipher_E_None != nError ) { - throw uno::RuntimeException("Can not decrypt/encrypt with cipher!", - uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException("Can not decrypt/encrypt with cipher!" ); } return aResult; diff --git a/package/source/zipapi/sha1context.cxx b/package/source/zipapi/sha1context.cxx index ba8e782eaaac..b300aba71d8d 100644 --- a/package/source/zipapi/sha1context.cxx +++ b/package/source/zipapi/sha1context.cxx @@ -30,8 +30,7 @@ uno::Reference< xml::crypto::XDigestContext > SHA1DigestContext::Create() ::rtl::Reference< SHA1DigestContext > xResult = new SHA1DigestContext(); xResult->m_pDigest = rtl_digest_createSHA1(); if ( !xResult->m_pDigest ) - throw uno::RuntimeException("Can not create cipher!", - uno::Reference< XInterface >() ); + throw uno::RuntimeException("Can not create cipher!" ); return uno::Reference< xml::crypto::XDigestContext >( xResult.get() ); } diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 4524769e490f..6dd1e82064d7 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -352,8 +352,7 @@ void ZipPackage::parseManifest() if ( !bManifestParsed && !m_bForceRecovery ) throw ZipIOException( - THROW_WHERE "Could not parse manifest.xml\n", - uno::Reference< uno::XInterface >() ); + THROW_WHERE "Could not parse manifest.xml\n" ); const OUString sMimetype ("mimetype"); if ( m_xRootFolder->hasByName( sMimetype ) ) @@ -394,11 +393,10 @@ void ZipPackage::parseManifest() // the mimetype stream should contain the information from manifest.xml if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) ) throw ZipIOException( - (THROW_WHERE - "mimetype conflicts with manifest.xml, \"" - + m_pRootFolder->GetMediaType() + "\" vs. \"" - + aPackageMediatype + "\""), - uno::Reference< uno::XInterface >() ); + THROW_WHERE + "mimetype conflicts with manifest.xml, \"" + + m_pRootFolder->GetMediaType() + "\" vs. \"" + + aPackageMediatype + "\"" ); } m_xRootFolder->removeByName( sMimetype ); @@ -415,15 +413,14 @@ void ZipPackage::parseManifest() // in case of ODF1.2 documents without version in manifest.xml the property IsInconsistent // should be checked later throw ZipIOException( - THROW_WHERE "there are streams not referred in manifest.xml\n", - uno::Reference< uno::XInterface >() ); + THROW_WHERE "there are streams not referred in manifest.xml" ); } else if ( bDifferentStartKeyAlgorithm ) { // 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( THROW_WHERE "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!" ); } } @@ -442,8 +439,7 @@ void ZipPackage::parseContentType() try { // the content type must exist in OFOPXML format! if ( !m_xRootFolder->hasByName( aContentTypes ) ) - throw io::IOException(THROW_WHERE "Wrong format!", - uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE "Wrong format!" ); uno::Reference< lang::XUnoTunnel > xTunnel; uno::Any aAny = m_xRootFolder->getByName( aContentTypes ); @@ -460,7 +456,7 @@ void ZipPackage::parseContentType() ::comphelper::OFOPXMLHelper::ReadContentTypeSequence( xInStream, m_xContext ); if ( aContentTypeInfo.getLength() != 2 ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); // set the implicit types fist for ( nInd = 0; nInd < aContentTypeInfo[0].getLength(); nInd++ ) @@ -839,7 +835,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) pCurrent = pCurrent->doGetByName( sTemp ).pFolder; } else - throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE ); nOldIndex = nIndex+1; } if ( bFolder ) @@ -858,7 +854,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) return pCurrent->getByName( sTemp ); } else - throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE ); } } } @@ -1382,7 +1378,7 @@ void SAL_CALL ZipPackage::commitChanges() xOutputStream = m_xStream->getOutputStream(); uno::Reference < XTruncate > xTruncate ( xOutputStream, UNO_QUERY ); if ( !xTruncate.is() ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); // after successful truncation the original file contents are already lost xTruncate->truncate(); @@ -1464,7 +1460,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ); Content aContent( @@ -1545,7 +1541,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey() else if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA1 ) aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA1UTF8; else - throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -1554,7 +1550,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(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); } else aResult = m_aEncryptionKey; @@ -1648,13 +1644,13 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception ) { if ( m_nFormat != embed::StorageFormats::PACKAGE ) - throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE ); if (aPropertyName == HAS_ENCRYPTED_ENTRIES_PROPERTY ||aPropertyName == HAS_NONENCRYPTED_ENTRIES_PROPERTY ||aPropertyName == IS_INCONSISTENT_PROPERTY ||aPropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY) - throw PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw PropertyVetoException(THROW_WHERE ); else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( !( aValue >>= m_aEncryptionKey ) ) @@ -1737,7 +1733,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const } } else - throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE ); } Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) @@ -1745,7 +1741,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE ); Any aAny; if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) @@ -1787,7 +1783,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) aAny <<= m_bMediaTypeFallbackUsed; return aAny; } - throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE ); } void SAL_CALL ZipPackage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) throw( UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception ) diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index ecdcdf5eaa0c..91b2e9466d07 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.cxx @@ -68,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, true ) ) - throw RuntimeException(THROW_WHERE "Unexpected character is used in file name.", uno::Reference< XInterface >() ); + throw RuntimeException(THROW_WHERE "Unexpected character is used in file name." ); msName = aName; @@ -96,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSupportException(THROW_WHERE ); ZipPackageFolder *pNewParent = reinterpret_cast < ZipPackageFolder * > ( nTest ); diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 8c2a53b7f285..e232f1afeec9 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -186,7 +186,7 @@ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const uno:: throw(IllegalArgumentException, ElementExistException, WrappedTargetException, uno::RuntimeException, std::exception) { if (hasByName(aName)) - throw ElementExistException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw ElementExistException(THROW_WHERE ); else { uno::Reference < XUnoTunnel > xRef; @@ -221,7 +221,7 @@ void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) { ContentHash::iterator aIter = maContents.find ( Name ); if ( aIter == maContents.end() ) - throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE ); maContents.erase( aIter ); } // XEnumerationAccess @@ -247,7 +247,7 @@ ContentInfo& ZipPackageFolder::doGetByName( const OUString& aName ) { ContentHash::iterator aIter = maContents.find ( aName ); if ( aIter == maContents.end()) - throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE ); return *(*aIter).second; } uno::Any SAL_CALL ZipPackageFolder::getByName( const OUString& aName ) @@ -278,7 +278,7 @@ void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const uno: if ( hasByName( aName ) ) removeByName( aName ); else - throw NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(THROW_WHERE ); insertByName(aName, aElement); } @@ -729,7 +729,7 @@ void ZipPackageFolder::saveContents( OUString &rPath, std::vector < uno::Sequenc } if( bWritingFailed ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); } void ZipPackageFolder::releaseUpwardRef( void ) @@ -777,7 +777,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE ); aValue >>= sMediaType; } @@ -786,7 +786,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == "Size" ) aValue >>= aEntry.nSize; else - throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE ); } uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, uno::RuntimeException, std::exception) @@ -795,7 +795,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(THROW_WHERE ); return uno::makeAny ( sMediaType ); } @@ -804,7 +804,7 @@ uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyNa else if ( PropertyName == "Size" ) return uno::makeAny ( aEntry.nSize ); else - throw UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(THROW_WHERE ); } void ZipPackageFolder::doInsertByName ( ZipPackageEntry *pEntry, bool bSetParent ) diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx index f8ac3b03ef68..7644cbb5576c 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.cxx @@ -49,7 +49,7 @@ uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) { uno::Any aAny; if (aIterator == rContents.end() ) - throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE ); aAny <<= (*aIterator).second->xTunnel; aIterator++; return aAny; diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 90ab0a98a6c5..d05676cc09c6 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -148,8 +148,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( THROW_WHERE "The stream must support XSeekable!", - uno::Reference< XInterface >() ); + throw RuntimeException( THROW_WHERE "The stream must support XSeekable!" ); m_bHasSeekable = true; } @@ -160,16 +159,14 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCopy() { if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); if ( m_xBaseEncryptionData.is() ) - throw ZipIOException(THROW_WHERE "Encrypted stream without encryption data!\n", - uno::Reference< XInterface >() ); + throw ZipIOException(THROW_WHERE "Encrypted stream without encryption data!" ); uno::Reference< io::XSeekable > xSeek( GetOwnSeekStream(), UNO_QUERY ); if ( !xSeek.is() ) - throw ZipIOException(THROW_WHERE "The stream must be seekable!\n", - uno::Reference< XInterface >() ); + throw ZipIOException(THROW_WHERE "The stream must be seekable!" ); // skip header xSeek->seek( n_ConstHeaderSize + getInitialisationVector().getLength() + @@ -230,7 +227,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi aNameToFind = bUseWinEncoding ? PACKAGE_ENCRYPTIONDATA_SHA1MS1252 : PACKAGE_ENCRYPTIONDATA_SHA1UTF8; } else - throw uno::RuntimeException(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -239,7 +236,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(THROW_WHERE "No expected key is provided!", uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); } else aResult = m_aEncryptionKey; @@ -260,7 +257,7 @@ sal_Int32 ZipPackageStream::GetStartKeyGenID() uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( bool bAddHeaderForEncr ) { if ( m_nStreamMode != PACKAGE_STREAM_DATA || !GetOwnSeekStream().is() || ( bAddHeaderForEncr && !bToBeEncrypted ) ) - throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE ); Sequence< sal_Int8 > aKey; @@ -268,7 +265,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { aKey = GetEncryptionKey(); if ( !aKey.getLength() ) - throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE ); } try @@ -282,7 +279,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE ); Sequence< Any > aArgs( 1 ); aArgs[0] <<= xTempStream; @@ -291,14 +288,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE ); xNewPackStream->setDataStream( static_cast< io::XInputStream* >( new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() ) ) ); uno::Reference< XPropertySet > xNewPSProps( xNewPackStream, UNO_QUERY ); if ( !xNewPSProps.is() ) - throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE ); // copy all the properties of this stream to the new stream xNewPSProps->setPropertyValue("MediaType", makeAny( sMediaType ) ); @@ -315,7 +312,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( aRoot >>= xTunnel; uno::Reference< container::XNameContainer > xRootNameContainer( xTunnel, UNO_QUERY ); if ( !xRootNameContainer.is() ) - throw RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw RuntimeException(THROW_WHERE ); uno::Reference< XUnoTunnel > xNPSTunnel( xNewPackStream, UNO_QUERY ); xRootNameContainer->insertByName("dummy", makeAny( xNPSTunnel ) ); @@ -361,7 +358,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { } - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); } bool ZipPackageStream::ParsePackageRawStream() @@ -529,7 +526,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE ); if ( IsPackageMember() ) { @@ -596,12 +593,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE ); if ( IsPackageMember() ) { if ( !bIsEncrypted || !GetEncryptionData().is() ) - throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE ); return rZipPackage.getZipFile().getWrappedRawStream( aEntry, GetEncryptionData(), sMediaType, rZipPackage.GetSharedMutexRef() ); } @@ -615,7 +612,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream() return TryToGetRawFromDataStream( true ); } - throw packages::NoEncryptionException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(THROW_WHERE ); } void SAL_CALL ZipPackageStream::setDataStream( const uno::Reference< io::XInputStream >& aStream ) @@ -636,8 +633,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(THROW_WHERE "The stream must support XSeekable!", - uno::Reference< XInterface >() ); + throw RuntimeException(THROW_WHERE "The stream must support XSeekable!" ); xSeek->seek( 0 ); uno::Reference< io::XInputStream > xOldStream = xStream; @@ -645,7 +641,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt if ( !ParsePackageRawStream() ) { xStream = xOldStream; - throw packages::NoRawFormatException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::NoRawFormatException(THROW_WHERE ); } // the raw stream MUST have seekable access @@ -666,7 +662,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(THROW_WHERE ); if ( IsPackageMember() ) { @@ -705,7 +701,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE ); if ( aValue >>= sMediaType ) { @@ -734,7 +730,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == "Encrypted" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE ); bool bEnc = false; if ( aValue >>= bEnc ) @@ -758,7 +754,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE ); uno::Sequence< sal_Int8 > aNewKey; @@ -803,7 +799,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(THROW_WHERE ); uno::Sequence< beans::NamedValue > aKeys; if ( !( aValue >>= aKeys ) ) @@ -854,7 +850,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, 2 ); } else - throw beans::UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(THROW_WHERE ); } Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) @@ -897,7 +893,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) return aAny; } else - throw beans::UnknownPropertyException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(THROW_WHERE ); } void ZipPackageStream::setSize ( const sal_Int64 nNewSize ) diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index 5bd868427169..4f737bfa2964 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -39,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); } } @@ -57,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); m_xSeekable->seek( m_nCurPos ); @@ -76,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(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); m_xSeekable->seek( m_nCurPos ); @@ -95,7 +95,7 @@ void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); m_xSeekable->seek( m_nCurPos ); @@ -111,7 +111,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::available() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); return m_xInStream->available(); } @@ -124,7 +124,7 @@ void SAL_CALL WrapStreamForShare::closeInput() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); // the package is the owner so it will close the stream // m_xInStream->closeInput(); @@ -141,7 +141,7 @@ void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); // let stream implementation do all the checking m_xSeekable->seek( location ); @@ -156,7 +156,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getPosition() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); return m_nCurPos; } @@ -168,7 +168,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getLength() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); return m_xSeekable->getLength(); } diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 7659535a3b3a..4cf2afbd7566 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -50,7 +50,7 @@ OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >& , m_bOwnContent( false ) { if ( !rxContext.is() ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); } OZipFileAccess::~OZipFileAccess() @@ -169,10 +169,10 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( m_pZipFile ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); // initialization is allowed only one time + throw uno::RuntimeException(THROW_WHERE ); // initialization is allowed only one time if ( !aArguments.getLength() ) throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); @@ -211,12 +211,12 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); if ( !m_xContentStream.is() ) - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); if ( !xSeekable.is() ) { // TODO: after fwkbugfix02 is integrated a helper class can be used to make the stream seekable - throw io::IOException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::IOException(THROW_WHERE ); } // TODO: in case xSeekable is implemented on separated XStream implementation a wrapper is required @@ -235,14 +235,14 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); EntryHash::iterator aIter = m_pZipFile->GetEntryHash().find( aName ); if ( aIter == m_pZipFile->GetEntryHash().end() ) - throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE ); uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, ::rtl::Reference< EncryptionData >(), @@ -250,7 +250,7 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); return uno::makeAny ( xEntryStream ); } @@ -261,10 +261,10 @@ uno::Sequence< OUString > SAL_CALL OZipFileAccess::getElementNames() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); uno::Sequence< OUString > aNames( m_pZipFile->GetEntryHash().size() ); sal_Int32 nLen = 0; @@ -295,10 +295,10 @@ sal_Bool SAL_CALL OZipFileAccess::hasByName( const OUString& aName ) ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); EntryHash::iterator aIter = m_pZipFile->GetEntryHash().find( aName ); @@ -311,10 +311,10 @@ uno::Type SAL_CALL OZipFileAccess::getElementType() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); return getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ); } @@ -325,10 +325,10 @@ sal_Bool SAL_CALL OZipFileAccess::hasElements() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); return ( m_pZipFile->GetEntryHash().size() != 0 ); } @@ -342,10 +342,10 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pZipFile ) - throw io::NotConnectedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(THROW_WHERE ); // Code to compare strings by patterns uno::Sequence< OUString > aPattern = GetPatternsFromString_Impl( aPatternString ); @@ -360,12 +360,12 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(THROW_WHERE ); return xEntryStream; } } - throw container::NoSuchElementException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(THROW_WHERE ); } // XComponent @@ -375,7 +375,7 @@ void SAL_CALL OZipFileAccess::dispose() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( m_pListenersContainer ) { @@ -406,7 +406,7 @@ void SAL_CALL OZipFileAccess::addEventListener( const uno::Reference< lang::XEve ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( !m_pListenersContainer ) m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutexHolder->GetMutex() ); @@ -419,7 +419,7 @@ void SAL_CALL OZipFileAccess::removeEventListener( const uno::Reference< lang::X ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException(THROW_WHERE, uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(THROW_WHERE ); if ( m_pListenersContainer ) m_pListenersContainer->removeInterface( xListener ); |