summaryrefslogtreecommitdiff
path: root/package/source/xstor/xstorage.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-03-06 15:29:08 +0200
committerNoel Grandin <noel@peralex.com>2014-03-18 08:32:26 +0200
commit86a32589e90ee983159fb5b2c6a594428ab7d422 (patch)
tree6de946fe2b9b25614f0d197af95e9d3aadcd1bd9 /package/source/xstor/xstorage.cxx
parentbb17844099ba98a77c8e5d7a25c0c416a4b0641e (diff)
Find places where OUString and OString are passed by value.
It's not very efficient, because we generally end up copying it twice - once into the parameter and again into the destination OUString. So I create a clang plugin that finds such places and generates a warning so that we can convert them to pass-by-reference. Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
Diffstat (limited to 'package/source/xstor/xstorage.cxx')
-rw-r--r--package/source/xstor/xstorage.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 1c00a5d68dc8..c3a621279cc6 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -776,7 +776,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes
void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
uno::Reference< embed::XStorage > xDest,
- OUString aName,
+ const OUString& aName,
sal_Bool bDirect )
{
SAL_WARN_IF( !xDest.is(), "package.xstor", "No destination storage!" );
@@ -1384,7 +1384,7 @@ SotElement_Impl* OStorage_Impl::FindElement( const OUString& rName )
return NULL;
}
-SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr )
+SotElement_Impl* OStorage_Impl::InsertStream( const OUString& aName, sal_Bool bEncr )
{
SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" );
if ( !m_xPackage.is() )
@@ -1418,7 +1418,7 @@ SotElement_Impl* OStorage_Impl::InsertStream( OUString aName, sal_Bool bEncr )
return pNewElement;
}
-SotElement_Impl* OStorage_Impl::InsertRawStream( OUString aName, const uno::Reference< io::XInputStream >& xInStream )
+SotElement_Impl* OStorage_Impl::InsertRawStream( const OUString& aName, const uno::Reference< io::XInputStream >& xInStream )
{
// insert of raw stream means insert and commit
SAL_WARN_IF( !m_xPackage.is(), "package.xstor", "Not possible to refer to package as to factory!" );
@@ -1486,7 +1486,7 @@ OStorage_Impl* OStorage_Impl::CreateNewStorageImpl( sal_Int32 nStorageMode )
return pResult;
}
-SotElement_Impl* OStorage_Impl::InsertStorage( OUString aName, sal_Int32 nStorageMode )
+SotElement_Impl* OStorage_Impl::InsertStorage( const OUString& aName, sal_Int32 nStorageMode )
{
SotElement_Impl* pNewElement = InsertElement( aName, sal_True );
@@ -1497,7 +1497,7 @@ SotElement_Impl* OStorage_Impl::InsertStorage( OUString aName, sal_Int32 nStorag
return pNewElement;
}
-SotElement_Impl* OStorage_Impl::InsertElement( OUString aName, sal_Bool bIsStorage )
+SotElement_Impl* OStorage_Impl::InsertElement( const OUString& aName, sal_Bool bIsStorage )
{
OSL_ENSURE( FindElement( aName ) == NULL, "Should not try to insert existing element" );