diff options
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/streaming/streamwrap.cxx | 18 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 9 |
2 files changed, 6 insertions, 21 deletions
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index bcc365d961b1..97d05180b020 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -177,16 +177,11 @@ sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getLength( ) ::osl::MutexGuard aGuard( m_aMutex ); checkConnected(); - sal_uInt32 nCurrentPos = m_pSvStream->Tell(); checkError(); - m_pSvStream->Seek(STREAM_SEEK_TO_END); - sal_uInt32 nEndPos = m_pSvStream->Tell(); - m_pSvStream->Seek(nCurrentPos); + sal_Int64 nEndPos = m_pSvStream->TellEnd(); - checkError(); - - return static_cast<sal_Int64>(nEndPos); + return nEndPos; } //= OOutputStreamWrapper @@ -268,16 +263,11 @@ sal_Int64 SAL_CALL OSeekableOutputStreamWrapper::getPosition( ) sal_Int64 SAL_CALL OSeekableOutputStreamWrapper::getLength( ) { - sal_uInt32 nCurrentPos = rStream.Tell(); checkError(); - rStream.Seek(STREAM_SEEK_TO_END); - sal_uInt32 nEndPos = rStream.Tell(); - rStream.Seek(nCurrentPos); - - checkError(); + sal_Int64 nEndPos = rStream.TellEnd(); - return static_cast<sal_Int64>(nEndPos); + return nEndPos; } OStreamWrapper::~OStreamWrapper() = default; diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 5437044b8586..8bfe8b14a009 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -338,16 +338,11 @@ sal_Int64 SAL_CALL OTempFileService::getLength( ) ::osl::MutexGuard aGuard( maMutex ); checkConnected(); - sal_uInt32 nCurrentPos = mpStream->Tell(); checkError(); - mpStream->Seek(STREAM_SEEK_TO_END); - sal_uInt32 nEndPos = mpStream->Tell(); - mpStream->Seek(nCurrentPos); + sal_Int64 nEndPos = mpStream->TellEnd(); - checkError(); - - return static_cast<sal_Int64>(nEndPos); + return nEndPos; } // XStream |