diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-15 13:21:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-19 07:46:25 +0100 |
commit | 193207c5abf339253e15b59f398da0c1f6f43bee (patch) | |
tree | af181e0b4335d73b4db5b2ccf180779f7c82de5b /sc/source | |
parent | b4b3949da1aad091b9f8d0f301f9f7031d6ce295 (diff) |
improve loplugin passparamsbyref
I think I managed to disable this when I converted it to
use the shared plugin infrastructure.
So fix that, and then make it much smarter to avoid various
false positives.
Change-Id: I0a4657cff3b40a00434924bf764d024dbfd7d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/SolverSettings.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/excel/xename.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/xestream.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/dbfunc.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/dbfunc.cxx | 2 |
7 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/core/data/SolverSettings.cxx b/sc/source/core/data/SolverSettings.cxx index 97103659b94c..c7413bcb943e 100644 --- a/sc/source/core/data/SolverSettings.cxx +++ b/sc/source/core/data/SolverSettings.cxx @@ -207,7 +207,7 @@ OUString SolverSettings::GetParameter(SolverParameter eParam) } // Sets the value of a single solver parameter in the object -void SolverSettings::SetParameter(SolverParameter eParam, OUString sValue) +void SolverSettings::SetParameter(SolverParameter eParam, const OUString& sValue) { switch (eParam) { @@ -393,7 +393,8 @@ void SolverSettings::WriteConstraints() } // Write a single constraint part to the file -void SolverSettings::WriteConstraintPart(ConstraintPart ePart, tools::Long nIndex, OUString sValue) +void SolverSettings::WriteConstraintPart(ConstraintPart ePart, tools::Long nIndex, + const OUString& sValue) { // Empty named ranges cannot be written to the file (this corrupts MS files) if (sValue.isEmpty()) diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 8d97ffaadda9..5607a9068d4f 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -162,7 +162,7 @@ private: * * @return excel's name index. */ - sal_uInt16 FindNamedExp( SCTAB nTab, OUString sName ); + sal_uInt16 FindNamedExp( SCTAB nTab, const OUString& sName ); /** Returns the index of an existing built-in NAME record with the passed definition, otherwise 0. */ sal_uInt16 FindBuiltInNameIdx( const OUString& rName, @@ -548,7 +548,7 @@ void XclExpNameManagerImpl::SaveXml( XclExpXmlStream& rStrm ) // private -------------------------------------------------------------------- -sal_uInt16 XclExpNameManagerImpl::FindNamedExp( SCTAB nTab, OUString sName ) +sal_uInt16 XclExpNameManagerImpl::FindNamedExp( SCTAB nTab, const OUString& sName ) { NamedExpMap::key_type key(nTab, sName); NamedExpMap::const_iterator itr = maNamedExpMap.find(key); diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index b777d7771c23..d9e7a6cf57ea 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1267,7 +1267,7 @@ void XclExpXmlStream::restoreTabNames(const std::vector<OUString>& aOriginalTabN } } -void XclExpXmlStream::renameTab(SCTAB aTab, OUString aNewName) +void XclExpXmlStream::renameTab(SCTAB aTab, const OUString& aNewName) { ScDocShell* pShell = getDocShell(); ScDocument& rDoc = pShell->GetDocument(); diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 669dadaec014..202e70a0e65d 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -342,7 +342,7 @@ private: void validateTabNames(std::vector<OUString>& aOriginalTabNames); void restoreTabNames(const std::vector<OUString>& aOriginalTabNames); - void renameTab(SCTAB aTab, OUString aNewName); + void renameTab(SCTAB aTab, const OUString& aNewName); typedef std::map< OUString, std::pair< OUString, diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index f77c49e64677..09a5f674089e 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -489,7 +489,7 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, std::share ScDocumentLoader::ScDocumentLoader(const OUString& rFileName, OUString& rFilterName, OUString& rOptions, sal_uInt32 nRekCnt, weld::Window* pInteractionParent, - css::uno::Reference<css::io::XInputStream> xInputStream) + const css::uno::Reference<css::io::XInputStream>& xInputStream) : pMedium(nullptr) { if ( rFilterName.isEmpty() ) diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index 0c2d77d38461..9d9f5481121d 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -37,7 +37,7 @@ private: void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& rDimension); static void ModifiedAutoFilter(ScDocShell* pDocSh); static void ApplyAutoFilter(ScDocShell* pDocSh, ScViewData* pViewData, ScDBData* pDBData, - SCROW nRow, SCTAB nTab, ScQueryParam aParam); + SCROW nRow, SCTAB nTab, const ScQueryParam& aParam); DECL_STATIC_LINK(ScDBFunc, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*); diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 9e2712fd2221..5f5a0621c9f6 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -381,7 +381,7 @@ IMPL_STATIC_LINK_NOARG(ScDBFunc, InstallLOKNotifierHdl, void*, vcl::ILibreOffice } void ScDBFunc::ApplyAutoFilter(ScDocShell* pDocSh, ScViewData* pViewData, ScDBData* pDBData, - SCROW nRow, SCTAB nTab, ScQueryParam aParam) + SCROW nRow, SCTAB nTab, const ScQueryParam& aParam) { ScDocument& rDoc = pViewData->GetDocument(); ScRange aRange; |