summaryrefslogtreecommitdiff
path: root/desktop
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 /desktop
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 'desktop')
-rw-r--r--desktop/source/app/dispatchwatcher.cxx6
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx2
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx2
3 files changed, 5 insertions, 5 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 7e5f7b969606..6067c348118d 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -80,8 +80,8 @@ struct DispatchHolder
Reference< XDispatch > xDispatch;
};
-static OUString impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
- OUString aAppl )
+static OUString impl_GetFilterFromExt( const OUString& aUrl, SfxFilterFlags nFlags,
+ const OUString& aAppl )
{
OUString aFilter;
SfxMedium* pMedium = new SfxMedium( aUrl,
@@ -108,7 +108,7 @@ static OUString impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
delete pMedium;
return aFilter;
}
-static OUString impl_GuessFilter( OUString aUrlIn, OUString aUrlOut )
+static OUString impl_GuessFilter( const OUString& aUrlIn, const OUString& aUrlOut )
{
/* aAppl can also be set to Factory like scalc, swriter... */
OUString aAppl;
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index 7c5777dc3b22..7a232fb7878e 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
@@ -265,7 +265,7 @@ private:
/** Helper method to compare the versions with the current version
*/
SAL_DLLPRIVATE bool
- checkBlacklistVersion(OUString currentversion,
+ checkBlacklistVersion(const OUString& currentversion,
::com::sun::star::uno::Sequence< OUString > const & versions) const;
::com::sun::star::uno::Reference<
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 67b6d8ebd5b1..8b2cbf672566 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -454,7 +454,7 @@ void DescriptionInfoset::checkBlacklist() const
}
bool DescriptionInfoset::checkBlacklistVersion(
- OUString currentversion,
+ const OUString& currentversion,
::com::sun::star::uno::Sequence< OUString > const & versions) const
{
sal_Int32 nLen = versions.getLength();