basegfx/source/curve/b2dbeziertools.cxx | 5 +++++ connectivity/source/drivers/flat/EDatabaseMetaData.cxx | 2 +- dbaccess/source/ui/querydesign/JoinTableView.cxx | 2 +- framework/source/services/autorecovery.cxx | 2 +- sc/source/core/data/documen5.cxx | 2 +- sc/source/filter/xml/XMLStylesImportHelper.cxx | 2 +- sdext/source/minimizer/graphiccollector.cxx | 3 +-- sfx2/source/control/templatelocalview.cxx | 2 +- slideshow/source/engine/shapes/shapeimporter.cxx | 2 +- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 2 +- 10 files changed, 14 insertions(+), 10 deletions(-)
New commits: commit 5568801a469ab45a763af97fcb5b2e6b6eacb3fd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 8 11:38:13 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 9 00:45:51 2025 +0200 cid#1556634 Variable copied when it could be moved cid#1659641 Variable copied when it could be moved cid#1659647 Variable copied when it could be moved cid#1659650 Variable copied when it could be moved cid#1659663 Variable copied when it could be moved cid#1659685 Variable copied when it could be moved cid#1659698 Variable copied when it could be moved cid#1659703 Variable copied when it could be moved cid#1659705 Variable copied when it could be moved Change-Id: If0d399dcce73d47be105ac4b1c342bcc010c56c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189181 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx index b76e88c9359e..038f01ad2fa1 100644 --- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx +++ b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx @@ -134,7 +134,7 @@ Reference< XResultSet > OFlatDatabaseMetaData::impl_getTypeInfo_throw( ) aRow[2] = new ORowSetValueDecorator(DataType::NUMERIC); aRow[3] = new ORowSetValueDecorator(sal_Int32(20)); aRow[15] = new ORowSetValueDecorator(sal_Int32(20)); - tmp.push_back(aRow); + tmp.push_back(std::move(aRow)); return tmp; }(); diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 300e91182b0d..8c4a91206e73 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -322,7 +322,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r VclPtr<OTableWindow> pNewTabWin = createWindow( pNewTabWinData ); if ( pNewTabWin->Init() ) { - m_pView->getController().getTableWindowData().push_back( pNewTabWinData); + m_pView->getController().getTableWindowData().push_back(std::move(pNewTabWinData)); // when we already have a table with this name insert the full qualified one instead if(m_aTableMap.contains(rWinName)) m_aTableMap[_rComposedName] = pNewTabWin; diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index b2431fd93e59..b7926b0bd8e3 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -3017,7 +3017,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( bool bAllow if (!(aInfo.DocumentState & DocState::Postponed)) { aInfo.DocumentState |= DocState::Postponed; - *pIt = aInfo; + *pIt = std::move(aInfo); // postponed documents will be saved if this method is called again! // That can be done by an outside started timer => E_POLL_FOR_USER_IDLE (if normal AutoSave is active) // or it must be done directly without starting any timer => E_CALL_ME_BACK (if Emergency- or SessionSave is active and must be finished ASAP!) diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index ebf92ef634e7..f0e08eaa1a21 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -177,7 +177,7 @@ void ScDocument::GetChartRanges( std::u16string_view rChartName, ::std::vector< { ScRangeList aRanges; aRanges.Parse( aRangeString, rSheetNameDoc, rSheetNameDoc.GetAddressConvention() ); - rRangesVector.push_back(aRanges); + rRangesVector.push_back(std::move(aRanges)); } } } diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx index d2d71aa7994a..4da7bb904acc 100644 --- a/sc/source/filter/xml/XMLStylesImportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx @@ -115,7 +115,7 @@ void ScMyStyleRanges::AddCurrencyRange(const ScRange& rRange, const std::optiona ScMyCurrencyStyle aStyle; if (pCurrency) aStyle.sCurrency = *pCurrency; - auto itPair = pCurrencyList->insert(aStyle); + auto itPair = pCurrencyList->insert(std::move(aStyle)); itPair.first->mpRanges->AddAndPartialCombine(rRange); } diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx index 61cf80142824..4e82bd94bfba 100644 --- a/sdext/source/minimizer/graphiccollector.cxx +++ b/sdext/source/minimizer/graphiccollector.cxx @@ -67,8 +67,7 @@ static void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraph }); if ( aIter == rGraphicEntities.end() ) { - GraphicCollector::GraphicEntity aEntity( rUser ); - rGraphicEntities.push_back( aEntity ); + rGraphicEntities.emplace_back(rUser); } else { diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index 8ccba5098d74..105129486b39 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -493,7 +493,7 @@ void TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, s aTemplateItem.aRegionName = pViewItem->maHelpText; aTemplateItem.aThumbnail = pViewItem->maPreview; - pTarget->maTemplates.push_back(aTemplateItem); + pTarget->maTemplates.push_back(std::move(aTemplateItem)); if (!bCopy) { diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index a073901bf5ea..361cdc35903d 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -444,7 +444,7 @@ void ShapeImporter::importPolygons(uno::Reference<beans::XPropertySet> const& xP pPolyPoly->setRGBALineColor( unoColor2RGBColor( nLineColor ).getIntegerColor() ); pPolyPoly->setStrokeWidth(fLineWidth); pPolyPoly->draw(); - maPolygons.push_back(pPolyPoly); + maPolygons.push_back(std::move(pPolyPoly)); } } } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index ef817b3b9cb5..93bf56d6844a 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -410,7 +410,7 @@ void DigitalSignaturesDialog::canRemove(const std::function<void(bool)>& rCallba std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Question, VclButtonsType::YesNo, XsResId(STR_XMLSECDLG_QUERY_REALLYREMOVE))); - xBox->runAsync(xBox, [onFinished](sal_Int32 nDlgRet) { + xBox->runAsync(xBox, [onFinished=std::move(onFinished)](sal_Int32 nDlgRet) { onFinished(nDlgRet == RET_YES); }); return; commit b88e89a8f6073915499dfaf05680e7a535680bee Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 8 09:27:17 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 9 00:45:39 2025 +0200 cid#1659717 silence Division or modulo by float zero Change-Id: Ib27714f5e1d79ff1880a7bf15ad108acc21dc610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189161 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/basegfx/source/curve/b2dbeziertools.cxx b/basegfx/source/curve/b2dbeziertools.cxx index 8fd4c4b84c74..2a4a360a71be 100644 --- a/basegfx/source/curve/b2dbeziertools.cxx +++ b/basegfx/source/curve/b2dbeziertools.cxx @@ -20,6 +20,7 @@ #include <basegfx/curve/b2dbeziertools.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> #include <algorithm> +#include <cassert> namespace basegfx { @@ -94,6 +95,10 @@ namespace basegfx return 1.0; } + // fDistance is >= fLength. For fLength to be zero, then fDistance has + // to be <= 0.0, but we return early in that case. + assert(fLength != 0 && "help coverity see it's not zero"); + // fDistance is in ]0.0 .. fLength[ if(mnEdgeCount == 1)