From b36612d4a34e4ab131c904a9e35ab3e2bded76f5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 3 May 2012 12:22:29 +0100 Subject: Fix sot stream bustage We want the Tell position of the wrapper stream, not that of the underlying wrapped stream. Change-Id: I5d30192dbc3746104ca2127d9a747ef70b85a136 --- sot/source/sdstor/stg.cxx | 14 +++++++------- sot/source/sdstor/storage.cxx | 2 +- sot/source/sdstor/ucbstorage.cxx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'sot/source') diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 4f4e991ae6ec..1f8b5bd66bce 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -234,13 +234,6 @@ sal_uLong StorageStream::Seek( sal_uLong n ) return n; } -sal_Size StorageStream::remainingSize() -{ - if( Validate() ) - return pEntry->GetSize() - Tell(); - return 0; -} - void StorageStream::Flush() { // Flushing means committing, since streams are never transacted @@ -259,6 +252,13 @@ sal_Bool StorageStream::SetSize( sal_uLong nNewSize ) return sal_False; } +sal_uLong StorageStream::GetSize() const +{ + if( Validate() ) + return pEntry->GetSize(); + return 0; +} + sal_Bool StorageStream::Commit() { if( !Validate() ) diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 67b270f33863..c4120bd488de 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -289,7 +289,7 @@ sal_uInt32 SotStorageStream::GetSize() const sal_Size SotStorageStream::remainingSize() { if (pOwnStm) - return pOwnStm->remainingSize(); + return pOwnStm->GetSize() - Tell(); return SvStream::remainingSize(); } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 2a1a00047221..fd5761a2f384 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1554,9 +1554,9 @@ sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::u return sal_False; } -sal_Size UCBStorageStream::remainingSize() +sal_uLong UCBStorageStream::GetSize() const { - return pImp->GetSize() - Tell(); + return pImp->GetSize(); } UCBStorage::UCBStorage( SvStream& rStrm, sal_Bool bDirect ) -- cgit