canvas/source/vcl/canvashelper.cxx | 2 +- connectivity/source/drivers/postgresql/pq_connection.cxx | 2 +- dbaccess/source/ui/browser/brwctrlr.cxx | 4 ++-- dbaccess/source/ui/dlg/queryfilter.cxx | 2 +- filter/source/svg/svgwriter.cxx | 2 +- framework/source/uielement/toolbarsmenucontroller.cxx | 2 +- include/sfx2/docfile.hxx | 2 +- package/source/xstor/xstorage.cxx | 2 +- sc/source/ui/unoobj/chart2uno.cxx | 2 +- sc/source/ui/unoobj/nameuno.cxx | 4 ++-- scripting/source/provider/ProviderCache.cxx | 2 +- sd/inc/sdgrffilter.hxx | 2 +- sd/source/filter/grf/sdgrffilter.cxx | 6 +++--- sdext/source/pdfimport/tree/style.cxx | 2 +- sfx2/source/doc/docfile.cxx | 6 +++--- slideshow/source/engine/slideshowimpl.cxx | 5 +++-- svl/source/misc/inettype.cxx | 2 +- svx/source/form/fmshimp.cxx | 2 +- sw/source/core/access/textmarkuphelper.cxx | 2 +- ucb/source/inc/regexpmap.hxx | 4 ++-- ucb/source/ucp/cmis/cmis_content.cxx | 3 ++- ucb/source/ucp/package/pkgcontent.cxx | 2 +- ucb/source/ucp/webdav-curl/CurlSession.cxx | 1 + 23 files changed, 33 insertions(+), 30 deletions(-)
New commits: commit 59768e605182dde4aabfd384d38b47b6317022e2 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 6 19:53:19 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 6 22:31:35 2024 +0200 cid#555593 COPY_INSTEAD_OF_MOVE and cid#1555849 COPY_INSTEAD_OF_MOVE cid#1555936 COPY_INSTEAD_OF_MOVE cid#1555951 COPY_INSTEAD_OF_MOVE cid#1555955 COPY_INSTEAD_OF_MOVE cid#1555960 COPY_INSTEAD_OF_MOVE cid#1555964 COPY_INSTEAD_OF_MOVE cid#1555965 COPY_INSTEAD_OF_MOVE cid#1555975 COPY_INSTEAD_OF_MOVE cid#1555979 COPY_INSTEAD_OF_MOVE cid#1555987 COPY_INSTEAD_OF_MOVE cid#1555990 COPY_INSTEAD_OF_MOVE cid#1555991 COPY_INSTEAD_OF_MOVE cid#1556002 COPY_INSTEAD_OF_MOVE cid#1556008 COPY_INSTEAD_OF_MOVE cid#1556011 COPY_INSTEAD_OF_MOVE cid#1556015 COPY_INSTEAD_OF_MOVE cid#1556017 COPY_INSTEAD_OF_MOVE cid#1556023 COPY_INSTEAD_OF_MOVE Change-Id: I8ab99d8e52a1780173a4272c59d408432c29de9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171572 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 5c504136ddae..f323f9671173 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -876,7 +876,7 @@ namespace vclcanvas // display bitmap - return cache object, to retain // that information. return uno::Reference< rendering::XCachedPrimitive >( - new CachedBitmap( pGrfObj, + new CachedBitmap( std::move(pGrfObj), aPt, aSz, aGrfAttr, diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index f87435600303..156e110c2df2 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -192,7 +192,7 @@ Reference< XStatement > Connection::createStatement() ::rtl::ByteSequence id( 16 ); rtl_createUuid( reinterpret_cast<sal_uInt8*>(id.getArray()), nullptr, false ); m_myStatements[ id ] = Reference< XCloseable > ( stmt ); - stmt->queryAdapter()->addReference( new ClosableReference( id, this ) ); + stmt->queryAdapter()->addReference( new ClosableReference( std::move(id), this ) ); return stmt; } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 2a93c7c82234..d85f33cd8368 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1239,11 +1239,11 @@ void SbaXDataBrowserController::errorOccured(const css::sdb::SQLErrorEvent& aEve if ( m_nFormActionNestingLevel ) { OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccurred: can handle one error per transaction only!" ); - m_aCurrentError = aInfo; + m_aCurrentError = std::move(aInfo); } else { - m_aCurrentError = aInfo; + m_aCurrentError = std::move(aInfo); m_aAsyncDisplayError.Call(); } } diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 5bc0f2f56ef9..4ffd8d070249 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -687,7 +687,7 @@ void DlgFilterCrit::BuildWherePart() sal_Int32 nAndPos = _rValues[nPos].getLength(); auto pValues = _rValues.getArray(); pValues[nPos].realloc( _rValues[nPos].getLength() + 1); - pValues[nPos].getArray()[nAndPos] = aValue; + pValues[nPos].getArray()[nAndPos] = std::move(aValue); } if( m_xLB_WHEREFIELD3->get_active() != 0 ) diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index c3054cfb4a1a..ac179f78372f 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -3479,7 +3479,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, mapCurShape->maId = aElementId + "_" + OUString::number(nEntryCount++); } - mapCurShape->maShapePolyPoly = aShapePolyPoly; + mapCurShape->maShapePolyPoly = std::move(aShapePolyPoly); mapCurShape->maShapeFillColor = aFill.getFillColor(); mapCurShape->maShapeFillColor.SetAlpha( 255 - basegfx::fround<sal_uInt8>( 255.0 * aFill.getTransparency() ) ); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 309b590dd642..387eef47590b 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -621,7 +621,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r { ExecuteInfo* pExecuteInfo = new ExecuteInfo; pExecuteInfo->xDispatch = xDispatchProvider->queryDispatch(aTargetURL, OUString(), 0); - pExecuteInfo->aTargetURL = aTargetURL; + pExecuteInfo->aTargetURL = std::move(aTargetURL); Application::PostUserEvent( LINK(nullptr, ToolbarsMenuController, ExecuteHdl_Impl), pExecuteInfo ); } } diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index f4a29a9414d9..9f7217cd01f4 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -149,7 +149,7 @@ public: ErrCodeMsg const & GetWarningError() const; ErrCodeMsg const & GetLastStorageCreationState() const; - void SetError(ErrCodeMsg nError); + void SetError(const ErrCodeMsg& rError); void SetWarningError(const ErrCodeMsg& nWarningError); void CloseInStream(); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 38f713c883fb..3951a38fec66 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -4099,7 +4099,7 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu uno::Any( aEncryptionMap.getAsConstNamedValueList() ) ); m_pImpl->m_bHasCommonEncryptionData = true; - m_pImpl->m_aCommonEncryptionData = aEncryptionMap; + m_pImpl->m_aCommonEncryptionData = std::move(aEncryptionMap); } catch( const uno::Exception& ) { diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index e2ac6f5b0917..98f6ca23fba8 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1308,7 +1308,7 @@ bool lcl_addUpperLeftCornerIfMissing(const ScDocument* pDoc, vector<ScTokenRef>& if (bExternal) { ScTokenRef pCorner( - new ScExternalSingleRefToken(nFileId, aExtTabName, aData)); + new ScExternalSingleRefToken(nFileId, std::move(aExtTabName), aData)); ScRefTokenHelper::join(pDoc, rRefTokens, pCorner, ScAddress()); } else diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 16570353a225..c96700f3474c 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -1057,9 +1057,9 @@ void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelAre xNewList->Join( ScRangePair( aLabelRange, aDataRange ) ); if (bColumn) - rDoc.GetColNameRangesRef() = xNewList; + rDoc.GetColNameRangesRef() = std::move(xNewList); else - rDoc.GetRowNameRangesRef() = xNewList; + rDoc.GetRowNameRangesRef() = std::move(xNewList); rDoc.CompileColRowNameFormula(); pDocShell->PostPaint( 0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, PaintPartFlags::Grid ); diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index f679df5d10e5..2c1b1c27639a 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -159,7 +159,7 @@ ProviderCache::populateCache() serviceName = *pName; ProviderDetails details; details.factory = factory; - m_hProviderDetailsCache[ serviceName ] = details; + m_hProviderDetailsCache[ serviceName ] = std::move(details); } } } diff --git a/sd/inc/sdgrffilter.hxx b/sd/inc/sdgrffilter.hxx index 28ce9de6dd29..a90934dd6dea 100644 --- a/sd/inc/sdgrffilter.hxx +++ b/sd/inc/sdgrffilter.hxx @@ -34,7 +34,7 @@ public: bool Export() override; static void HandleGraphicFilterError(ErrCode nFilterError, ErrCode nStreamError); - static void InsertSdrGrafObj(Graphic pGraphic, SdPage* pPage); + static void InsertSdrGrafObj(const Graphic& rGraphic, SdPage* pPage); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index c276c28c3ab0..7527b965ed79 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -181,11 +181,11 @@ bool SdGRFFilter::Import() return bRet; } -void SdGRFFilter::InsertSdrGrafObj(Graphic pGraphic, SdPage* pPage) +void SdGRFFilter::InsertSdrGrafObj(const Graphic& rGraphic, SdPage* pPage) { Point aPos; Size aPagSize(pPage->GetSize()); - Size aGrfSize(OutputDevice::LogicToLogic(pGraphic.GetPrefSize(), pGraphic.GetPrefMapMode(), + Size aGrfSize(OutputDevice::LogicToLogic(rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); aPagSize.AdjustWidth(-(pPage->GetLeftBorder() + pPage->GetRightBorder())); @@ -215,7 +215,7 @@ void SdGRFFilter::InsertSdrGrafObj(Graphic pGraphic, SdPage* pPage) aPos.setX(((aPagSize.Width() - aGrfSize.Width()) >> 1) + pPage->GetLeftBorder()); aPos.setY(((aPagSize.Height() - aGrfSize.Height()) >> 1) + pPage->GetUpperBorder()); - pPage->InsertObject(new SdrGrafObj(pPage->getSdrModelFromSdrPage(), pGraphic, + pPage->InsertObject(new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic, ::tools::Rectangle(aPos, aGrfSize))); } diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index 9ed2281421c8..1248ce79ccf7 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -64,7 +64,7 @@ sal_Int32 StyleContainer::impl_getStyleId( const Style& rStyle, bool bSubStyle ) nRet = m_nNextId++; // create new style RefCountedHashedStyle& rNew = m_aIdToStyle[ nRet ]; - rNew.style = aSearchStyle; + rNew.style = std::move(aSearchStyle); rNew.RefCount = 1; rNew.style.IsSubStyle = bSubStyle; // fill the style hash to find the id diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 08c2ebfe99f5..1674a41131df 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -506,10 +506,10 @@ ErrCodeMsg const & SfxMedium::GetLastStorageCreationState() const return pImpl->nLastStorageError; } -void SfxMedium::SetError(ErrCodeMsg nError) +void SfxMedium::SetError(const ErrCodeMsg& rError) { - if (pImpl->m_eError == ERRCODE_NONE || (pImpl->m_eError.IsWarning() && nError.IsError())) - pImpl->m_eError = nError; + if (pImpl->m_eError == ERRCODE_NONE || (pImpl->m_eError.IsWarning() && rError.IsError())) + pImpl->m_eError = rError; } void SfxMedium::SetWarningError(const ErrCodeMsg& nWarningError) diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 1eeed4e25b43..7487214bc071 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -432,7 +432,7 @@ bool INetContentTypes::parse( rType = t; rSubType = s; if (pParameters != nullptr) { - *pParameters = p; + *pParameters = std::move(p); } return true; } else { diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index f16511f29cc0..e75742bf4f0d 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -3530,7 +3530,7 @@ void FmXFormShell::viewDeactivated_Lock(FmFormView& _rCurrentView, bool _bDeacti Application::RemoveUserEvent( aAction.nEventId ); } } - m_aLoadingPages = aNewEvents; + m_aLoadingPages = std::move(aNewEvents); // remove callbacks at the page pPage->GetImpl().SetFormsCreationHdl( Link<FmFormPageImpl&,void>() ); diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx index ae221f499831..910edc439b7c 100644 --- a/sw/source/core/access/textmarkuphelper.cxx +++ b/sw/source/core/access/textmarkuphelper.cxx @@ -156,7 +156,7 @@ css::accessibility::TextSegment if (oIndices && mrPortionData.IsValidCorePosition(oIndices->first) && mrPortionData.IsValidCorePosition(oIndices->second)) { if (nIndexInPortion == nTextMarkupIndex) - oElement = oIndices; + oElement = std::move(oIndices); nIndexInPortion++; } diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index 186affb1db83..d9ce996ad6fc 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -308,7 +308,7 @@ void RegexpMap< Val >::add(OUString const & rKey, Val const & rValue) { return; } - m_pDefault.reset( new Entry< Val >(aRegexp, rValue) ); + m_pDefault.reset( new Entry< Val >(std::move(aRegexp), rValue) ); } else { @@ -322,7 +322,7 @@ void RegexpMap< Val >::add(OUString const & rKey, Val const & rValue) } } - rTheList.push_back(Entry< Val >(aRegexp, rValue)); + rTheList.push_back(Entry< Val >(std::move(aRegexp), rValue)); } } diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 2eda3608151d..facf7979b28f 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -230,7 +230,8 @@ namespace propertyType->setOpenChoice( bOpenChoice ); propertyType->setType( type ); - libcmis::PropertyPtr property( new libcmis::Property( propertyType, std::move(values) ) ); + libcmis::PropertyPtr property( new libcmis::Property( std::move(propertyType), + std::move(values) ) ); return property; } diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 05b635725cf5..64f6eaa8d67a 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1294,7 +1294,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( m_aProps.aTitle = aNewTitle; - aChanges.getArray()[ nChanged ] = aEvent; + aChanges.getArray()[ nChanged ] = std::move(aEvent); nChanged++; } commit fdc9c3d592f8a0d4ad75910f2a23ae77a14c3328 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 6 19:35:30 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 6 22:31:28 2024 +0200 cid#1615230 silence Overflowed constant Change-Id: Iffa09b68794ff7942c1d2780097f0021c070ed96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171571 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 6eb3e3f2c41e..128cb4b538af 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -538,6 +538,7 @@ static auto ProcessHeaders(::std::vector<OString> const& rHeaders) -> ::std::map SAL_WARN("ucb.ucp.webdav.curl", "invalid header field (empty name)"); continue; } + assert(nColon != std::string_view::npos); // case insensitive; must be ASCII auto const name(::rtl::OStringToOUString(OString(line.substr(0, nColon)).toAsciiLowerCase(), RTL_TEXTENCODING_ASCII_US)); commit 40686d6c2fcccadc2004f187c443f105ef5fe070 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Aug 5 16:03:44 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 6 22:31:21 2024 +0200 cid#1607096 silence Overflowed constant Change-Id: Ifa89ef67ffd7f5842c60a34f6705365f3de94770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171570 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 7a6d5e8f34d3..e9df84afe339 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1608,14 +1608,15 @@ void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMult if (aPoly.count() > 1) // otherwise skip it, count should be 2 { - if (aDrawingPoints.count() == 0) + const auto ptCount = aDrawingPoints.count(); + if (ptCount == 0) { aDrawingPoints.append(aPoly); pFirstPolyPoly = pPolyPoly; continue; } basegfx::B2DPoint aLast - = aDrawingPoints.getB2DPoint(aDrawingPoints.count() - 1); + = aDrawingPoints.getB2DPoint(ptCount - 1); if (aPoly.getB2DPoint(0).equal(aLast)) { aDrawingPoints.append(aPoly, 1);