[Libreoffice-commits] .: sot/inc sot/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu May 3 04:23:45 PDT 2012
sot/inc/sot/stg.hxx | 6 +++---
sot/source/sdstor/stg.cxx | 14 +++++++-------
sot/source/sdstor/storage.cxx | 2 +-
sot/source/sdstor/ucbstorage.cxx | 4 ++--
4 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit b36612d4a34e4ab131c904a9e35ab3e2bded76f5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 3 12:22:29 2012 +0100
Fix sot stream bustage
We want the Tell position of the wrapper stream, not that of the underlying
wrapped stream.
Change-Id: I5d30192dbc3746104ca2127d9a747ef70b85a136
diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx
index ab567f3..d716995 100644
--- a/sot/inc/sot/stg.hxx
+++ b/sot/inc/sot/stg.hxx
@@ -90,11 +90,11 @@ public:
virtual sal_uLong Tell() = 0;
virtual void Flush() = 0;
virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0;
+ virtual sal_uLong GetSize() const = 0;
virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0;
virtual sal_Bool Commit() = 0;
virtual sal_Bool Revert() = 0;
virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0;
- virtual sal_Size remainingSize() = 0;
};
class BaseStorage : public StorageBase
@@ -172,6 +172,7 @@ public:
virtual sal_uLong Tell() { return nPos; }
virtual void Flush();
virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_uLong GetSize() const;
virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
virtual sal_Bool Commit();
virtual sal_Bool Revert();
@@ -179,7 +180,6 @@ public:
virtual sal_Bool ValidateMode( StreamMode ) const;
const SvStream* GetSvStream() const;
virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
- virtual sal_Size remainingSize();
};
class UCBStorageStream;
@@ -267,12 +267,12 @@ public:
virtual sal_uLong Tell();
virtual void Flush();
virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_uLong GetSize() const;
virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
virtual sal_Bool Commit();
virtual sal_Bool Revert();
virtual sal_Bool Validate( sal_Bool=sal_False ) const;
virtual sal_Bool ValidateMode( StreamMode ) const;
- virtual sal_Size remainingSize();
const SvStream* GetSvStream() const;
virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 4f4e991..1f8b5bd 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 67b270f..c4120bd 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 2a1a000..fd5761a 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 )
More information about the Libreoffice-commits
mailing list