diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-12 11:49:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 06:15:21 +0000 |
commit | 14df26ac57696c11fd344bb16ec22738e42377fc (patch) | |
tree | 38d06a93a5f01e014be6b93cbc420d016bd4405e /unotools | |
parent | 20adf4683c7d38ad41edac586b897757393c8029 (diff) |
XUnoTunnel->dynamic_cast in comphelper::ByteReader and comphelper::ByteWriter
Change-Id: I1f8c864a939dff1252ba15f517f63b62d1a1e1fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145393
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/streaming/streamwrap.cxx | 8 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 6 |
2 files changed, 1 insertions, 13 deletions
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index bc6e65779a10..7cb90aa3a63f 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -157,14 +157,6 @@ void OInputStreamWrapper::checkError() const throw css::io::NotConnectedException("utl::OInputStreamWrapper error " + e.toString(), const_cast<css::uno::XWeak*>(static_cast<const css::uno::XWeak*>(this))); } -sal_Int64 SAL_CALL OInputStreamWrapper::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) -{ - if (rIdentifier == comphelper::ByteReader::getUnoTunnelId()) - return reinterpret_cast<sal_Int64>(static_cast<comphelper::ByteReader*>(this)); - return 0; -} - - //= OSeekableInputStreamWrapper OSeekableInputStreamWrapper::~OSeekableInputStreamWrapper() = default; diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 7231e0b46579..83ef4f75ad0a 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1111,11 +1111,7 @@ ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, return ERRCODE_IO_PENDING; } - Reference< css::lang::XUnoTunnel > xTunnel( xStream, UNO_QUERY ); - comphelper::ByteReader* pByteReader = nullptr; - if (xTunnel) - pByteReader = reinterpret_cast< comphelper::ByteReader* >( xTunnel->getSomething( comphelper::ByteReader::getUnoTunnelId() ) ); - + comphelper::ByteReader* pByteReader = dynamic_cast< comphelper::ByteReader* >(xStream.get()); if (pByteReader) { nSize = pByteReader->readSomeBytes( static_cast<sal_Int8*>(pBuffer), sal_Int32(nCount) ); |