tabs to spaces
Change-Id: Iafc55604f49f0db08ad2b6b3940c1ade12835355
This commit is contained in:
@@ -114,7 +114,7 @@ OLEStorageBase::~OLEStorageBase()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( pIo && !pIo->DecRef() )
|
if( pIo && !pIo->DecRef() )
|
||||||
{
|
{
|
||||||
delete pIo;
|
delete pIo;
|
||||||
pIo = NULL;
|
pIo = NULL;
|
||||||
@@ -473,7 +473,7 @@ void Storage::Init( sal_Bool bCreate )
|
|||||||
bIsRoot = sal_True;
|
bIsRoot = sal_True;
|
||||||
|
|
||||||
OSL_ENSURE( pIo, "The pointer may not be empty at this point!" );
|
OSL_ENSURE( pIo, "The pointer may not be empty at this point!" );
|
||||||
if( pIo->Good() && pIo->GetStrm() )
|
if( pIo->Good() && pIo->GetStrm() )
|
||||||
{
|
{
|
||||||
sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
|
sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
|
||||||
pIo->GetStrm()->Seek( 0L );
|
pIo->GetStrm()->Seek( 0L );
|
||||||
@@ -549,7 +549,7 @@ const String& Storage::GetName() const
|
|||||||
|
|
||||||
void Storage::FillInfoList( SvStorageInfoList* pList ) const
|
void Storage::FillInfoList( SvStorageInfoList* pList ) const
|
||||||
{
|
{
|
||||||
if( Validate() && pList )
|
if( Validate() && pList )
|
||||||
{
|
{
|
||||||
StgIterator aIter( *pEntry );
|
StgIterator aIter( *pEntry );
|
||||||
StgDirEntry* p = aIter.First();
|
StgDirEntry* p = aIter.First();
|
||||||
|
@@ -62,7 +62,7 @@ public:
|
|||||||
SvStream* GetStrm() { return pStrm; }
|
SvStream* GetStrm() { return pStrm; }
|
||||||
void SetStrm( SvStream*, sal_Bool );
|
void SetStrm( SvStream*, sal_Bool );
|
||||||
void SetStrm( UCBStorageStream* );
|
void SetStrm( UCBStorageStream* );
|
||||||
sal_Bool IsWritable() { return ( pStrm && pStrm->IsWritable() ); }
|
sal_Bool IsWritable() { return ( pStrm && pStrm->IsWritable() ); }
|
||||||
sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); }
|
sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); }
|
||||||
sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); }
|
sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); }
|
||||||
sal_uLong GetError() { return nError; }
|
sal_uLong GetError() { return nError; }
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ) : StgAvlNode()
|
StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ) : StgAvlNode()
|
||||||
{
|
{
|
||||||
*pbOk = aEntry.Load( pBuffer, nBufferLen );
|
*pbOk = aEntry.Load( pBuffer, nBufferLen );
|
||||||
|
|
||||||
InitMembers();
|
InitMembers();
|
||||||
}
|
}
|
||||||
@@ -259,9 +259,9 @@ void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig )
|
|||||||
sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
|
sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
|
||||||
delete pStgStrm;
|
delete pStgStrm;
|
||||||
if( !bForceBig && aEntry.GetSize() < nThreshold )
|
if( !bForceBig && aEntry.GetSize() < nThreshold )
|
||||||
pStgStrm = new StgSmallStrm( rIo, *this );
|
pStgStrm = new StgSmallStrm( rIo, *this );
|
||||||
else
|
else
|
||||||
pStgStrm = new StgDataStrm( rIo, *this );
|
pStgStrm = new StgDataStrm( rIo, *this );
|
||||||
if( bInvalid && aEntry.GetSize() )
|
if( bInvalid && aEntry.GetSize() )
|
||||||
{
|
{
|
||||||
// This entry has invalid data, so delete that data
|
// This entry has invalid data, so delete that data
|
||||||
|
@@ -62,7 +62,7 @@ public:
|
|||||||
sal_Bool bDirect; // sal_True: direct mode
|
sal_Bool bDirect; // sal_True: direct mode
|
||||||
sal_Bool bZombie; // sal_True: Removed From StgIo
|
sal_Bool bZombie; // sal_True: Removed From StgIo
|
||||||
sal_Bool bInvalid; // sal_True: invalid entry
|
sal_Bool bInvalid; // sal_True: invalid entry
|
||||||
StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk );
|
StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk );
|
||||||
StgDirEntry( const StgEntry& );
|
StgDirEntry( const StgEntry& );
|
||||||
~StgDirEntry();
|
~StgDirEntry();
|
||||||
|
|
||||||
|
@@ -121,7 +121,7 @@ sal_Bool StgHeader::Load( StgIo& rIo )
|
|||||||
{
|
{
|
||||||
SvStream& r = *rIo.GetStrm();
|
SvStream& r = *rIo.GetStrm();
|
||||||
bResult = Load( r );
|
bResult = Load( r );
|
||||||
bResult = ( bResult && rIo.Good() );
|
bResult = ( bResult && rIo.Good() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return bResult;
|
return bResult;
|
||||||
@@ -257,7 +257,7 @@ sal_Bool StgEntry::Init()
|
|||||||
nLeft = 0;
|
nLeft = 0;
|
||||||
nRight = 0;
|
nRight = 0;
|
||||||
nChild = 0;
|
nChild = 0;
|
||||||
memset( &aClsId, 0, sizeof( aClsId ) );
|
memset( &aClsId, 0, sizeof( aClsId ) );
|
||||||
nFlags = 0;
|
nFlags = 0;
|
||||||
nMtime[0] = 0; nMtime[1] = 0;
|
nMtime[0] = 0; nMtime[1] = 0;
|
||||||
nAtime[0] = 0; nAtime[1] = 0;
|
nAtime[0] = 0; nAtime[1] = 0;
|
||||||
@@ -362,7 +362,7 @@ sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
|
|||||||
if ( nBufSize < 128 )
|
if ( nBufSize < 128 )
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
|
||||||
SvMemoryStream r( (sal_Char*) pFrom, nBufSize, STREAM_READ );
|
SvMemoryStream r( (sal_Char*) pFrom, nBufSize, STREAM_READ );
|
||||||
for( short i = 0; i < 32; i++ )
|
for( short i = 0; i < 32; i++ )
|
||||||
r >> nName[ i ]; // 00 name as WCHAR
|
r >> nName[ i ]; // 00 name as WCHAR
|
||||||
r >> nNameLen // 40 size of name in bytes including 00H
|
r >> nNameLen // 40 size of name in bytes including 00H
|
||||||
@@ -388,7 +388,7 @@ sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
|
|||||||
if (n > nMaxLegalStr)
|
if (n > nMaxLegalStr)
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
|
||||||
if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && nPage1 != -2))
|
if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && nPage1 != -2))
|
||||||
{
|
{
|
||||||
// the size makes no sense for the substorage
|
// the size makes no sense for the substorage
|
||||||
// TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
|
// TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
|
||||||
|
@@ -129,7 +129,7 @@ public:
|
|||||||
void GetName( String& rName ) const;
|
void GetName( String& rName ) const;
|
||||||
// fill in the name
|
// fill in the name
|
||||||
short Compare( const StgEntry& ) const; // compare two entries
|
short Compare( const StgEntry& ) const; // compare two entries
|
||||||
sal_Bool Load( const void* pBuffer, sal_uInt32 nBufSize );
|
sal_Bool Load( const void* pBuffer, sal_uInt32 nBufSize );
|
||||||
void Store( void* );
|
void Store( void* );
|
||||||
StgEntryType GetType() const { return (StgEntryType) cType; }
|
StgEntryType GetType() const { return (StgEntryType) cType; }
|
||||||
sal_Int32 GetStartPage() const { return nPage1; }
|
sal_Int32 GetStartPage() const { return nPage1; }
|
||||||
|
@@ -95,7 +95,7 @@ void StgIo::SetupStreams()
|
|||||||
if( pRoot )
|
if( pRoot )
|
||||||
{
|
{
|
||||||
pDataFAT = new StgDataStrm( *this, aHdr.GetDataFATStart(), -1 );
|
pDataFAT = new StgDataStrm( *this, aHdr.GetDataFATStart(), -1 );
|
||||||
pDataStrm = new StgDataStrm( *this, *pRoot );
|
pDataStrm = new StgDataStrm( *this, *pRoot );
|
||||||
pDataFAT->SetIncrement( 1 << aHdr.GetPageSize() );
|
pDataFAT->SetIncrement( 1 << aHdr.GetPageSize() );
|
||||||
pDataStrm->SetIncrement( GetDataPageSize() );
|
pDataStrm->SetIncrement( GetDataPageSize() );
|
||||||
pDataStrm->SetEntry( *pRoot );
|
pDataStrm->SetEntry( *pRoot );
|
||||||
@@ -154,7 +154,7 @@ public:
|
|||||||
|
|
||||||
sal_Int32 GetPageSize() { return nPageSize; }
|
sal_Int32 GetPageSize() { return nPageSize; }
|
||||||
sal_Int32 Count() { return nPages; }
|
sal_Int32 Count() { return nPages; }
|
||||||
sal_Int32 operator[]( sal_Int32 nOffset )
|
sal_Int32 operator[]( sal_Int32 nOffset )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( nOffset >= 0 && nOffset < nPages, "Unexpected offset!" );
|
OSL_ENSURE( nOffset >= 0 && nOffset < nPages, "Unexpected offset!" );
|
||||||
return nOffset >= 0 && nOffset < nPages ? pFat[ nOffset ] : -2;
|
return nOffset >= 0 && nOffset < nPages ? pFat[ nOffset ] : -2;
|
||||||
@@ -206,8 +206,8 @@ sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect )
|
|||||||
sal_Int32 nCurPage = nPage;
|
sal_Int32 nCurPage = nPage;
|
||||||
while( nCount != 0 )
|
while( nCount != 0 )
|
||||||
{
|
{
|
||||||
if( nCurPage < 0 || nCurPage >= nPages )
|
if( nCurPage < 0 || nCurPage >= nPages )
|
||||||
return FAT_OUTOFBOUNDS;
|
return FAT_OUTOFBOUNDS;
|
||||||
pFree[ nCurPage ] = sal_False;
|
pFree[ nCurPage ] = sal_False;
|
||||||
nCurPage = pFat[ nCurPage ];
|
nCurPage = pFat[ nCurPage ];
|
||||||
//Stream zu lang
|
//Stream zu lang
|
||||||
@@ -265,7 +265,7 @@ sal_uLong Validator::ValidateMasterFATs()
|
|||||||
sal_Int32 nCount = rIo.aHdr.GetFATSize();
|
sal_Int32 nCount = rIo.aHdr.GetFATSize();
|
||||||
sal_uLong nErr;
|
sal_uLong nErr;
|
||||||
if ( !rIo.pFAT )
|
if ( !rIo.pFAT )
|
||||||
return FAT_INMEMORYERROR;
|
return FAT_INMEMORYERROR;
|
||||||
|
|
||||||
for( sal_Int32 i = 0; i < nCount; i++ )
|
for( sal_Int32 i = 0; i < nCount; i++ )
|
||||||
{
|
{
|
||||||
@@ -282,7 +282,7 @@ sal_uLong Validator::ValidateMasterFATs()
|
|||||||
sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
|
sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
|
||||||
{
|
{
|
||||||
if ( !pEntry )
|
if ( !pEntry )
|
||||||
return FAT_INMEMORYERROR;
|
return FAT_INMEMORYERROR;
|
||||||
|
|
||||||
StgIterator aIter( *pEntry );
|
StgIterator aIter( *pEntry );
|
||||||
sal_uLong nErr = FAT_OK;
|
sal_uLong nErr = FAT_OK;
|
||||||
@@ -311,7 +311,7 @@ sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
|
|||||||
sal_uLong Validator::ValidateDirectoryEntries()
|
sal_uLong Validator::ValidateDirectoryEntries()
|
||||||
{
|
{
|
||||||
if ( !rIo.pTOC )
|
if ( !rIo.pTOC )
|
||||||
return FAT_INMEMORYERROR;
|
return FAT_INMEMORYERROR;
|
||||||
|
|
||||||
// Normale DirEntries
|
// Normale DirEntries
|
||||||
sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() );
|
sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() );
|
||||||
|
@@ -117,7 +117,7 @@ class StgDataStrm : public StgStrm // a physical data stream
|
|||||||
void Init( sal_Int32 nBgn, sal_Int32 nLen );
|
void Init( sal_Int32 nBgn, sal_Int32 nLen );
|
||||||
public:
|
public:
|
||||||
StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
|
StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
|
||||||
StgDataStrm( StgIo&, StgDirEntry& );
|
StgDataStrm( StgIo&, StgDirEntry& );
|
||||||
void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty );
|
void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty );
|
||||||
void SetIncrement( short n ) { nIncr = n ; }
|
void SetIncrement( short n ) { nIncr = n ; }
|
||||||
virtual sal_Bool SetSize( sal_Int32 );
|
virtual sal_Bool SetSize( sal_Int32 );
|
||||||
@@ -136,7 +136,7 @@ class StgSmallStrm : public StgStrm // a logical data stream
|
|||||||
void Init( sal_Int32 nBgn, sal_Int32 nLen );
|
void Init( sal_Int32 nBgn, sal_Int32 nLen );
|
||||||
public:
|
public:
|
||||||
StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen );
|
StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen );
|
||||||
StgSmallStrm( StgIo&, StgDirEntry& );
|
StgSmallStrm( StgIo&, StgDirEntry& );
|
||||||
virtual sal_Int32 Read( void*, sal_Int32 );
|
virtual sal_Int32 Read( void*, sal_Int32 );
|
||||||
virtual sal_Int32 Write( const void*, sal_Int32 );
|
virtual sal_Int32 Write( const void*, sal_Int32 );
|
||||||
virtual sal_Bool IsSmallStrm() const { return sal_True; }
|
virtual sal_Bool IsSmallStrm() const { return sal_True; }
|
||||||
|
Reference in New Issue
Block a user