diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-11 19:33:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-12 07:26:07 +0100 |
commit | e27fd62bd83e5d78f544f661e8aa7e86d3a53c4d (patch) | |
tree | 871ad2097277951d54970704c6a34849171fcd24 /oox/source/drawingml | |
parent | 22a9cfbc9cc9577b08493828f3192262f76e7ac9 (diff) |
clang-tidy: performance-unnecessary-copy-initialization in oox
Change-Id: I9964087880efcf24b5748130cffa2bd85adf1965
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176418
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/fontworkhelpers.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 6 | ||||
-rw-r--r-- | oox/source/drawingml/textbody.cxx | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 49a0c9e50bdc..ec2a10da02fe 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -208,7 +208,7 @@ Reference<XGraphic> lclApplyBlackWhiteEffect(const BlipFillProperties& aBlipProp ::Graphic aReturnGraphic; BitmapEx aBitmapEx(aGraphic.GetBitmapEx()); - AlphaMask aMask(aBitmapEx.GetAlphaMask()); + const AlphaMask& aMask(aBitmapEx.GetAlphaMask()); BitmapEx aTmpBmpEx(aBitmapEx.GetBitmap()); BitmapFilter::Filter(aTmpBmpEx, BitmapMonochromeFilter{ nThreshold }); diff --git a/oox/source/drawingml/fontworkhelpers.cxx b/oox/source/drawingml/fontworkhelpers.cxx index d9fa4fb8d4d6..565f6b6c7b88 100644 --- a/oox/source/drawingml/fontworkhelpers.cxx +++ b/oox/source/drawingml/fontworkhelpers.cxx @@ -1079,7 +1079,7 @@ OUString lcl_getWMarkupStringForThemeColor(const model::ComplexColor& rComplexCo bool lcl_getThemeColorTransformationValue(const model::ComplexColor& rComplexColor, const model::TransformationType& rType, sal_Int16& rValue) { - const std::vector<model::Transformation> aTransVec(rComplexColor.getTransformations()); + const std::vector<model::Transformation>& aTransVec(rComplexColor.getTransformations()); auto bItemFound = [rType](const model::Transformation& rTrans) { return rType == rTrans.meType; }; auto pIt = std::find_if(aTransVec.begin(), aTransVec.end(), bItemFound); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 8bc71abeb3c7..409b67b58ba2 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -655,7 +655,7 @@ static void lcl_copyCharPropsToShape(const uno::Reference<drawing::XShape>& xSha }); if (aParaIt != rParagraphs.cend()) { - std::shared_ptr<TextParagraph> pParagraph = *aParaIt; + const std::shared_ptr<TextParagraph>& pParagraph = *aParaIt; const TextRunVector& rRuns = pParagraph->getRuns(); auto aRunIt = std::find_if_not(rRuns.cbegin(), rRuns.cend(), [](const std::shared_ptr<TextRun> pRun) @@ -666,14 +666,14 @@ static void lcl_copyCharPropsToShape(const uno::Reference<drawing::XShape>& xSha }); if (aRunIt != rRuns.cend()) { - std::shared_ptr<TextRun> pRun = *aRunIt; + const std::shared_ptr<TextRun>& pRun = *aRunIt; TextCharacterProperties& rCharProps = pRun->getTextCharacterProperties(); // set language if (rCharProps.moLang.has_value() && !rCharProps.moLang.value().isEmpty()) { LanguageTag aTag(rCharProps.moLang.value()); - css::lang::Locale aLocale(aTag.getLocale(false)); + const css::lang::Locale& aLocale(aTag.getLocale(false)); switch (MsLangId::getScriptType(aTag.getLanguageType())) { case css::i18n::ScriptType::LATIN: diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 9d0d2c8d2aac..1d9e45f505f5 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -57,14 +57,12 @@ void TextBody::insertAt( const TextCharacterProperties& rTextStyleProperties, const TextListStylePtr& pMasterTextListStylePtr ) const { - TextListStyle aMasterTextStyle(*pMasterTextListStylePtr); - Reference<css::beans::XPropertySet> xPropertySet(xAt, UNO_QUERY); float nCharHeight = xPropertySet->getPropertyValue(u"CharHeight"_ustr).get<float>(); size_t nIndex = 0; for (auto const& paragraph : maParagraphs) { - paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, aMasterTextStyle, + paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, *pMasterTextListStylePtr, maTextListStyle, (nIndex == 0), nCharHeight); ++nIndex; } |