From 5b112c8f8843613873181fce50990a8feef837ca Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 5 Aug 2022 11:21:44 +0200 Subject: clang-tidy modernize-pass-by-value in sc Change-Id: Ia7ff651d1cbc119b36a9f8052594d03650988f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137848 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/undo/undocell.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sc/source/ui/undo/undocell.cxx') diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 480238023ef5..b306dcd83a07 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -42,6 +42,7 @@ #include #include #include +#include namespace HelperNotifyChanges { @@ -159,9 +160,9 @@ ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {} ScUndoEnterData::ScUndoEnterData( ScDocShell* pNewDocShell, const ScAddress& rPos, ValuesType& rOldValues, - const OUString& rNewStr, std::unique_ptr pObj ) : + OUString aNewStr, std::unique_ptr pObj ) : ScSimpleUndo( pNewDocShell ), - maNewString(rNewStr), + maNewString(std::move(aNewStr)), mpNewEditData(std::move(pObj)), mnEndChangeAction(0), maPos(rPos) @@ -306,10 +307,10 @@ bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const ScUndoEnterValue::ScUndoEnterValue( ScDocShell* pNewDocShell, const ScAddress& rNewPos, - const ScCellValue& rUndoCell, double nVal ) : + ScCellValue aUndoCell, double nVal ) : ScSimpleUndo( pNewDocShell ), aPos ( rNewPos ), - maOldCell(rUndoCell), + maOldCell(std::move(aUndoCell)), nValue ( nVal ) { SetChangeTrack(); @@ -380,8 +381,8 @@ bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const return false; } -ScUndoSetCell::ScUndoSetCell( ScDocShell* pDocSh, const ScAddress& rPos, const ScCellValue& rOldVal, const ScCellValue& rNewVal ) : - ScSimpleUndo(pDocSh), maPos(rPos), maOldValue(rOldVal), maNewValue(rNewVal), mnEndChangeAction(0) +ScUndoSetCell::ScUndoSetCell( ScDocShell* pDocSh, const ScAddress& rPos, ScCellValue aOldVal, ScCellValue aNewVal ) : + ScSimpleUndo(pDocSh), maPos(rPos), maOldValue(std::move(aOldVal)), maNewValue(std::move(aNewVal)), mnEndChangeAction(0) { SetChangeTrack(); } @@ -640,13 +641,13 @@ bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const ScUndoThesaurus::ScUndoThesaurus( ScDocShell* pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, - const ScCellValue& rOldText, const ScCellValue& rNewText ) : + ScCellValue aOldText, ScCellValue aNewText ) : ScSimpleUndo( pNewDocShell ), nCol( nNewCol ), nRow( nNewRow ), nTab( nNewTab ), - maOldText(rOldText), - maNewText(rNewText) + maOldText(std::move(aOldText)), + maNewText(std::move(aNewText)) { SetChangeTrack(maOldText); } @@ -740,11 +741,11 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP } ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos, - const ScNoteData& rOldData, const ScNoteData& rNewData, std::unique_ptr pDrawUndo ) : + ScNoteData aOldData, ScNoteData aNewData, std::unique_ptr pDrawUndo ) : ScSimpleUndo( &rDocShell ), maPos( rPos ), - maOldData( rOldData ), - maNewData( rNewData ), + maOldData(std::move( aOldData )), + maNewData(std::move( aNewData )), mpDrawUndo( std::move(pDrawUndo) ) { OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" ); -- cgit