sc/source/core/tool/interpr4.cxx | 2 sc/source/filter/excel/xichart.cxx | 2 sc/source/filter/oox/worksheetbuffer.cxx | 2 sc/source/ui/docshell/externalrefmgr.cxx | 2 sc/source/ui/unoobj/chart2uno.cxx | 8 +-- sd/source/ui/func/fuconrec.cxx | 2 sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | 2 sw/source/core/doc/tblrwcl.cxx | 2 sw/source/core/view/printdata.cxx | 2 sw/source/filter/basflt/iodetect.cxx | 2 sw/source/ui/misc/contentcontroldlg.cxx | 35 ++++++++-------- sw/source/uibase/utlui/content.cxx | 2 sw/source/writerfilter/dmapper/BorderHandler.cxx | 2 13 files changed, 33 insertions(+), 32 deletions(-)
New commits: commit e0e49a0ab061bb46d580fdeddfd2b70951029701 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 13 19:46:17 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 13 21:53:15 2024 +0200 cid#1557699 COPY_INSTEAD_OF_MOVE and cid#1557696 COPY_INSTEAD_OF_MOVE cid#1557695 COPY_INSTEAD_OF_MOVE cid#1557690 COPY_INSTEAD_OF_MOVE cid#1557671 COPY_INSTEAD_OF_MOVE cid#1557661 COPY_INSTEAD_OF_MOVE cid#1557626 COPY_INSTEAD_OF_MOVE cid#1557624 COPY_INSTEAD_OF_MOVE cid#1557622 COPY_INSTEAD_OF_MOVE cid#1557618 COPY_INSTEAD_OF_MOVE cid#1557617 COPY_INSTEAD_OF_MOVE cid#1557607 COPY_INSTEAD_OF_MOVE cid#1557559 COPY_INSTEAD_OF_MOVE cid#1557538 COPY_INSTEAD_OF_MOVE Change-Id: I8bcd61f21e6b5284d641ff8c6bd09008c2458baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171837 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 0d67dee45143..519387445aa2 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1339,7 +1339,7 @@ void ScInterpreter::GetExternalDoubleRef( return; } - rArray = pArray; + rArray = std::move(pArray); } bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr ) diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 5189b60e229a..4b0b70dfe2f9 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2853,7 +2853,7 @@ void XclImpChTypeGroup::ReadChChartLine( XclImpStream& rStrm ) { XclImpChLineFormat aLineFmt; aLineFmt.ReadChLineFormat( rStrm ); - m_ChartLines[ nLineId ] = aLineFmt; + m_ChartLines[nLineId] = std::move(aLineFmt); } } diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx index 52285a75d390..0783c27a147e 100644 --- a/sc/source/filter/oox/worksheetbuffer.cxx +++ b/sc/source/filter/oox/worksheetbuffer.cxx @@ -230,7 +230,7 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel ) auto xSheetInfo = std::make_shared<SheetInfo>( rModel, aIndexName.first, aIndexName.second ); maSheetInfos.push_back( xSheetInfo ); maSheetInfosByName[ rModel.maName ] = xSheetInfo; - maSheetInfosByName[ lclQuoteName( rModel.maName ) ] = xSheetInfo; + maSheetInfosByName[ lclQuoteName( rModel.maName ) ] = std::move(xSheetInfo); } void WorksheetBuffer::finalizeImport( sal_Int16 nActiveSheet ) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 26e7991ed4ad..b95b1c0c1155 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1634,7 +1634,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray( ScMatrixToken aToken(xMat); pArray->AddToken(aToken); - itrCache->mpRangeData = xMat; + itrCache->mpRangeData = std::move(xMat); bFirstTab = false; } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 98f6ca23fba8..fc12d662929c 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -621,11 +621,11 @@ void Chart2Positioner::calcGlueState(SCCOL nColSize, SCROW nRowSize) { ScComplexRefData aData; ScRefTokenHelper::getDoubleRefDataFromToken(aData, rxToken); - SCCOL nCol1 = aData.Ref1.Col() - mnStartCol; - SCCOL nCol2 = aData.Ref2.Col() - mnStartCol; + auto nCol1 = aData.Ref1.Col() - mnStartCol; + auto nCol2 = aData.Ref2.Col() - mnStartCol; SCROW nRow1 = aData.Ref1.Row() - mnStartRow; SCROW nRow2 = aData.Ref2.Row() - mnStartRow; - for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) + for (auto nCol = nCol1; nCol <= nCol2; ++nCol) for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) { size_t i = nCol*nRowSize + nRow; @@ -641,7 +641,7 @@ void Chart2Positioner::calcGlueState(SCCOL nColSize, SCROW nRowSize) bool bGlue = true; bool bGlueCols = false; - for (SCCOL nCol = 0; bGlue && nCol < nColSize; ++nCol) + for (auto nCol = 0; bGlue && nCol < nColSize; ++nCol) { for (SCROW nRow = 0; bGlue && nRow < nRowSize; ++nRow) { diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index 1c0557705c6c..88a81a7e34fd 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -833,7 +833,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj case SID_LINE_CIRCLE_ARROW: { // circle start - rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle)); + rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_CIRCLE), std::move(aCircle))); rAttr.Put(XLineStartWidthItem(nWidth)); } break; diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index eac289090ae3..9f24d4813ac5 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -308,7 +308,7 @@ void PageSelector::UpdateCurrentPage (const bool bUpdateOnlyWhenPending) continue; if (pDescriptor->HasState(PageDescriptor::ST_Selected)) { - pCurrentPageDescriptor = pDescriptor; + pCurrentPageDescriptor = std::move(pDescriptor); break; } } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 1e8ec32c136b..0c66bf3b048d 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -2777,7 +2777,7 @@ bool SwTable::SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eTyp // Bug 61494 if( LONG_MAX != nFrameWidth ) { - SwFormatFrameSize aAbsSz( aSz ); + SwFormatFrameSize aAbsSz(std::move(aSz)); aAbsSz.SetWidth( nFrameWidth ); GetFrameFormat()->SetFormatAttr( aAbsSz ); } diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 934bd552a784..4cc427af5b7e 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -425,7 +425,7 @@ bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< bea } bChanged = bChanged || (pOut.get() != m_pLast.get()); if( pOut ) - m_pLast = pOut; + m_pLast = std::move(pOut); return bChanged; } diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 59bdd4294d1e..bfd7b613cd6f 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -192,7 +192,7 @@ std::shared_ptr<const SfxFilter> SwIoSystem::GetFileFilter(const OUString& rFile // there's only a template filter that could be found if ( pTemplateFilter ) - pFilter = pTemplateFilter; + pFilter = std::move(pTemplateFilter); } } else diff --git a/sw/source/ui/misc/contentcontroldlg.cxx b/sw/source/ui/misc/contentcontroldlg.cxx index a189a0ef7c19..f075701a8689 100644 --- a/sw/source/ui/misc/contentcontroldlg.cxx +++ b/sw/source/ui/misc/contentcontroldlg.cxx @@ -371,26 +371,27 @@ IMPL_LINK_NOARG(SwContentControlDlg, RenameHdl, weld::Button&, void) aItem->m_aValue = m_xListItems->get_text(nRow, 1); SwAbstractDialogFactory& rFact = swui::GetFactory(); m_xListItemDialog = rFact.CreateSwContentControlListItemDlg(m_xDialog.get(), *aItem); - m_xListItemDialog->StartExecuteAsync([this, aItem, nRow](sal_Int32 nResult) { - if (nResult == RET_OK) - { - if (aItem->m_aDisplayText.isEmpty() && aItem->m_aValue.isEmpty()) + m_xListItemDialog->StartExecuteAsync( + [ this, aItem = std::move(aItem), nRow ](sal_Int32 nResult) { + if (nResult == RET_OK) { - // Maintain the invariant that value can't be empty. - return; + if (aItem->m_aDisplayText.isEmpty() && aItem->m_aValue.isEmpty()) + { + // Maintain the invariant that value can't be empty. + return; + } + + if (aItem->m_aValue.isEmpty()) + { + aItem->m_aValue = aItem->m_aDisplayText; + } + + m_xListItems->set_text(nRow, aItem->m_aDisplayText, 0); + m_xListItems->set_text(nRow, aItem->m_aValue, 1); } - if (aItem->m_aValue.isEmpty()) - { - aItem->m_aValue = aItem->m_aDisplayText; - } - - m_xListItems->set_text(nRow, aItem->m_aDisplayText, 0); - m_xListItems->set_text(nRow, aItem->m_aValue, 1); - } - - m_xListItemDialog.disposeAndClear(); - }); + m_xListItemDialog.disposeAndClear(); + }); } IMPL_LINK_NOARG(SwContentControlDlg, DeleteHdl, weld::Button&, void) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ad8048837e50..82bd41151cca 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2543,7 +2543,7 @@ void SwContentTree::Expand(const weld::TreeIter& rParent, bChild = m_xTreeView->iter_next(*xChild); } } - mOutLineNodeMap = aCurrOutLineNodeMap; + mOutLineNodeMap = std::move(aCurrOutLineNodeMap); return; } else // content entry diff --git a/sw/source/writerfilter/dmapper/BorderHandler.cxx b/sw/source/writerfilter/dmapper/BorderHandler.cxx index c007ecf5e515..0453a907c7f9 100644 --- a/sw/source/writerfilter/dmapper/BorderHandler.cxx +++ b/sw/source/writerfilter/dmapper/BorderHandler.cxx @@ -150,7 +150,7 @@ void BorderHandler::lcl_sprm(Sprm & rSprm) if (!m_aInteropGrabBagName.isEmpty()) { aSavedGrabBag.push_back(getInteropGrabBag(aBorderPos)); - m_aInteropGrabBag = aSavedGrabBag; + m_aInteropGrabBag = std::move(aSavedGrabBag); } } ConversionHelper::MakeBorderLine( m_nLineWidth, m_nLineType, m_nLineColor,