include/docmodel/styles/ChartStyle.hxx | 14 +++++++------- oox/source/drawingml/chart/stylemodel.cxx | 2 +- sc/source/ui/view/viewdata.cxx | 4 +++- vcl/source/bitmap/bitmap.cxx | 4 ++-- vcl/source/filter/svm/SvmReader.cxx | 10 +++++----- vcl/source/rendercontext/drawmode.cxx | 2 +- 6 files changed, 19 insertions(+), 17 deletions(-)
New commits: commit 0c72ae925e2c76f5fd6e04a4e747ae955e8e13dd Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 6 10:04:43 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 6 12:36:30 2025 +0200 cid#1665283 Variable copied when it could be moved and cid#1665282 Variable copied when it could be moved cid#1665279 Variable copied when it could be moved cid#1665278 Variable copied when it could be moved cid#1665276 Variable copied when it could be moved cid#1665275 Variable copied when it could be moved cid#1665257 Variable copied when it could be moved Change-Id: I222860c6385693610b95f4d674d4d0da59e75a5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190635 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/include/docmodel/styles/ChartStyle.hxx b/include/docmodel/styles/ChartStyle.hxx index 401a518f2fb3..353a2b0ffcb6 100644 --- a/include/docmodel/styles/ChartStyle.hxx +++ b/include/docmodel/styles/ChartStyle.hxx @@ -56,14 +56,14 @@ struct StyleEntry std::shared_ptr<StyleColor> aFontClr, std::shared_ptr<oox::drawingml::Shape> aShape, std::shared_ptr<oox::PropertyMap> aCharProps, std::shared_ptr<oox::PropertyMap> aBodyProps) - : mxLnClr(aLnClr) + : mxLnClr(std::move(aLnClr)) , mfLineWidthScale(fLineScale) - , mxFillClr(aFillClr) - , mxEffectClr(aEffectClr) - , mxFontClr(aFontClr) - , mxShapePr(aShape) - , mrTextCharacterPr(aCharProps) - , mxTextBodyPr(aBodyProps) + , mxFillClr(std::move(aFillClr)) + , mxEffectClr(std::move(aEffectClr)) + , mxFontClr(std::move(aFontClr)) + , mxShapePr(std::move(aShape)) + , mrTextCharacterPr(std::move(aCharProps)) + , mxTextBodyPr(std::move(aBodyProps)) { } }; diff --git a/oox/source/drawingml/chart/stylemodel.cxx b/oox/source/drawingml/chart/stylemodel.cxx index c72c8391179a..526fb4cbbbbb 100644 --- a/oox/source/drawingml/chart/stylemodel.cxx +++ b/oox/source/drawingml/chart/stylemodel.cxx @@ -43,7 +43,7 @@ model::StyleEntry StyleEntryModel::toStyleEntry(oox::core::XmlFilterBase& rFilte } return model::StyleEntry(mxLnRef, mfLineWidthScale, mxFillRef, mxEffectRef, mxFontRef, - mxShapeProp, aCharMap, aBodyMap); + mxShapeProp, std::move(aCharMap), std::move(aBodyMap)); } } // namespace oox::drawingml::chart diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index a5fc7e22a98b..54f40d34d2a4 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -153,9 +153,9 @@ static Bitmap createBitmapFromColorAndAlpha(const Bitmap& rColorBitmap, const Bi if (!bSuccess) { SAL_WARN("vcl", "Bitmap::Bitmap(): could not create image"); - return Bitmap(xSalBmp); + return Bitmap(std::move(xSalBmp)); } - Bitmap aRetBmp(xSalBmp); + Bitmap aRetBmp(std::move(xSalBmp)); BitmapScopedReadAccess pReadColorAcc(rColorBitmap); BitmapScopedReadAccess pReadAlphaAcc(rAlphaBitmap); BitmapScopedWriteAccess pWriteAcc(aRetBmp); diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 84e3959605a5..96239da18cbc 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -969,10 +969,10 @@ rtl::Reference<MetaAction> SvmReader::ClipRegionHandler() VersionCompatRead aCompat(mrStream); vcl::Region aRegion; ReadRegion(mrStream, aRegion); - bool aClip(false); - mrStream.ReadCharAsBool(aClip); + bool bClip(false); + mrStream.ReadCharAsBool(bClip); - return new MetaClipRegionAction(aRegion, aClip); + return new MetaClipRegionAction(std::move(aRegion), bClip); } rtl::Reference<MetaAction> SvmReader::ISectRectClipRegionHandler() @@ -991,7 +991,7 @@ rtl::Reference<MetaAction> SvmReader::ISectRegionClipRegionHandler() vcl::Region aRegion; ReadRegion(mrStream, aRegion); - return new MetaISectRegionClipRegionAction(aRegion); + return new MetaISectRegionClipRegionAction(std::move(aRegion)); } rtl::Reference<MetaAction> SvmReader::MoveClipRegionHandler() @@ -1178,7 +1178,7 @@ rtl::Reference<MetaAction> SvmReader::EPSHandler() GDIMetaFile aSubst; Read(aSubst); - return new MetaEPSAction(aPoint, aSize, aGfxLink, aSubst); + return new MetaEPSAction(aPoint, aSize, std::move(aGfxLink), aSubst); } rtl::Reference<MetaAction> SvmReader::RefPointHandler() diff --git a/vcl/source/rendercontext/drawmode.cxx b/vcl/source/rendercontext/drawmode.cxx index 26cf9f6cc3dd..03bece25a831 100644 --- a/vcl/source/rendercontext/drawmode.cxx +++ b/vcl/source/rendercontext/drawmode.cxx @@ -270,7 +270,7 @@ Bitmap GetBitmap(Bitmap const& rBitmap, DrawModeFlags nDrawMode) } else { - aBmp = aColorBmp; + aBmp = std::move(aColorBmp); } } commit 38f4e1c84ef8b9247909cf6cdf1087631a60ba02 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 6 10:01:31 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 6 12:36:23 2025 +0200 cid#1665261 Argument cannot be negative and approx 24 other similar cases Change-Id: I6bd05c61f6d1b7fcd983947ec4fa677f1c9ad2f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190634 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 5a08ff0afce9..9d12ef74e17f 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -4425,7 +4425,9 @@ SCTAB ScViewData::CurrentTabForData() const if (nSheetViewID != sc::DefaultSheetViewID) { SCTAB nTab = mrDoc.GetSheetViewNumber(GetTabNumber(), nSheetViewID); - return nTab; + if (ValidTab(nTab)) + return nTab; + SAL_WARN("sc.ui","ScViewData::CurrentTabForData - invalid tab: " << nTab); } return GetTabNumber(); }
