desktop/source/deployment/manager/dp_manager.cxx | 2 +- desktop/source/deployment/registry/help/dp_help.cxx | 5 ++--- desktop/source/migration/migration.cxx | 2 +- drawinglayer/source/dumper/XShapeDumper.cxx | 5 ++--- drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx | 2 +- drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 2 +- drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 2 +- drawinglayer/source/processor3d/baseprocessor3d.cxx | 2 +- drawinglayer/source/tools/primitive2dxmldump.cxx | 2 +- drawinglayer/source/tools/wmfemfhelper.cxx | 10 +++------- 10 files changed, 14 insertions(+), 20 deletions(-)
New commits: commit bc7a5d01a0a87f3d125fba2a0c3e4293108bb23a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Nov 11 11:16:44 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Nov 11 15:47:26 2024 +0100 clang-tidy: performance-unnecessary-copy-initialization in drawinglayer Change-Id: I7ed82c26a5c9d5e7803776e96b19bd8f4d98259e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176393 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index 61428d16e19c..5a9fef72a941 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -640,12 +640,11 @@ void dumpPolygonKindAsAttribute(drawing::PolygonKind ePolygonKind, xmlTextWriter void dumpPointSequenceSequence(const drawing::PointSequenceSequence& aPointSequenceSequence, const uno::Sequence<uno::Sequence< drawing::PolygonFlags > >* pFlags, xmlTextWriterPtr xmlWriter) { // LibreOffice proudly presents - The Sequenception - uno::Sequence<uno::Sequence< awt::Point > > pointSequenceSequence = aPointSequenceSequence; - sal_Int32 nPointsSequence = pointSequenceSequence.getLength(); + sal_Int32 nPointsSequence = aPointSequenceSequence.getLength(); for (sal_Int32 i = 0; i < nPointsSequence; ++i) { - uno::Sequence< awt::Point > pointSequence = pointSequenceSequence[i]; + const uno::Sequence< awt::Point >& pointSequence = aPointSequenceSequence[i]; sal_Int32 nPoints = pointSequence.getLength(); uno::Sequence< drawing::PolygonFlags> flagsSequence; diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index 3e0abc582732..eaa100c41fc5 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -50,7 +50,7 @@ namespace drawinglayer::primitive3d for(size_t a(0); a < nSourceCount; a++) { // get reference - const Primitive3DReference xReference(aSource[a]); + const Primitive3DReference& xReference(aSource[a]); if(xReference.is()) { diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index ff9fd83455ef..43f0856fd2f7 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -1153,7 +1153,7 @@ void CairoPixelProcessor2D::paintBitmapAlpha(const BitmapEx& rBitmapEx, // use unit geometry as fallback object geometry. Do *not* // transform, the below used method will use the already // correctly initialized local ViewInformation - basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon()); + const basegfx::B2DPolygon& aPolygon(basegfx::utils::createUnitPolygon()); // draw directly, done paintPolyPoylgonRGBA(basegfx::B2DPolyPolygon(aPolygon), aModifiedColor, fTransparency); diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 86e2a6237aee..d931320718d4 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -2319,7 +2319,7 @@ void VclMetafileProcessor2D::processUnifiedTransparencePrimitive2D( if (!bForceToMetafile && 1 == rContent.size()) { - const primitive2d::Primitive2DReference xReference(rContent.front()); + const primitive2d::Primitive2DReference& xReference(rContent.front()); pPoPoColor = dynamic_cast<const primitive2d::PolyPolygonColorPrimitive2D*>( xReference.get()); } diff --git a/drawinglayer/source/processor3d/baseprocessor3d.cxx b/drawinglayer/source/processor3d/baseprocessor3d.cxx index a9638dc92bb4..0969d45dca9b 100644 --- a/drawinglayer/source/processor3d/baseprocessor3d.cxx +++ b/drawinglayer/source/processor3d/baseprocessor3d.cxx @@ -49,7 +49,7 @@ namespace drawinglayer::processor3d for(size_t a(0); a < nCount; a++) { // get reference - const primitive3d::Primitive3DReference xReference(rSource[a]); + const primitive3d::Primitive3DReference& xReference(rSource[a]); if(xReference.is()) { diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx b/drawinglayer/source/tools/primitive2dxmldump.cxx index 218d4c8a3cc3..9e591a2281c0 100644 --- a/drawinglayer/source/tools/primitive2dxmldump.cxx +++ b/drawinglayer/source/tools/primitive2dxmldump.cxx @@ -549,7 +549,7 @@ public: { for (size_t i = 0; i < rSequence.size(); i++) { - drawinglayer::primitive3d::Primitive3DReference xReference = rSequence[i]; + const drawinglayer::primitive3d::Primitive3DReference& xReference = rSequence[i]; const auto* pBasePrimitive = static_cast<const drawinglayer::primitive3d::BasePrimitive3D*>(xReference.get()); sal_uInt32 nId = pBasePrimitive->getPrimitive3DID(); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 0e3c6e0611d2..c77c653d4ebd 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -921,7 +921,7 @@ namespace wmfemfhelper TargetHolder& rTarget, PropertyHolder const & rProperty) { - const BitmapEx aBitmapEx(rWallpaper.GetBitmap()); + const BitmapEx& aBitmapEx(rWallpaper.GetBitmap()); const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle()); // if bitmap visualisation is transparent, maybe background @@ -967,12 +967,10 @@ namespace wmfemfhelper else { // when a transformation is set, embed to it - const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill); - rTarget.append( new drawinglayer::primitive2d::TransformPrimitive2D( rProperty.getTransformation(), - drawinglayer::primitive2d::Primitive2DContainer { xPrim })); + drawinglayer::primitive2d::Primitive2DContainer { pBitmapWallpaperFill })); } } @@ -1227,12 +1225,10 @@ namespace wmfemfhelper else { // when a transformation is set, embed to it - const drawinglayer::primitive2d::Primitive2DReference aReference(pResult); - rTarget.append( new drawinglayer::primitive2d::TransformPrimitive2D( rProperty.getTransformation(), - drawinglayer::primitive2d::Primitive2DContainer { aReference })); + drawinglayer::primitive2d::Primitive2DContainer { pResult })); } } commit 40afc6f25a95fba8824b60d0ced265ff80e62a4b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Nov 11 11:15:50 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Nov 11 15:47:17 2024 +0100 clang-tidy: performance-unnecessary-copy-initialization in desktop Change-Id: I0e6ce8858fc058403020e2db863730f04cac70db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176392 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 99996531af5e..0e22618e04dd 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -411,7 +411,7 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( // Initialize logger which will be used in ProgressLogImpl (created below) rtl::Bootstrap::expandMacros(logFile); comphelper::EventLogger logger(xComponentContext, "unopkg"); - const Reference<XLogger> xLogger(logger.getLogger()); + const Reference<XLogger>& xLogger(logger.getLogger()); Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xComponentContext)); Sequence < beans::NamedValue > aSeq2 { { u"Formatter"_ustr, Any(xLogFormatter) }, {u"FileURL"_ustr, Any(logFile)} }; Reference<XLogHandler> xFileHandler(css::logging::FileHandler::createWithSettings(xComponentContext, aSeq2)); diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 936875a886eb..68882e1cd254 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -450,9 +450,8 @@ void BackendImpl::implProcessHelp( std::unique_ptr<OUString[]> pXhpFiles(new OUString[nXhpFileCount]); for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) { - OUString aXhpFile = aXhpFileVector[iXhp]; - OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); - pXhpFiles[iXhp] = aXhpRelFile; + const OUString& aXhpFile = aXhpFileVector[iXhp]; + pXhpFiles[iXhp] = aXhpFile.copy( nLenLangFolderURL ); } OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 439265546ae7..da01086b7a17 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -922,7 +922,7 @@ std::vector< MigrationModuleInfo > MigrationImpl::detectUIChangesForAllModules() uno::Sequence< OUString > lNames = xModules->getElementNames(); sal_Int32 nLength = lNames.getLength(); for (sal_Int32 i=0; i<nLength; ++i) { - OUString sModuleShortName = lNames[i]; + const OUString& sModuleShortName = lNames[i]; uno::Reference< embed::XStorage > xModule = xModules->openStorageElement(sModuleShortName, embed::ElementModes::READ); if (xModule.is()) { MigrationModuleInfo aModuleInfo;