summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-19 21:50:40 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-20 16:40:49 +0200
commit0999687367a673d08d836c1cd47b4b0339d7ee2e (patch)
treecd0bd787b73cd2138c19fbd66f514ed3d06c29e4
parent3e93e4ac7cdf135b5c331bba7feb4b884ba7441c (diff)
cid#1607830 Use of auto that causes a copy
and cid#1607722 Use of auto that causes a copy cid#1557606 Use of auto that causes a copy cid#1557569 Use of auto that causes a copy cid#1556239 Use of auto that causes a copy cid#1556043 Use of auto that causes a copy cid#1554961 Use of auto that causes a copy cid#1554818 Use of auto that causes a copy Change-Id: I9f74c7bc4da2c6b1df80d0fb4504dd4d03eb1053 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170784 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx8
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx4
-rw-r--r--sd/source/ui/func/fupage.cxx6
-rw-r--r--starmath/source/mathml/export.cxx5
-rw-r--r--svx/source/svdraw/svdotext.cxx16
-rw-r--r--sw/source/uibase/utlui/uitool.cxx10
7 files changed, 25 insertions, 26 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index bf3a02f5c92e..94b65098ed5e 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1013,7 +1013,7 @@ Document::retrieveCharacterAttributes(
std::vector<css::beans::PropertyValue> aNewValues;
aNewValues.reserve(nLength);
std::transform(&pIndices[0], &pIndices[nLength], std::back_inserter(aNewValues),
- [&aRes](const sal_Int32 nIdx) { return aRes[nIdx]; });
+ [&aRes](const sal_Int32 nIdx) -> const css::beans::PropertyValue& { return aRes[nIdx]; });
return comphelper::containerToSequence(aNewValues);
}
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 89c8eea90111..d63a33c0a9b0 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -1131,11 +1131,11 @@ namespace basegfx::utils
}
// provide callbacks as lambdas
- auto aLineCallback(
+ const auto& rLineCallback(
nullptr == pLineTarget
? std::function<void(const basegfx::B2DPolygon&)>()
: [&pLineTarget](const basegfx::B2DPolygon& rSnippet){ pLineTarget->append(rSnippet); });
- auto aGapCallback(
+ const auto& rGapCallback(
nullptr == pGapTarget
? std::function<void(const basegfx::B2DPolygon&)>()
: [&pGapTarget](const basegfx::B2DPolygon& rSnippet){ pGapTarget->append(rSnippet); });
@@ -1144,8 +1144,8 @@ namespace basegfx::utils
applyLineDashing(
rCandidate,
rDotDashArray,
- aLineCallback,
- aGapCallback,
+ rLineCallback,
+ rGapCallback,
fDotDashLength);
}
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 968624e0f28b..14e5abf46b64 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -104,7 +104,7 @@ namespace basegfx::utils
}
// provide callback as lambda
- auto aLineCallback(
+ const auto& rLineCallback(
nullptr == pLineTarget
? std::function<void(const basegfx::B3DPolygon&)>()
: [&pLineTarget](const basegfx::B3DPolygon& rSnippet){ pLineTarget->append(rSnippet); });
@@ -113,7 +113,7 @@ namespace basegfx::utils
applyLineDashing(
rCandidate,
rDotDashArray,
- aLineCallback,
+ rLineCallback,
fDotDashLength);
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 1e70db8a0f58..ff48aca5d3be 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -548,9 +548,9 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pPoolItem))
{
SfxGrabBagItem const*const pGrabBag(static_cast<SfxGrabBagItem const*>(pPoolItem));
- const auto pGrabBagInner = pGrabBag->GetGrabBag();
- const auto iter = pGrabBagInner.find(u"BackgroundFullSize"_ustr);
- assert(iter != pGrabBagInner.end());
+ const auto& rGrabBagInner = pGrabBag->GetGrabBag();
+ const auto iter = rGrabBagInner.find(u"BackgroundFullSize"_ustr);
+ assert(iter != rGrabBagInner.end());
if (iter->second >>= bFullSize)
{
if (pMasterPage->IsBackgroundFullSize() != bFullSize)
diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx
index a1611b3eee8a..3241f42c9d9e 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -803,9 +803,8 @@ void SmMLExport::exportMlAttributes(const SmMlElement* pMlElement)
}
case SmMlAttributeValueType::MlMathsize:
{
- auto aSizeData = aAttribute.getMlMathsize();
- auto aLengthData = aSizeData->m_aLengthValue;
- exportMlAttributeLength(XML_MATHSIZE, aLengthData);
+ auto pSizeData = aAttribute.getMlMathsize();
+ exportMlAttributeLength(XML_MATHSIZE, pSizeData->m_aLengthValue);
break;
}
case SmMlAttributeValueType::MlMathvariant:
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 83e22a5ce60f..563e7ef02a2f 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1154,18 +1154,18 @@ sal_uInt32 SdrTextObj::GetSnapPointCount() const
Point SdrTextObj::GetSnapPoint(sal_uInt32 i) const
{
Point aP;
- auto aRectangle = getRectangle();
+ const auto& rRectangle = getRectangle();
switch (i) {
- case 0: aP = aRectangle.TopLeft(); break;
- case 1: aP = aRectangle.TopRight(); break;
- case 2: aP = aRectangle.BottomLeft(); break;
- case 3: aP = aRectangle.BottomRight(); break;
- default: aP = aRectangle.Center(); break;
+ case 0: aP = rRectangle.TopLeft(); break;
+ case 1: aP = rRectangle.TopRight(); break;
+ case 2: aP = rRectangle.BottomLeft(); break;
+ case 3: aP = rRectangle.BottomRight(); break;
+ default: aP = rRectangle.Center(); break;
}
if (maGeo.m_nShearAngle)
- ShearPoint(aP, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
+ ShearPoint(aP, rRectangle.TopLeft(), maGeo.mfTanShearAngle);
if (maGeo.m_nRotationAngle)
- RotatePoint(aP, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aP, rRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
return aP;
}
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 0672f41047a8..c863334f220e 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -286,15 +286,15 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
if (const SfxGrabBagItem* pGrabBag = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG))
{
bool bValue;
- const auto pGrabBagInner = pGrabBag->GetGrabBag();
- const auto iter = pGrabBagInner.find(u"BackgroundFullSize"_ustr);
- assert(iter != pGrabBagInner.end());
+ const auto& rGrabBagInner = pGrabBag->GetGrabBag();
+ const auto iter = rGrabBagInner.find(u"BackgroundFullSize"_ustr);
+ assert(iter != rGrabBagInner.end());
if (iter->second >>= bValue)
{
rMaster.SetFormatAttr(SfxBoolItem(RES_BACKGROUND_FULL_SIZE, bValue));
}
- auto it = pGrabBagInner.find(u"RtlGutter"_ustr);
- if (it != pGrabBagInner.end() && (it->second >>= bValue))
+ auto it = rGrabBagInner.find(u"RtlGutter"_ustr);
+ if (it != rGrabBagInner.end() && (it->second >>= bValue))
{
rMaster.SetFormatAttr(SfxBoolItem(RES_RTL_GUTTER, bValue));
}