sc/source/core/tool/dbdata.cxx              |    4 ++--
 sc/source/filter/inc/stylesbuffer.hxx       |    6 +++---
 sc/source/filter/oox/defaulttablestyles.cxx |   10 +++++-----
 sc/source/filter/oox/stylesbuffer.cxx       |    6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 24c78f6313993d71b3e0fb2f14517a87d4ada30c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Feb 16 09:26:36 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Feb 16 13:59:35 2026 +0100

    cid#1681371 Variable copied when it could be moved
    
    and
    
    cid#1681369 Variable copied when it could be moved
    cid#1681365 Variable copied when it could be moved
    cid#1681362 Variable copied when it could be moved
    cid#1681361 Variable copied when it could be moved
    cid#1681357 Variable copied when it could be moved
    
    Change-Id: I16f32f8dc54cb2ae77eea25046c60a588593df3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199461
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 6d4ee3e2e518..ba290f9eefb4 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1240,7 +1240,7 @@ void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos)
         SetArea(nTab, aRange.aStart.Col(), aRange.aStart.Row(), 
aRange.aEnd.Col(),
                 aRange.aEnd.Row());
         // Do not use SetTableColumnNames() because that resets 
mbTableColumnNamesDirty.
-        maTableColumnNames = aNames;
+        maTableColumnNames = std::move(aNames);
         mbTableColumnNamesDirty = bTableColumnNamesDirty;
     }
 
@@ -1283,7 +1283,7 @@ bool ScDBData::UpdateReference(const ScDocument& rDoc, 
UpdateRefMode eUpdateRefM
         else
             MoveTo( theTab1, theCol1, theRow1, theCol2, theRow2 );
         // Do not use SetTableColumnNames() because that resets 
mbTableColumnNamesDirty.
-        maTableColumnNames = aNames;
+        maTableColumnNames = std::move(aNames);
         mbTableColumnNamesDirty = bTableColumnNamesDirty;
     }
 
diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 862c63544c4e..eab4d05d138a 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -717,9 +717,9 @@ public:
     ProtectionRef const & createProtection( bool bAlwaysNew = true );
 
     // methods for OOXML default table style import
-    void setFill(FillRef xFill);
-    void setBorder(BorderRef xBorder);
-    void setFont(FontRef xFont);
+    void setFill(const FillRef& xFill);
+    void setBorder(const BorderRef& xBorder);
+    void setFont(const FontRef& xFont);
 
     /** Inserts a new number format code. */
     void                importNumFmt( const AttributeList& rAttribs );
diff --git a/sc/source/filter/oox/defaulttablestyles.cxx 
b/sc/source/filter/oox/defaulttablestyles.cxx
index e7698b6c1dc9..5f734e434610 100644
--- a/sc/source/filter/oox/defaulttablestyles.cxx
+++ b/sc/source/filter/oox/defaulttablestyles.cxx
@@ -30,7 +30,7 @@ void DefaultOOXMLTableStyles::importColors()
     {
         oox::xls::XlsColor aColor;
         aColor.setTheme(aThemeColors[i].nThemeId, aThemeColors[i].fTint);
-        maColors.push_back(aColor);
+        maColors.push_back(std::move(aColor));
     }
 }
 
@@ -41,7 +41,7 @@ void DefaultOOXMLTableStyles::importFills()
     {
         auto xFill = std::make_shared<oox::xls::Fill>(*this, true);
         xFill->setFillColors(maColors[aFills[i].nFgColorId], 
maColors[aFills[i].nBgColorId]);
-        maFills.push_back(xFill);
+        maFills.push_back(std::move(xFill));
     }
 }
 
@@ -97,7 +97,7 @@ void DefaultOOXMLTableStyles::importBorders()
         if (rBorderInfo.nHorizontalId >= 0)
             importBorderElement(xBorder, XLS_TOKEN(horizontal), 
rBorderInfo.nHorizontalId);
 
-        maBorders.push_back(xBorder);
+        maBorders.push_back(std::move(xBorder));
     }
 }
 
@@ -111,7 +111,7 @@ void DefaultOOXMLTableStyles::importFonts()
         const Font& rFontInfo = aFonts[i];
         xFont->setFontElements(maColors[rFontInfo.nThemeColorId], 
rFontInfo.bBold);
 
-        maFonts.push_back(xFont);
+        maFonts.push_back(std::move(xFont));
     }
 }
 
@@ -133,7 +133,7 @@ void DefaultOOXMLTableStyles::importDxfs()
             xDxf->setFont(maFonts[aDxfInfo.nFontId]);
 
         xDxf->finalizeImport();
-        maDxfs.push_back(xDxf);
+        maDxfs.push_back(std::move(xDxf));
     }
 }
 
diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index 1860612b2c01..7189a5688bc8 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -2491,17 +2491,17 @@ ProtectionRef const & Dxf::createProtection( bool 
bAlwaysNew )
     return mxProtection;
 }
 
-void Dxf::setFill(FillRef xFill)
+void Dxf::setFill(const FillRef& xFill)
 {
     mxFill = xFill;
 }
 
-void Dxf::setBorder(BorderRef xBorder)
+void Dxf::setBorder(const BorderRef& xBorder)
 {
     mxBorder = xBorder;
 }
 
-void Dxf::setFont(FontRef xFont)
+void Dxf::setFont(const FontRef& xFont)
 {
     mxFont = xFont;
 }

Reply via email to