diff options
author | Kai Sommerfeld <kso@openoffice.org> | 2000-12-06 11:31:00 +0000 |
---|---|---|
committer | Kai Sommerfeld <kso@openoffice.org> | 2000-12-06 11:31:00 +0000 |
commit | ce30df3f50f53f135329cc5b06241fa9f63909be (patch) | |
tree | 3655104358b65495ab3e74a0e19b29533a5483af /ucb/source/ucp | |
parent | 49661d2eece4079b7d980f82e133136334c67c89 (diff) |
#81371# - Fixed XStream_impl::getLength().
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r-- | ucb/source/ucp/file/shell.cxx | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index e9b21cd3f61e..1f780cef3d59 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shell.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: kso $ $Date: 2000-12-05 14:16:12 $ + * last change: $Author: kso $ $Date: 2000-12-06 12:31:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -920,7 +920,6 @@ XInputStream_impl::getLength( throw( io::IOException, uno::RuntimeException ) { - osl::DirectoryItem aDirectoryItem; osl::FileBase::RC err; sal_uInt64 uCurrentPos, uEndPos; @@ -1622,16 +1621,27 @@ XStream_impl::getLength( throw( io::IOException, uno::RuntimeException ) { - osl::DirectoryItem aDirectoryItem; - osl::FileBase::RC err = osl::DirectoryItem::get( m_aFile,aDirectoryItem ); + osl::FileBase::RC err; + sal_uInt64 uCurrentPos, uEndPos; + + err = m_aFile.getPos( uCurrentPos ); if( err != osl::FileBase::E_None ) throw io::IOException(); - osl::FileStatus aFileStatus( FileStatusMask_FileSize ); - aDirectoryItem.getFileStatus( aFileStatus ); - if( aFileStatus.isValid( FileStatusMask_FileSize ) ) - return sal_Int64( aFileStatus.getFileSize() ); - else + + err = m_aFile.setPos( Pos_End, 0 ); + if( err != osl::FileBase::E_None ) + throw io::IOException(); + + err = m_aFile.getPos( uEndPos ); + if( err != osl::FileBase::E_None ) + throw io::IOException(); + + err = m_aFile.setPos( Pos_Absolut, uCurrentPos ); + if( err != osl::FileBase::E_None ) throw io::IOException(); + else + return sal_Int64( uEndPos ); + } |