summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-15 13:21:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-19 07:46:25 +0100
commit193207c5abf339253e15b59f398da0c1f6f43bee (patch)
treeaf181e0b4335d73b4db5b2ccf180779f7c82de5b
parentb4b3949da1aad091b9f8d0f301f9f7031d6ce295 (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>
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basctl/source/basicide/baside2.hxx2
-rw-r--r--canvas/workben/canvasdemo.cxx6
-rw-r--r--chart2/qa/extras/charttest.hxx2
-rw-r--r--chart2/qa/extras/uichart.cxx8
-rw-r--r--chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx4
-rw-r--r--chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx4
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx2
-rw-r--r--comphelper/source/container/enumhelper.cxx2
-rw-r--r--compilerplugins/clang/passparamsbyref.cxx124
-rw-r--r--compilerplugins/clang/sharedvisitor/dummyplugin.hxx2
-rw-r--r--compilerplugins/clang/test/passparamsbyref.cxx30
-rw-r--r--cui/source/customize/CustomNotebookbarGenerator.cxx3
-rw-r--r--cui/source/dialogs/GraphicTestsDialog.cxx3
-rw-r--r--cui/source/dialogs/ImageViewerDialog.cxx3
-rw-r--r--cui/source/inc/CustomNotebookbarGenerator.hxx2
-rw-r--r--cui/source/inc/GraphicsTestsDialog.hxx4
-rw-r--r--cui/source/inc/ImageViewerDialog.hxx2
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx14
-rw-r--r--include/sfx2/dispatch.hxx2
-rw-r--r--include/sfx2/docfile.hxx2
-rw-r--r--include/sfx2/viewsh.hxx2
-rw-r--r--include/svtools/acceleratorexecute.hxx2
-rw-r--r--include/svx/FileExportedDialog.hxx2
-rw-r--r--include/svx/svdotext.hxx2
-rw-r--r--include/svx/svdpntv.hxx2
-rw-r--r--include/test/a11y/eventposter.hxx2
-rw-r--r--include/test/beans/xpropertyset.hxx4
-rw-r--r--include/test/sheet/xformulaquery.hxx2
-rw-r--r--include/unotools/securityoptions.hxx2
-rw-r--r--include/unotools/ucbstreamhelper.hxx4
-rw-r--r--include/vcl/font/Feature.hxx2
-rw-r--r--include/vcl/metaact.hxx2
-rw-r--r--include/xmloff/xmlexp.hxx2
-rw-r--r--sc/inc/SolverSettings.hxx4
-rw-r--r--sc/inc/tablink.hxx2
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
-rw-r--r--sc/qa/unit/ucalc_copypaste.cxx4
-rw-r--r--sc/source/core/data/SolverSettings.cxx5
-rw-r--r--sc/source/filter/excel/xename.cxx4
-rw-r--r--sc/source/filter/excel/xestream.cxx2
-rw-r--r--sc/source/filter/inc/xestream.hxx2
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
-rw-r--r--sc/source/ui/inc/dbfunc.hxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx2
-rw-r--r--sd/qa/unit/sdmodeltestbase.hxx2
-rw-r--r--sd/source/filter/eppt/epptooxml.hxx4
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx4
-rw-r--r--sd/source/ui/inc/drawview.hxx2
-rw-r--r--sd/source/ui/view/drawview.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx2
-rw-r--r--sfx2/source/dialog/StyleList.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/inc/StyleList.hxx2
-rw-r--r--sfx2/source/view/viewsh.cxx2
-rw-r--r--slideshow/source/engine/box2dtools.cxx14
-rw-r--r--slideshow/source/inc/box2dtools.hxx15
-rw-r--r--svl/source/misc/sharedstringpool.cxx2
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx2
-rw-r--r--svx/qa/unit/customshapes.cxx5
-rw-r--r--svx/source/dialog/FileExportedDialog.cxx4
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/inc/formcontroller.hxx2
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx2
-rw-r--r--svx/source/svdraw/svdotxtr.cxx2
-rw-r--r--sw/inc/swtable.hxx2
-rw-r--r--sw/inc/textboxhelper.hxx2
-rw-r--r--sw/inc/txtrfmrk.hxx2
-rw-r--r--sw/inc/unocrsr.hxx2
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/qa/inc/swmodeltestbase.hxx2
-rw-r--r--sw/qa/unit/swmodeltestbase.cxx2
-rw-r--r--sw/source/core/doc/textboxhelper.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx4
-rw-r--r--sw/source/core/inc/unometa.hxx4
-rw-r--r--sw/source/core/table/swtable.cxx2
-rw-r--r--sw/source/core/txtnode/atrref.cxx2
-rw-r--r--sw/source/core/unocore/unorefmk.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx2
-rw-r--r--sw/source/filter/ww8/docxexport.hxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx2
-rw-r--r--sw/source/uibase/sidebar/CommentsPanel.hxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapperTableHandler.hxx2
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx2
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx10
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx10
-rw-r--r--sw/source/writerfilter/dmapper/PropertyMap.hxx2
-rw-r--r--toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx4
-rw-r--r--toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.hxx5
-rw-r--r--unotools/source/config/securityoptions.cxx2
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx4
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx6
-rw-r--r--vcl/inc/pdf/pdfwriter_impl.hxx2
-rw-r--r--vcl/inc/qt5/QtAccessibleRegistry.hxx6
-rw-r--r--vcl/inc/qt5/QtAccessibleWidget.hxx2
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx7
-rw-r--r--vcl/qt5/QtAccessibleRegistry.cxx6
-rw-r--r--vcl/qt5/QtAccessibleWidget.cxx2
-rw-r--r--vcl/source/font/Feature.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
103 files changed, 292 insertions, 186 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 76f3ec8ac7bd..dd75a88b06fc 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1609,7 +1609,7 @@ void ModulWindowLayout::SyntaxColors::ConfigurationChanged (utl::ConfigurationBr
// Applies an entire new color scheme; when bFirst is true, then the checks to see if the color scheme
// has changed are ignored to make sure the color scheme is applied
-void ModulWindowLayout::SyntaxColors::ApplyColorScheme(OUString aSchemeId, bool bFirst)
+void ModulWindowLayout::SyntaxColors::ApplyColorScheme(const OUString& aSchemeId, bool bFirst)
{
const TokenType vTokenTypes[] =
{
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 3006b5a76bd8..2d0bad211007 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -460,7 +460,7 @@ private:
Color const & GetBackgroundColor () const { return m_aBackgroundColor; };
Color const & GetFontColor () const { return m_aFontColor; }
Color const & GetColor(TokenType eType) const { return aColors[eType]; }
- void ApplyColorScheme(OUString aSchemeId, bool bFirst);
+ void ApplyColorScheme(const OUString& aSchemeId, bool bFirst);
private:
virtual void ConfigurationChanged (utl::ConfigurationBroadcaster*, ConfigurationHints) override;
diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx
index 65e8ba775c76..7199553f6223 100644
--- a/canvas/workben/canvasdemo.cxx
+++ b/canvas/workben/canvasdemo.cxx
@@ -88,7 +88,7 @@ class DemoRenderer
uno::Reference< rendering::XGraphicDevice > mxDevice;
DemoRenderer( uno::Reference< rendering::XGraphicDevice > xDevice,
- uno::Reference< rendering::XCanvas > xCanvas,
+ const uno::Reference< rendering::XCanvas > & xCanvas,
Size aSize ) :
maSize(aSize),
maColorBlack( vcl::unotools::colorToStdColorSpaceSequence( COL_BLACK) ),
@@ -139,7 +139,7 @@ class DemoRenderer
maViewState, maRenderState );
}
- void drawStringAt( OString aString, double x, double y )
+ void drawStringAt( const OString & aString, double x, double y )
{
rendering::StringContext aText;
aText.Text = OStringToOUString( aString, RTL_TEXTENCODING_UTF8 );
@@ -261,7 +261,7 @@ class DemoRenderer
//mxCanvas->drawPolyPolygon( xPoly, maViewState, aRenderState );
}
- void drawTitle( OString aTitle )
+ void drawTitle( const OString & aTitle )
{
// FIXME: text anchoring to be done
double nStringWidth = aTitle.getLength() * 8.0;
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 8fb413a244f6..696e3c7ab164 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -62,7 +62,7 @@ using namespace css::uno;
class ChartTest : public UnoApiXmlTest
{
public:
- ChartTest(OUString path)
+ ChartTest(const OUString& path)
: UnoApiXmlTest(path)
{
}
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index fe0c53a73bcf..e17d0e6daa20 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -21,13 +21,13 @@ public:
{
}
- void testCopyPasteToNewSheet(uno::Reference<chart::XChartDocument> xChartDoc,
+ void testCopyPasteToNewSheet(const uno::Reference<chart::XChartDocument>& xChartDoc,
OUString aObjectName, sal_Int32 nColumns, sal_Int32 nRows);
};
-void Chart2UiChartTest::testCopyPasteToNewSheet(uno::Reference<chart::XChartDocument> xChartDoc,
- OUString aObjectName, sal_Int32 nColumns,
- sal_Int32 nRows)
+void Chart2UiChartTest::testCopyPasteToNewSheet(
+ const uno::Reference<chart::XChartDocument>& xChartDoc, OUString aObjectName,
+ sal_Int32 nColumns, sal_Int32 nRows)
{
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
diff --git a/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx b/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
index f7e25fe51348..abb74ded2294 100644
--- a/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
@@ -52,8 +52,8 @@ private:
const css::uno::Reference<css::chart2::XScaling>& xScalingY,
sal_Bool bMaySkipPointsInCalculation ) override;
- void calculateValues(RegressionCalculationHelper::tDoubleVectorPair aValues, bool bUseXAvg);
- void calculateValuesCentral(RegressionCalculationHelper::tDoubleVectorPair aValues);
+ void calculateValues(const RegressionCalculationHelper::tDoubleVectorPair& aValues, bool bUseXAvg);
+ void calculateValuesCentral(const RegressionCalculationHelper::tDoubleVectorPair& aValues);
std::vector<double> aYList;
std::vector<double> aXList;
};
diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
index 6d3f2b01d6fc..a846d4d224f7 100644
--- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
@@ -81,7 +81,7 @@ void SAL_CALL MovingAverageRegressionCurveCalculator::recalculateRegression(
}
void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
- RegressionCalculationHelper::tDoubleVectorPair aValues)
+ const RegressionCalculationHelper::tDoubleVectorPair& aValues)
{
const size_t aSize = aValues.first.size();
if (aSize == 0)
@@ -106,7 +106,7 @@ void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
}
void MovingAverageRegressionCurveCalculator::calculateValues(
- RegressionCalculationHelper::tDoubleVectorPair aValues, bool bUseXAvg)
+ const RegressionCalculationHelper::tDoubleVectorPair& aValues, bool bUseXAvg)
{
const size_t aSize = aValues.first.size();
for (size_t i = mPeriod - 1; i < aSize; ++i)
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index a65b0f3cd428..e86d248fcf7a 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2308,7 +2308,7 @@ namespace {
// charts).
struct ROrderPair
{
- ROrderPair(OUString n, sal_Int32 r) : chartName(n), renderOrder(r) {}
+ ROrderPair(OUString n, sal_Int32 r) : chartName(std::move(n)), renderOrder(r) {}
OUString chartName;
sal_Int32 renderOrder;
diff --git a/comphelper/source/container/enumhelper.cxx b/comphelper/source/container/enumhelper.cxx
index 3390fef86444..4ea5fa8b357e 100644
--- a/comphelper/source/container/enumhelper.cxx
+++ b/comphelper/source/container/enumhelper.cxx
@@ -28,7 +28,7 @@ namespace comphelper
OEnumerationByName::OEnumerationByName(css::uno::Reference<css::container::XNameAccess> _xAccess)
:m_aNames(_xAccess->getElementNames())
- ,m_xAccess(_xAccess)
+ ,m_xAccess(std::move(_xAccess))
,m_nPos(0)
,m_bListening(false)
{
diff --git a/compilerplugins/clang/passparamsbyref.cxx b/compilerplugins/clang/passparamsbyref.cxx
index 9a3562752c2c..1cdf5272390b 100644
--- a/compilerplugins/clang/passparamsbyref.cxx
+++ b/compilerplugins/clang/passparamsbyref.cxx
@@ -46,11 +46,19 @@ public:
bool PreTraverseFunctionDecl(FunctionDecl *);
bool PostTraverseFunctionDecl(FunctionDecl *, bool);
bool TraverseFunctionDecl(FunctionDecl *);
+ bool PreTraverseCXXMethodDecl(CXXMethodDecl *);
+ bool PostTraverseCXXMethodDecl(CXXMethodDecl *, bool);
+ bool TraverseCXXMethodDecl(CXXMethodDecl *);
+ bool PreTraverseCXXConstructorDecl(CXXConstructorDecl *);
+ bool PostTraverseCXXConstructorDecl(CXXConstructorDecl *, bool);
+ bool TraverseCXXConstructorDecl(CXXConstructorDecl *);
bool PreTraverseImplicitCastExpr(ImplicitCastExpr *);
bool TraverseImplicitCastExpr(ImplicitCastExpr *);
bool VisitBinaryOperator(BinaryOperator const *);
bool VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *);
+ bool VisitCallExpr(const CallExpr *);
+ bool VisitCXXMemberCallExpr(const CXXMemberCallExpr *);
private:
bool isFat(QualType type);
@@ -68,10 +76,10 @@ bool PassParamsByRef::PreTraverseFunctionDecl(FunctionDecl* functionDecl)
{
return false;
}
- // only consider base declarations, not overridden ones, or we warn on methods that
- // are overriding stuff from external libraries
+ // Ignore virtual methods, sometimes we want to pass by value, and we cannot tell from
+ // the limited info available at an individual site.
const CXXMethodDecl * methodDecl = dyn_cast<CXXMethodDecl>(functionDecl);
- if (methodDecl && methodDecl->size_overridden_methods() > 0)
+ if (methodDecl && methodDecl->isVirtual())
return false;
// Only warn on the definition of the function:
@@ -87,7 +95,6 @@ bool PassParamsByRef::PostTraverseFunctionDecl(FunctionDecl* functionDecl, bool)
{
mbInsideFunctionDecl = false;
- auto cxxConstructorDecl = dyn_cast<CXXConstructorDecl>(functionDecl);
unsigned n = functionDecl->getNumParams();
for (unsigned i = 0; i != n; ++i) {
const ParmVarDecl * pvDecl = functionDecl->getParamDecl(i);
@@ -96,29 +103,6 @@ bool PassParamsByRef::PostTraverseFunctionDecl(FunctionDecl* functionDecl, bool)
continue;
if (mParamExclusions.find(pvDecl) != mParamExclusions.end())
continue;
- // Ignore cases where the parameter is std::move'd.
- // This is a fairly simple check, might need some more complexity if the parameter is std::move'd
- // somewhere else in the constructor.
- bool bFoundMove = false;
- if (cxxConstructorDecl) {
- for (CXXCtorInitializer const * cxxCtorInitializer : cxxConstructorDecl->inits()) {
- if (cxxCtorInitializer->isMemberInitializer())
- {
- auto cxxConstructExpr = dyn_cast<CXXConstructExpr>(cxxCtorInitializer->getInit()->IgnoreParenImpCasts());
- if (cxxConstructExpr && cxxConstructExpr->getNumArgs() == 1)
- {
- if (auto callExpr = dyn_cast<CallExpr>(cxxConstructExpr->getArg(0)->IgnoreParenImpCasts())) {
- if (loplugin::DeclCheck(callExpr->getCalleeDecl()).Function("move").StdNamespace()) {
- bFoundMove = true;
- break;
- }
- }
- }
- }
- }
- }
- if (bFoundMove)
- continue;
report(
DiagnosticsEngine::Warning,
("passing %0 by value, rather pass by const lvalue reference"),
@@ -146,6 +130,48 @@ bool PassParamsByRef::TraverseFunctionDecl(FunctionDecl* functionDecl)
return ret;
}
+bool PassParamsByRef::PreTraverseCXXMethodDecl(CXXMethodDecl* functionDecl)
+{
+ return PreTraverseFunctionDecl(functionDecl);
+}
+
+bool PassParamsByRef::PostTraverseCXXMethodDecl(CXXMethodDecl* functionDecl, bool b)
+{
+ return PostTraverseFunctionDecl(functionDecl, b);
+}
+
+bool PassParamsByRef::TraverseCXXMethodDecl(CXXMethodDecl* functionDecl)
+{
+ bool ret = true;
+ if (PreTraverseCXXMethodDecl(functionDecl))
+ {
+ ret = RecursiveASTVisitor::TraverseCXXMethodDecl(functionDecl);
+ PostTraverseCXXMethodDecl(functionDecl, ret);
+ }
+ return ret;
+}
+
+bool PassParamsByRef::PreTraverseCXXConstructorDecl(CXXConstructorDecl* functionDecl)
+{
+ return PreTraverseFunctionDecl(functionDecl);
+}
+
+bool PassParamsByRef::PostTraverseCXXConstructorDecl(CXXConstructorDecl* functionDecl, bool b)
+{
+ return PostTraverseFunctionDecl(functionDecl, b);
+}
+
+bool PassParamsByRef::TraverseCXXConstructorDecl(CXXConstructorDecl* functionDecl)
+{
+ bool ret = true;
+ if (PreTraverseCXXConstructorDecl(functionDecl))
+ {
+ ret = RecursiveASTVisitor::TraverseCXXConstructorDecl(functionDecl);
+ PostTraverseCXXConstructorDecl(functionDecl, ret);
+ }
+ return ret;
+}
+
bool PassParamsByRef::PreTraverseImplicitCastExpr(ImplicitCastExpr * expr)
{
if (ignoreLocation(expr))
@@ -202,6 +228,50 @@ bool PassParamsByRef::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr * cxxOp
return true;
}
+bool PassParamsByRef::VisitCallExpr(const CallExpr * callExpr )
+{
+ if (!mbInsideFunctionDecl)
+ return true;
+ if (loplugin::DeclCheck(callExpr->getCalleeDecl()).Function("move").StdNamespace())
+ if (auto declRefExpr = dyn_cast<DeclRefExpr>(callExpr->getArg(0)))
+ {
+ if (auto parmVarDecl = dyn_cast<ParmVarDecl>(declRefExpr->getDecl()))
+ mParamExclusions.emplace(parmVarDecl);
+ }
+ if (auto const fun = callExpr->getDirectCallee())
+ {
+ unsigned const n = std::min(fun->getNumParams(), callExpr->getNumArgs());
+ for (unsigned i = 0; i != n; ++i)
+ {
+ if (!loplugin::TypeCheck(fun->getParamDecl(i)->getType())
+ .LvalueReference()
+ .NonConstVolatile())
+ continue;
+ auto a = callExpr->getArg(i)->IgnoreParenImpCasts();
+ if (auto declRefExpr = dyn_cast<DeclRefExpr>(a))
+ if (auto parmVarDecl = dyn_cast<ParmVarDecl>(declRefExpr->getDecl()))
+ mParamExclusions.emplace(parmVarDecl);
+ }
+ }
+ return true;
+}
+
+bool PassParamsByRef::VisitCXXMemberCallExpr(const CXXMemberCallExpr * callExpr )
+{
+ if (!mbInsideFunctionDecl)
+ return true;
+ // exclude cases where we call a non-const method on the parameter i.e. potentially mutating it
+ if (auto const e1 = callExpr->getMethodDecl())
+ if (!e1->isConst())
+ {
+ auto a = callExpr->getImplicitObjectArgument()->IgnoreParenImpCasts();
+ if (auto declRefExpr = dyn_cast<DeclRefExpr>(a))
+ if (auto parmVarDecl = dyn_cast<ParmVarDecl>(declRefExpr->getDecl()))
+ mParamExclusions.emplace(parmVarDecl);
+ }
+ return true;
+}
+
bool PassParamsByRef::isFat(QualType type) {
if (!type->isRecordType()) {
return false;
diff --git a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
index 1ef87416a907..8d48622e44ca 100644
--- a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
+++ b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx
@@ -48,6 +48,8 @@ public:
bool TraverseCXXCatchStmt( CXXCatchStmt* ) { return complain(); }
bool TraverseCXXDestructorDecl( CXXDestructorDecl* ) { return complain(); }
bool TraverseFunctionDecl( FunctionDecl* ) { return complain(); }
+ bool TraverseCXXMethodDecl( CXXMethodDecl* ) { return complain(); }
+ bool TraverseCXXConstructorDecl( CXXConstructorDecl* ) { return complain(); }
bool TraverseSwitchStmt( SwitchStmt* ) { return complain(); }
bool TraverseImplicitCastExpr( ImplicitCastExpr* ) { return complain(); }
bool TraverseCStyleCastExpr( CStyleCastExpr* ) { return complain(); }
diff --git a/compilerplugins/clang/test/passparamsbyref.cxx b/compilerplugins/clang/test/passparamsbyref.cxx
index 010556a67b6e..707def635ca4 100644
--- a/compilerplugins/clang/test/passparamsbyref.cxx
+++ b/compilerplugins/clang/test/passparamsbyref.cxx
@@ -19,8 +19,36 @@ struct S {
// make sure we ignore cases where the passed in parameter is std::move'd
S(OUString v1, OUString v2)
: mv1(std::move(v1)), mv2((std::move(v2))) {}
+
+ // expected-error-re@+1 {{passing '{{(rtl::)?}}OUString' by value, rather pass by const lvalue reference [loplugin:passparamsbyref]}}
+ S(OUString v1)
+ : mv1(v1) {}
+
+ // expected-error-re@+1 {{passing '{{(rtl::)?}}OUString' by value, rather pass by const lvalue reference [loplugin:passparamsbyref]}}
+ void foo(OUString v1) { (void) v1; }
+
+ // no warning expected
+ void foo2(OUString v1) { mv1 = std::move(v1); }
+
+ void takeByNonConstRef(OUString&);
+
+ // no warning expected
+ void foo3(OUString v)
+ {
+ takeByNonConstRef(v);
+ }
};
+namespace test2
+{
+ struct TestObject { OUString s[64]; void nonConstMethod(); };
+
+ // no warning expected
+ void f1(TestObject to)
+ {
+ to.nonConstMethod();
+ }
+}
void f()
{
@@ -37,6 +65,4 @@ OUString trim_string(OUString aString)
return aString;
}
-// expected-no-diagnostics
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx
index 7b26d36a68b8..ac2c18d5c238 100644
--- a/cui/source/customize/CustomNotebookbarGenerator.cxx
+++ b/cui/source/customize/CustomNotebookbarGenerator.cxx
@@ -252,7 +252,8 @@ void CustomNotebookbarGenerator::createCustomizedUIFile()
"Cannot copy the file or file was present :" << sCustomizedUIPath);
}
-Sequence<OUString> CustomNotebookbarGenerator::getCustomizedUIItem(OUString sNotebookbarConfigType)
+Sequence<OUString>
+CustomNotebookbarGenerator::getCustomizedUIItem(const OUString& sNotebookbarConfigType)
{
OUString aPath = getAppNameRegistryPath();
const utl::OConfigurationTreeRoot aAppNode(::comphelper::getProcessComponentContext(), aPath,
diff --git a/cui/source/dialogs/GraphicTestsDialog.cxx b/cui/source/dialogs/GraphicTestsDialog.cxx
index 49525d71bb62..25dfe17cc15d 100644
--- a/cui/source/dialogs/GraphicTestsDialog.cxx
+++ b/cui/source/dialogs/GraphicTestsDialog.cxx
@@ -24,7 +24,8 @@
#include <ImageViewerDialog.hxx>
GraphicTestEntry::GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDialog,
- OUString aTestName, OUString aTestStatus, Bitmap aTestBitmap)
+ const OUString& aTestName, const OUString& aTestStatus,
+ Bitmap aTestBitmap)
: m_xBuilder(Application::CreateBuilder(pParent, u"cui/ui/graphictestentry.ui"_ustr))
, m_xContainer(m_xBuilder->weld_container(u"gptestbox"_ustr))
, m_xTestLabel(m_xBuilder->weld_label(u"gptestlabel"_ustr))
diff --git a/cui/source/dialogs/ImageViewerDialog.cxx b/cui/source/dialogs/ImageViewerDialog.cxx
index d15960193d0f..1c0f537715d7 100644
--- a/cui/source/dialogs/ImageViewerDialog.cxx
+++ b/cui/source/dialogs/ImageViewerDialog.cxx
@@ -10,7 +10,8 @@
#include <vcl/virdev.hxx>
#include <ImageViewerDialog.hxx>
-ImageViewerDialog::ImageViewerDialog(weld::Dialog* pParent, BitmapEx aBitmap, OUString atitle)
+ImageViewerDialog::ImageViewerDialog(weld::Dialog* pParent, BitmapEx aBitmap,
+ const OUString& atitle)
: GenericDialogController(pParent, u"cui/ui/imageviewer.ui"_ustr, u"ImageViewerDialog"_ustr)
, m_xDisplayImage(m_xBuilder->weld_image(u"ImgVW_mainImage"_ustr))
{
diff --git a/cui/source/inc/CustomNotebookbarGenerator.hxx b/cui/source/inc/CustomNotebookbarGenerator.hxx
index a7149879aef0..53c1c4b3e85e 100644
--- a/cui/source/inc/CustomNotebookbarGenerator.hxx
+++ b/cui/source/inc/CustomNotebookbarGenerator.hxx
@@ -31,7 +31,7 @@ public:
static OUString getCustomizedUIPath();
static OUString getOriginalUIPath();
static OString getSystemPath(OUString const& sURL);
- static Sequence<OUString> getCustomizedUIItem(OUString sNotebookbarConfigType);
+ static Sequence<OUString> getCustomizedUIItem(const OUString& sNotebookbarConfigType);
static void getFileNameAndAppName(OUString& sAppName, OUString& sNotebookbarUIFileName);
static void modifyCustomizedUIFile(const Sequence<OUString>& sUIItemProperties);
static void createCustomizedUIFile();
diff --git a/cui/source/inc/GraphicsTestsDialog.hxx b/cui/source/inc/GraphicsTestsDialog.hxx
index 2bf18de5dde7..841715575ca1 100644
--- a/cui/source/inc/GraphicsTestsDialog.hxx
+++ b/cui/source/inc/GraphicsTestsDialog.hxx
@@ -28,8 +28,8 @@ private:
public:
DECL_LINK(HandleResultViewRequest, weld::Button&, void);
- GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDialog, OUString aTestName,
- OUString aTestStatus, Bitmap aTestBitmap);
+ GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDialog, const OUString& aTestName,
+ const OUString& aTestStatus, Bitmap aTestBitmap);
weld::Widget* get_widget() const { return m_xContainer.get(); }
};
diff --git a/cui/source/inc/ImageViewerDialog.hxx b/cui/source/inc/ImageViewerDialog.hxx
index 884deb18d4a7..c6c763552310 100644
--- a/cui/source/inc/ImageViewerDialog.hxx
+++ b/cui/source/inc/ImageViewerDialog.hxx
@@ -16,5 +16,5 @@ class ImageViewerDialog : public weld::GenericDialogController
std::unique_ptr<weld::Image> m_xDisplayImage;
public:
- ImageViewerDialog(weld::Dialog* pParent, BitmapEx aBitmap, OUString atitle);
+ ImageViewerDialog(weld::Dialog* pParent, BitmapEx aBitmap, const OUString& atitle);
};
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index cbb082c8db49..f33a29958ee2 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -42,10 +42,10 @@ public:
uno::Reference< XOfficeDatabaseDocument > const & xDocument);
void createDBDocument(const OUString& rDriverURL);
- void createTables(Reference< XConnection > xConnection);
- void createQueries(Reference< XDataSource > xDataSource);
- void createQuery(OUString sQuery, bool bEscapeProcessing,
- OUString sQueryName, Reference<XDataSource> xDataSource);
+ void createTables(const Reference< XConnection >& xConnection);
+ void createQueries(const Reference< XDataSource >& xDataSource);
+ void createQuery(const OUString& sQuery, bool bEscapeProcessing,
+ const OUString& sQueryName, const Reference<XDataSource> & xDataSource);
virtual void tearDown() override;
};
@@ -84,7 +84,7 @@ void DBTestBase::createDBDocument(const OUString& rDriverURL)
loadFromURL(maTempFile.GetURL());
}
-void DBTestBase::createTables(Reference<XConnection> xConnection)
+void DBTestBase::createTables(const Reference<XConnection>& xConnection)
{
uno::Reference<XStatement> xStatement = xConnection->createStatement();
@@ -137,7 +137,7 @@ void DBTestBase::createTables(Reference<XConnection> xConnection)
xConnection->commit();
}
-void DBTestBase::createQueries(Reference<XDataSource> xDataSource)
+void DBTestBase::createQueries(const Reference<XDataSource>& xDataSource)
{
createQuery(
u"SELECT \"ORDERS\".\"ID\" AS \"Order No.\", "
@@ -164,7 +164,7 @@ void DBTestBase::createQueries(Reference<XDataSource> xDataSource)
createQuery(u"SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VIEWS"_ustr, false, u"parseable native"_ustr, xDataSource);
}
-void DBTestBase::createQuery(OUString sQuery, bool bEscapeProcessing, OUString sQueryName, Reference<XDataSource> xDataSource)
+void DBTestBase::createQuery(const OUString& sQuery, bool bEscapeProcessing, const OUString& sQueryName, const Reference<XDataSource> & xDataSource)
{
Reference<XQueryDefinitionsSupplier> xQuerySupplier(xDataSource, UNO_QUERY_THROW);
Reference<container::XNameAccess> xQueryAccess = xQuerySupplier->getQueryDefinitions();
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 17d2fa464e3b..6963484b3b0e 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -90,7 +90,7 @@ friend class SfxHintPoster;
bool FindServer_( sal_uInt16 nId, SfxSlotServer &rServer );
- static bool IsCommandAllowedInLokReadOnlyViewMode (OUString commandName);
+ static bool IsCommandAllowedInLokReadOnlyViewMode(const OUString & commandName);
bool FillState_( const SfxSlotServer &rServer,
SfxItemSet &rState, const SfxSlot *pRealSlot );
void Execute_( SfxShell &rShell, const SfxSlot &rSlot,
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index ccf143c7e2a2..6ab8d2ce5571 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -229,7 +229,7 @@ public:
SAL_DLLPRIVATE void SetStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xNewStorage );
SAL_DLLPRIVATE void SetInnerStorage_Impl(const css::uno::Reference<css::embed::XStorage>& xStorage);
SAL_DLLPRIVATE css::uno::Reference<css::embed::XStorage>
- TryEncryptedInnerPackage(css::uno::Reference<css::embed::XStorage> xStorage);
+ TryEncryptedInnerPackage(const css::uno::Reference<css::embed::XStorage> & xStorage);
SAL_DLLPRIVATE void CloseAndReleaseStreams_Impl();
SAL_DLLPRIVATE void AddVersion_Impl( css::util::RevisionTag& rVersion );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 621f9125b0a5..bfd43c67101e 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -487,7 +487,7 @@ public:
// Blocked Command view settings
void setBlockedCommandList(const char* blockedCommandList);
- bool isBlockedCommand(OUString command) const;
+ bool isBlockedCommand(const OUString & command) const;
void SetStoringHelper(const std::shared_ptr<SfxStoringHelper>& xHelper) { m_xHelper = xHelper; }
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
index 3601e6043537..048eb8911b28 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -176,7 +176,7 @@ class SVT_DLLPUBLIC AcceleratorExecute final
static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame);
- static css::uno::Reference<css::ui::XAcceleratorConfiguration> lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString sModule);
+ static css::uno::Reference<css::ui::XAcceleratorConfiguration> lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const OUString& sModule);
void lok_setModuleConfig(const css::uno::Reference<css::ui::XAcceleratorConfiguration>& acceleratorConfig);
/** TODO document me */
diff --git a/include/svx/FileExportedDialog.hxx b/include/svx/FileExportedDialog.hxx
index 3ad5ab559a25..ea01dc5eb453 100644
--- a/include/svx/FileExportedDialog.hxx
+++ b/include/svx/FileExportedDialog.hxx
@@ -19,5 +19,5 @@ private:
DECL_DLLPRIVATE_LINK(OpenHdl, weld::Button&, void);
public:
- explicit FileExportedDialog(weld::Window* pParent, OUString atitle);
+ explicit FileExportedDialog(weld::Window* pParent, const OUString& atitle);
};
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 901e1daf4610..e4099dd6e2ad 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -295,7 +295,7 @@ private:
protected:
bool ImpCanConvTextToCurve() const;
rtl::Reference<SdrPathObj> ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const;
- rtl::Reference<SdrObject> ImpConvertAddText(rtl::Reference<SdrObject> pObj, bool bBezier) const;
+ rtl::Reference<SdrObject> ImpConvertAddText(const rtl::Reference<SdrObject> & pObj, bool bBezier) const;
void ImpSetTextStyleSheetListeners();
static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection);
static void ImpJustifyRect(tools::Rectangle& rRect);
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 569ddf2c4c07..6e6f04b84078 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -236,7 +236,7 @@ protected:
// Interface to SdrPaintWindow
void DeletePaintWindow(const SdrPaintWindow& rOld);
void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
- static void InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager);
+ static void InitOverlayManager(const rtl::Reference<sdr::overlay::OverlayManager> & xOverlayManager);
public:
sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
diff --git a/include/test/a11y/eventposter.hxx b/include/test/a11y/eventposter.hxx
index d9bce5601fe0..34651fd08047 100644
--- a/include/test/a11y/eventposter.hxx
+++ b/include/test/a11y/eventposter.hxx
@@ -110,7 +110,7 @@ public:
: EventPosterHelper()
{
}
- AccessibleEventPosterHelper(const css::uno::Reference<css::accessibility::XAccessible> xAcc)
+ AccessibleEventPosterHelper(const css::uno::Reference<css::accessibility::XAccessible>& xAcc)
{
setWindow(xAcc);
}
diff --git a/include/test/beans/xpropertyset.hxx b/include/test/beans/xpropertyset.hxx
index dbfac0a2e86c..645c7520fddf 100644
--- a/include/test/beans/xpropertyset.hxx
+++ b/include/test/beans/xpropertyset.hxx
@@ -27,8 +27,8 @@ class OOO_DLLPUBLIC_TEST XPropertySet
public:
XPropertySet() {}
- XPropertySet(const std::set<OUString> rIgnoreValue)
- : m_IgnoreValue(rIgnoreValue)
+ XPropertySet(std::set<OUString> rIgnoreValue)
+ : m_IgnoreValue(std::move(rIgnoreValue))
{
}
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
diff --git a/include/test/sheet/xformulaquery.hxx b/include/test/sheet/xformulaquery.hxx
index 8382e961a96a..c62eb3c406ba 100644
--- a/include/test/sheet/xformulaquery.hxx
+++ b/include/test/sheet/xformulaquery.hxx
@@ -34,7 +34,7 @@ public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
virtual css::uno::Reference<css::uno::XInterface> getXSpreadsheet() = 0;
- void setXCell(css::uno::Reference<css::table::XCell> xCell) { m_xCell = xCell; }
+ void setXCell(css::uno::Reference<css::table::XCell> xCell) { m_xCell = std::move(xCell); }
css::uno::Reference<css::table::XCell> const& getXCell() const { return m_xCell; }
void testQueryDependents();
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
index 1becb0b9ac4b..5322f2615ba3 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -157,7 +157,7 @@ class UNOTOOLS_DLLPUBLIC SvtSecurityMapPersonalInfo
{
std::unordered_map< OUString, size_t > aInfoIDs;
public:
- size_t GetInfoID( const OUString sPersonalInfo );
+ size_t GetInfoID( const OUString& sPersonalInfo );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/ucbstreamhelper.hxx b/include/unotools/ucbstreamhelper.hxx
index 3c8868c03911..6ad96621c8e9 100644
--- a/include/unotools/ucbstreamhelper.hxx
+++ b/include/unotools/ucbstreamhelper.hxx
@@ -41,11 +41,11 @@ namespace utl
public:
static std::unique_ptr<SvStream>
CreateStream(const OUString& rFileName, StreamMode eOpenMode,
- css::uno::Reference<css::awt::XWindow> xParentWin = nullptr,
+ const css::uno::Reference<css::awt::XWindow> & xParentWin = nullptr,
bool bUseSimpleFileAccessInteraction = true);
static std::unique_ptr<SvStream>
CreateStream(const OUString& rFileName, StreamMode eOpenMode, bool bFileExists,
- css::uno::Reference<css::awt::XWindow> xParentWin = nullptr,
+ const css::uno::Reference<css::awt::XWindow> & xParentWin = nullptr,
bool bUseSimpleFileAccessInteraction = true);
static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XInputStream >& xStream );
static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XStream >& xStream );
diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx
index 0c3c159dbc11..67c24dd44f90 100644
--- a/include/vcl/font/Feature.hxx
+++ b/include/vcl/font/Feature.hxx
@@ -114,7 +114,7 @@ struct Feature
// headers here, so the member types should remain compatible.
struct FeatureSetting
{
- FeatureSetting(OString feature);
+ FeatureSetting(const OString& feature);
uint32_t m_nTag;
uint32_t m_nValue;
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 79a91a629783..aa2eaeedc696 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -810,7 +810,7 @@ public:
const BitmapEx& GetBitmapEx() const { return maBmpEx; }
const Point& GetPoint() const { return maPt; }
- void SetBitmapEx(BitmapEx rBmpEx) { maBmpEx = rBmpEx; }
+ void SetBitmapEx(const BitmapEx& rBmpEx) { maBmpEx = rBmpEx; }
void SetPoint(const Point& rPt) { maPt = rPt; }
bool IsTransparent() const override { return GetBitmapEx().IsAlpha(); }
};
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index 24db3601b3c3..2d978852e0cf 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -388,7 +388,7 @@ public:
const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; }
// Get author id to remove personal info
- size_t GetInfoID( const OUString sPersonalInfo ) const { return mpAuthorIDs->GetInfoID(sPersonalInfo); }
+ size_t GetInfoID( const OUString& sPersonalInfo ) const { return mpAuthorIDs->GetInfoID(sPersonalInfo); }
// Get unit converter
const SvXMLUnitConverter& GetMM100UnitConverter() const { return maUnitConv; }
diff --git a/sc/inc/SolverSettings.hxx b/sc/inc/SolverSettings.hxx
index 2916c6ad3519..58edd20f30f2 100644
--- a/sc/inc/SolverSettings.hxx
+++ b/sc/inc/SolverSettings.hxx
@@ -184,7 +184,7 @@ private:
// Used to create or get a single constraint part
bool ReadConstraintPart(ConstraintPart ePart, tools::Long nIndex, OUString& rValue);
- void WriteConstraintPart(ConstraintPart ePart, tools::Long nIndex, OUString sValue);
+ void WriteConstraintPart(ConstraintPart ePart, tools::Long nIndex, const OUString& sValue);
// Creates or reads all named ranges associated with solver engine options
void ReadEngine();
@@ -289,7 +289,7 @@ public:
SolverSettings(ScTable& pTable);
SC_DLLPUBLIC OUString GetParameter(SolverParameter eParam);
- SC_DLLPUBLIC void SetParameter(SolverParameter eParam, OUString sValue);
+ SC_DLLPUBLIC void SetParameter(SolverParameter eParam, const OUString& sValue);
SC_DLLPUBLIC ObjectiveType GetObjectiveType() { return m_eObjType; }
SC_DLLPUBLIC void SetObjectiveType(ObjectiveType eType);
SC_DLLPUBLIC void GetEngineOptions(css::uno::Sequence<css::beans::PropertyValue>& aOptions);
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 56bd64881835..dae9e3f37485 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -79,7 +79,7 @@ private:
public:
ScDocumentLoader(const OUString& rFileName, OUString& rFilterName, OUString& rOptions,
sal_uInt32 nRekCnt = 0, weld::Window* pInteractionParent = nullptr,
- css::uno::Reference<css::io::XInputStream> xInputStream
+ const css::uno::Reference<css::io::XInputStream>& xInputStream
= css::uno::Reference<css::io::XInputStream>());
~ScDocumentLoader();
ScDocument* GetDocument();
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 3bb12e701c70..6eeb111ad25b 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -149,7 +149,7 @@ protected:
class SCQAHELPER_DLLPUBLIC ScModelTestBase : public UnoApiXmlTest
{
public:
- ScModelTestBase(OUString path)
+ ScModelTestBase(const OUString& path)
: UnoApiXmlTest(path)
{
}
diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx
index 056d439d6691..373a1c458266 100644
--- a/sc/qa/unit/ucalc_copypaste.cxx
+++ b/sc/qa/unit/ucalc_copypaste.cxx
@@ -107,7 +107,7 @@ protected:
void printValuesAndFormulasInRange(ScDocument* pDoc, const ScRange& rRange,
const OString& rCaption);
OUString getRangeByName(const OUString& aRangeName);
- ScAddress setNote(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString noteText);
+ ScAddress setNote(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& noteText);
OUString getNote(SCCOL nCol, SCROW nRow, SCTAB nTab);
};
@@ -137,7 +137,7 @@ OUString TestCopyPaste::getRangeByName(const OUString& aRangeName)
return ScUcalcTestBase::getRangeByName(m_pDoc, aRangeName);
}
-ScAddress TestCopyPaste::setNote(SCCOL nCol, SCROW nRow, SCTAB nTab, OUString noteText)
+ScAddress TestCopyPaste::setNote(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& noteText)
{
ScAddress aAdr(nCol, nRow, nTab);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aAdr);
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;
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 000e5992fa6d..1cd4fc626342 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star;
class SdModelTestBase : public UnoApiXmlTest
{
public:
- SdModelTestBase(OUString path)
+ SdModelTestBase(const OUString& path)
: UnoApiXmlTest(path)
{
}
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index 488d72a5ae1c..f8e4eea812cf 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -161,7 +161,7 @@ private:
std::unordered_map< css::uno::Reference<css::drawing::XShape>, sal_Int32 > maPlaceholderShapeToIndexMap;
// Get author id to remove personal info
- size_t GetInfoID( const OUString sPersonalInfo ) const { return mpAuthorIDs->GetInfoID(sPersonalInfo); }
+ size_t GetInfoID( const OUString& sPersonalInfo ) const { return mpAuthorIDs->GetInfoID(sPersonalInfo); }
struct AuthorComments {
sal_Int32 nId;
sal_Int32 nLastIndex;
@@ -175,7 +175,7 @@ private:
AuthorComments(sal_Int32 nId_, sal_Int32 nLastIndex_, OUString sInitials_)
: nId(nId_)
, nLastIndex(nLastIndex_)
- , sInitials(sInitials_)
+ , sInitials(std::move(sInitials_))
{
}
};
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index eb5a790cc156..ab319d6ab498 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -137,7 +137,7 @@ public:
ShapeExport& WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, sal_Int32 nReferencedPlaceholderIdx, PageType ePageType, const Reference<XPropertySet>& rXPagePropSet);
ShapeExport& WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj);
/** Writes textbody of a placeholder that references the placeholder on the master slide */
- ShapeExport& WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet);
+ ShapeExport& WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet>& xPagePropSet);
// helper parts
bool WritePlaceholder(const Reference< XShape >& xShape, PlaceholderType ePlaceholder, bool bMaster);
@@ -1884,7 +1884,7 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceShape(
}
ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody(
- PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet)
+ PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet>& xPagePropSet)
{
mpFS->startElementNS(XML_p, XML_txBody);
mpFS->singleElementNS(XML_a, XML_bodyPr);
diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx
index 37d8f79f4c7c..c08a1fd74bf1 100644
--- a/sd/source/ui/inc/drawview.hxx
+++ b/sd/source/ui/inc/drawview.hxx
@@ -45,7 +45,7 @@ public:
void CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, bool bSlide = false, bool bMaster = false) override;
- void SetMasterAttributes(SdrObject* pObject, const SdPage& rPage, SfxItemSet rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide);
+ void SetMasterAttributes(SdrObject* pObject, const SdPage& rPage, const SfxItemSet& rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide);
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index de83bfde277b..efa3cad6a619 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -282,7 +282,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
return bOk;
}
-void DrawView::SetMasterAttributes( SdrObject* pObject, const SdPage& rPage, SfxItemSet rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide )
+void DrawView::SetMasterAttributes( SdrObject* pObject, const SdPage& rPage, const SfxItemSet& rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide )
{
SdrInventor nInv = pObject->GetObjInventor();
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index f29294872577..e704d324a355 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1523,7 +1523,7 @@ SfxSlotFilterState SfxDispatcher::IsSlotEnabledByFilter_Impl( sal_uInt16 nSID )
return bFound ? SfxSlotFilterState::DISABLED : SfxSlotFilterState::ENABLED;
}
-bool SfxDispatcher::IsCommandAllowedInLokReadOnlyViewMode (OUString commandName) {
+bool SfxDispatcher::IsCommandAllowedInLokReadOnlyViewMode (const OUString & commandName) {
static constexpr OUString allowedList[] = {
u".uno:InsertAnnotation"_ustr,
u".uno:ReplyComment"_ustr,
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index f534379e53dd..60151d2c83ad 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -137,7 +137,7 @@ std::optional<OUString> sDefaultCharStyleUIName;
StyleList::StyleList(weld::Builder* pBuilder, SfxBindings* pBindings,
SfxCommonTemplateDialog_Impl* Parent, weld::Container* pC,
- OUString treeviewname, OUString flatviewname)
+ const OUString& treeviewname, const OUString& flatviewname)
: m_bHierarchical(false)
, m_bAllowReParentDrop(false)
, m_bNewByExampleDisabled(false)
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 5b6c805cfcd1..13711a5a31c5 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1745,7 +1745,7 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand(bool bLoading, bool bN
// this either returns non-null or throws exception
uno::Reference<embed::XStorage>
-SfxMedium::TryEncryptedInnerPackage(uno::Reference<embed::XStorage> const xStorage)
+SfxMedium::TryEncryptedInnerPackage(uno::Reference<embed::XStorage> const & xStorage)
{
uno::Reference<embed::XStorage> xRet;
if (xStorage->hasByName(u"encrypted-package"_ustr))
diff --git a/sfx2/source/inc/StyleList.hxx b/sfx2/source/inc/StyleList.hxx
index fe4ff6269bd5..ef2696e5fd34 100644
--- a/sfx2/source/inc/StyleList.hxx
+++ b/sfx2/source/inc/StyleList.hxx
@@ -63,7 +63,7 @@ class StyleList final : public SfxListener
public:
// Constructor
StyleList(weld::Builder* pBuilder, SfxBindings* pBindings, SfxCommonTemplateDialog_Impl* Parent,
- weld::Container* pC, OUString treeviewname, OUString flatviewname);
+ weld::Container* pC, const OUString& treeviewname, const OUString& flatviewname);
// Destructor
~StyleList();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 46b809472878..d743cd5ddd02 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -3942,7 +3942,7 @@ void SfxViewShell::setBlockedCommandList(const char* blockedCommandList)
}
}
-bool SfxViewShell::isBlockedCommand(OUString command) const
+bool SfxViewShell::isBlockedCommand(const OUString & command) const
{
return mvLOKBlockedCommandList.find(command) != mvLOKBlockedCommandList.end();
}
diff --git a/slideshow/source/engine/box2dtools.cxx b/slideshow/source/engine/box2dtools.cxx
index 93aa8936a035..5d99aef07e3e 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -267,7 +267,7 @@ void box2DWorld::createStaticFrameAroundSlide(const ::basegfx::B2DVector& rSlide
pStaticBody->CreateFixture(&aFixtureDef);
}
-void box2DWorld::setShapePosition(const css::uno::Reference<css::drawing::XShape> xShape,
+void box2DWorld::setShapePosition(const css::uno::Reference<css::drawing::XShape>& xShape,
const basegfx::B2DPoint& rOutPos)
{
const auto iter = mpXShapeToBodyMap.find(xShape);
@@ -277,7 +277,7 @@ void box2DWorld::setShapePosition(const css::uno::Reference<css::drawing::XShape
}
void box2DWorld::setShapePositionByLinearVelocity(
- const css::uno::Reference<css::drawing::XShape> xShape, const basegfx::B2DPoint& rOutPos,
+ const css::uno::Reference<css::drawing::XShape>& xShape, const basegfx::B2DPoint& rOutPos,
const double fPassedTime)
{
assert(mpBox2DWorld);
@@ -290,7 +290,7 @@ void box2DWorld::setShapePositionByLinearVelocity(
}
}
-void box2DWorld::setShapeLinearVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+void box2DWorld::setShapeLinearVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const basegfx::B2DVector& rVelocity)
{
assert(mpBox2DWorld);
@@ -300,7 +300,7 @@ void box2DWorld::setShapeLinearVelocity(const css::uno::Reference<css::drawing::
pBox2DBody->setLinearVelocity(rVelocity);
}
-void box2DWorld::setShapeAngle(const css::uno::Reference<css::drawing::XShape> xShape,
+void box2DWorld::setShapeAngle(const css::uno::Reference<css::drawing::XShape>& xShape,
const double fAngle)
{
const auto iter = mpXShapeToBodyMap.find(xShape);
@@ -310,7 +310,7 @@ void box2DWorld::setShapeAngle(const css::uno::Reference<css::drawing::XShape> x
}
void box2DWorld::setShapeAngleByAngularVelocity(
- const css::uno::Reference<css::drawing::XShape> xShape, const double fAngle,
+ const css::uno::Reference<css::drawing::XShape>& xShape, const double fAngle,
const double fPassedTime)
{
assert(mpBox2DWorld);
@@ -323,7 +323,7 @@ void box2DWorld::setShapeAngleByAngularVelocity(
}
}
-void box2DWorld::setShapeAngularVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+void box2DWorld::setShapeAngularVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const double fAngularVelocity)
{
assert(mpBox2DWorld);
@@ -333,7 +333,7 @@ void box2DWorld::setShapeAngularVelocity(const css::uno::Reference<css::drawing:
pBox2DBody->setAngularVelocity(fAngularVelocity);
}
-void box2DWorld::setShapeCollision(const css::uno::Reference<css::drawing::XShape> xShape,
+void box2DWorld::setShapeCollision(const css::uno::Reference<css::drawing::XShape>& xShape,
bool bCanCollide)
{
assert(mpBox2DWorld);
diff --git a/slideshow/source/inc/box2dtools.hxx b/slideshow/source/inc/box2dtools.hxx
index ffa95655f03b..037c5ef63b6c 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -113,7 +113,7 @@ private:
@param rOutPos
Position in LO user space coordinates
*/
- void setShapePosition(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapePosition(const css::uno::Reference<css::drawing::XShape>& xShape,
const ::basegfx::B2DPoint& rOutPos);
/** Moves shape's corresponding Box2D body to specified position
@@ -130,7 +130,7 @@ private:
@param fPassedTime
Time frame which the Box2D body should move to the specified position.
*/
- void setShapePositionByLinearVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapePositionByLinearVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const ::basegfx::B2DPoint& rOutPos,
const double fPassedTime);
@@ -145,7 +145,7 @@ private:
@param rVelocity
Velocity vector in LO user space coordinates.
*/
- void setShapeLinearVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapeLinearVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const basegfx::B2DVector& rVelocity);
/** Sets rotation angle of the shape's corresponding Box2D body
@@ -156,7 +156,8 @@ private:
@param fAngle
Angle of rotation in degrees.
*/
- void setShapeAngle(const css::uno::Reference<css::drawing::XShape> xShape, const double fAngle);
+ void setShapeAngle(const css::uno::Reference<css::drawing::XShape>& xShape,
+ const double fAngle);
/** Rotates shape's corresponding Box2D body to specified angle
@@ -173,7 +174,7 @@ private:
@param fPassedTime
Time frame which the Box2D body should rotate to the specified angle.
*/
- void setShapeAngleByAngularVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapeAngleByAngularVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const double fAngle, const double fPassedTime);
/** Sets angular velocity of the shape's corresponding Box2D body.
@@ -184,7 +185,7 @@ private:
@param fAngularVelocity
Angular velocity in degrees per second.
*/
- void setShapeAngularVelocity(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapeAngularVelocity(const css::uno::Reference<css::drawing::XShape>& xShape,
const double fAngularVelocity);
/** Sets whether a shape's corresponding Box2D body has collision in the Box2D World or not
@@ -198,7 +199,7 @@ private:
true if collisions should be enabled for the corresponding Box2D body of this shape
and false if it should be disabled.
*/
- void setShapeCollision(const css::uno::Reference<css::drawing::XShape> xShape,
+ void setShapeCollision(const css::uno::Reference<css::drawing::XShape>& xShape,
const bool bCanCollide);
/** Process the updates queued in the maShapeParallelUpdateQueue
diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx
index 06cf8a5cef31..8cf20475bd5c 100644
--- a/svl/source/misc/sharedstringpool.cxx
+++ b/svl/source/misc/sharedstringpool.cxx
@@ -23,7 +23,7 @@ struct StringWithHash
OUString str;
sal_Int32 hashCode;
StringWithHash(OUString s)
- : str(s)
+ : str(std::move(s))
, hashCode(s.hashCode())
{
}
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index 2415886e0f23..82918676b649 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -411,7 +411,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st
return xAccCfg;
}
-css::uno::Reference<css::ui::XAcceleratorConfiguration> AcceleratorExecute::lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString sModule)
+css::uno::Reference<css::ui::XAcceleratorConfiguration> AcceleratorExecute::lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const OUString& sModule)
{
css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier(css::ui::theModuleUIConfigurationManagerSupplier::get(rxContext));
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 47ab375e6037..d3858706cdf2 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -60,7 +60,8 @@ protected:
sal_uInt8 countShapes();
// fX and fY are positions relative to the size of the bitmap of the shape
// Thus the position is independent from DPI
- Color getColor(uno::Reference<drawing::XShape> xShape, const double& fX, const double& fY);
+ Color getColor(const uno::Reference<drawing::XShape>& xShape, const double& fX,
+ const double& fY);
};
uno::Reference<drawing::XShape> CustomshapesTest::getShape(sal_uInt8 nShapeIndex)
@@ -87,7 +88,7 @@ sal_uInt8 CustomshapesTest::countShapes()
return xDrawPage->getCount();
}
-Color CustomshapesTest::getColor(uno::Reference<drawing::XShape> xShape, const double& fX,
+Color CustomshapesTest::getColor(const uno::Reference<drawing::XShape>& xShape, const double& fX,
const double& fY)
{
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, u"image/png"_ustr,
diff --git a/svx/source/dialog/FileExportedDialog.cxx b/svx/source/dialog/FileExportedDialog.cxx
index b38ed3ae11b8..0cc2a94dd874 100644
--- a/svx/source/dialog/FileExportedDialog.cxx
+++ b/svx/source/dialog/FileExportedDialog.cxx
@@ -16,7 +16,7 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecute.hpp>
-FileExportedDialog::FileExportedDialog(weld::Window* pParent, OUString atitle)
+FileExportedDialog::FileExportedDialog(weld::Window* pParent, const OUString& atitle)
: GenericDialogController(pParent, u"svx/ui/fileexporteddialog.ui"_ustr,
u"FileExportedDialog"_ustr)
, m_xFileLabel(m_xBuilder->weld_label(u"Filelabel"_ustr))
@@ -40,4 +40,4 @@ IMPL_LINK_NOARG(FileExportedDialog, OpenHdl, weld::Button&, void)
TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:");
}
m_xDialog->response(RET_OK);
-} \ No newline at end of file
+}
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index cb3893d36cbb..287cb4933eaf 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -3436,7 +3436,7 @@ sal_Bool SAL_CALL FormController::supportsMode(const OUString& Mode)
return comphelper::findValue(aModes, Mode) != -1;
}
-css::uno::Reference<css::awt::XWindow> FormController::getDialogParentWindow(css::uno::Reference<css::form::runtime::XFormController> xFormController)
+css::uno::Reference<css::awt::XWindow> FormController::getDialogParentWindow(const css::uno::Reference<css::form::runtime::XFormController> & xFormController)
{
try
{
diff --git a/svx/source/inc/formcontroller.hxx b/svx/source/inc/formcontroller.hxx
index 22e3bcb432a9..d839cbe96837 100644
--- a/svx/source/inc/formcontroller.hxx
+++ b/svx/source/inc/formcontroller.hxx
@@ -203,7 +203,7 @@ namespace svxform
FormController( const css::uno::Reference< css::uno::XComponentContext > & _rxORB );
// returns the window which should be used as parent window for dialogs
- static css::uno::Reference<css::awt::XWindow> getDialogParentWindow(css::uno::Reference<css::form::runtime::XFormController> xFormController);
+ static css::uno::Reference<css::awt::XWindow> getDialogParentWindow(const css::uno::Reference<css::form::runtime::XFormController> & xFormController);
private:
virtual ~FormController() override;
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index bf66375f41e6..5f3f65fe38e3 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -175,7 +175,7 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
mpPreRenderDevice->EnableMapMode(bMapModeWasEnabledSource);
}
-void SdrPaintView::InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager)
+void SdrPaintView::InitOverlayManager(const rtl::Reference<sdr::overlay::OverlayManager> & xOverlayManager)
{
Color aColA(SvtOptionsDrawinglayer::GetStripeColorA());
Color aColB(SvtOptionsDrawinglayer::GetStripeColorB());
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 55b717a17aab..f9c3716b9d60 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -457,7 +457,7 @@ rtl::Reference<SdrPathObj> SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyP
return pPathObj;
}
-rtl::Reference<SdrObject> SdrTextObj::ImpConvertAddText(rtl::Reference<SdrObject> pObj, bool bBezier) const
+rtl::Reference<SdrObject> SdrTextObj::ImpConvertAddText(const rtl::Reference<SdrObject> & pObj, bool bBezier) const
{
if(!ImpCanConvTextToCurve())
{
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index c28ce241a8f1..eb02a95c0e30 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -366,7 +366,7 @@ public:
void SwitchFormulasToInternalRepresentation()
{ UpdateFields(TBL_BOXPTR); }
void Merge(SwTable& rTable, SwHistory* pHistory);
- void Split(OUString sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory);
+ void Split(const OUString& sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory);
static void GatherFormulas(SwDoc& rDoc, std::vector<SwTableBoxFormula*>& rvFormulas);
diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index a43777c2e519..62be491c94d9 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -66,7 +66,7 @@ public:
static void create(SwFrameFormat* pShape, SdrObject* pObject, bool bCopyText = false);
/// Sets the given textframe as textbox for the given (group member) shape.
static void set(SwFrameFormat* pShape, SdrObject* pObject,
- css::uno::Reference<css::text::XTextFrame> xNew);
+ const css::uno::Reference<css::text::XTextFrame>& xNew);
/// Destroy a TextBox for a shape. If the format has more textboxes
/// like group shapes, it will destroy only that textbox what belongs
/// to the given pObject shape.
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index 4f68b9ef0201..842b378e6cb9 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -41,7 +41,7 @@ public:
virtual const sal_Int32* GetEnd() const override; // SwTextAttr
virtual void SetEnd(sal_Int32) override; // SwTextAttr
- void UpdateFieldContent(SwDoc* pDoc, SwWrtShell& rWrtSh, OUString aContent);
+ void UpdateFieldContent(SwDoc* pDoc, SwWrtShell& rWrtSh, const OUString& aContent);
// get and set TextNode pointer
inline const SwTextNode& GetTextNode() const;
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index eea78fe54b72..e00ff8e38c01 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -142,7 +142,7 @@ namespace sw
{ return get(); }
SwUnoCursor& operator*() const
{ return *get(); }
- UnoCursorPointer& operator=(UnoCursorPointer aOther)
+ UnoCursorPointer& operator=(const UnoCursorPointer& aOther)
{
if (m_pCursor)
{
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index c57d8d228f92..3eba3163d333 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -647,7 +647,7 @@ public:
std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
OUString GetDataSourceName() const;
- static bool IsDataSourceAvailable(const OUString sDataSourceName);
+ static bool IsDataSourceAvailable(const OUString& sDataSourceName);
void ExecFormatPaintbrush(SfxRequest const &);
void StateFormatPaintbrush(SfxItemSet &);
diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx
index c5b9abaef25d..3ff243c2c11c 100644
--- a/sw/qa/inc/swmodeltestbase.hxx
+++ b/sw/qa/inc/swmodeltestbase.hxx
@@ -78,7 +78,7 @@ protected:
OUString mpFilter;
/// Copy&paste helper.
- void paste(std::u16string_view aFilename, OUString aInstance, css::uno::Reference<css::text::XTextRange> const& xTextRange);
+ void paste(std::u16string_view aFilename, const OUString& aInstance, css::uno::Reference<css::text::XTextRange> const& xTextRange);
public:
SwModelTestBase(const OUString& pTestDocumentPath = OUString(), const OUString& pFilter = {});
diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx
index b53f19d7f454..88156bb58eb0 100644
--- a/sw/qa/unit/swmodeltestbase.cxx
+++ b/sw/qa/unit/swmodeltestbase.cxx
@@ -37,7 +37,7 @@
using namespace css;
-void SwModelTestBase::paste(std::u16string_view aFilename, OUString aInstance,
+void SwModelTestBase::paste(std::u16string_view aFilename, const OUString& aInstance,
uno::Reference<text::XTextRange> const& xTextRange)
{
uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance(aInstance),
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 4f34b9e61a47..9ef42c1ba407 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -232,7 +232,7 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, SdrObject* pObject, bool bCo
}
void SwTextBoxHelper::set(SwFrameFormat* pShapeFormat, SdrObject* pObj,
- uno::Reference<text::XTextFrame> xNew)
+ const uno::Reference<text::XTextFrame>& xNew)
{
// Do not set invalid data
assert(pShapeFormat && pObj && xNew);
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 2e5056b6bbaa..ec439961d788 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1754,7 +1754,7 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT,
const sal_uInt32 nParentId,
const sal_uInt32 nParaId,
const sal_uInt32 nParentPostItId,
- const OUString aParentName
+ OUString aParentName
)
: SwField( pT )
, m_sText( std::move(aText) )
@@ -1766,7 +1766,7 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT,
, m_nParentId( nParentId )
, m_nParaId( nParaId )
, m_nParentPostItId ( nParentPostItId )
- , m_sParentName( aParentName )
+ , m_sParentName( std::move(aParentName) )
{
m_nPostItId = nPostItId == 0 ? s_nLastPostItId++ : nPostItId;
}
diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx
index 91108eb464ac..cb63789d492c 100644
--- a/sw/source/core/inc/unometa.hxx
+++ b/sw/source/core/inc/unometa.hxx
@@ -93,7 +93,7 @@ public:
static rtl::Reference<SwXMeta>
CreateXMeta(
::sw::Meta & rMeta,
- css::uno::Reference<SwXText> xParentText,
+ const css::uno::Reference<SwXText>& xParentText,
std::unique_ptr<TextRangeList_t const> && pPortions);
static rtl::Reference<SwXMeta>
@@ -194,7 +194,7 @@ private:
friend rtl::Reference<SwXMeta>
SwXMeta::CreateXMeta(::sw::Meta &,
- css::uno::Reference<SwXText>,
+ const css::uno::Reference<SwXText>&,
std::unique_ptr<TextRangeList_t const> && pPortions);
SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta,
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 0b91e902413a..3a24d194339c 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1653,7 +1653,7 @@ void SwTable::GatherFormulas(SwDoc& rDoc, std::vector<SwTableBoxFormula*>& rvFor
}
}
-void SwTable::Split(OUString sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory)
+void SwTable::Split(const OUString& sNewTableName, sal_uInt16 nSplitLine, SwHistory* pHistory)
{
SwTableFormulaUpdate aHint(this);
aHint.m_eFlags = TBL_SPLITTBL;
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 4df7d15ab375..5a12e0662b4c 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -171,7 +171,7 @@ void SwTextRefMark::SetEnd(sal_Int32 n)
}
}
-void SwTextRefMark::UpdateFieldContent(SwDoc* pDoc, SwWrtShell& rWrtSh, OUString aContent)
+void SwTextRefMark::UpdateFieldContent(SwDoc* pDoc, SwWrtShell& rWrtSh, const OUString& aContent)
{
if (!this->End())
{
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index b5aa314be008..ac167a11e5fc 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -672,7 +672,7 @@ SwXMeta::CreateXMeta(SwDoc & rDoc, bool const isField)
rtl::Reference<SwXMeta>
SwXMeta::CreateXMeta(::sw::Meta & rMeta,
- css::uno::Reference<SwXText> i_xParent,
+ const css::uno::Reference<SwXText>& i_xParent,
std::unique_ptr<TextRangeList_t const> && pPortions)
{
// re-use existing SwXMeta
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index b99a8a2be759..2518a9a5678c 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -182,7 +182,7 @@ constexpr ParagraphStyleCategoryEntry sParagraphStyleCategoryEntries[]
class StyleFamilyEntry
{
public:
- template <SfxStyleFamily f> static StyleFamilyEntry Create(sal_uInt16 nPropMapType, SwGetPoolIdFromName aPoolId, OUString sName, TranslateId pResId)
+ template <SfxStyleFamily f> static StyleFamilyEntry Create(sal_uInt16 nPropMapType, SwGetPoolIdFromName aPoolId, const OUString& sName, TranslateId pResId)
{
return StyleFamilyEntry(f, nPropMapType, aPoolId, sName, pResId, GetCountOrName<f>, TranslateIndex<f>);
}
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index fd5f08a20d61..7ed6457d6339 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -317,7 +317,7 @@ public:
void SetFloatingTableFrame(const ww8::Frame* pF) { m_pFloatingTableFrame = pF; }
// Get author id to remove personal info
- size_t GetInfoID( const OUString sPersonalInfo ) const { return m_pAuthorIDs->GetInfoID(sPersonalInfo); }
+ size_t GetInfoID( const OUString& sPersonalInfo ) const { return m_pAuthorIDs->GetInfoID(sPersonalInfo); }
// needed in docxsdrexport.cxx and docxattributeoutput.cxx
sal_Int32 getWordCompatibilityModeFromGrabBag() const;
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index b9a7c1cbdade..71d242ef8647 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -205,7 +205,7 @@ public:
const SfxItemSet* GetFirstPageItemSet() const { return m_pFirstPageItemSet; }
// Get author id to remove personal info
- size_t GetInfoID(const OUString sPersonalInfo) const
+ size_t GetInfoID(const OUString& sPersonalInfo) const
{
return mpAuthorIDs->GetInfoID(sPersonalInfo);
}
diff --git a/sw/source/uibase/sidebar/CommentsPanel.hxx b/sw/source/uibase/sidebar/CommentsPanel.hxx
index 3d2bbc9ac87a..cd8eebb0b42a 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.hxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.hxx
@@ -87,7 +87,7 @@ public:
bool mbResolved;
void InitControls(const SwPostItField* pPostItField);
- void SetCommentText(OUString sText) { msText = sText; }
+ void SetCommentText(OUString sText) { msText = std::move(sText); }
const OUString& GetAuthor() { return msAuthor; }
const Date& GetDate() { return maDate; }
};
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index dfca448da361..02722177646d 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -2026,7 +2026,7 @@ OUString SwView::GetDataSourceName() const
return sDataSourceName;
}
-bool SwView::IsDataSourceAvailable(const OUString sDataSourceName)
+bool SwView::IsDataSourceAvailable(const OUString& sDataSourceName)
{
const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< XDatabaseContext> xDatabaseContext = DatabaseContext::create(xContext);
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 393ca160feca..fa4d6b3d7eae 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -190,7 +190,7 @@ private:
public:
SwNumberInputDlg(weld::Window* pParent, const OUString& rTitle,
const OUString& rLabel1, const sal_Int64 nValue, const sal_Int64 min, const sal_Int64 max,
- OUString rLabel2 = OUString())
+ const OUString& rLabel2 = OUString())
: SfxDialogController(pParent, u"modules/swriter/ui/numberinput.ui"_ustr, u"NumberInputDialog"_ustr)
, m_xLabel1(m_xBuilder->weld_label(u"label1"_ustr))
, m_xSpinButton(m_xBuilder->weld_spin_button(u"spinbutton"_ustr))
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
index 6989ae844f4f..58658ba927c8 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
@@ -1079,7 +1079,7 @@ static bool isAbsent(const std::vector<beans::PropertyValue>& propvals, const OU
// table style has got bigger precedence than docDefault style,
// but lower precedence than the paragraph styles and direct paragraph formatting
-void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableParaProperties, const css::beans::PropertyValues rCellProperties)
+void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableParaProperties, const css::beans::PropertyValues& rCellProperties)
{
// Setting paragraph or character properties using setPropertyValue may have unwanted
// side effects; e.g., setting a paragraph's font size can reset font size in a runs
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.hxx b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.hxx
index 39c89b7b569a..cedb45b9459c 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.hxx
@@ -87,7 +87,7 @@ public:
*/
void startTable(const TablePropertyMapPtr& pProps);
- void ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableProperties, const css::beans::PropertyValues rCellProperties);
+ void ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableProperties, const css::beans::PropertyValues & rCellProperties);
/// Handle end of table.
void endTable(unsigned int nestedTableLevel);
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx b/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx
index 329b876b43d2..c5552fb35d50 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableManager.hxx
@@ -141,7 +141,7 @@ public:
// setMoved() writes the first level from these two levels
// i.e. second startLevel() hasn't been called, yet.)
// TODO: check drag & drop of only a part of the tables.
- void setMoved(OUString sMoved)
+ void setMoved(const OUString& sMoved)
{
if ( m_aMoved.empty() )
return;
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 211a8c074989..f774cf3b0ebd 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -4415,8 +4415,8 @@ static void lcl_PasteRedlines(
}
bool DomainMapper_Impl::CopyTemporaryNotes(
- rtl::Reference< SwXFootnote > xNoteSrc,
- rtl::Reference< SwXFootnote > xNoteDest )
+ const rtl::Reference< SwXFootnote > & xNoteSrc,
+ const rtl::Reference< SwXFootnote > & xNoteDest )
{
if (!m_bSaxError && xNoteSrc != xNoteDest)
{
@@ -6000,7 +6000,7 @@ void DomainMapper_Impl::PopTextBoxContent()
}
}
-void DomainMapper_Impl::AttachTextBoxContentToShape(css::uno::Reference<css::drawing::XShape> xShape)
+void DomainMapper_Impl::AttachTextBoxContentToShape(const css::uno::Reference<css::drawing::XShape> & xShape)
{
// Without textbox or shape pointless to continue
if (m_xPendingTextBoxFrames.empty() || !xShape)
@@ -7510,8 +7510,8 @@ void DomainMapper_Impl::handleToc
}
rtl::Reference<SwXSection> DomainMapper_Impl::createSectionForRange(
- uno::Reference< css::text::XTextRange > xStart,
- uno::Reference< css::text::XTextRange > xEnd,
+ const uno::Reference< css::text::XTextRange > & xStart,
+ const uno::Reference< css::text::XTextRange > & xEnd,
std::u16string_view sObjectType,
bool stepLeft)
{
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
index 8f49e41233d4..9d5274d7ed62 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
@@ -761,7 +761,7 @@ public:
void PushTextBoxContent();
void PopTextBoxContent();
- void AttachTextBoxContentToShape(css::uno::Reference<css::drawing::XShape> xShape);
+ void AttachTextBoxContentToShape(const css::uno::Reference<css::drawing::XShape> & xShape);
void RemoveDummyParaForTableInSection();
void AddDummyParaForTableInSection();
@@ -968,8 +968,8 @@ public:
sal_Int32 GetEndnoteCount() const { return m_nEndnotes; }
void IncrementEndnoteCount() { ++m_nEndnotes; }
bool CopyTemporaryNotes(
- rtl::Reference< SwXFootnote > xNoteSrc,
- rtl::Reference< SwXFootnote > xNoteDest );
+ const rtl::Reference< SwXFootnote > & xNoteSrc,
+ const rtl::Reference< SwXFootnote > & xNoteDest );
void RemoveTemporaryFootOrEndnotes();
void PushAnnotation();
@@ -1032,8 +1032,8 @@ public:
/// Returns title of the TOC placed in paragraph(s) before TOC field inside STD-frame
OUString extractTocTitle();
rtl::Reference<SwXSection> createSectionForRange(
- css::uno::Reference< css::text::XTextRange > xStart,
- css::uno::Reference< css::text::XTextRange > xEnd,
+ const css::uno::Reference< css::text::XTextRange > & xStart,
+ const css::uno::Reference< css::text::XTextRange > & xEnd,
std::u16string_view sObjectType, bool stepLeft);
void SetBookmarkName( const OUString& rBookmarkName );
diff --git a/sw/source/writerfilter/dmapper/PropertyMap.hxx b/sw/source/writerfilter/dmapper/PropertyMap.hxx
index 9268d32609ee..14e37c48b5cb 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.hxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.hxx
@@ -414,7 +414,7 @@ public:
void SetPaperSource(sal_Int32 first, sal_Int32 other) { m_nPaperSourceFirst = first; m_nPaperSourceOther = other;}
- void addRelativeWidthShape( css::uno::Reference<css::drawing::XShape> xShape ) { m_xRelativeWidthShapes.push_back( xShape ); }
+ void addRelativeWidthShape( const css::uno::Reference<css::drawing::XShape>& xShape ) { m_xRelativeWidthShapes.push_back( xShape ); }
// determine which style gets the borders
void ApplyBorderToPageStyles( DomainMapper_Impl &rDM_Impl,
diff --git a/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx b/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx
index 852c91c341be..cdf4ccbcf592 100644
--- a/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx
+++ b/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx
@@ -83,14 +83,14 @@ XAccessibleEventBroadcasterTester::XAccessibleEventBroadcasterTester(
}
bool XAccessibleEventBroadcasterTester::isTransient(
- const uno::Reference<accessibility::XAccessibleEventBroadcaster> xBroadcaster)
+ const uno::Reference<accessibility::XAccessibleEventBroadcaster>& xBroadcaster)
{
uno::Reference<accessibility::XAccessibleContext> xCtx(xBroadcaster, uno::UNO_QUERY_THROW);
return isTransient(xCtx);
}
bool XAccessibleEventBroadcasterTester::isTransient(
- const uno::Reference<accessibility::XAccessibleContext> xCtx)
+ const uno::Reference<accessibility::XAccessibleContext>& xCtx)
{
return ((xCtx->getAccessibleStateSet() & accessibility::AccessibleStateType::TRANSIENT)
&& (xCtx->getAccessibleParent()->getAccessibleContext()->getAccessibleStateSet()
diff --git a/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.hxx b/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.hxx
index 0fc7c23bd3e0..5642d10005c2 100644
--- a/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.hxx
+++ b/toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.hxx
@@ -31,8 +31,9 @@ private:
const css::uno::Reference<css::awt::XWindow> mxWindow;
static bool isTransient(
- const css::uno::Reference<css::accessibility::XAccessibleEventBroadcaster> xBroadcaster);
- static bool isTransient(const css::uno::Reference<css::accessibility::XAccessibleContext> xCtx);
+ const css::uno::Reference<css::accessibility::XAccessibleEventBroadcaster>& xBroadcaster);
+ static bool
+ isTransient(const css::uno::Reference<css::accessibility::XAccessibleContext>& xCtx);
void fireEvent();
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 1ee00678c54a..263a32808aec 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -413,7 +413,7 @@ void SetOption( EOption eOption, bool bValue )
// map personal info strings to 1, 2, ... to remove personal info
-size_t SvtSecurityMapPersonalInfo::GetInfoID( const OUString sPersonalInfo )
+size_t SvtSecurityMapPersonalInfo::GetInfoID( const OUString& sPersonalInfo )
{
auto aIter = aInfoIDs.find( sPersonalInfo );
if ( aIter == aInfoIDs.end() )
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index f68a503370c1..cb713f938003 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -139,7 +139,7 @@ static std::unique_ptr<SvStream> lcl_CreateStream( const OUString& rFileName, St
std::unique_ptr<SvStream>
UcbStreamHelper::CreateStream(const OUString& rFileName, StreamMode eOpenMode,
- css::uno::Reference<css::awt::XWindow> xParentWin,
+ const css::uno::Reference<css::awt::XWindow>& xParentWin,
bool bUseSimpleFileAccessInteraction)
{
// related tdf#99312
@@ -157,7 +157,7 @@ UcbStreamHelper::CreateStream(const OUString& rFileName, StreamMode eOpenMode,
std::unique_ptr<SvStream>
UcbStreamHelper::CreateStream(const OUString& rFileName, StreamMode eOpenMode, bool bFileExists,
- css::uno::Reference<css::awt::XWindow> xParentWin,
+ const css::uno::Reference<css::awt::XWindow> & xParentWin,
bool bUseSimpleFileAccessInteraction)
{
// related tdf#99312
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 33bf2ccb6bd3..3d3b8d3ab3e5 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -132,9 +132,9 @@ private:
OString generateCloseMessage() const;
OString generateActionMessage(VclPtr<vcl::Window> pWindow,
std::unique_ptr<jsdialog::ActionDataMap> pData) const;
- OString generatePopupMessage(VclPtr<vcl::Window> pWindow, OUString sParentId,
- OUString sCloseId) const;
- OString generateClosePopupMessage(OUString sWindowId) const;
+ OString generatePopupMessage(VclPtr<vcl::Window> pWindow, const OUString& sParentId,
+ const OUString& sCloseId) const;
+ OString generateClosePopupMessage(const OUString& sWindowId) const;
};
class JSDialogSender
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 92e5452e0c70..2a1fb1febcae 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -852,7 +852,7 @@ private:
/* the buffer where the data are encrypted, dynamically allocated */
std::vector<sal_uInt8> m_vEncryptionBuffer;
- void addRoleMap(OString aAlias, PDFWriter::StructElement eType);
+ void addRoleMap(const OString& aAlias, PDFWriter::StructElement eType);
/* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
void checkAndEnableStreamEncryption( sal_Int32 nObject ) override;
diff --git a/vcl/inc/qt5/QtAccessibleRegistry.hxx b/vcl/inc/qt5/QtAccessibleRegistry.hxx
index ed04dddb85b2..00f6ba0a5762 100644
--- a/vcl/inc/qt5/QtAccessibleRegistry.hxx
+++ b/vcl/inc/qt5/QtAccessibleRegistry.hxx
@@ -32,10 +32,10 @@ private:
public:
/** Returns the related QObject* for the XAccessible. Creates a new one if none exists yet. */
- static QObject* getQObject(css::uno::Reference<XAccessible> xAcc);
- static void insert(css::uno::Reference<XAccessible> xAcc, QObject* pQObject);
+ static QObject* getQObject(const css::uno::Reference<XAccessible>& xAcc);
+ static void insert(const css::uno::Reference<XAccessible>& xAcc, QObject* pQObject);
/** Removes the entry for the given XAccessible. */
- static void remove(css::uno::Reference<XAccessible> xAcc);
+ static void remove(const css::uno::Reference<XAccessible>& xAcc);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/inc/qt5/QtAccessibleWidget.hxx b/vcl/inc/qt5/QtAccessibleWidget.hxx
index 5c4fc8086dfa..c02411ba2556 100644
--- a/vcl/inc/qt5/QtAccessibleWidget.hxx
+++ b/vcl/inc/qt5/QtAccessibleWidget.hxx
@@ -51,7 +51,7 @@ class QtAccessibleWidget final : public QAccessibleInterface,
public QAccessibleValueInterface
{
public:
- QtAccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible> xAccessible,
+ QtAccessibleWidget(const css::uno::Reference<css::accessibility::XAccessible>& xAccessible,
QObject* pObject);
void invalidate();
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 797247fef13e..d1ce9311c904 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -193,8 +193,9 @@ JSDialogNotifyIdle::generateActionMessage(VclPtr<vcl::Window> pWindow,
return aJsonWriter.finishAndGetAsOString();
}
-OString JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow, OUString sParentId,
- OUString sCloseId) const
+OString JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow,
+ const OUString& sParentId,
+ const OUString& sCloseId) const
{
if (!pWindow || !m_aNotifierWindow)
return OString();
@@ -242,7 +243,7 @@ OString JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow, OU
return aJsonWriter.finishAndGetAsOString();
}
-OString JSDialogNotifyIdle::generateClosePopupMessage(OUString sWindowId) const
+OString JSDialogNotifyIdle::generateClosePopupMessage(const OUString& sWindowId) const
{
if (!m_aNotifierWindow)
return OString();
diff --git a/vcl/qt5/QtAccessibleRegistry.cxx b/vcl/qt5/QtAccessibleRegistry.cxx
index 28a54d2b2436..b8b117220b0d 100644
--- a/vcl/qt5/QtAccessibleRegistry.cxx
+++ b/vcl/qt5/QtAccessibleRegistry.cxx
@@ -14,7 +14,7 @@
std::map<XAccessible*, QObject*> QtAccessibleRegistry::m_aMapping = {};
-QObject* QtAccessibleRegistry::getQObject(css::uno::Reference<XAccessible> xAcc)
+QObject* QtAccessibleRegistry::getQObject(const css::uno::Reference<XAccessible>& xAcc)
{
if (!xAcc.is())
return nullptr;
@@ -30,13 +30,13 @@ QObject* QtAccessibleRegistry::getQObject(css::uno::Reference<XAccessible> xAcc)
return pQtAcc;
}
-void QtAccessibleRegistry::insert(css::uno::Reference<XAccessible> xAcc, QObject* pQObject)
+void QtAccessibleRegistry::insert(const css::uno::Reference<XAccessible>& xAcc, QObject* pQObject)
{
assert(pQObject);
m_aMapping.emplace(xAcc.get(), pQObject);
}
-void QtAccessibleRegistry::remove(css::uno::Reference<XAccessible> xAcc)
+void QtAccessibleRegistry::remove(const css::uno::Reference<XAccessible>& xAcc)
{
assert(xAcc.is());
m_aMapping.erase(xAcc.get());
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index a9b567ca43af..7438c5e368d1 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -63,7 +63,7 @@ using namespace css;
using namespace css::accessibility;
using namespace css::uno;
-QtAccessibleWidget::QtAccessibleWidget(const Reference<XAccessible> xAccessible, QObject* pObject)
+QtAccessibleWidget::QtAccessibleWidget(const Reference<XAccessible>& xAccessible, QObject* pObject)
: m_xAccessible(xAccessible)
, m_pObject(pObject)
{
diff --git a/vcl/source/font/Feature.cxx b/vcl/source/font/Feature.cxx
index ece71df8ed8a..f9f35682c15e 100644
--- a/vcl/source/font/Feature.cxx
+++ b/vcl/source/font/Feature.cxx
@@ -41,7 +41,7 @@ Feature::Feature(uint32_t nCode, FeatureType eType)
}
// FeatureSetting
-FeatureSetting::FeatureSetting(OString feature)
+FeatureSetting::FeatureSetting(const OString& feature)
: m_nTag(0)
, m_nValue(0)
, m_nStart(0)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index e202cce65b47..88a9853ca392 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10837,7 +10837,7 @@ const char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType )
return it != aTagStrings.end() ? it->second : "Div";
}
-void PDFWriterImpl::addRoleMap(OString aAlias, PDFWriter::StructElement eType)
+void PDFWriterImpl::addRoleMap(const OString& aAlias, PDFWriter::StructElement eType)
{
OString aTag = getStructureTag(eType);
// For PDF/UA it's not allowed to map an alias with the same name.