diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-15 11:05:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-19 10:29:31 +0200 |
commit | 610b2b94b33b0fc2d79cd515f9e293ca1c2610e8 (patch) | |
tree | 6eab2639cb8104ca54daa3f7a2ebd83ef1566cf0 /embeddedobj | |
parent | remove most use of RTL_CONSTASCII_USTRINGPARAM macro (diff) | |
download | core-610b2b94b33b0fc2d79cd515f9e293ca1c2610e8.tar.gz core-610b2b94b33b0fc2d79cd515f9e293ca1c2610e8.zip |
remove unnecessary use of OUString constructor when assigning
change code like
aStr = OUString("xxxx");
to
aStr = "xxxx";
Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 38 | ||||
-rw-r--r-- | embeddedobj/source/msole/graphconvert.cxx | 6 | ||||
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 20 | ||||
-rw-r--r-- | embeddedobj/source/msole/olepersist.cxx | 13 | ||||
-rw-r--r-- | embeddedobj/source/msole/ownview.cxx | 18 |
5 files changed, 44 insertions, 51 deletions
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 4e161a886756..b3e920884fba 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -106,7 +106,7 @@ uno::Sequence< beans::PropertyValue > addAsTemplate( const uno::Sequence< beans: if ( !bAsTemplateSet ) { aResult.realloc( nLength + 1 ); - aResult[nLength].Name = OUString( "AsTemplate" ); + aResult[nLength].Name = "AsTemplate"; aResult[nLength].Value <<= sal_True; } @@ -221,7 +221,7 @@ static void SetDocToEmbedded( const uno::Reference< frame::XModel > xDocument, c if ( xDocument.is() ) { uno::Sequence< beans::PropertyValue > aSeq( 1 ); - aSeq[0].Name = OUString( "SetEmbedded" ); + aSeq[0].Name = "SetEmbedded"; aSeq[0].Value <<= sal_True; xDocument->attachResource( OUString(), aSeq ); @@ -377,14 +377,14 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() sal_Int32 nLen = 2; uno::Sequence< beans::PropertyValue > aArgs( nLen ); - aArgs[0].Name = OUString( "URL" ); + aArgs[0].Name = "URL"; aArgs[0].Value <<= m_aLinkURL; - aArgs[1].Name = OUString( "FilterName" ); + aArgs[1].Name = "FilterName"; aArgs[1].Value <<= m_aLinkFilterName; if ( m_bLinkHasPassword ) { aArgs.realloc( ++nLen ); - aArgs[nLen-1].Name = OUString( "Password" ); + aArgs[nLen-1].Name = "Password"; aArgs[nLen-1].Value <<= m_aLinkPassword; } @@ -590,13 +590,13 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr throw io::IOException(); // TODO: uno::Sequence< beans::PropertyValue > aArgs( 4 ); - aArgs[0].Name = OUString( "FilterName" ); + aArgs[0].Name = "FilterName"; aArgs[0].Value <<= aFilterName; - aArgs[1].Name = OUString( "OutputStream" ); + aArgs[1].Name = "OutputStream"; aArgs[1].Value <<= xTempOut; - aArgs[2].Name = OUString( "DocumentBaseURL" ); + aArgs[2].Name = "DocumentBaseURL"; aArgs[2].Value <<= aBaseURL; - aArgs[3].Name = OUString( "HierarchicalDocumentName" ); + aArgs[3].Name = "HierarchicalDocumentName"; aArgs[3].Value <<= aHierarchName; xStorable->storeToURL( OUString( "private:stream" ), aArgs ); @@ -751,11 +751,11 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: throw io::IOException(); // TODO: uno::Sequence< beans::PropertyValue > aArgs( 3 ); - aArgs[0].Name = OUString( "FilterName" ); + aArgs[0].Name = "FilterName"; aArgs[0].Value <<= aFilterName; - aArgs[2].Name = OUString( "DocumentBaseURL" ); + aArgs[2].Name = "DocumentBaseURL"; aArgs[2].Value <<= aBaseURL; - aArgs[1].Name = OUString( "HierarchicalDocumentName" ); + aArgs[1].Name = "HierarchicalDocumentName"; aArgs[1].Value <<= aHierarchName; xDoc->storeToStorage( xStorage, aArgs ); @@ -866,21 +866,21 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ SAL_WARN_IF( aTempFileURL.isEmpty(), "embeddedobj.common", "Couldn't retrieve temporary file URL!" ); - aTempMediaDescr[0].Name = OUString( "URL" ); + aTempMediaDescr[0].Name = "URL"; aTempMediaDescr[0].Value <<= aTempFileURL; - aTempMediaDescr[1].Name = OUString( "InputStream" ); + aTempMediaDescr[1].Name = "InputStream"; aTempMediaDescr[1].Value <<= xTempStream; - aTempMediaDescr[2].Name = OUString( "FilterName" ); + aTempMediaDescr[2].Name = "FilterName"; aTempMediaDescr[2].Value <<= GetFilterName( nStorageFormat ); - aTempMediaDescr[3].Name = OUString( "AsTemplate" ); + aTempMediaDescr[3].Name = "AsTemplate"; aTempMediaDescr[3].Value <<= sal_True; } else { aTempMediaDescr.realloc( 2 ); - aTempMediaDescr[0].Name = OUString( "URL" ); + aTempMediaDescr[0].Name = "URL"; aTempMediaDescr[0].Value <<= m_aLinkURL; - aTempMediaDescr[1].Name = OUString( "FilterName" ); + aTempMediaDescr[1].Name = "FilterName"; aTempMediaDescr[1].Value <<= m_aLinkFilterName; } @@ -1692,7 +1692,7 @@ void SAL_CALL OCommonEmbeddedObject::reload( else { uno::Sequence< beans::PropertyValue > aArgs( 1 ); - aArgs[0].Name = OUString( "URL" ); + aArgs[0].Name = "URL"; aArgs[0].Value <<= m_aLinkURL; m_aLinkFilterName = aHelper.UpdateMediaDescriptorWithFilterName( aArgs, sal_False ); } diff --git a/embeddedobj/source/msole/graphconvert.cxx b/embeddedobj/source/msole/graphconvert.cxx index e054f7a95005..9883c490cb16 100644 --- a/embeddedobj/source/msole/graphconvert.cxx +++ b/embeddedobj/source/msole/graphconvert.cxx @@ -54,7 +54,7 @@ sal_Bool ConvertBufferToFormat( void* pBuf, { uno::Reference < graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(comphelper::getProcessComponentContext())); uno::Sequence< beans::PropertyValue > aMediaProperties( 1 ); - aMediaProperties[0].Name = OUString( "InputStream" ); + aMediaProperties[0].Name = "InputStream"; aMediaProperties[0].Value <<= xIn; uno::Reference< graphic::XGraphic > xGraphic( xGraphicProvider->queryGraphic( aMediaProperties ) ); if( xGraphic.is() ) @@ -62,9 +62,9 @@ sal_Bool ConvertBufferToFormat( void* pBuf, SvMemoryStream aNewStream( 65535, 65535 ); uno::Reference < io::XStream > xOut = new utl::OStreamWrapper( aNewStream ); uno::Sequence< beans::PropertyValue > aOutMediaProperties( 2 ); - aOutMediaProperties[0].Name = OUString( "OutputStream" ); + aOutMediaProperties[0].Name = "OutputStream"; aOutMediaProperties[0].Value <<= xOut; - aOutMediaProperties[1].Name = OUString( "MimeType" ); + aOutMediaProperties[1].Name = "MimeType"; aOutMediaProperties[1].Value <<= aMimeType; xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties ); diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index d2da4840fca5..b0c8abc0f88a 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -207,9 +207,7 @@ uno::Reference< embed::XStorage > OleEmbeddedObject::CreateTemporarySubstorage( for ( sal_Int32 nInd = 0; nInd < 32000 && !xResult.is(); nInd++ ) { - OUString aName = OUString::number( nInd ); - aName += OUString( "TMPSTOR" ); - aName += m_aEntryName; + OUString aName = OUString::number( nInd ) + "TMPSTOR" + m_aEntryName; if ( !m_xParentStorage->hasByName( aName ) ) { xResult = m_xParentStorage->openStorageElement( aName, embed::ElementModes::READWRITE ); @@ -232,9 +230,7 @@ OUString OleEmbeddedObject::MoveToTemporarySubstream() OUString aResult; for ( sal_Int32 nInd = 0; nInd < 32000 && aResult.isEmpty(); nInd++ ) { - OUString aName = OUString::number( nInd ); - aName += OUString( "TMPSTREAM" ); - aName += m_aEntryName; + OUString aName = OUString::number( nInd ) + "TMPSTREAM" + m_aEntryName; if ( !m_xParentStorage->hasByName( aName ) ) { m_xParentStorage->renameElement( m_aEntryName, aName ); @@ -300,21 +296,21 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo() // let the model behave as embedded one uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW ); uno::Sequence< beans::PropertyValue > aSeq( 1 ); - aSeq[0].Name = OUString( "SetEmbedded" ); + aSeq[0].Name = "SetEmbedded"; aSeq[0].Value <<= sal_True; xModel->attachResource( OUString(), aSeq ); // load the model from the stream uno::Sequence< beans::PropertyValue > aArgs( 5 ); - aArgs[0].Name = OUString( "HierarchicalDocumentName" ); + aArgs[0].Name = "HierarchicalDocumentName"; aArgs[0].Value <<= m_aEntryName; - aArgs[1].Name = OUString( "ReadOnly" ); + aArgs[1].Name = "ReadOnly"; aArgs[1].Value <<= sal_True; - aArgs[2].Name = OUString( "FilterName" ); + aArgs[2].Name = "FilterName"; aArgs[2].Value <<= aFilterName; - aArgs[3].Name = OUString( "URL" ); + aArgs[3].Name = "URL"; aArgs[3].Value <<= OUString( "private:stream" ); - aArgs[4].Name = OUString( "InputStream" ); + aArgs[4].Name = "InputStream"; aArgs[4].Value <<= m_xObjectStream->getInputStream(); xSeekable->seek( 0 ); diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index e020de2e1c2f..528d0fc5bdfa 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -500,7 +500,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea throw io::IOException(); // TODO: // insert the result file as replacement image - OUString aCacheName = OUString( "\002OlePres000" ); + OUString aCacheName = "\002OlePres000"; if ( xNameContainer->hasByName( aCacheName ) ) xNameContainer->replaceByName( aCacheName, uno::makeAny( xTempFile ) ); else @@ -535,8 +535,7 @@ void OleEmbeddedObject::RemoveVisualCache_Impl( const uno::Reference< io::XStrea for ( sal_uInt8 nInd = 0; nInd < 10; nInd++ ) { - OUString aStreamName( "\002OlePres00" ); - aStreamName += OUString::number( nInd ); + OUString aStreamName = "\002OlePres00" + OUString::number( nInd ); if ( xNameContainer->hasByName( aStreamName ) ) xNameContainer->removeByName( aStreamName ); } @@ -603,8 +602,7 @@ sal_Bool OleEmbeddedObject::HasVisReplInStream() { for ( sal_uInt8 nInd = 0; nInd < 10 && !bExists; nInd++ ) { - OUString aStreamName( "\002OlePres00" ); - aStreamName += OUString::number( nInd ); + OUString aStreamName = "\002OlePres00" + OUString::number( nInd ); try { bExists = xNameContainer->hasByName( aStreamName ); @@ -653,8 +651,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToRetrieveCachedVisualRepres { for ( sal_uInt8 nInd = 0; nInd < 10; nInd++ ) { - OUString aStreamName( "\002OlePres00" ); - aStreamName += OUString::number( nInd ); + OUString aStreamName = "\002OlePres00" + OUString::number( nInd ); uno::Reference< io::XStream > xCachedCopyStream; try { @@ -671,7 +668,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToRetrieveCachedVisualRepres if ( nInd == 0 ) { // to be compatible with the old versions Ole10Native is checked after OlePress000 - aStreamName = OUString( "\001Ole10Native" ); + aStreamName = "\001Ole10Native"; try { if ( ( xNameContainer->getByName( aStreamName ) >>= xCachedCopyStream ) && xCachedCopyStream.is() ) diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx index 5478d054b063..90814fb3dd46 100644 --- a/embeddedobj/source/msole/ownview.cxx +++ b/embeddedobj/source/msole/ownview.cxx @@ -120,22 +120,22 @@ sal_Bool OwnView_Impl::CreateModelFromURL( const OUString& aFileURL ) uno::Sequence< beans::PropertyValue > aArgs( m_aFilterName.isEmpty() ? 4 : 5 ); - aArgs[0].Name = OUString( "URL" ); + aArgs[0].Name = "URL"; aArgs[0].Value <<= aFileURL; - aArgs[1].Name = OUString( "ReadOnly" ); + aArgs[1].Name = "ReadOnly"; aArgs[1].Value <<= sal_True; - aArgs[2].Name = OUString( "InteractionHandler" ); + aArgs[2].Name = "InteractionHandler"; aArgs[2].Value <<= uno::Reference< task::XInteractionHandler >( static_cast< ::cppu::OWeakObject* >( new DummyHandler_Impl() ), uno::UNO_QUERY ); - aArgs[3].Name = OUString( "DontEdit" ); + aArgs[3].Name = "DontEdit"; aArgs[3].Value <<= sal_True; if ( !m_aFilterName.isEmpty() ) { - aArgs[4].Name = OUString( "FilterName" ); + aArgs[4].Name = "FilterName"; aArgs[4].Value <<= m_aFilterName; } @@ -215,13 +215,13 @@ OUString OwnView_Impl::GetFilterNameFromExtentionAndInStream( } uno::Sequence< beans::PropertyValue > aArgs( aTypeName.isEmpty() ? 2 : 3 ); - aArgs[0].Name = OUString( "URL" ); + aArgs[0].Name = "URL"; aArgs[0].Value <<= OUString( "private:stream" ); - aArgs[1].Name = OUString( "InputStream" ); + aArgs[1].Name = "InputStream"; aArgs[1].Value <<= xInputStream; if ( !aTypeName.isEmpty() ) { - aArgs[2].Name = OUString( "TypeName" ); + aArgs[2].Name = "TypeName"; aArgs[2].Value <<= aTypeName; } @@ -425,7 +425,7 @@ void OwnView_Impl::CreateNative() aArgs ), uno::UNO_QUERY_THROW ); - OUString aSubStreamName = OUString( "\1Ole10Native" ); + OUString aSubStreamName = "\1Ole10Native"; uno::Reference< embed::XClassifiedObject > xStor( xNameAccess, uno::UNO_QUERY_THROW ); uno::Sequence< sal_Int8 > aStorClassID = xStor->getClassID(); |