diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-19 13:46:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-19 21:04:48 +0200 |
commit | 62531ec1091c7b3f6a3577889a18234790ec716d (patch) | |
tree | 72766dd4a58bbf61e2a56adc870d1a73307a9043 /unotools | |
parent | 5eb25f6a7ecb215f7bc81116cd930c1dec645e8d (diff) |
add ByteWriter to reduce memory copying when writing data
similarly to ByteReader
move both of them down to comphelper, since we want to use it from
comphelper, and comphelper is "below" unotools in the module dependency
graph
Change-Id: Ic98fa2268e125fd8e4378fb899ad5f97de721713
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/streaming/streamhelper.cxx | 10 | ||||
-rw-r--r-- | unotools/source/streaming/streamwrap.cxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 6 |
3 files changed, 5 insertions, 15 deletions
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index 39585ec5f369..b5f07e6a6a7f 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -22,10 +22,8 @@ #include <com/sun/star/io/BufferSizeExceededException.hpp> #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/io/NotConnectedException.hpp> -#include <comphelper/servicehelper.hxx> #include <o3tl/safeint.hxx> #include <unotools/streamhelper.hxx> -#include <unotools/bytereader.hxx> namespace utl { @@ -120,14 +118,6 @@ void SAL_CALL OInputStreamHelper::acquire() SAL_NOEXCEPT cppu::WeakImplHelper<css::io::XInputStream, css::io::XSeekable>::acquire(); } -ByteReader::~ByteReader() {} - -const css::uno::Sequence< sal_Int8 > & ByteReader::getUnoTunnelId() -{ - static const comphelper::UnoIdInit implId; - return implId.getSeq(); -} - } // namespace utl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index 0ed933b530e3..6a6cbbd20142 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -158,8 +158,8 @@ void OInputStreamWrapper::checkError() const sal_Int64 SAL_CALL OInputStreamWrapper::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if (rIdentifier == utl::ByteReader::getUnoTunnelId()) - return reinterpret_cast<sal_Int64>(static_cast<utl::ByteReader*>(this)); + if (rIdentifier == comphelper::ByteReader::getUnoTunnelId()) + return reinterpret_cast<sal_Int64>(static_cast<comphelper::ByteReader*>(this)); return 0; } diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index b40be28f2225..9cbee8ef6b95 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -56,9 +56,9 @@ #include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <comphelper/bytereader.hxx> #include <comphelper/storagehelper.hxx> #include <ucbhelper/content.hxx> -#include <unotools/bytereader.hxx> #include <mutex> using namespace ::com::sun::star::uno; @@ -1110,9 +1110,9 @@ ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, } Reference< css::lang::XUnoTunnel > xTunnel( xStream, UNO_QUERY ); - utl::ByteReader* pByteReader = nullptr; + comphelper::ByteReader* pByteReader = nullptr; if (xTunnel) - pByteReader = reinterpret_cast< utl::ByteReader* >( xTunnel->getSomething( utl::ByteReader::getUnoTunnelId() ) ); + pByteReader = reinterpret_cast< comphelper::ByteReader* >( xTunnel->getSomething( comphelper::ByteReader::getUnoTunnelId() ) ); if (pByteReader) { |