diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-17 22:06:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-17 22:07:30 +0200 |
commit | 2cbdaf677c0a1e88aa582c6a17b496dff61a78b0 (patch) | |
tree | 34ec2e77730c39dd055f901e589c8a975e95e6ab /package | |
parent | e704e4691186c23e52490817d6b710ef5bf68db6 (diff) |
package: no more RTL_CONSTASCII_USTRINGPARAM in zippackage
Change-Id: Ibd1fd59ed87ffc70f6b66290c48f95f6c3615102
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 215 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageBuffer.cxx | 6 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageEntry.cxx | 6 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 106 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolderEnumeration.cxx | 6 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 103 | ||||
-rw-r--r-- | package/source/zippackage/wrapstreamforshare.cxx | 18 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 104 |
8 files changed, 278 insertions, 286 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 35c737996eb1..e6abbea5b4ee 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -97,21 +97,18 @@ using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::manifest; using namespace com::sun::star::packages::zip::ZipConstants; -using ::rtl::OUString; -using ::rtl::OString; - #define LOGFILE_AUTHOR "mg115289" namespace { -sal_Bool isLocalFile_Impl( ::rtl::OUString aURL ) +sal_Bool isLocalFile_Impl( OUString aURL ) { - ::rtl::OUString aSystemPath; + OUString aSystemPath; ContentBroker* pBroker = ContentBroker::get(); if ( !pBroker ) { - ::rtl::OUString aRet; + OUString aRet; if ( FileBase::getSystemPathFromFileURL( aURL, aRet ) == FileBase::E_None ) aSystemPath = aRet; } @@ -212,10 +209,10 @@ void ZipPackage::parseManifest() { sal_Bool bManifestParsed = sal_False; bool bDifferentStartKeyAlgorithm = false; - const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) ); + const OUString sMeta ("META-INF"); if ( m_xRootFolder->hasByName( sMeta ) ) { - const OUString sManifest ( RTL_CONSTASCII_USTRINGPARAM( "manifest.xml" ) ); + const OUString sManifest ("manifest.xml"); try { uno::Reference< XUnoTunnel > xTunnel; @@ -229,22 +226,22 @@ void ZipPackage::parseManifest() uno::Reference < XActiveDataSink > xSink ( xTunnel, UNO_QUERY ); if ( xSink.is() ) { - OUString sManifestReader ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.manifest.ManifestReader" ) ); + OUString sManifestReader ("com.sun.star.packages.manifest.ManifestReader"); uno::Reference < XManifestReader > xReader ( m_xFactory->createInstance( sManifestReader ), UNO_QUERY ); if ( xReader.is() ) { - const OUString sPropFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - const OUString sPropVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); - const OUString sPropMediaType ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); - const OUString sPropInitialisationVector ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ); - const OUString sPropSalt ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ); - const OUString sPropIterationCount ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ); - const OUString sPropSize ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ); - const OUString sPropDigest ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ); - const OUString sPropDerivedKeySize ( RTL_CONSTASCII_USTRINGPARAM ( "DerivedKeySize" ) ); - const OUString sPropDigestAlgorithm ( RTL_CONSTASCII_USTRINGPARAM ( "DigestAlgorithm" ) ); - const OUString sPropEncryptionAlgorithm ( RTL_CONSTASCII_USTRINGPARAM ( "EncryptionAlgorithm" ) ); - const OUString sPropStartKeyAlgorithm ( RTL_CONSTASCII_USTRINGPARAM ( "StartKeyAlgorithm" ) ); + const OUString sPropFullPath ("FullPath"); + const OUString sPropVersion ("Version"); + const OUString sPropMediaType ("MediaType"); + const OUString sPropInitialisationVector ("InitialisationVector"); + const OUString sPropSalt ("Salt"); + const OUString sPropIterationCount ("IterationCount"); + const OUString sPropSize ("Size"); + const OUString sPropDigest ("Digest"); + const OUString sPropDerivedKeySize ("DerivedKeySize"); + const OUString sPropDigestAlgorithm ("DigestAlgorithm"); + const OUString sPropEncryptionAlgorithm ("EncryptionAlgorithm"); + const OUString sPropStartKeyAlgorithm ("StartKeyAlgorithm"); uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence = xReader->readManifestSequence ( xSink->getInputStream() ); sal_Int32 nLength = aManifestSequence.getLength(); @@ -359,7 +356,7 @@ void ZipPackage::parseManifest() bManifestParsed = sal_True; } else - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No manifes parser!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX "No manifes parser!", uno::Reference< uno::XInterface >() ); } // now hide the manifest.xml file from user @@ -375,14 +372,14 @@ void ZipPackage::parseManifest() if ( !bManifestParsed && !m_bForceRecovery ) throw ZipIOException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Could not parse manifest.xml\n" ) ), + OSL_LOG_PREFIX "Could not parse manifest.xml\n", uno::Reference< uno::XInterface >() ); - const OUString sMimetype ( RTL_CONSTASCII_USTRINGPARAM ( "mimetype" ) ); + const OUString sMimetype ("mimetype"); if ( m_xRootFolder->hasByName( sMimetype ) ) { // get mediatype from the "mimetype" stream - ::rtl::OUString aPackageMediatype; + OUString aPackageMediatype; uno::Reference< lang::XUnoTunnel > xMimeTypeTunnel; m_xRootFolder->getByName( sMimetype ) >>= xMimeTypeTunnel; uno::Reference < io::XActiveDataSink > xMimeSink( xMimeTypeTunnel, UNO_QUERY ); @@ -398,7 +395,7 @@ void ZipPackage::parseManifest() nRead = aData.getLength(); if ( nRead ) - aPackageMediatype = ::rtl::OUString( ( sal_Char* )aData.getConstArray(), nRead, RTL_TEXTENCODING_ASCII_US ); + aPackageMediatype = OUString( ( sal_Char* )aData.getConstArray(), nRead, RTL_TEXTENCODING_ASCII_US ); } } @@ -406,7 +403,7 @@ void ZipPackage::parseManifest() if ( !bManifestParsed ) { // the manifest.xml could not be successfuly parsed, this is an inconsistent package - if ( aPackageMediatype.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "application/vnd." ) ) == 0 ) + if ( aPackageMediatype.compareToAscii("application/vnd.") == 0 ) { // accept only types that look similar to own mediatypes m_pRootFolder->SetMediaType( aPackageMediatype ); @@ -418,14 +415,14 @@ void ZipPackage::parseManifest() // the mimetype stream should contain the information from manifest.xml if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) ) throw ZipIOException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "mimetype conflicts with manifest.xml\n" ) ), + OSL_LOG_PREFIX "mimetype conflicts with manifest.xml\n", uno::Reference< uno::XInterface >() ); } m_xRootFolder->removeByName( sMimetype ); } - m_bInconsistent = m_pRootFolder->LookForUnexpectedODF12Streams( ::rtl::OUString() ); + m_bInconsistent = m_pRootFolder->LookForUnexpectedODF12Streams( OUString() ); sal_Bool bODF12AndNewer = ( m_pRootFolder->GetVersion().compareTo( ODFVER_012_TEXT ) >= 0 ); if ( !m_bForceRecovery && bODF12AndNewer ) @@ -436,7 +433,7 @@ void ZipPackage::parseManifest() // in case of ODF1.2 documents without version in manifest.xml the property IsInconsistent // should be checked later throw ZipIOException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "there are streams not referred in manifest.xml\n" ) ), + OSL_LOG_PREFIX "there are streams not referred in manifest.xml\n", uno::Reference< uno::XInterface >() ); } else if ( bDifferentStartKeyAlgorithm ) @@ -444,7 +441,7 @@ void ZipPackage::parseManifest() // all the streams should be encrypted with the same StartKey in ODF1.2 // TODO/LATER: in future the exception should be thrown OSL_ENSURE( false, "ODF1.2 contains different StartKey Algorithms" ); - // throw ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "More than one Start Key Generation algorithm is specified!" ) ), uno::Reference< uno::XInterface >() ); + // throw ZipIOException( OSL_LOG_PREFIX "More than one Start Key Generation algorithm is specified!", uno::Reference< uno::XInterface >() ); } } @@ -460,11 +457,11 @@ void ZipPackage::parseContentType() { if ( m_nFormat == embed::StorageFormats::OFOPXML ) { - const ::rtl::OUString aContentTypes( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) ); + const OUString aContentTypes("[Content_Types].xml"); try { // the content type must exist in OFOPXML format! if ( !m_xRootFolder->hasByName( aContentTypes ) ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong format!" ) ), + throw io::IOException(OSL_LOG_PREFIX "Wrong format!", uno::Reference< uno::XInterface >() ); uno::Reference< lang::XUnoTunnel > xTunnel; @@ -482,7 +479,7 @@ void ZipPackage::parseContentType() ::comphelper::OFOPXMLHelper::ReadContentTypeSequence( xInStream, m_xFactory ); if ( aContentTypeInfo.getLength() != 2 ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // set the implicit types fist for ( nInd = 0; nInd < aContentTypeInfo[0].getLength(); nInd++ ) @@ -491,7 +488,7 @@ void ZipPackage::parseContentType() // now set the explicit types for ( nInd = 0; nInd < aContentTypeInfo[1].getLength(); nInd++ ) { - ::rtl::OUString aPath; + OUString aPath; if ( aContentTypeInfo[1][nInd].First.toChar() == ( sal_Unicode )'/' ) aPath = aContentTypeInfo[1][nInd].First.copy( 1 ); else @@ -624,7 +621,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) sal_Int32 nIndex = 0; do { - ::rtl::OUString aCommand = aParam.getToken( 0, '&', nIndex ); + OUString aCommand = aParam.getToken( 0, '&', nIndex ); if ( aCommand == "repairpackage" ) { m_bForceRecovery = sal_True; @@ -649,7 +646,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) m_aURL = aParamUrl; Content aContent ( m_aURL, uno::Reference < XCommandEnvironment >() ); - Any aAny = aContent.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "Size" )) ); + Any aAny = aContent.getPropertyValue("Size"); sal_uInt64 aSize = 0; // kind of optimisation: treat empty files as nonexistent files // and write to such files directly. Note that "Size" property is optional. @@ -699,7 +696,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) } else if ( aNamedValue.Name == "StorageFormat" ) { - ::rtl::OUString aFormatName; + OUString aFormatName; sal_Int32 nFormatID = 0; if ( aNamedValue.Value >>= aFormatName ) { @@ -710,19 +707,19 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) m_nFormat = embed::StorageFormats::OFOPXML; else - throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); } else if ( aNamedValue.Value >>= nFormatID ) { if ( nFormatID != embed::StorageFormats::PACKAGE && nFormatID != embed::StorageFormats::ZIP && nFormatID != embed::StorageFormats::OFOPXML ) - throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); m_nFormat = nFormatID; } else - throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } @@ -733,12 +730,12 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) } // for now the progress handler is not used, probably it will never be - // if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ProgressHandler" ) ) + // if ( aNamedValue.Name == "ProgressHandler" ) } else { // The URL is not acceptable - throw com::sun::star::uno::Exception ( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Bad arguments." ) ), + throw com::sun::star::uno::Exception (OSL_LOG_PREFIX "Bad arguments.", static_cast < ::cppu::OWeakObject * > ( this ) ); } } @@ -751,7 +748,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) m_xContentStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( m_xContentStream, m_xFactory ); m_xContentSeek = uno::Reference < XSeekable > ( m_xContentStream, UNO_QUERY ); if ( ! m_xContentSeek.is() ) - throw com::sun::star::uno::Exception ( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "The package component _requires_ an XSeekable interface!" ) ), + throw com::sun::star::uno::Exception (OSL_LOG_PREFIX "The package component _requires_ an XSeekable interface!", static_cast < ::cppu::OWeakObject * > ( this ) ); if ( !m_xContentSeek->getLength() ) @@ -794,7 +791,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; } throw com::sun::star::packages::zip::ZipIOException ( - OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Bad Zip File." ) ), + OSL_LOG_PREFIX "Bad Zip File.", static_cast < ::cppu::OWeakObject * > ( this ) ); } } @@ -861,7 +858,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) pCurrent = pCurrent->doGetByName( sTemp ).pFolder; } else - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); nOldIndex = nIndex+1; } if ( bFolder ) @@ -880,7 +877,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) return pCurrent->getByName( sTemp ); } else - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } } } @@ -991,7 +988,7 @@ uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( c //-------------------------------------------------------- void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) { - const OUString sMime ( RTL_CONSTASCII_USTRINGPARAM ( "mimetype" ) ); + const OUString sMime ("mimetype"); if ( m_xRootFolder->hasByName( sMime ) ) m_xRootFolder->removeByName( sMime ); @@ -1020,7 +1017,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) catch ( const ::com::sun::star::io::IOException & r ) { throw WrappedTargetException( - OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ), + OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!", static_cast < OWeakObject * > ( this ), makeAny( r ) ); } @@ -1031,15 +1028,14 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq { // Write the manifest uno::Reference < XOutputStream > xManOutStream; - OUString sManifestWriter( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.manifest.ManifestWriter" ) ); - uno::Reference < XManifestWriter > xWriter ( m_xFactory->createInstance( sManifestWriter ), UNO_QUERY ); + uno::Reference < XManifestWriter > xWriter ( m_xFactory->createInstance("com.sun.star.packages.manifest.ManifestWriter"), UNO_QUERY ); if ( xWriter.is() ) { ZipEntry * pEntry = new ZipEntry; ZipPackageBuffer *pBuffer = new ZipPackageBuffer( n_ConstBufferSize ); xManOutStream = uno::Reference < XOutputStream > ( *pBuffer, UNO_QUERY ); - pEntry->sPath = OUString( RTL_CONSTASCII_USTRINGPARAM ( "META-INF/manifest.xml" ) ); + pEntry->sPath = "META-INF/manifest.xml"; pEntry->nMethod = DEFLATED; pEntry->nCrc = pEntry->nSize = pEntry->nCompressedSize = -1; pEntry->nTime = ZipOutputStream::getCurrentDosTime(); @@ -1068,7 +1064,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq OSL_FAIL( "Couldn't get a ManifestWriter!" ); IOException aException; throw WrappedTargetException( - OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ), + OSL_LOG_PREFIX "Couldn't get a ManifestWriter!", static_cast < OWeakObject * > ( this ), makeAny( aException ) ); } @@ -1077,14 +1073,14 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq //-------------------------------------------------------- void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno::Sequence < PropertyValue > >& aManList ) { - const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - const OUString sMediaType ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); + const OUString sFullPath ("FullPath"); + const OUString sMediaType ("MediaType"); ZipEntry* pEntry = new ZipEntry; ZipPackageBuffer *pBuffer = new ZipPackageBuffer( n_ConstBufferSize ); uno::Reference< io::XOutputStream > xConTypeOutStream( *pBuffer, UNO_QUERY ); - pEntry->sPath = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) ); + pEntry->sPath = "[Content_Types].xml"; pEntry->nMethod = DEFLATED; pEntry->nCrc = pEntry->nSize = pEntry->nCompressedSize = -1; pEntry->nTime = ZipOutputStream::getCurrentDosTime(); @@ -1099,8 +1095,8 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno: aIter != aEnd; ++aIter) { - ::rtl::OUString aPath; - ::rtl::OUString aType; + OUString aPath; + OUString aType; OSL_ENSURE( ( *aIter )[PKG_MNFST_MEDIATYPE].Name.equals( sMediaType ) && ( *aIter )[PKG_MNFST_FULLPATH].Name.equals( sFullPath ), "The mediatype sequence format is wrong!\n" ); ( *aIter )[PKG_MNFST_MEDIATYPE].Value >>= aType; @@ -1109,7 +1105,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno: // only nonempty type makes sence here nSeqLength++; ( *aIter )[PKG_MNFST_FULLPATH].Value >>= aPath; - aOverridesSequence[nSeqLength-1].First = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) + aPath; + aOverridesSequence[nSeqLength-1].First = "/" + aPath; aOverridesSequence[nSeqLength-1].Second = aType; } } @@ -1181,8 +1177,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() if( bUseTemp ) { // create temporary file - const OUString sServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.io.TempFile" ) ); - uno::Reference < io::XStream > xTempFile( m_xFactory->createInstance ( sServiceName ), UNO_QUERY_THROW ); + uno::Reference < io::XStream > xTempFile( m_xFactory->createInstance ("com.sun.star.io.TempFile"), UNO_QUERY_THROW ); xTempOut.set( xTempFile->getOutputStream(), UNO_SET_THROW ); xTempIn.set( xTempFile->getInputStream(), UNO_SET_THROW ); } @@ -1199,11 +1194,11 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Remove the old manifest.xml file as the // manifest will be re-generated and the // META-INF directory implicitly created if does not exist - const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) ); + const OUString sMeta ("META-INF"); if ( m_xRootFolder->hasByName( sMeta ) ) { - const OUString sManifest ( RTL_CONSTASCII_USTRINGPARAM( "manifest.xml" ) ); + const OUString sManifest ("manifest.xml"); uno::Reference< XUnoTunnel > xTunnel; Any aAny = m_xRootFolder->getByName( sMeta ); @@ -1221,7 +1216,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Remove the old [Content_Types].xml file as the // file will be re-generated - const ::rtl::OUString aContentTypes( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) ); + const OUString aContentTypes("[Content_Types].xml"); if ( m_xRootFolder->hasByName( aContentTypes ) ) m_xRootFolder->removeByName( aContentTypes ); @@ -1230,9 +1225,9 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Create a vector to store data for the manifest.xml file vector < uno::Sequence < PropertyValue > > aManList; - const OUString sMediaType ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); - const OUString sVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); - const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); + const OUString sMediaType ("MediaType"); + const OUString sVersion ("Version"); + const OUString sFullPath ("FullPath"); if ( m_nFormat == embed::StorageFormats::PACKAGE ) { @@ -1242,7 +1237,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() aPropSeq [PKG_MNFST_VERSION].Name = sVersion; aPropSeq [PKG_MNFST_VERSION].Value <<= m_pRootFolder->GetVersion(); aPropSeq [PKG_MNFST_FULLPATH].Name = sFullPath; - aPropSeq [PKG_MNFST_FULLPATH].Value <<= OUString ( RTL_CONSTASCII_USTRINGPARAM ( "/" ) ); + aPropSeq [PKG_MNFST_FULLPATH].Value <<= OUString("/"); aManList.push_back( aPropSeq ); } @@ -1312,7 +1307,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() throw aException; throw WrappedTargetException( - OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Problem writing the original content!" ) ), + OSL_LOG_PREFIX "Problem writing the original content!", static_cast < OWeakObject * > ( this ), aCaught ); } @@ -1320,8 +1315,8 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() { // the document is written directly, although it was empty it is important to notify that the writing has failed // TODO/LATER: let the package be able to recover in this situation - ::rtl::OUString aErrTxt( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is unusable!" ) ); - embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), ::rtl::OUString() ); + OUString aErrTxt(OSL_LOG_PREFIX "This package is unusable!"); + embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), OUString() ); throw WrappedTargetException( aErrTxt, static_cast < OWeakObject * > ( this ), makeAny ( aException ) ); @@ -1348,7 +1343,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() { Exception aDetect; sal_Int64 aSize = 0; - Any aAny = aOriginalContent.setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "Size" )), makeAny( aSize ) ); + Any aAny = aOriginalContent.setPropertyValue("Size", makeAny( aSize ) ); if( !( aAny >>= aDetect ) ) bTruncSuccess = sal_True; } @@ -1371,7 +1366,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() aArg.Sink = xSink; aArg.Properties = uno::Sequence< Property >( 0 ); // unused - aOriginalContent.executeCommand( OUString(RTL_CONSTASCII_USTRINGPARAM( "open" )), makeAny( aArg ) ); + aOriginalContent.executeCommand("open", makeAny( aArg ) ); } catch( Exception& ) { @@ -1393,7 +1388,7 @@ void SAL_CALL ZipPackage::commitChanges() if ( m_eMode == e_IMode_XInputStream ) { IOException aException; - throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) ), + throw WrappedTargetException(OSL_LOG_PREFIX "This package is read only!", static_cast < OWeakObject * > ( this ), makeAny ( aException ) ); } @@ -1413,7 +1408,7 @@ void SAL_CALL ZipPackage::commitChanges() } catch( const uno::Exception& r ) { - throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Temporary file should be seekable!" ) ), + throw WrappedTargetException(OSL_LOG_PREFIX "Temporary file should be seekable!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1431,14 +1426,14 @@ void SAL_CALL ZipPackage::commitChanges() xOutputStream = m_xStream->getOutputStream(); uno::Reference < XTruncate > xTruncate ( xOutputStream, UNO_QUERY ); if ( !xTruncate.is() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // after successful truncation the original file contents are already lost xTruncate->truncate(); } catch( const uno::Exception& r ) { - throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) ), + throw WrappedTargetException(OSL_LOG_PREFIX "This package is read only!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1513,13 +1508,13 @@ 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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ); Content aContent ( sTargetFolder, uno::Reference < XCommandEnvironment > () ); OUString sTempURL; - Any aAny = xPropSet->getPropertyValue ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Uri" ) ) ); + Any aAny = xPropSet->getPropertyValue ("Uri"); aAny >>= sTempURL; TransferInfo aInfo; @@ -1532,7 +1527,7 @@ void SAL_CALL ZipPackage::commitChanges() aAny <<= aInfo; // if the file is still not corrupted, it can become after the next step - aContent.executeCommand ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "transfer" ) ), aAny ); + aContent.executeCommand ("transfer", aAny ); } catch ( const ::com::sun::star::uno::Exception& r ) { @@ -1540,7 +1535,7 @@ void SAL_CALL ZipPackage::commitChanges() DisconnectFromTargetAndThrowException_Impl( xTempInStream ); throw WrappedTargetException( - OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package may be read only!" ) ), + OSL_LOG_PREFIX "This package may be read only!", static_cast < OWeakObject * > ( this ), makeAny ( r ) ); } @@ -1563,12 +1558,12 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc else m_eMode = e_IMode_XInputStream; - ::rtl::OUString aTempURL; + OUString aTempURL; try { uno::Reference< beans::XPropertySet > xTempFile( xTempStream, uno::UNO_QUERY_THROW ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri") ) ); + uno::Any aUrl = xTempFile->getPropertyValue("Uri"); aUrl >>= aTempURL; - xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile") ), + xTempFile->setPropertyValue("RemoveFile", uno::makeAny( sal_False ) ); } catch ( uno::Exception& ) @@ -1576,7 +1571,7 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc OSL_FAIL( "These calls are pretty simple, they should not fail!\n" ); } - ::rtl::OUString aErrTxt( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) ); + OUString aErrTxt(OSL_LOG_PREFIX "This package is read only!"); embed::UseBackupException aException( aErrTxt, uno::Reference< uno::XInterface >(), aTempURL ); throw WrappedTargetException( aErrTxt, static_cast < OWeakObject * > ( this ), @@ -1590,13 +1585,13 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey() if ( m_aStorageEncryptionKeys.getLength() ) { - ::rtl::OUString aNameToFind; + OUString aNameToFind; if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA256 ) aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA256UTF8; else if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA1 ) aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA1UTF8; else - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No expected key is provided!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -1605,7 +1600,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No expected key is provided!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); } else aResult = m_aEncryptionKey; @@ -1639,14 +1634,14 @@ uno::Reference < XInterface >SAL_CALL ZipPackage_createInstance( //-------------------------------------------------------- OUString ZipPackage::static_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.comp.ZipPackage" ) ); + return OUString("com.sun.star.packages.comp.ZipPackage"); } //-------------------------------------------------------- Sequence< OUString > ZipPackage::static_getSupportedServiceNames() { uno::Sequence< OUString > aNames( 1 ); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.Package" ) ); + aNames[0] = OUString("com.sun.star.packages.Package"); return aNames; } //-------------------------------------------------------- @@ -1714,17 +1709,17 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException ) { if ( m_nFormat != embed::StorageFormats::PACKAGE ) - throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( HAS_ENCRYPTED_ENTRIES_PROPERTY ) ) - ||aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( HAS_NONENCRYPTED_ENTRIES_PROPERTY ) ) - ||aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( IS_INCONSISTENT_PROPERTY ) ) - ||aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MEDIATYPE_FALLBACK_USED_PROPERTY ) ) ) - throw PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + if (aPropertyName == HAS_ENCRYPTED_ENTRIES_PROPERTY + ||aPropertyName == HAS_NONENCRYPTED_ENTRIES_PROPERTY + ||aPropertyName == IS_INCONSISTENT_PROPERTY + ||aPropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY) + throw PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( !( aValue >>= m_aEncryptionKey ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); m_aStorageEncryptionKeys.realloc( 0 ); } @@ -1736,7 +1731,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const // TODO/LATER: Get rid of this property as well as of support of raw passwords in storages uno::Sequence< beans::NamedValue > aKeys; if ( !( aValue >>= aKeys ) || ( aKeys.getLength() && aKeys.getLength() < 2 ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 2 ); if ( aKeys.getLength() ) { @@ -1751,7 +1746,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const } if ( !bHasSHA256 || !bHasSHA1 ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Expected keys are not provided!" ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "Expected keys are not provided!", uno::Reference< uno::XInterface >(), 2 ); } m_aStorageEncryptionKeys = aKeys; @@ -1763,7 +1758,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const if ( m_pZipFile || !( aValue >>= aAlgorithms ) || aAlgorithms.getLength() == 0 ) { // the algorithms can not be changed if the file has a persistence based on the algorithms ( m_pZipFile ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "unexpected algorithms list is provided." ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); } for ( sal_Int32 nInd = 0; nInd < aAlgorithms.getLength(); nInd++ ) @@ -1773,7 +1768,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::DigestID::SHA256 && nID != xml::crypto::DigestID::SHA1 ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!" ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nStartKeyGenerationID = nID; } @@ -1782,7 +1777,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::CipherID::AES_CBC_W3C_PADDING && nID != xml::crypto::CipherID::BLOWFISH_CFB_8 ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!" ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nCommonEncryptionID = nID; } @@ -1791,19 +1786,19 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) || ( nID != xml::crypto::DigestID::SHA1_1K && nID != xml::crypto::DigestID::SHA256_1K ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!" ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "Unexpected start key generation algorithm is provided!", uno::Reference< uno::XInterface >(), 2 ); m_nChecksumDigestID = nID; } else { OSL_ENSURE( sal_False, "Unexpected encryption algorithm is provided!" ); - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "unexpected algorithms list is provided." ) ), uno::Reference< uno::XInterface >(), 2 ); + throw IllegalArgumentException(OSL_LOG_PREFIX "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 ); } } } else - throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } //-------------------------------------------------------- @@ -1812,7 +1807,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); Any aAny; if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) @@ -1823,9 +1818,9 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) else if ( PropertyName == ENCRYPTION_ALGORITHMS_PROPERTY ) { ::comphelper::SequenceAsHashMap aAlgorithms; - aAlgorithms[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StartKeyGenerationAlgorithm" ) ) ] <<= m_nStartKeyGenerationID; - aAlgorithms[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionAlgorithm" ) ) ] <<= m_nCommonEncryptionID; - aAlgorithms[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChecksumAlgorithm" ) ) ] <<= m_nChecksumDigestID; + aAlgorithms["StartKeyGenerationAlgorithm"] <<= m_nStartKeyGenerationID; + aAlgorithms["EncryptionAlgorithm"] <<= m_nCommonEncryptionID; + aAlgorithms["ChecksumAlgorithm"] <<= m_nChecksumDigestID; aAny <<= aAlgorithms.getAsConstNamedValueList(); return aAny; } @@ -1854,7 +1849,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) aAny <<= m_bMediaTypeFallbackUsed; return aAny; } - throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } //-------------------------------------------------------- void SAL_CALL ZipPackage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) diff --git a/package/source/zippackage/ZipPackageBuffer.cxx b/package/source/zippackage/ZipPackageBuffer.cxx index a96b39271fac..e1fc959b355e 100644 --- a/package/source/zippackage/ZipPackageBuffer.cxx +++ b/package/source/zippackage/ZipPackageBuffer.cxx @@ -40,7 +40,7 @@ sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToRead < 0) - throw BufferSizeExceededException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), *this ); + throw BufferSizeExceededException(OSL_LOG_PREFIX, *this ); if (nBytesToRead + m_nCurrent > m_nEnd) nBytesToRead = static_cast < sal_Int32 > (m_nEnd - m_nCurrent); @@ -60,7 +60,7 @@ void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToSkip < 0) - throw BufferSizeExceededException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), *this ); + throw BufferSizeExceededException(OSL_LOG_PREFIX, *this ); if (nBytesToSkip + m_nCurrent > m_nEnd) nBytesToSkip = static_cast < sal_Int32 > (m_nEnd - m_nCurrent); @@ -111,7 +111,7 @@ void SAL_CALL ZipPackageBuffer::seek( sal_Int64 location ) throw( IllegalArgumentException, IOException, RuntimeException) { if ( location > m_nEnd || location < 0 ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); m_nCurrent = location; } sal_Int64 SAL_CALL ZipPackageBuffer::getPosition( ) diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index 62c1eef54a39..c109c196f0b0 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.cxx @@ -34,8 +34,6 @@ using namespace com::sun::star::container; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; -using rtl::OUString; - ZipPackageEntry::ZipPackageEntry ( bool bNewFolder ) : mbIsFolder ( bNewFolder ) , mbAllowRemoveOnInsert( sal_True ) @@ -64,7 +62,7 @@ void SAL_CALL ZipPackageEntry::setName( const OUString& aName ) // unfortunately no other exception than RuntimeException can be thrown here // usually the package is used through storage implementation, the problem should be detected there if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_True ) ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected character is used in file name." ) ), uno::Reference< XInterface >() ); + throw RuntimeException(OSL_LOG_PREFIX "Unexpected character is used in file name.", uno::Reference< XInterface >() ); msName = aName; @@ -92,7 +90,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSupportException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); ZipPackageFolder *pNewParent = reinterpret_cast < ZipPackageFolder * > ( nTest ); diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 60de629b6384..c3dd800d40a2 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -81,7 +81,7 @@ ZipPackageFolder::~ZipPackageFolder() { } -sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& aPath ) +sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const OUString& aPath ) { sal_Bool bHasUnexpected = sal_False; @@ -89,7 +89,7 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& !bHasUnexpected && aCI != aEnd; ++aCI) { - const ::rtl::OUString &rShortName = (*aCI).first; + const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; if ( rInfo.bFolder ) @@ -101,7 +101,7 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& } else { - ::rtl::OUString sOwnPath = aPath + rShortName + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) ); + OUString sOwnPath = aPath + rShortName + "/"; bHasUnexpected = rInfo.pFolder->LookForUnexpectedODF12Streams( sOwnPath ); } } @@ -136,17 +136,17 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& aPair ) { - ::rtl::OUString aExt; + OUString aExt; if ( aPair.First.toChar() == (sal_Unicode)'.' ) aExt = aPair.First; else - aExt = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) + aPair.First; + aExt = "." + aPair.First; for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); aCI != aEnd; ++aCI) { - const ::rtl::OUString &rShortName = (*aCI).first; + const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; if ( rInfo.bFolder ) @@ -182,11 +182,11 @@ const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageFolder::static_get } // XNameContainer -void SAL_CALL ZipPackageFolder::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement ) +void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const uno::Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, uno::RuntimeException) { if (hasByName(aName)) - throw ElementExistException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw ElementExistException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); else { uno::Reference < XUnoTunnel > xRef; @@ -206,22 +206,22 @@ void SAL_CALL ZipPackageFolder::insertByName( const ::rtl::OUString& aName, cons pEntry = static_cast < ZipPackageEntry * > ( pStream ); } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); + throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); if (pEntry->getName() != aName ) pEntry->setName (aName); doInsertByName ( pEntry, sal_True ); } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); + throw IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 0 ); } } -void SAL_CALL ZipPackageFolder::removeByName( const ::rtl::OUString& Name ) +void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException) { ContentHash::iterator aIter = maContents.find ( Name ); if ( aIter == maContents.end() ) - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); maContents.erase( aIter ); } // XEnumerationAccess @@ -242,43 +242,43 @@ sal_Bool SAL_CALL ZipPackageFolder::hasElements( ) return maContents.size() > 0; } // XNameAccess -ContentInfo& ZipPackageFolder::doGetByName( const ::rtl::OUString& aName ) +ContentInfo& ZipPackageFolder::doGetByName( const OUString& aName ) throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException) { ContentHash::iterator aIter = maContents.find ( aName ); if ( aIter == maContents.end()) - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return *(*aIter).second; } -uno::Any SAL_CALL ZipPackageFolder::getByName( const ::rtl::OUString& aName ) +uno::Any SAL_CALL ZipPackageFolder::getByName( const OUString& aName ) throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException) { return uno::makeAny ( doGetByName ( aName ).xTunnel ); } -uno::Sequence< ::rtl::OUString > SAL_CALL ZipPackageFolder::getElementNames( ) +uno::Sequence< OUString > SAL_CALL ZipPackageFolder::getElementNames( ) throw(uno::RuntimeException) { sal_uInt32 i=0, nSize = maContents.size(); - uno::Sequence < ::rtl::OUString > aSequence ( nSize ); + uno::Sequence < OUString > aSequence ( nSize ); for ( ContentHash::const_iterator aIterator = maContents.begin(), aEnd = maContents.end(); aIterator != aEnd; ++i, ++aIterator) aSequence[i] = (*aIterator).first; return aSequence; } -sal_Bool SAL_CALL ZipPackageFolder::hasByName( const ::rtl::OUString& aName ) +sal_Bool SAL_CALL ZipPackageFolder::hasByName( const OUString& aName ) throw(uno::RuntimeException) { return maContents.find ( aName ) != maContents.end (); } // XNameReplace -void SAL_CALL ZipPackageFolder::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) +void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const uno::Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, uno::RuntimeException) { if ( hasByName( aName ) ) removeByName( aName ); else - throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); insertByName(aName, aElement); } @@ -294,29 +294,29 @@ static void ImplSetStoredData( ZipEntry & rEntry, uno::Reference< XInputStream> rEntry.nCrc = aCRC32.getValue(); } -bool ZipPackageFolder::saveChild( const ::rtl::OUString &rShortName, const ContentInfo &rInfo, ::rtl::OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool) +bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo &rInfo, OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool) { bool bSuccess = true; - const ::rtl::OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); - const ::rtl::OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); - const ::rtl::OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - const ::rtl::OUString sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ); - const ::rtl::OUString sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ); - const ::rtl::OUString sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ); - const ::rtl::OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ); - const ::rtl::OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ); - const ::rtl::OUString sEncryptionAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "EncryptionAlgorithm" ) ); - const ::rtl::OUString sStartKeyAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "StartKeyAlgorithm" ) ); - const ::rtl::OUString sDigestAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "DigestAlgorithm" ) ); - const ::rtl::OUString sDerivedKeySizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "DerivedKeySize" ) ); + const OUString sMediaTypeProperty ("MediaType"); + const OUString sVersionProperty ("Version"); + const OUString sFullPathProperty ("FullPath"); + const OUString sInitialisationVectorProperty ("InitialisationVector"); + const OUString sSaltProperty ("Salt"); + const OUString sIterationCountProperty ("IterationCount"); + const OUString sSizeProperty ("Size"); + const OUString sDigestProperty ("Digest"); + const OUString sEncryptionAlgProperty ("EncryptionAlgorithm"); + const OUString sStartKeyAlgProperty ("StartKeyAlgorithm"); + const OUString sDigestAlgProperty ("DigestAlgorithm"); + const OUString sDerivedKeySizeProperty ("DerivedKeySize"); uno::Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST); OSL_ENSURE( ( rInfo.bFolder && rInfo.pFolder ) || ( !rInfo.bFolder && rInfo.pStream ), "A valid child object is expected!" ); if ( rInfo.bFolder ) { - ::rtl::OUString sTempName = rPath + rShortName + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) ); + OUString sTempName = rPath + rShortName + "/"; if ( !rInfo.pFolder->GetMediaType().isEmpty() ) { @@ -344,7 +344,7 @@ bool ZipPackageFolder::saveChild( const ::rtl::OUString &rShortName, const Conte ZipPackageFolder::copyZipEntry ( *pTempEntry, rInfo.pStream->aEntry ); pTempEntry->sPath = rPath + rShortName; - pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( pTempEntry->sPath, RTL_TEXTENCODING_UTF8 ).getLength() ); + pTempEntry->nPathLen = (sal_Int16)( OUStringToOString( pTempEntry->sPath, RTL_TEXTENCODING_UTF8 ).getLength() ); sal_Bool bToBeEncrypted = rInfo.pStream->IsToBeEncrypted() && (rEncryptionKey.getLength() || rInfo.pStream->HasOwnKey()); sal_Bool bToBeCompressed = bToBeEncrypted ? sal_True : rInfo.pStream->IsToBeCompressed(); @@ -352,7 +352,7 @@ bool ZipPackageFolder::saveChild( const ::rtl::OUString &rShortName, const Conte aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty; aPropSet[PKG_MNFST_MEDIATYPE].Value <<= rInfo.pStream->GetMediaType( ); aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty; - aPropSet[PKG_MNFST_VERSION].Value <<= ::rtl::OUString(); // no version is stored for streams currently + aPropSet[PKG_MNFST_VERSION].Value <<= OUString(); // no version is stored for streams currently aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty; aPropSet[PKG_MNFST_FULLPATH].Value <<= pTempEntry->sPath; @@ -675,7 +675,7 @@ bool ZipPackageFolder::saveChild( const ::rtl::OUString &rShortName, const Conte return bSuccess; } -void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool ) +void ZipPackageFolder::saveContents( OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool ) throw( uno::RuntimeException ) { bool bWritingFailed = false; @@ -685,7 +685,7 @@ void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno:: // it is an empty subfolder, use workaround to store it ZipEntry* pTempEntry = new ZipEntry(); ZipPackageFolder::copyZipEntry ( *pTempEntry, aEntry ); - pTempEntry->nPathLen = (sal_Int16)( ::rtl::OUStringToOString( rPath, RTL_TEXTENCODING_UTF8 ).getLength() ); + pTempEntry->nPathLen = (sal_Int16)( OUStringToOString( rPath, RTL_TEXTENCODING_UTF8 ).getLength() ); pTempEntry->nExtraLen = -1; pTempEntry->sPath = rPath; @@ -705,7 +705,7 @@ void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno:: } bool bMimeTypeStreamStored = false; - ::rtl::OUString aMimeTypeStreamName( RTL_CONSTASCII_USTRINGPARAM( "mimetype" ) ); + OUString aMimeTypeStreamName("mimetype"); if ( m_nFormat == embed::StorageFormats::ZIP && rPath.isEmpty() ) { // let the "mimtype" stream in root folder be stored as the first stream if it is zip format @@ -721,7 +721,7 @@ void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno:: aCI != aEnd; ++aCI) { - const ::rtl::OUString &rShortName = (*aCI).first; + const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; if ( !bMimeTypeStreamStored || !rShortName.equals( aMimeTypeStreamName ) ) @@ -729,7 +729,7 @@ void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno:: } if( bWritingFailed ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } void ZipPackageFolder::releaseUpwardRef( void ) @@ -770,14 +770,14 @@ sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const uno::Sequence< sal_Int8 nMe = reinterpret_cast < sal_Int64 > ( this ); return nMe; } -void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) +void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, uno::RuntimeException) { if ( aPropertyName == "MediaType" ) { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); aValue >>= sMediaType; } @@ -786,16 +786,16 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aProper else if ( aPropertyName == "Size" ) aValue >>= aEntry.nSize; else - throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } -uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& PropertyName ) +uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, uno::RuntimeException) { if ( PropertyName == "MediaType" ) { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return uno::makeAny ( sMediaType ); } @@ -804,7 +804,7 @@ uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& Pro else if ( PropertyName == "Size" ) return uno::makeAny ( aEntry.nSize ); else - throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } void ZipPackageFolder::doInsertByName ( ZipPackageEntry *pEntry, sal_Bool bSetParent ) @@ -825,20 +825,20 @@ void ZipPackageFolder::doInsertByName ( ZipPackageEntry *pEntry, sal_Bool bSetPa if ( bSetParent ) pEntry->setParent ( *this ); } -::rtl::OUString ZipPackageFolder::getImplementationName() +OUString ZipPackageFolder::getImplementationName() throw (uno::RuntimeException) { - return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "ZipPackageFolder" ) ); + return OUString("ZipPackageFolder"); } -uno::Sequence< ::rtl::OUString > ZipPackageFolder::getSupportedServiceNames() +uno::Sequence< OUString > ZipPackageFolder::getSupportedServiceNames() throw (uno::RuntimeException) { - uno::Sequence< ::rtl::OUString > aNames(1); - aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.PackageFolder" ) ); + uno::Sequence< OUString > aNames(1); + aNames[0] = "com.sun.star.packages.PackageFolder"; return aNames; } -sal_Bool SAL_CALL ZipPackageFolder::supportsService( ::rtl::OUString const & rServiceName ) +sal_Bool SAL_CALL ZipPackageFolder::supportsService( OUString const & rServiceName ) throw (uno::RuntimeException) { return rServiceName == getSupportedServiceNames()[0]; diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx index 1b8a3907e641..627ccdaf4408 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.cxx @@ -43,7 +43,7 @@ uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) { uno::Any aAny; if (aIterator == rContents.end() ) - throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); aAny <<= (*aIterator).second->xTunnel; aIterator++; return aAny; @@ -52,14 +52,14 @@ uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) OUString ZipPackageFolderEnumeration::getImplementationName() throw (uno::RuntimeException) { - return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "ZipPackageFolderEnumeration" ) ); + return OUString ("ZipPackageFolderEnumeration"); } uno::Sequence< OUString > ZipPackageFolderEnumeration::getSupportedServiceNames() throw (uno::RuntimeException) { uno::Sequence< OUString > aNames(1); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.PackageFolderEnumeration" ) ); + aNames[0] = "com.sun.star.packages.PackageFolderEnumeration"; return aNames; } sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService( OUString const & rServiceName ) diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index d0e63fbda425..a8029ff9ec72 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -51,7 +51,6 @@ using namespace com::sun::star::lang; using namespace com::sun::star; using namespace cppu; -using rtl::OUString; namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; } const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId() @@ -146,7 +145,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() xStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( xStream, m_xFactory ); uno::Reference< io::XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "The stream must support XSeekable!" ) ), + throw RuntimeException( OSL_LOG_PREFIX "The stream must support XSeekable!", uno::Reference< XInterface >() ); m_bHasSeekable = sal_True; @@ -159,15 +158,15 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream() uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCopy() { if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( m_xBaseEncryptionData.is() ) - throw ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Encrypted stream without encryption data!\n" ) ), + throw ZipIOException(OSL_LOG_PREFIX "Encrypted stream without encryption data!\n", uno::Reference< XInterface >() ); uno::Reference< io::XSeekable > xSeek( GetOwnSeekStream(), UNO_QUERY ); if ( !xSeek.is() ) - throw ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "The stream must be seekable!\n" ) ), + throw ZipIOException(OSL_LOG_PREFIX "The stream must be seekable!\n", uno::Reference< XInterface >() ); // skip header @@ -176,12 +175,12 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCop // create temporary stream uno::Reference < io::XOutputStream > xTempOut( - m_xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), + m_xFactory->createInstance("com.sun.star.io.TempFile"), uno::UNO_QUERY ); uno::Reference < io::XInputStream > xTempIn( xTempOut, UNO_QUERY ); uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY ); if ( !xTempOut.is() || !xTempIn.is() || !xTempSeek.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // copy the raw stream to the temporary file starting from the current position ::comphelper::OStorageHelper::CopyInputToOutput( GetOwnSeekStream(), xTempOut ); @@ -228,7 +227,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi if ( bHaveOwnKey && m_aStorageEncryptionKeys.getLength() ) { - ::rtl::OUString aNameToFind; + OUString aNameToFind; if ( nKeyGenID == xml::crypto::DigestID::SHA256 ) aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA256UTF8; else if ( nKeyGenID == xml::crypto::DigestID::SHA1 ) @@ -236,7 +235,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi aNameToFind = bUseWinEncoding ? PACKAGE_ENCRYPTIONDATA_SHA1MS1252 : PACKAGE_ENCRYPTIONDATA_SHA1UTF8; } else - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No expected key is provided!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) @@ -245,7 +244,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No expected key is provided!" ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX "No expected key is provided!", uno::Reference< uno::XInterface >() ); } else aResult = m_aEncryptionKey; @@ -268,7 +267,7 @@ sal_Int32 ZipPackageStream::GetStartKeyGenID() uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( sal_Bool bAddHeaderForEncr ) { if ( m_nStreamMode != PACKAGE_STREAM_DATA || !GetOwnSeekStream().is() || ( bAddHeaderForEncr && !bToBeEncrypted ) ) - throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); Sequence< sal_Int8 > aKey; @@ -276,23 +275,23 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { aKey = GetEncryptionKey(); if ( !aKey.getLength() ) - throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } try { // create temporary file uno::Reference < io::XStream > xTempStream( - m_xFactory->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), + m_xFactory->createInstance ("com.sun.star.io.TempFile"), uno::UNO_QUERY ); if ( !xTempStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // create a package based on it ZipPackage* pPackage = new ZipPackage( m_xFactory ); uno::Reference< XSingleServiceFactory > xPackageAsFactory( static_cast< XSingleServiceFactory* >( pPackage ) ); if ( !xPackageAsFactory.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); Sequence< Any > aArgs( 1 ); aArgs[0] <<= xTempStream; @@ -301,34 +300,34 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( // create a new package stream uno::Reference< XDataSinkEncrSupport > xNewPackStream( xPackageAsFactory->createInstance(), UNO_QUERY ); if ( !xNewPackStream.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); xNewPackStream->setDataStream( static_cast< io::XInputStream* >( new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() ) ) ); uno::Reference< XPropertySet > xNewPSProps( xNewPackStream, UNO_QUERY ); if ( !xNewPSProps.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // copy all the properties of this stream to the new stream - xNewPSProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), makeAny( sMediaType ) ); - xNewPSProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ), makeAny( bToBeCompressed ) ); + xNewPSProps->setPropertyValue("MediaType", makeAny( sMediaType ) ); + xNewPSProps->setPropertyValue("Compressed", makeAny( bToBeCompressed ) ); if ( bToBeEncrypted ) { - xNewPSProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_KEY_PROPERTY ) ), makeAny( aKey ) ); - xNewPSProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ), makeAny( sal_True ) ); + xNewPSProps->setPropertyValue(ENCRYPTION_KEY_PROPERTY, makeAny( aKey ) ); + xNewPSProps->setPropertyValue("Encrypted", makeAny( sal_True ) ); } // insert a new stream in the package uno::Reference< XUnoTunnel > xTunnel; - Any aRoot = pPackage->getByHierarchicalName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ); + Any aRoot = pPackage->getByHierarchicalName("/"); aRoot >>= xTunnel; uno::Reference< container::XNameContainer > xRootNameContainer( xTunnel, UNO_QUERY ); if ( !xRootNameContainer.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); uno::Reference< XUnoTunnel > xNPSTunnel( xNewPackStream, UNO_QUERY ); - xRootNameContainer->insertByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "dummy" ) ), makeAny( xNPSTunnel ) ); + xRootNameContainer->insertByName("dummy", makeAny( xNPSTunnel ) ); // commit the temporary package pPackage->commitChanges(); @@ -342,12 +341,12 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( // create another temporary file uno::Reference < io::XOutputStream > xTempOut( - m_xFactory->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), + m_xFactory->createInstance ("com.sun.star.io.TempFile"), uno::UNO_QUERY ); uno::Reference < io::XInputStream > xTempIn( xTempOut, UNO_QUERY ); uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY ); if ( !xTempOut.is() || !xTempIn.is() || !xTempSeek.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // copy the raw stream to the temporary file ::comphelper::OStorageHelper::CopyInputToOutput( xInRaw, xTempOut ); @@ -373,7 +372,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( { } - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } //-------------------------------------------------------------------------- @@ -404,7 +403,7 @@ sal_Bool ZipPackageStream::ParsePackageRawStream() // this is one of our god-awful, but extremely devious hacks, everyone cheer xTempEncrData = new BaseEncryptionData; - ::rtl::OUString aMediaType; + OUString aMediaType; sal_Int32 nEncAlgorithm = 0; sal_Int32 nChecksumAlgorithm = 0; sal_Int32 nDerivedKeySize = 0; @@ -546,7 +545,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { @@ -590,12 +589,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { if ( !bIsEncrypted || !GetEncryptionData().is() ) - throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return rZipPackage.getZipFile().getWrappedRawStream( aEntry, GetEncryptionData(), sMediaType, rZipPackage.GetSharedMutexRef() ); } @@ -609,7 +608,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream() return TryToGetRawFromDataStream( sal_True ); } - throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::NoEncryptionException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } @@ -633,7 +632,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt uno::Reference< io::XInputStream > xNewStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( aStream, m_xFactory ); uno::Reference< io::XSeekable > xSeek( xNewStream, UNO_QUERY ); if ( !xSeek.is() ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "The stream must support XSeekable!" ) ), + throw RuntimeException(OSL_LOG_PREFIX "The stream must support XSeekable!", uno::Reference< XInterface >() ); xSeek->seek( 0 ); @@ -642,7 +641,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt if ( !ParsePackageRawStream() ) { xStream = xOldStream; - throw packages::NoRawFormatException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::NoRawFormatException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } // the raw stream MUST have seekable access @@ -664,7 +663,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw packages::zip::ZipIOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( IsPackageMember() ) { @@ -705,7 +704,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( aValue >>= sMediaType ) { @@ -719,7 +718,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "MediaType must be a string!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "MediaType must be a string!\n", uno::Reference< XInterface >(), 2 ); @@ -727,21 +726,21 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == "Size" ) { if ( !( aValue >>= aEntry.nSize ) ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for Size property!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Size property!\n", uno::Reference< XInterface >(), 2 ); } else if ( aPropertyName == "Encrypted" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); sal_Bool bEnc = sal_False; if ( aValue >>= bEnc ) { // In case of new raw stream, the stream must not be encrypted on storing if ( bEnc && m_nStreamMode == PACKAGE_STREAM_RAW ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Raw stream can not be encrypted on storing" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Raw stream can not be encrypted on storing", uno::Reference< XInterface >(), 2 ); @@ -750,7 +749,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_xBaseEncryptionData = new BaseEncryptionData; } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for Encrypted property!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Encrypted property!\n", uno::Reference< XInterface >(), 2 ); @@ -758,7 +757,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); uno::Sequence< sal_Int8 > aNewKey; @@ -776,7 +775,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, aNewKey = aSequence; } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for EncryptionKey property!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for EncryptionKey property!\n", uno::Reference< XInterface >(), 2 ); } @@ -803,12 +802,12 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) - throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::PropertyVetoException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); uno::Sequence< beans::NamedValue > aKeys; if ( !( aValue >>= aKeys ) ) { - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for StorageEncryptionKeys property!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for StorageEncryptionKeys property!\n", uno::Reference< XInterface >(), 2 ); } @@ -833,7 +832,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_aEncryptionKey.realloc( 0 ); } - else if ( aPropertyName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Compressed" ) ) ) + else if ( aPropertyName == "Compressed" ) { sal_Bool bCompr = sal_False; @@ -841,7 +840,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, { // In case of new raw stream, the stream must not be encrypted on storing if ( bCompr && m_nStreamMode == PACKAGE_STREAM_RAW ) - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Raw stream can not be encrypted on storing" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Raw stream can not be encrypted on storing", uno::Reference< XInterface >(), 2 ); @@ -849,12 +848,12 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_bCompressedIsSetFromOutside = sal_True; } else - throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for Compressed property!\n" ) ), + throw IllegalArgumentException(OSL_LOG_PREFIX "Wrong type for Compressed property!\n", uno::Reference< XInterface >(), 2 ); } else - throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } //-------------------------------------------------------------------------- @@ -898,7 +897,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) return aAny; } else - throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw beans::UnknownPropertyException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } //-------------------------------------------------------------------------- @@ -912,7 +911,7 @@ void ZipPackageStream::setSize ( const sal_Int32 nNewSize ) OUString ZipPackageStream::getImplementationName() throw ( RuntimeException ) { - return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "ZipPackageStream" ) ); + return OUString ("ZipPackageStream"); } //-------------------------------------------------------------------------- @@ -920,7 +919,7 @@ Sequence< OUString > ZipPackageStream::getSupportedServiceNames() throw ( RuntimeException ) { Sequence< OUString > aNames( 1 ); - aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.PackageStream" ) ); + aNames[0] = "com.sun.star.packages.PackageStream"; return aNames; } //-------------------------------------------------------------------------- diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index 76a9680b0c59..171faad91456 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -34,7 +34,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } } @@ -52,7 +52,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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -71,7 +71,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::readSomeBytes( uno::Sequence< sal_Int8 >& ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -90,7 +90,7 @@ void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); m_xSeekable->seek( m_nCurPos ); @@ -106,7 +106,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::available() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return m_xInStream->available(); } @@ -119,7 +119,7 @@ void SAL_CALL WrapStreamForShare::closeInput() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // the package is the owner so it will close the stream // m_xInStream->closeInput(); @@ -136,7 +136,7 @@ void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // let stream implementation do all the checking m_xSeekable->seek( location ); @@ -151,7 +151,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getPosition() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return m_nCurPos; } @@ -163,7 +163,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getLength() ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); if ( !m_xInStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return m_xSeekable->getLength(); } diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 7521dfca1eb9..5339b84ccd2b 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -46,7 +46,7 @@ OZipFileAccess::OZipFileAccess( const uno::Reference< lang::XMultiServiceFactory , m_bDisposed( sal_False ) { if ( !xFactory.is() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } // ---------------------------------------------------------------- @@ -66,12 +66,12 @@ OZipFileAccess::~OZipFileAccess() } // ---------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( const ::rtl::OUString& aString ) +uno::Sequence< OUString > OZipFileAccess::GetPatternsFromString_Impl( const OUString& aString ) { if ( aString.isEmpty() ) - return uno::Sequence< ::rtl::OUString >(); + return uno::Sequence< OUString >(); - uno::Sequence< ::rtl::OUString > aPattern( 1 ); + uno::Sequence< OUString > aPattern( 1 ); sal_Int32 nInd = 0; const sal_Unicode* pString = aString.getStr(); @@ -83,18 +83,18 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con if ( *pString == (sal_Unicode)'\\' ) { - aPattern[nInd] += ::rtl::OUString::valueOf( (sal_Unicode)'\\' ); + aPattern[nInd] += OUString::valueOf( (sal_Unicode)'\\' ); pString++; } else if ( *pString == (sal_Unicode)'*' ) { - aPattern[nInd] += ::rtl::OUString::valueOf( (sal_Unicode)'*' ); + aPattern[nInd] += OUString::valueOf( (sal_Unicode)'*' ); pString++; } else { OSL_FAIL( "The backslash is not guarded!\n" ); - aPattern[nInd] += ::rtl::OUString::valueOf( (sal_Unicode)'\\' ); + aPattern[nInd] += OUString::valueOf( (sal_Unicode)'\\' ); } } else if ( *pString == (sal_Unicode)'*' ) @@ -104,7 +104,7 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con } else { - aPattern[nInd] += ::rtl::OUString::valueOf( *pString ); + aPattern[nInd] += OUString::valueOf( *pString ); pString++; } } @@ -113,8 +113,8 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con } // ---------------------------------------------------------------- -sal_Bool OZipFileAccess::StringGoodForPattern_Impl( const ::rtl::OUString& aString, - const uno::Sequence< ::rtl::OUString >& aPattern ) +sal_Bool OZipFileAccess::StringGoodForPattern_Impl( const OUString& aString, + const uno::Sequence< OUString >& aPattern ) { sal_Int32 nInd = aPattern.getLength() - 1; if ( nInd < 0 ) @@ -169,17 +169,17 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( m_pZipFile ) - throw uno::Exception( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // initialization is allowed only one time + throw uno::Exception(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // initialization is allowed only one time if ( !aArguments.getLength() ) - throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); OSL_ENSURE( aArguments.getLength() == 1, "Too many arguments are provided, only the first one will be used!\n" ); - ::rtl::OUString aParamURL; + OUString aParamURL; uno::Reference< io::XStream > xStream; uno::Reference< io::XSeekable > xSeekable; @@ -204,15 +204,15 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu xSeekable = uno::Reference< io::XSeekable >( m_xContentStream, uno::UNO_QUERY ); } else - throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + throw lang::IllegalArgumentException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >(), 1 ); if ( !m_xContentStream.is() ) - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !xSeekable.is() ) { // TODO: after fwkbugfix02 is integrated a helper class can be used to make the stream seekable - throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::IOException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } // TODO: in case xSeekable is implemented on separated XStream implementation a wrapper is required @@ -224,7 +224,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu // XNameAccess // ---------------------------------------------------------------- -uno::Any SAL_CALL OZipFileAccess::getByName( const ::rtl::OUString& aName ) +uno::Any SAL_CALL OZipFileAccess::getByName( const OUString& aName ) throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) @@ -232,14 +232,14 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const ::rtl::OUString& aName ) ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); EntryHash::iterator aIter = m_pZipFile->GetEntryHash().find( aName ); if ( aIter == m_pZipFile->GetEntryHash().end() ) - throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, ::rtl::Reference< EncryptionData >(), @@ -247,24 +247,24 @@ uno::Any SAL_CALL OZipFileAccess::getByName( const ::rtl::OUString& aName ) m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return uno::makeAny ( xEntryStream ); } // ---------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getElementNames() +uno::Sequence< OUString > SAL_CALL OZipFileAccess::getElementNames() throw ( uno::RuntimeException ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); - uno::Sequence< ::rtl::OUString > aNames( m_pZipFile->GetEntryHash().size() ); + uno::Sequence< OUString > aNames( m_pZipFile->GetEntryHash().size() ); sal_Int32 nLen = 0; for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); ++aIter ) @@ -288,16 +288,16 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getElementNames() } // ---------------------------------------------------------------- -sal_Bool SAL_CALL OZipFileAccess::hasByName( const ::rtl::OUString& aName ) +sal_Bool SAL_CALL OZipFileAccess::hasByName( const OUString& aName ) throw (uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); 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( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ); } @@ -326,17 +326,17 @@ sal_Bool SAL_CALL OZipFileAccess::hasElements() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return ( m_pZipFile->GetEntryHash().size() != 0 ); } // XZipFileAccess // ---------------------------------------------------------------- -uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( const ::rtl::OUString& aPatternString ) +uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( const OUString& aPatternString ) throw ( container::NoSuchElementException, io::IOException, uno::RuntimeException ) @@ -344,13 +344,13 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pZipFile ) - throw io::NotConnectedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw io::NotConnectedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); // Code to compare strings by patterns - uno::Sequence< ::rtl::OUString > aPattern = GetPatternsFromString_Impl( aPatternString ); + uno::Sequence< OUString > aPattern = GetPatternsFromString_Impl( aPatternString ); for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); ++aIter ) { @@ -362,12 +362,12 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( m_aMutexHolder ) ); if ( !xEntryStream.is() ) - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); return xEntryStream; } } - throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw container::NoSuchElementException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); } // XComponent @@ -378,7 +378,7 @@ void SAL_CALL OZipFileAccess::dispose() ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( m_pListenersContainer ) { @@ -410,7 +410,7 @@ void SAL_CALL OZipFileAccess::addEventListener( const uno::Reference< lang::XEve ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( !m_pListenersContainer ) m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutexHolder->GetMutex() ); @@ -424,25 +424,25 @@ void SAL_CALL OZipFileAccess::removeEventListener( const uno::Reference< lang::X ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); if ( m_bDisposed ) - throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw lang::DisposedException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); if ( m_pListenersContainer ) m_pListenersContainer->removeInterface( xListener ); } //------------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::impl_staticGetSupportedServiceNames() +uno::Sequence< OUString > SAL_CALL OZipFileAccess::impl_staticGetSupportedServiceNames() { - uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.zip.ZipFileAccess") ); - aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.packages.zip.ZipFileAccess") ); + uno::Sequence< OUString > aRet(2); + aRet[0] = "com.sun.star.packages.zip.ZipFileAccess"; + aRet[1] = "com.sun.star.comp.packages.zip.ZipFileAccess"; return aRet; } //------------------------------------------------------------------------- -::rtl::OUString SAL_CALL OZipFileAccess::impl_staticGetImplementationName() +OUString SAL_CALL OZipFileAccess::impl_staticGetImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.package.zip.ZipFileAccess") ); + return OUString("com.sun.star.comp.package.zip.ZipFileAccess"); } //------------------------------------------------------------------------- @@ -453,17 +453,17 @@ uno::Reference< uno::XInterface > SAL_CALL OZipFileAccess::impl_staticCreateSelf } //------------------------------------------------------------------------- -::rtl::OUString SAL_CALL OZipFileAccess::getImplementationName() +OUString SAL_CALL OZipFileAccess::getImplementationName() throw ( uno::RuntimeException ) { return impl_staticGetImplementationName(); } //------------------------------------------------------------------------- -sal_Bool SAL_CALL OZipFileAccess::supportsService( const ::rtl::OUString& ServiceName ) +sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames(); + uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames(); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) if ( ServiceName.compareTo( aSeq[nInd] ) == 0 ) @@ -473,7 +473,7 @@ sal_Bool SAL_CALL OZipFileAccess::supportsService( const ::rtl::OUString& Servic } //------------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames() +uno::Sequence< OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames() throw ( uno::RuntimeException ) { return impl_staticGetSupportedServiceNames(); |