diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 17:00:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 19:45:48 +0200 |
commit | f4ac99f717d7365fc7d1f0adbf72a9bb4d4c8db5 (patch) | |
tree | bb263a9aa6c17ed7103078b8bdb991b6db17b265 /xmlscript | |
parent | fa311ad62f935d6469b77936d477125d98dbee60 (diff) |
loplugin:moveparam in xmlscript
Change-Id: I8c33291dae8a4f90c02f47d823b127ca4e383d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/qa/cppunit/test.cxx | 2 | ||||
-rw-r--r-- | xmlscript/source/xml_helper/xml_byteseq.cxx | 10 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/xmlscript/qa/cppunit/test.cxx b/xmlscript/qa/cppunit/test.cxx index 572fae867423..aa8bd934ea14 100644 --- a/xmlscript/qa/cppunit/test.cxx +++ b/xmlscript/qa/cppunit/test.cxx @@ -92,7 +92,7 @@ Reference<container::XNameContainer> XmlScriptTest::importFile(std::u16string_vi "com.sun.star.awt.UnoControlDialogModel", mxComponentContext), UNO_QUERY); - ::xmlscript::importDialogModel(::xmlscript::createInputStream(bytes), xDialogModel, + ::xmlscript::importDialogModel(::xmlscript::createInputStream(std::move(bytes)), xDialogModel, mxComponentContext, nullptr); Reference<lang::XComponent> xDialogModelComp(xDialogModel, UNO_QUERY); diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx b/xmlscript/source/xml_helper/xml_byteseq.cxx index 693ef301384e..2ae8ecea1661 100644 --- a/xmlscript/source/xml_helper/xml_byteseq.cxx +++ b/xmlscript/source/xml_helper/xml_byteseq.cxx @@ -41,8 +41,8 @@ class BSeqInputStream sal_Int32 _nPos; public: - explicit BSeqInputStream( std::vector<sal_Int8> const & rSeq ) - : _seq( rSeq ) + explicit BSeqInputStream( std::vector<sal_Int8>&& rSeq ) + : _seq( std::move(rSeq) ) , _nPos( 0 ) {} @@ -134,9 +134,9 @@ void BSeqOutputStream::closeOutput() { } -Reference< io::XInputStream > createInputStream( std::vector<sal_Int8> const & rInData ) +Reference< io::XInputStream > createInputStream( std::vector<sal_Int8>&& rInData ) { - return new BSeqInputStream( rInData ); + return new BSeqInputStream( std::move(rInData) ); } Reference< io::XInputStream > createInputStream( const sal_Int8* pData, int len ) @@ -145,7 +145,7 @@ Reference< io::XInputStream > createInputStream( const sal_Int8* pData, int len if (len != 0) { memcpy( rInData.data(), pData, len); } - return new BSeqInputStream( rInData ); + return new BSeqInputStream( std::move(rInData) ); } Reference< io::XOutputStream > createOutputStream( std::vector<sal_Int8> * pOutData ) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx index 6b3d9c425417..be3605de59cd 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx @@ -40,8 +40,8 @@ class InputStreamProvider std::vector<sal_Int8> const _bytes; public: - explicit InputStreamProvider( std::vector<sal_Int8> const & rBytes ) - : _bytes( rBytes ) + explicit InputStreamProvider( std::vector<sal_Int8>&& rBytes ) + : _bytes( std::move(rBytes) ) { } @@ -53,7 +53,7 @@ public: uno::Reference< io::XInputStream > InputStreamProvider::createInputStream() { - return ::xmlscript::createInputStream( _bytes ); + return ::xmlscript::createInputStream( std::vector(_bytes) ); } uno::Reference< io::XInputStreamProvider > exportDialogModel( @@ -69,7 +69,7 @@ uno::Reference< io::XInputStreamProvider > exportDialogModel( uno::Reference< xml::sax::XExtendedDocumentHandler > xHandler(xWriter, uno::UNO_QUERY_THROW); exportDialogModel( xHandler, xDialogModel, xDocument ); - return new InputStreamProvider( aBytes ); + return new InputStreamProvider( std::move(aBytes) ); } void importDialogModel( |