summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-11 22:04:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-12 11:15:45 +0100
commit134afb333ace20672531e464f4e21f1d00cf7bee (patch)
tree28026cdede4b44254af30635aa25dceaeaa187d4 /sc/source/ui
parent33c2a79f141cd20078f82dba5a9292dd6046df6e (diff)
clang-tidy: performance-unnecessary-copy-initialization in sc
Change-Id: I5d4b2190af6373772fcea7c8427454170fde2e6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx4
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx4
-rw-r--r--sc/source/ui/view/tabvwsha.cxx2
-rw-r--r--sc/source/ui/view/tabvwshb.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx5
-rw-r--r--sc/source/ui/view/viewfun6.cxx5
9 files changed, 13 insertions, 15 deletions
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index d62aff05b79c..27b2e28b44d8 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -95,7 +95,7 @@ bool lclFillListBox(weld::TreeView& rLBox, const vector<ScDPLabelData::Member>&
rLBox.append();
int pos = rLBox.n_children() - 1;
rLBox.set_toggle(pos, TRISTATE_FALSE);
- OUString aName = rMember.getDisplayName();
+ const OUString& aName = rMember.getDisplayName();
if (!aName.isEmpty())
rLBox.set_text(pos, aName, 0);
else
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 83fd3d7227c0..728865a43f4d 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -276,7 +276,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell& rViewSh,
if ( pReqArgs &&
(pGraphicItem = pReqArgs->GetItemIfSet( SID_INSERT_GRAPHIC, true )) )
{
- OUString aFileName = pGraphicItem->GetValue();
+ const OUString& aFileName = pGraphicItem->GetValue();
OUString aFilterName;
if ( const SfxStringItem* pFilterItem = pReqArgs->GetItemIfSet( FN_PARAM_FILTER ) )
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 782b08b87d47..b93d10aec8fc 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -317,7 +317,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
bool bFlag = false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange(*pDoc);
- OUString aUser=pScChangeAction->GetUser();
+ const OUString& aUser=pScChangeAction->GetUser();
DateTime aDateTime=pScChangeAction->GetDateTime();
ScChangeActionType eType=pScChangeAction->GetType();
@@ -513,7 +513,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendFilteredAction(
bool bFlag = false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange(*pDoc);
- OUString aUser=pScChangeAction->GetUser();
+ const OUString& aUser=pScChangeAction->GetUser();
DateTime aDateTime=pScChangeAction->GetDateTime();
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index b3cc8e543c3e..014a7632ea49 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -85,7 +85,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent,
for (sal_Int32 nImpl=0; nImpl<nImplCount; ++nImpl)
{
OUString aImplName( maImplNames[nImpl] );
- OUString aDescription( rDescriptions[nImpl] ); // user-visible descriptions in list box
+ const OUString& aDescription( rDescriptions[nImpl] ); // user-visible descriptions in list box
m_xLbEngine->append_text(aDescription);
if ( aImplName == maEngine )
nSelect = nImpl;
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 5dc82b93bff0..cbd7ebbecda5 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -536,7 +536,7 @@ void PivotTableDataProvider::collectPivotTableData()
size_t i = 0;
for (ValueAndFormat & rItem : rDataRow)
{
- OUString sName = aDataFieldNamesVectors[i];
+ const OUString& sName = aDataFieldNamesVectors[i];
sal_Int32 nNumberFormat = aDataFieldNumberFormatMap[sName];
rItem.m_nNumberFormat = nNumberFormat;
i++;
@@ -548,7 +548,7 @@ void PivotTableDataProvider::collectPivotTableData()
size_t i = 0;
for (std::vector<ValueAndFormat> & rDataRow : m_aDataRowVector)
{
- OUString sName = aDataFieldNamesVectors[i];
+ const OUString& sName = aDataFieldNamesVectors[i];
sal_Int32 nNumberFormat = aDataFieldNumberFormatMap[sName];
for (ValueAndFormat & rItem : rDataRow)
{
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 0437ca0d6da8..2fc2d2d576d2 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -972,7 +972,7 @@ void ScTabViewShell::ExecStyle( SfxRequest& rReq )
eFamily = static_cast<SfxStyleFamily>(pFamItem->GetValue());
else if ( pArgs && (pFamilyNameItem = pArgs->GetItemIfSet( SID_STYLE_FAMILYNAME )) )
{
- OUString sFamily = pFamilyNameItem->GetValue();
+ const OUString& sFamily = pFamilyNameItem->GetValue();
if (sFamily == "CellStyles")
eFamily = SfxStyleFamily::Para;
else if (sFamily == "PageStyles")
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index a2b5fb9e8873..3b1bf47dc238 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -74,7 +74,7 @@ void ScTabViewShell::ConnectObject( const SdrOle2Obj* pObj )
{
// is called from paint
- uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
+ const uno::Reference < embed::XEmbeddedObject >& xObj = pObj->GetObjRef();
vcl::Window* pWin = GetActiveWin();
// when already connected do not execute SetObjArea/SetSizeScale again
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 7e944557856f..1e8a19021c08 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -857,11 +857,10 @@ OUString ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSub
if(!rRangeList.empty())
{
- ScRangeList aRangeList = rRangeList;
- size_t ListSize = aRangeList.size();
+ size_t ListSize = rRangeList.size();
for ( size_t i = 0; i < ListSize; ++i )
{
- const ScRange & r = aRangeList[i];
+ const ScRange & r = rRangeList[i];
if (i != 0)
aArray.AddOpCode(ocSep);
ScComplexRefData aRef;
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index ca636813f139..510ab6f0ab51 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -142,13 +142,12 @@ void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges)
ScViewData& rView = GetViewData();
ScDocShell* pDocSh = rView.GetDocShell();
- ScRangeList aRanges(rRanges);
ScRangeList aRangesToMark;
ScAddress aCurPos = rView.GetCurPos();
- size_t ListSize = aRanges.size();
+ size_t ListSize = rRanges.size();
for ( size_t i = 0; i < ListSize; ++i )
{
- const ScRange & r = aRanges[i];
+ const ScRange & r = rRanges[i];
// Collect only those ranges that are on the same sheet as the current
// cursor.
if (r.aStart.Tab() == aCurPos.Tab())