diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-01 15:18:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-01 18:52:21 +0200 |
commit | 6b252b6adb1613c6392cbb1462bae218d0d43032 (patch) | |
tree | 01e95df4441a71cafdbab3e302abdf695f4cdfd4 /filter | |
parent | pass ScRange around by value (diff) | |
download | core-6b252b6adb1613c6392cbb1462bae218d0d43032.tar.gz core-6b252b6adb1613c6392cbb1462bae218d0d43032.zip |
clang-tidy modernize-pass-by-value in filter
Change-Id: Id55c90665eaa29ee2ece07606429411549e06b8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135242
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
23 files changed, 64 insertions, 47 deletions
diff --git a/filter/source/config/cache/cacheupdatelistener.cxx b/filter/source/config/cache/cacheupdatelistener.cxx index de9d5704e783..c613d0549185 100644 --- a/filter/source/config/cache/cacheupdatelistener.cxx +++ b/filter/source/config/cache/cacheupdatelistener.cxx @@ -26,15 +26,16 @@ #include <unotools/configpaths.hxx> #include <rtl/ustring.hxx> #include <comphelper/processfactory.hxx> +#include <utility> namespace filter::config{ CacheUpdateListener::CacheUpdateListener(FilterCache &rFilterCache, - const css::uno::Reference< css::uno::XInterface >& xConfigAccess, + css::uno::Reference< css::uno::XInterface > xConfigAccess, FilterCache::EItemType eConfigType) : m_rCache(rFilterCache) - , m_xConfig(xConfigAccess) + , m_xConfig(std::move(xConfigAccess)) , m_eConfigType(eConfigType) { } diff --git a/filter/source/config/cache/cacheupdatelistener.hxx b/filter/source/config/cache/cacheupdatelistener.hxx index fc0789af8dec..3870b9916859 100644 --- a/filter/source/config/cache/cacheupdatelistener.hxx +++ b/filter/source/config/cache/cacheupdatelistener.hxx @@ -75,7 +75,7 @@ class CacheUpdateListener : public ::cppu::WeakImplHelper< css::util::XChangesLi specify the type of configuration. */ CacheUpdateListener(FilterCache &rFilterCache, - const css::uno::Reference< css::uno::XInterface >& xConfigAccess, + css::uno::Reference< css::uno::XInterface > xConfigAccess, FilterCache::EItemType eConfigType); diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 1aae850fd535..ae8c194faef4 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -36,6 +36,7 @@ #include <tools/urlobj.hxx> #include <comphelper/fileurl.hxx> #include <comphelper/sequence.hxx> +#include <utility> #define DEBUG_TYPE_DETECTION 0 @@ -345,7 +346,7 @@ class FindByType { OUString maType; public: - explicit FindByType(const OUString& rType) : maType(rType) {} + explicit FindByType(OUString aType) : maType(std::move(aType)) {} bool operator() (const FlatDetectionInfo& rInfo) const { return rInfo.sType == maType; diff --git a/filter/source/graphic/GraphicExportFilter.cxx b/filter/source/graphic/GraphicExportFilter.cxx index b0b93222dfa3..ee5843066ad5 100644 --- a/filter/source/graphic/GraphicExportFilter.cxx +++ b/filter/source/graphic/GraphicExportFilter.cxx @@ -25,14 +25,15 @@ #include <com/sun/star/frame/XModel.hpp> #include <cppuhelper/supportsservice.hxx> +#include <utility> #include <vcl/graphicfilter.hxx> #include <svl/outstrm.hxx> #include <svtools/DocumentToGraphicRenderer.hxx> using namespace css; -GraphicExportFilter::GraphicExportFilter( const uno::Reference< uno::XComponentContext > & rxContext ) - : mxContext(rxContext) +GraphicExportFilter::GraphicExportFilter( uno::Reference< uno::XComponentContext > xContext ) + : mxContext(std::move(xContext)) , mnTargetWidth(0) , mnTargetHeight(0) , mbSelectionOnly(false) diff --git a/filter/source/graphic/GraphicExportFilter.hxx b/filter/source/graphic/GraphicExportFilter.hxx index 6e2a30448817..c78b25d70a89 100644 --- a/filter/source/graphic/GraphicExportFilter.hxx +++ b/filter/source/graphic/GraphicExportFilter.hxx @@ -57,7 +57,7 @@ class GraphicExportFilter : const css::uno::Reference< css::drawing::XShape > & rxShape ) const; public: - explicit GraphicExportFilter( const css::uno::Reference< css::uno::XComponentContext > & rxContext ); + explicit GraphicExportFilter( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~GraphicExportFilter() override; // XServiceInfo diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 03f72587e1b2..5f84a0df7273 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -31,6 +31,7 @@ #include <svx/svdoole2.hxx> #include <svx/sdtfsitm.hxx> #include <editeng/outlobj.hxx> +#include <utility> #include <vcl/graph.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/svapp.hxx> @@ -4373,8 +4374,8 @@ struct EscherShapeListEntry uno::Reference<drawing::XShape>aXShape; sal_uInt32 n_EscherId; - EscherShapeListEntry(const uno::Reference<drawing::XShape> & rShape, sal_uInt32 nId) - : aXShape(rShape) + EscherShapeListEntry(uno::Reference<drawing::XShape> xShape, sal_uInt32 nId) + : aXShape(std::move(xShape)) , n_EscherId(nId) {} }; @@ -4862,8 +4863,8 @@ public: } -EscherEx::EscherEx(const std::shared_ptr<EscherExGlobal>& rxGlobal, SvStream* pOutStrm, bool bOOXML) - : mxGlobal(rxGlobal) +EscherEx::EscherEx(std::shared_ptr<EscherExGlobal> xGlobal, SvStream* pOutStrm, bool bOOXML) + : mxGlobal(std::move(xGlobal)) , mpOutStrm(pOutStrm) , mbOwnsStrm(false) , mnCurrentDg(0) diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx index 7aad72ba2dc7..376a453206fc 100644 --- a/filter/source/msfilter/mscodec.cxx +++ b/filter/source/msfilter/mscodec.cxx @@ -28,6 +28,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <comphelper/docpasswordhelper.hxx> #include <com/sun/star/beans/NamedValue.hpp> +#include <utility> #define DEBUG_MSO_ENCRYPTION_STD97 0 @@ -246,8 +247,8 @@ void MSCodec_Xor95::Skip( std::size_t nBytes ) mnOffset = (mnOffset + nBytes) & 0x0F; } -MSCodec97::MSCodec97(size_t nHashLen, const OUString& rEncKeyName) - : m_sEncKeyName(rEncKeyName) +MSCodec97::MSCodec97(size_t nHashLen, OUString aEncKeyName) + : m_sEncKeyName(std::move(aEncKeyName)) , m_nHashLen(nHashLen) , m_hCipher(rtl_cipher_create(rtl_Cipher_AlgorithmARCFOUR, rtl_Cipher_ModeStream)) , m_aDocId(16, 0) diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 66c3857711c2..66bac102ac89 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -23,6 +23,7 @@ #include <math.h> #include <limits> #include <limits.h> +#include <utility> #include <vector> #include <o3tl/any.hxx> @@ -5720,7 +5721,7 @@ void SvxMSDffManager::RemoveFromShapeOrder( SdrObject const * pObject ) const // exported class: Public Methods SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, - const OUString& rBaseURL, + OUString aBaseURL, sal_uInt32 nOffsDgg_, SvStream* pStData_, SdrModel* pSdrModel_,// see SetModel() below @@ -5735,7 +5736,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, nBLIPCount( USHRT_MAX ), // initialize with error, since we first check if the nGroupShapeFlags(ShapeFlag::NONE), // ensure initialization here, as some corrupted // files may yield to this being uninitialized - maBaseURL( rBaseURL ), + maBaseURL(std::move( aBaseURL )), mnIdClusters(0), rStCtrl( rStCtrl_ ), pStData( pStData_ ), @@ -5770,14 +5771,14 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, pStData->Seek( nOldPosData ); } -SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL ) +SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, OUString aBaseURL ) :DffPropertyReader( *this ), m_pBLIPInfos( new SvxMSDffBLIPInfos ), m_xShapeInfosByTxBxComp( new SvxMSDffShapeInfos_ByTxBxComp ), nOffsDgg( 0 ), nBLIPCount( USHRT_MAX ), // initialize with error, since we first have to check nGroupShapeFlags(ShapeFlag::NONE), - maBaseURL( rBaseURL ), + maBaseURL(std::move( aBaseURL )), mnIdClusters(0), rStCtrl( rStCtrl_ ), pStData( nullptr ), diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index d2236f62c30c..e3ccf6524471 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -28,12 +28,13 @@ #include <com/sun/star/form/XForm.hpp> #include <osl/diagnose.h> #include <filter/msfilter/msocximex.hxx> +#include <utility> using namespace ::com::sun::star; constexpr OUStringLiteral sWW8_form( u"WW-Standard" ); -SvxMSConvertOCXControls::SvxMSConvertOCXControls( const uno::Reference< frame::XModel >& rxModel) : mxModel(rxModel) +SvxMSConvertOCXControls::SvxMSConvertOCXControls( uno::Reference< frame::XModel > xModel) : mxModel(std::move(xModel)) { } diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index f746ad0e8a2d..aa781c4717c8 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/ui/ImageType.hpp> #include <com/sun/star/ui/ItemType.hpp> #include <com/sun/star/ui/ItemStyle.hpp> +#include <utility> #include <vcl/dibtools.hxx> #include <vcl/graph.hxx> #include <vcl/bitmapex.hxx> @@ -219,7 +220,7 @@ void TBCHeader::Print( FILE* fp ) } #endif -TBCData::TBCData( const TBCHeader& Header ) : rHeader( Header ) +TBCData::TBCData( TBCHeader Header ) : rHeader(std::move( Header )) { } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 1c1cf439b999..1e5d2bf1bb89 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <osl/endian.h> +#include <utility> #include <vcl/svapp.hxx> #include <unotools/tempfile.hxx> #include <tools/diagnose_ex.h> @@ -3188,9 +3189,9 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader const & rHd, } } -PPTBuGraEntry::PPTBuGraEntry( Graphic const & rGraphic, sal_uInt32 nInst ) : +PPTBuGraEntry::PPTBuGraEntry( Graphic aGraphic, sal_uInt32 nInst ) : nInstance ( nInst ), - aBuGra ( rGraphic ) {} + aBuGra (std::move( aGraphic )) {} PPTExtParaLevel::PPTExtParaLevel() : mnExtParagraphMask( 0 ) diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index a01db3452b10..aea2f816bde9 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -13,6 +13,7 @@ #include <comphelper/string.hxx> #include <unotools/fontcvt.hxx> #include <unotools/fontdefs.hxx> +#include <utility> #include <vcl/BitmapPalette.hxx> #include <filter/msfilter/escherex.hxx> #include <filter/msfilter/util.hxx> @@ -329,8 +330,8 @@ std::u16string_view findQuotedText( std::u16string_view rCommand, } -WW8ReadFieldParams::WW8ReadFieldParams( const OUString& _rData ) - : aData( _rData ) +WW8ReadFieldParams::WW8ReadFieldParams( OUString _aData ) + : aData(std::move( _aData )) , nFnd( 0 ) , nNext( 0 ) , nSavPtr( 0 ) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index e2c072a146b7..80aca22bc13a 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -24,6 +24,7 @@ #include <tools/poly.hxx> #include <tools/diagnose_ex.h> #include <unotools/resmgr.hxx> +#include <utility> #include <vcl/canvastools.hxx> #include <vcl/mapmod.hxx> #include <vcl/gdimtf.hxx> @@ -1053,7 +1054,7 @@ class PDFErrorRequest : private cppu::BaseMutex, { task::PDFExportException maExc; public: - explicit PDFErrorRequest( const task::PDFExportException& i_rExc ); + explicit PDFErrorRequest( task::PDFExportException aExc ); // XInteractionRequest virtual uno::Any SAL_CALL getRequest() override; @@ -1061,9 +1062,9 @@ public: }; -PDFErrorRequest::PDFErrorRequest( const task::PDFExportException& i_rExc ) : +PDFErrorRequest::PDFErrorRequest( task::PDFExportException aExc ) : PDFErrorRequestBase( m_aMutex ), - maExc( i_rExc ) + maExc(std::move( aExc )) { } diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx index f45edd6cb5b6..05eb74769b60 100644 --- a/filter/source/storagefilterdetect/filterdetect.cxx +++ b/filter/source/storagefilterdetect/filterdetect.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> +#include <utility> using namespace ::com::sun::star; using utl::MediaDescriptor; @@ -75,8 +76,8 @@ OUString getInternalFromMediaType(std::u16string_view aMediaType) } -StorageFilterDetect::StorageFilterDetect(const uno::Reference<uno::XComponentContext>& xCxt) : - mxCxt(xCxt) {} +StorageFilterDetect::StorageFilterDetect(uno::Reference<uno::XComponentContext> xCxt) : + mxCxt(std::move(xCxt)) {} StorageFilterDetect::~StorageFilterDetect() {} diff --git a/filter/source/storagefilterdetect/filterdetect.hxx b/filter/source/storagefilterdetect/filterdetect.hxx index 0b7849f2d979..052e2c2ffd80 100644 --- a/filter/source/storagefilterdetect/filterdetect.hxx +++ b/filter/source/storagefilterdetect/filterdetect.hxx @@ -35,7 +35,7 @@ class StorageFilterDetect : public cppu::WeakImplHelper< public: - explicit StorageFilterDetect (const css::uno::Reference<css::uno::XComponentContext>& xCxt); + explicit StorageFilterDetect (css::uno::Reference<css::uno::XComponentContext> xCxt); virtual ~StorageFilterDetect() override; // XExtendedFilterDetection diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index d2f44023b590..7aced676430f 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -37,6 +37,7 @@ #include <rtl/character.hxx> #include <unotools/resmgr.hxx> #include <unotools/streamwrap.hxx> +#include <utility> using namespace ::cppu; using namespace ::osl; @@ -131,14 +132,14 @@ namespace T602ImportFilter { static inistruct ini; -T602ImportFilter::T602ImportFilter(const css::uno::Reference<css::uno::XComponentContext > &r ) - : mxContext(r) +T602ImportFilter::T602ImportFilter(css::uno::Reference<css::uno::XComponentContext > x ) + : mxContext(std::move(x)) , node(tnode::START) { } -T602ImportFilter::T602ImportFilter(css::uno::Reference<css::io::XInputStream> const & xInputStream) - : mxInputStream(xInputStream) +T602ImportFilter::T602ImportFilter(css::uno::Reference<css::io::XInputStream> xInputStream) + : mxInputStream(std::move(xInputStream)) , node(tnode::START) { } diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx index 04376a1f3c26..26fa088faa4b 100644 --- a/filter/source/t602/t602filter.hxx +++ b/filter/source/t602/t602filter.hxx @@ -224,8 +224,8 @@ private: bool importImpl( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ); public: - explicit T602ImportFilter(const css::uno::Reference<css::uno::XComponentContext > &r ); - explicit T602ImportFilter(css::uno::Reference<css::io::XInputStream> const & xInputStream); + explicit T602ImportFilter(css::uno::Reference<css::uno::XComponentContext > x ); + explicit T602ImportFilter(css::uno::Reference<css::io::XInputStream> xInputStream); virtual ~T602ImportFilter() override; // XFilter diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx index 43db4e939ba7..a276d396eda2 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> +#include <utility> enum FilterType @@ -64,8 +65,8 @@ class XmlFilterAdaptor final : public cppu::WeakImplHelper public: - explicit XmlFilterAdaptor( const css::uno::Reference< css::uno::XComponentContext > & rxContext) - : mxContext(rxContext) + explicit XmlFilterAdaptor( css::uno::Reference< css::uno::XComponentContext > xContext) + : mxContext(std::move(xContext)) , meType(FILTER_IMPORT) { } diff --git a/filter/source/xmlfilterdetect/filterdetect.hxx b/filter/source/xmlfilterdetect/filterdetect.hxx index 61b6dfaf53ee..c84b9f06612e 100644 --- a/filter/source/xmlfilterdetect/filterdetect.hxx +++ b/filter/source/xmlfilterdetect/filterdetect.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase.hxx> +#include <utility> namespace com::sun::star::uno { class XComponentContext; @@ -38,8 +39,8 @@ class FilterDetect final : public cppu::WeakImplHelper < css::uno::Reference< css::uno::XComponentContext > mxCtx; public: - explicit FilterDetect( const css::uno::Reference< css::uno::XComponentContext > &rxCtx) - : mxCtx( rxCtx ) {} + explicit FilterDetect( css::uno::Reference< css::uno::XComponentContext > xCtx) + : mxCtx(std::move( xCtx )) {} //XExtendedFilterDetection virtual OUString SAL_CALL detect( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) override; diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index 6cfe82c30a2a..1a7c34805f1b 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -386,8 +386,8 @@ namespace XSLT } LibXSLTTransformer::LibXSLTTransformer( - const css::uno::Reference<XComponentContext> & rxContext) : - m_xContext(rxContext) + css::uno::Reference<XComponentContext> xContext) : + m_xContext(std::move(xContext)) { } diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx index 266fa2c559e1..6cfaebe69a92 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.hxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx @@ -131,7 +131,7 @@ namespace XSLT public: // ctor... - LibXSLTTransformer(const css::uno::Reference<css::uno::XComponentContext> &r); + LibXSLTTransformer(css::uno::Reference<css::uno::XComponentContext> x); // XServiceInfo virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) override; diff --git a/filter/source/xsltfilter/OleHandler.hxx b/filter/source/xsltfilter/OleHandler.hxx index 485541ee1f3b..d59429aacf4d 100644 --- a/filter/source/xsltfilter/OleHandler.hxx +++ b/filter/source/xsltfilter/OleHandler.hxx @@ -13,6 +13,7 @@ #include <cstring> #include <map> #include <string_view> +#include <utility> #include <vector> #include <iostream> #include <libxml/parser.h> @@ -56,8 +57,8 @@ namespace XSLT class OleHandler { public: - OleHandler(const css::uno::Reference<XComponentContext>& rxContext) - : m_xContext(rxContext) + OleHandler(css::uno::Reference<XComponentContext> xContext) + : m_xContext(std::move(xContext)) , m_tcontext(nullptr) { } diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index d22c372a72f5..1052a381693b 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> #include <com/sun/star/xml/xslt/XSLT2Transformer.hpp> #include <com/sun/star/xml/xslt/XSLTTransformer.hpp> +#include <utility> #define TRANSFORMATION_TIMEOUT_SEC 60 @@ -147,7 +148,7 @@ namespace XSLT public: // ctor... - explicit XSLTFilter(const css::uno::Reference<XComponentContext> &r); + explicit XSLTFilter(css::uno::Reference<XComponentContext> x); // XServiceInfo virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) override; @@ -180,8 +181,8 @@ namespace XSLT } - XSLTFilter::XSLTFilter(const css::uno::Reference<XComponentContext> &r): - m_xContext(r), m_bTerminated(false), m_bError(false) + XSLTFilter::XSLTFilter(css::uno::Reference<XComponentContext> x): + m_xContext(std::move(x)), m_bTerminated(false), m_bError(false) {} void |