diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-02-02 19:01:51 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-02-02 22:59:45 +0100 |
commit | efe9bf61ed408e94a9171992c1582e00f21d209e (patch) | |
tree | 678d471d515c3b8da3d859ef7f28d8285f364589 /sot | |
parent | 108a95630d5f4a8cf8aa075cee950a75d2628dfe (diff) |
sal_Bool to bool
Change-Id: I7d05020b6e07268349fb269bd58ce11aeddf6631
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgdir.cxx | 196 | ||||
-rw-r--r-- | sot/source/sdstor/stgdir.hxx | 58 | ||||
-rw-r--r-- | sot/source/sdstor/stgstrms.cxx | 156 | ||||
-rw-r--r-- | sot/source/sdstor/stgstrms.hxx | 40 |
4 files changed, 225 insertions, 225 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index fd890fc5f261..31c2de2f205c 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -44,7 +44,7 @@ // Problem der Implementation: Keine Hierarchischen commits. Daher nur // insgesamt transaktionsorientert oder direkt. -StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ) : StgAvlNode() +StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, bool * pbOk ) : StgAvlNode() { *pbOk = aEntry.Load( pBuffer, nBufferLen ); @@ -71,14 +71,14 @@ void StgDirEntry::InitMembers() nEntry = nRefCnt = 0; nMode = STREAM_READ; - bDirect = sal_True; + bDirect = true; bInvalid = bCreated = bRenamed = bRemoved = bTemp = bDirty = - bZombie = sal_False; + bZombie = false; } StgDirEntry::~StgDirEntry() @@ -132,17 +132,17 @@ void StgDirEntry::Enum( sal_Int32& n ) // Delete all temporary entries before writing the TOC stream. // Until now Deltem is never called with bForce True -void StgDirEntry::DelTemp( sal_Bool bForce ) +void StgDirEntry::DelTemp( bool bForce ) { if( pLeft ) - ((StgDirEntry*) pLeft)->DelTemp( sal_False ); + ((StgDirEntry*) pLeft)->DelTemp( false ); if( pRight ) - ((StgDirEntry*) pRight)->DelTemp( sal_False ); + ((StgDirEntry*) pRight)->DelTemp( false ); if( pDown ) { // If the storage is dead, of course all elements are dead, too if( bInvalid && aEntry.GetType() == STG_STORAGE ) - bForce = sal_True; + bForce = true; pDown->DelTemp( bForce ); } if( ( bForce || bInvalid ) @@ -152,12 +152,12 @@ void StgDirEntry::DelTemp( sal_Bool bForce ) if( pUp ) { // this deletes the element if refcnt == 0! - sal_Bool bDel = nRefCnt == 0; + bool bDel = nRefCnt == 0; StgAvlNode::Remove( (StgAvlNode**) &pUp->pDown, this, bDel ); if( !bDel ) { pLeft = pRight = pDown = 0; - bInvalid = bZombie = sal_True; + bInvalid = bZombie = true; } } } @@ -165,26 +165,26 @@ void StgDirEntry::DelTemp( sal_Bool bForce ) // Save the tree into the given dir stream -sal_Bool StgDirEntry::Store( StgDirStrm& rStrm ) +bool StgDirEntry::Store( StgDirStrm& rStrm ) { - void* pEntry = rStrm.GetEntry( nEntry, sal_True ); + void* pEntry = rStrm.GetEntry( nEntry, true ); if( !pEntry ) - return sal_False; + return false; // Do not store the current (maybe not commited) entry aSave.Store( pEntry ); if( pLeft ) if( !((StgDirEntry*) pLeft)->Store( rStrm ) ) - return sal_False; + return false; if( pRight ) if( !((StgDirEntry*) pRight)->Store( rStrm ) ) - return sal_False; + return false; if( pDown ) if( !pDown->Store( rStrm ) ) - return sal_False; - return sal_True; + return false; + return true; } -sal_Bool StgDirEntry::StoreStream( StgIo& rIo ) +bool StgDirEntry::StoreStream( StgIo& rIo ) { if( aEntry.GetType() == STG_STREAM || aEntry.GetType() == STG_ROOT ) { @@ -201,27 +201,27 @@ sal_Bool StgDirEntry::StoreStream( StgIo& rIo ) } // or write the data stream else if( !Tmp2Strm() ) - return sal_False; + return false; } - return sal_True; + return true; } // Save all dirty streams -sal_Bool StgDirEntry::StoreStreams( StgIo& rIo ) +bool StgDirEntry::StoreStreams( StgIo& rIo ) { if( !StoreStream( rIo ) ) - return sal_False; + return false; if( pLeft ) if( !((StgDirEntry*) pLeft)->StoreStreams( rIo ) ) - return sal_False; + return false; if( pRight ) if( !((StgDirEntry*) pRight)->StoreStreams( rIo ) ) - return sal_False; + return false; if( pDown ) if( !pDown->StoreStreams( rIo ) ) - return sal_False; - return sal_True; + return false; + return true; } // Revert all directory entries after failure to write the TOC stream @@ -239,22 +239,22 @@ void StgDirEntry::RevertAll() // Look if any element of the tree is dirty -sal_Bool StgDirEntry::IsDirty() +bool StgDirEntry::IsDirty() { if( bDirty || bInvalid ) - return sal_True; + return true; if( pLeft && ((StgDirEntry*) pLeft)->IsDirty() ) - return sal_True; + return true; if( pRight && ((StgDirEntry*) pRight)->IsDirty() ) - return sal_True; + return true; if( pDown && pDown->IsDirty() ) - return sal_True; - return sal_False; + return true; + return false; } // Set up a stream. -void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig ) +void StgDirEntry::OpenStream( StgIo& rIo, bool bForceBig ) { sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold(); delete pStgStrm; @@ -266,7 +266,7 @@ void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig ) { // This entry has invalid data, so delete that data SetSize( 0L ); -// bRemoved = bInvalid = sal_False; +// bRemoved = bInvalid = false; } nPos = 0; } @@ -299,14 +299,14 @@ sal_Int32 StgDirEntry::GetSize() // Set the stream size. This means also creating a temp stream. -sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) +bool StgDirEntry::SetSize( sal_Int32 nNewSize ) { if ( !( nMode & STREAM_WRITE ) || (!bDirect && !pTmpStrm && !Strm2Tmp()) ) { - return sal_False; + return false; } if( nNewSize < nPos ) @@ -315,15 +315,15 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) { pTmpStrm->SetSize( nNewSize ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); - return sal_Bool( pTmpStrm->GetError() == SVSTREAM_OK ); + return pTmpStrm->GetError() == SVSTREAM_OK; } else { OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" ); if ( !pStgStrm ) - return sal_False; + return false; - sal_Bool bRes = sal_False; + bool bRes = false; StgIo& rIo = pStgStrm->GetIo(); sal_Int32 nThreshold = rIo.aHdr.GetThreshold(); // ensure the correct storage stream! @@ -355,11 +355,11 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) pStgStrm->Pos2Page( 0L ); if( pOld->Read( pBuf, nOldSize ) && pStgStrm->Write( pBuf, nOldSize ) ) - bRes = sal_True; + bRes = true; delete[] static_cast<sal_uInt8*>(pBuf); } else - bRes = sal_True; + bRes = true; if( bRes ) { pOld->SetSize( 0 ); @@ -377,7 +377,7 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) else { pStgStrm->Pos2Page( nPos ); - bRes = sal_True; + bRes = true; } } return bRes; @@ -517,12 +517,12 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) // Commit this entry -sal_Bool StgDirEntry::Commit() +bool StgDirEntry::Commit() { // OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" ); aSave = aEntry; - sal_Bool bRes = sal_True; + bool bRes = true; if( aEntry.GetType() == STG_STREAM ) { if( pTmpStrm ) @@ -543,7 +543,7 @@ sal_Bool StgDirEntry::Commit() // Revert the entry -sal_Bool StgDirEntry::Revert() +bool StgDirEntry::Revert() { aEntry = aSave; switch( aEntry.GetType() ) @@ -554,24 +554,24 @@ sal_Bool StgDirEntry::Revert() break; case STG_STORAGE: { - sal_Bool bSomeRenamed = sal_False; + bool bSomeRenamed = false; StgIterator aOIter( *this ); StgDirEntry* op = aOIter.First(); while( op ) { op->aEntry = op->aSave; - op->bDirty = sal_False; - bSomeRenamed = sal_Bool( bSomeRenamed | op->bRenamed ); + op->bDirty = false; + bSomeRenamed = ( bSomeRenamed | op->bRenamed ); // Remove any new entries if( op->bCreated ) { - op->bCreated = sal_False; + op->bCreated = false; op->Close(); - op->bInvalid = sal_True; + op->bInvalid = true; } // Reactivate any removed entries else if( op->bRemoved ) - op->bRemoved = op->bInvalid = op->bTemp = sal_False; + op->bRemoved = op->bInvalid = op->bTemp = false; op = aOIter.Next(); } // Resort all renamed entries @@ -586,12 +586,12 @@ sal_Bool StgDirEntry::Revert() StgAvlNode::Move ( (StgAvlNode**) &p->pUp->pDown, (StgAvlNode**) &p->pUp->pDown, p ); - p->bRenamed = sal_False; + p->bRenamed = false; } p = aIter.Next(); } } - DelTemp( sal_False ); + DelTemp( false ); break; } case STG_EMPTY: @@ -600,12 +600,12 @@ sal_Bool StgDirEntry::Revert() case STG_ROOT: break; } - return sal_True; + return true; } // Copy the stg stream to the temp stream -sal_Bool StgDirEntry::Strm2Tmp() +bool StgDirEntry::Strm2Tmp() { if( !pTmpStrm ) { @@ -615,7 +615,7 @@ sal_Bool StgDirEntry::Strm2Tmp() // It was already commited once pTmpStrm = new StgTmpStrm; if( pTmpStrm->GetError() == SVSTREAM_OK && pTmpStrm->Copy( *pCurStrm ) ) - return sal_True; + return true; n = 1; // indicates error } else @@ -628,7 +628,7 @@ sal_Bool StgDirEntry::Strm2Tmp() { OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" ); if ( !pStgStrm ) - return sal_False; + return false; sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast<void*>( aTempBytes ); @@ -660,15 +660,15 @@ sal_Bool StgDirEntry::Strm2Tmp() delete pTmpStrm; pTmpStrm = NULL; - return sal_False; + return false; } } - return sal_True; + return true; } // Copy the temp stream to the stg stream during the final commit -sal_Bool StgDirEntry::Tmp2Strm() +bool StgDirEntry::Tmp2Strm() { // We did commit once, but have not written since then if( !pTmpStrm ) @@ -677,7 +677,7 @@ sal_Bool StgDirEntry::Tmp2Strm() { OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" ); if ( !pStgStrm ) - return sal_False; + return false; sal_uLong n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); @@ -706,7 +706,7 @@ sal_Bool StgDirEntry::Tmp2Strm() pTmpStrm->Seek( nPos ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pNewStrm; - return sal_False; + return false; } else { @@ -722,12 +722,12 @@ sal_Bool StgDirEntry::Tmp2Strm() } } } - return sal_True; + return true; } // Check if the given entry is contained in this entry -sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg ) +bool StgDirEntry::IsContained( StgDirEntry* pStg ) { if( aEntry.GetType() == STG_STORAGE ) { @@ -736,25 +736,25 @@ sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg ) while( p ) { if( !p->aEntry.Compare( pStg->aEntry ) ) - return sal_False; + return false; if( p->aEntry.GetType() == STG_STORAGE ) if( !p->IsContained( pStg ) ) - return sal_False; + return false; p = aIter.Next(); } } - return sal_True; + return true; } // Invalidate all open entries by setting the RefCount to 0. If the bDel // flag is set, also set the invalid flag to indicate deletion during the // next dir stream flush. -void StgDirEntry::Invalidate( sal_Bool bDel ) +void StgDirEntry::Invalidate( bool bDel ) { // nRefCnt = 0; if( bDel ) - bRemoved = bInvalid = sal_True; + bRemoved = bInvalid = true; switch( aEntry.GetType() ) { case STG_STORAGE: @@ -813,7 +813,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) void* p = ( n == STG_FREE ) ? NULL : GetEntry( n ); if( p ) { - sal_Bool bOk(sal_False); + bool bOk(false); StgDirEntry* pCur = new StgDirEntry( p, STGENTRY_SIZE, &bOk ); if( !bOk ) @@ -888,7 +888,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) // Extend or shrink the directory stream. -sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes ) +bool StgDirStrm::SetSize( sal_Int32 nBytes ) { // Always allocate full pages if ( nBytes < 0 ) @@ -900,12 +900,12 @@ sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes ) // Save the TOC stream into a new substream after saving all data streams -sal_Bool StgDirStrm::Store() +bool StgDirStrm::Store() { if( !pRoot || !pRoot->IsDirty() ) - return sal_True; + return true; if( !pRoot->StoreStreams( rIo ) ) - return sal_False; + return false; // After writing all streams, the data FAT stream has changed, // so we have to commit the root again pRoot->Commit(); @@ -916,7 +916,7 @@ sal_Bool StgDirStrm::Store() nSize = nPos = 0; nOffset = 0; // Delete all temporary entries - pRoot->DelTemp( sal_False ); + pRoot->DelTemp( false ); // set the entry numbers sal_Int32 n = 0; pRoot->Enum( n ); @@ -924,19 +924,19 @@ sal_Bool StgDirStrm::Store() { nStart = nOldStart; nSize = nOldSize; pRoot->RevertAll(); - return sal_False; + return false; } // set up the cache elements for the new stream if( !Copy( STG_FREE, nSize ) ) { pRoot->RevertAll(); - return sal_False; + return false; } // Write the data to the new stream if( !pRoot->Store( *this ) ) { pRoot->RevertAll(); - return sal_False; + return false; } // fill any remaining entries with empty data sal_Int32 ne = nSize / STGENTRY_SIZE; @@ -944,23 +944,23 @@ sal_Bool StgDirStrm::Store() aEmpty.Init(); while( n < ne ) { - void* p = GetEntry( n++, sal_True ); + void* p = GetEntry( n++, true ); if( !p ) { pRoot->RevertAll(); - return sal_False; + return false; } aEmpty.Store( p ); } // Now we can release the old stream - pFat->FreePages( nOldStart, sal_True ); + pFat->FreePages( nOldStart, true ); rIo.aHdr.SetTOCStart( nStart ); - return sal_True; + return true; } // Get a dir entry. -void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty ) +void* StgDirStrm::GetEntry( sal_Int32 n, bool bDirty ) { if( n < 0 ) return NULL; @@ -968,7 +968,7 @@ void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty ) n *= STGENTRY_SIZE; if( n < 0 && n >= nSize ) return NULL; - return GetPtr( n, sal_True, bDirty ); + return GetPtr( n, true, bDirty ); } // Find a dir entry. @@ -1015,9 +1015,9 @@ StgDirEntry* StgDirStrm::Create } pRes->bInvalid = pRes->bRemoved = - pRes->bTemp = sal_False; + pRes->bTemp = false; pRes->bCreated = - pRes->bDirty = sal_True; + pRes->bDirty = true; } else { @@ -1027,7 +1027,7 @@ StgDirEntry* StgDirStrm::Create pRes->pUp = &rStg; pRes->ppRoot = &pRoot; pRes->bCreated = - pRes->bDirty = sal_True; + pRes->bDirty = true; } else { @@ -1040,44 +1040,44 @@ StgDirEntry* StgDirStrm::Create // Rename the given entry. -sal_Bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) +bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) { StgDirEntry* p = Find( rStg, rOld ); if( p ) { - if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, sal_False ) ) - return sal_False; + if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, false ) ) + return false; p->aEntry.SetName( rNew ); if( !StgAvlNode::Insert( (StgAvlNode**) &rStg.pDown, p ) ) - return sal_False; - p->bRenamed = p->bDirty = sal_True; - return sal_True; + return false; + p->bRenamed = p->bDirty = true; + return true; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return sal_False; + return false; } } // Move the given entry to a different storage. -sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) +bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) { StgDirEntry* p = Find( rStg1, rName ); if( p ) { if( !StgAvlNode::Move ( (StgAvlNode**) &rStg1.pDown, (StgAvlNode**) &rStg2.pDown, p ) ) - return sal_False; - p->bDirty = sal_True; - return sal_True; + return false; + p->bDirty = true; + return true; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return sal_False; + return false; } } diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index c62a035370eb..d2196d33be45 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -43,46 +43,46 @@ class StgDirEntry : public StgAvlNode StgTmpStrm* pCurStrm; // temp stream after commit sal_Int32 nEntry; // entry # in TOC stream (temp) sal_Int32 nPos; // current position - sal_Bool bDirty; // dirty directory entry - sal_Bool bCreated; // newly created entry - sal_Bool bRemoved; // removed per Invalidate() - sal_Bool bRenamed; // renamed + bool bDirty; // dirty directory entry + bool bCreated; // newly created entry + bool bRemoved; // removed per Invalidate() + bool bRenamed; // renamed void InitMembers(); // ctor helper virtual short Compare( const StgAvlNode* ) const; - sal_Bool StoreStream( StgIo& ); // store the stream - sal_Bool StoreStreams( StgIo& ); // store all streams + bool StoreStream( StgIo& ); // store the stream + bool StoreStreams( StgIo& ); // store all streams void RevertAll(); // revert the whole tree - sal_Bool Strm2Tmp(); // copy stgstream to temp file - sal_Bool Tmp2Strm(); // copy temp file to stgstream + bool Strm2Tmp(); // copy stgstream to temp file + bool Tmp2Strm(); // copy temp file to stgstream public: StgEntry aEntry; // entry data sal_Int32 nRefCnt; // reference count StreamMode nMode; // open mode - sal_Bool bTemp; // sal_True: delete on dir flush - sal_Bool bDirect; // sal_True: direct mode - sal_Bool bZombie; // sal_True: Removed From StgIo - sal_Bool bInvalid; // sal_True: invalid entry - StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ); + bool bTemp; // true: delete on dir flush + bool bDirect; // true: direct mode + bool bZombie; // true: Removed From StgIo + bool bInvalid; // true: invalid entry + StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, bool * pbOk ); StgDirEntry( const StgEntry& ); ~StgDirEntry(); - void Invalidate( sal_Bool=sal_False ); // invalidate all open entries + void Invalidate( bool=false ); // invalidate all open entries void Enum( sal_Int32& ); // enumerate entries for iteration - void DelTemp( sal_Bool ); // delete temporary entries - sal_Bool Store( StgDirStrm& ); // save entry into dir strm - sal_Bool IsContained( StgDirEntry* ); // check if subentry + void DelTemp( bool ); // delete temporary entries + bool Store( StgDirStrm& ); // save entry into dir strm + bool IsContained( StgDirEntry* ); // check if subentry - void SetDirty() { bDirty = sal_True; } - sal_Bool IsDirty(); + void SetDirty() { bDirty = true; } + bool IsDirty(); void ClearDirty(); - sal_Bool Commit(); - sal_Bool Revert(); + bool Commit(); + bool Revert(); - void OpenStream( StgIo&, sal_Bool=sal_False ); // set up an approbiate stream + void OpenStream( StgIo&, bool=false ); // set up an approbiate stream void Close(); sal_Int32 GetSize(); - sal_Bool SetSize( sal_Int32 ); + bool SetSize( sal_Int32 ); sal_Int32 Seek( sal_Int32 ); sal_Int32 Tell() { return nPos; } sal_Int32 Read( void*, sal_Int32 ); @@ -99,15 +99,15 @@ class StgDirStrm : public StgDataStrm public: StgDirStrm( StgIo& ); ~StgDirStrm(); - virtual sal_Bool SetSize( sal_Int32 ); // change the size - sal_Bool Store(); - void* GetEntry( sal_Int32 n, sal_Bool=sal_False );// get an entry + virtual bool SetSize( sal_Int32 ); // change the size + bool Store(); + void* GetEntry( sal_Int32 n, bool=false );// get an entry StgDirEntry* GetRoot() { return pRoot; } StgDirEntry* Find( StgDirEntry&, const String& ); StgDirEntry* Create( StgDirEntry&, const String&, StgEntryType ); - sal_Bool Remove( StgDirEntry&, const String& ); - sal_Bool Rename( StgDirEntry&, const String&, const String& ); - sal_Bool Move( StgDirEntry&, StgDirEntry&, const String& ); + bool Remove( StgDirEntry&, const String& ); + bool Rename( StgDirEntry&, const String&, const String& ); + bool Move( StgDirEntry&, StgDirEntry&, const String& ); }; class StgIterator : public StgAvlIterator diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index b2c94ef3b0e2..4dda8717978e 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -36,10 +36,10 @@ ///////////////////////////// class StgFAT /////////////////////////////// // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the master FAT stream (m == sal_True ) or a normal +// This stream is either the master FAT stream (m == true ) or a normal // storage stream, which then holds the FAT for small data allocations. -StgFAT::StgFAT( StgStrm& r, sal_Bool m ) : rStrm( r ) +StgFAT::StgFAT( StgStrm& r, bool m ) : rStrm( r ) { bPhys = m; nPageSize = rStrm.GetIo().GetPhysPageSize(); @@ -61,7 +61,7 @@ rtl::Reference< StgPage > StgFAT::GetPhysPage( sal_Int32 nByteOff ) nOffset = rStrm.GetOffset(); sal_Int32 nPhysPage = rStrm.GetPage(); // get the physical page (must be present) - pPg = rStrm.GetIo().Get( nPhysPage, sal_True ); + pPg = rStrm.GetIo().Get( nPhysPage, true ); } return pPg; } @@ -90,7 +90,7 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL; sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0; sal_Int32 nPages = rStrm.GetSize() >> 2; - sal_Bool bFound = sal_False; + bool bFound = false; rtl::Reference< StgPage > pPg; short nEntry = 0; for( sal_Int32 i = 0; i < nPages; i++, nEntry++ ) @@ -121,12 +121,12 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) { if( nTmpLen > nPgs && nTmpLen < nMaxLen ) // block > requested size - nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = sal_True; + nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = true; else if( nTmpLen >= nMinLen ) { // block < requested size nMinLen = nTmpLen, nMinStart = nTmpStart; - bFound = sal_True; + bFound = true; if( nTmpLen == nPgs ) break; } @@ -164,19 +164,19 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) // Set up the consecutive chain for a given block. -sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs ) +bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs ) { sal_Int32 nPos = nStart << 2; rtl::Reference< StgPage > pPg = GetPhysPage( nPos ); if( !pPg.is() || !nPgs ) - return sal_False; + return false; while( --nPgs ) { if( nOffset >= nPageSize ) { pPg = GetPhysPage( nPos ); if( !pPg.is() ) - return sal_False; + return false; } rStrm.GetIo().SetToPage( pPg, nOffset >> 2, ++nStart ); nOffset += 4; @@ -186,10 +186,10 @@ sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs ) { pPg = GetPhysPage( nPos ); if( !pPg.is() ) - return sal_False; + return false; } rStrm.GetIo().SetToPage( pPg, nOffset >> 2, STG_EOF ); - return sal_True; + return true; } // Allocate a block of data from the given page number on. @@ -237,7 +237,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs ) if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) ) return STG_EOF; if( !bPhys && !InitNew( nPages ) ) - return sal_False; + return false; nPages = rStrm.GetSize() >> 2; nPasses++; } @@ -257,7 +257,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs ) // It can be assumed that the stream size is always on // a page boundary -sal_Bool StgFAT::InitNew( sal_Int32 nPage1 ) +bool StgFAT::InitNew( sal_Int32 nPage1 ) { sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries; if ( n > 0 ) @@ -271,30 +271,30 @@ sal_Bool StgFAT::InitNew( sal_Int32 nPage1 ) // Initialize the page pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE ); if ( !pPg.is() ) - return sal_False; + return false; for( short i = 0; i < nEntries; i++ ) rStrm.GetIo().SetToPage( pPg, i, STG_FREE ); nPage1++; } } - return sal_True; + return true; } // Release a chain -sal_Bool StgFAT::FreePages( sal_Int32 nStart, sal_Bool bAll ) +bool StgFAT::FreePages( sal_Int32 nStart, bool bAll ) { while( nStart >= 0 ) { rtl::Reference< StgPage > pPg = GetPhysPage( nStart << 2 ); if( !pPg.is() ) - return sal_False; + return false; nStart = rStrm.GetIo().GetFromPage( pPg, nOffset >> 2 ); // The first released page is either set to EOF or FREE rStrm.GetIo().SetToPage( pPg, nOffset >> 2, bAll ? STG_FREE : STG_EOF ); - bAll = sal_True; + bAll = true; } - return sal_True; + return true; } ///////////////////////////// class StgStrm //////////////////////////////// @@ -366,10 +366,10 @@ void StgStrm::scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize) // Compute page number and offset for the given byte position. // If the position is behind the size, set the stream right // behind the EOF. -sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) +bool StgStrm::Pos2Page( sal_Int32 nBytePos ) { if ( !pFat ) - return sal_False; + return false; // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) @@ -382,7 +382,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) nOffset = (short) ( nBytePos & ~nMask ); nPos = nBytePos; if( nOld == nNew ) - return sal_True; + return true; // See fdo#47644 for a .doc with a vast amount of pages where seeking around the // document takes a colossal amount of time @@ -419,7 +419,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); nPage = STG_EOF; nOffset = nPageSize; - return sal_False; + return false; } // special case: seek to 1st byte of new, unallocated page // (in case the file size is a multiple of the page size) @@ -431,7 +431,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) else if ( nIdx == m_aPagesCache.size() ) { nPage = STG_EOF; - return sal_False; + return false; } nPage = m_aPagesCache[ nIdx ]; @@ -441,7 +441,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) // Retrieve the physical page for a given byte offset. -rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) +rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, bool bForce ) { if( !Pos2Page( nBytePos ) ) return NULL; @@ -451,10 +451,10 @@ rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bFo // Copy an entire stream. Both streams are allocated in the FAT. // The target stream is this stream. -sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) +bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) { if ( !pFat ) - return sal_False; + return false; m_aPagesCache.clear(); @@ -465,7 +465,7 @@ sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) if( nTo < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return sal_False; + return false; } rIo.Copy( nTo, nFrom ); if( nFrom >= 0 ) @@ -474,18 +474,18 @@ sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) if( nFrom < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return sal_False; + return false; } } nTo = pFat->GetNextPage( nTo ); } - return sal_True; + return true; } -sal_Bool StgStrm::SetSize( sal_Int32 nBytes ) +bool StgStrm::SetSize( sal_Int32 nBytes ) { if ( nBytes < 0 || !pFat ) - return sal_False; + return false; m_aPagesCache.clear(); @@ -495,18 +495,18 @@ sal_Bool StgStrm::SetSize( sal_Int32 nBytes ) if( nNew > nOld ) { if( !Pos2Page( nSize ) ) - return sal_False; + return false; sal_Int32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize ); if( nBgn == STG_EOF ) - return sal_False; + return false; if( nStart == STG_EOF ) nStart = nPage = nBgn; } else if( nNew < nOld ) { - sal_Bool bAll = sal_Bool( nBytes == 0 ); + bool bAll = ( nBytes == 0 ); if( !Pos2Page( nBytes ) || !pFat->FreePages( nPage, bAll ) ) - return sal_False; + return false; if( bAll ) nStart = nPage = STG_EOF; } @@ -520,7 +520,7 @@ sal_Bool StgStrm::SetSize( sal_Int32 nBytes ) } nSize = nBytes; pFat->SetLimit( GetPages() ); - return sal_True; + return true; } // Return the # of allocated pages @@ -538,11 +538,11 @@ sal_Int32 StgStrm::GetPages() const StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r ) { - pFat = new StgFAT( *this, sal_True ); + pFat = new StgFAT( *this, true ); nSize = rIo.aHdr.GetFATSize() * nPageSize; } -sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos ) +bool StgFATStrm::Pos2Page( sal_Int32 nBytePos ) { // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) @@ -550,15 +550,15 @@ sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos ) nPage = nBytePos / nPageSize; nOffset = (short) ( nBytePos % nPageSize ); nPos = nBytePos; - nPage = GetPage( (short) nPage, sal_False ); - return sal_Bool( nPage >= 0 ); + nPage = GetPage( (short) nPage, false ); + return nPage >= 0; } // Retrieve the physical page for a given byte offset. // Since Pos2Page() already has computed the physical offset, // use the byte offset directly. -rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) +rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, bool bForce ) { OSL_ENSURE( nBytePos >= 0, "The value may not be negative!" ); return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce ); @@ -566,7 +566,7 @@ rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool // Get the page number entry for the given page offset. -sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc ) +sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc ) { OSL_ENSURE( nOff >= 0, "The offset may not be negative!" ); if( pnMasterAlloc ) *pnMasterAlloc = 0; @@ -612,7 +612,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA { if( !Pos2Page( nFAT << 2 ) ) return STG_EOF; - rtl::Reference< StgPage > pPg = rIo.Get( nPage, sal_True ); + rtl::Reference< StgPage > pPg = rIo.Get( nPage, true ); if( !pPg.is() ) return STG_EOF; rIo.SetToPage( pPg, nOffset >> 2, STG_MASTER ); @@ -626,7 +626,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA } else { - pMaster = rIo.Get( nFAT, sal_True ); + pMaster = rIo.Get( nFAT, true ); if ( pMaster.is() ) { nFAT = rIo.GetFromPage( pMaster, nMasterCount ); @@ -643,12 +643,12 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA // Set the page number entry for the given page offset. -sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) +bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) { OSL_ENSURE( nOff >= 0, "The offset may not be negative!" ); m_aPagesCache.clear(); - sal_Bool bRes = sal_True; + bool bRes = true; if( nOff < rIo.aHdr.GetFAT1Size() ) rIo.aHdr.SetFATPage( nOff, nNewPage ); else @@ -669,7 +669,7 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) pMaster = 0; break; } - pMaster = rIo.Get( nFAT, sal_True ); + pMaster = rIo.Get( nFAT, true ); if ( pMaster.is() ) nFAT = rIo.GetFromPage( pMaster, nMasterCount ); } @@ -678,7 +678,7 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) else { rIo.SetError( SVSTREAM_GENERALERROR ); - bRes = sal_False; + bRes = false; } } @@ -686,19 +686,19 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) if( bRes ) { Pos2Page( nNewPage << 2 ); - rtl::Reference< StgPage > pPg = rIo.Get( nPage, sal_True ); + rtl::Reference< StgPage > pPg = rIo.Get( nPage, true ); if( pPg.is() ) rIo.SetToPage( pPg, nOffset >> 2, STG_FAT ); else - bRes = sal_False; + bRes = false; } return bRes; } -sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) +bool StgFATStrm::SetSize( sal_Int32 nBytes ) { if ( nBytes < 0 ) - return sal_False; + return false; m_aPagesCache.clear(); @@ -720,9 +720,9 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) // find a free master page slot sal_Int32 nPg = 0; sal_uInt16 nMasterAlloc = 0; - nPg = GetPage( nOld, sal_True, &nMasterAlloc ); + nPg = GetPage( nOld, true, &nMasterAlloc ); if( nPg == STG_EOF ) - return sal_False; + return false; // 4 Bytes have been used for Allocation of each MegaMasterPage nBytes += nMasterAlloc << 2; @@ -742,12 +742,12 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) // adjust the file size if necessary if( nNewPage >= rIo.GetPhysPages() ) if( !rIo.SetSize( nNewPage + 1 ) ) - return sal_False; + return false; } // Set up the page with empty entries rtl::Reference< StgPage > pPg = rIo.Copy( nNewPage, STG_FREE ); if ( !pPg.is() ) - return sal_False; + return false; for( short j = 0; j < ( nPageSize >> 2 ); j++ ) rIo.SetToPage( pPg, j, STG_FREE ); @@ -764,16 +764,16 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) for( sal_uInt16 nCount = 0; nCount < nMax; nCount++ ) { if( !Pos2Page( nFAT << 2 ) ) - return sal_False; + return false; if( nMax - nCount <= nMasterAlloc ) { - rtl::Reference< StgPage > piPg = rIo.Get( nPage, sal_True ); + rtl::Reference< StgPage > piPg = rIo.Get( nPage, true ); if( !piPg.is() ) - return sal_False; + return false; rIo.SetToPage( piPg, nOffset >> 2, STG_MASTER ); } - rtl::Reference< StgPage > pPage = rIo.Get( nFAT, sal_True ); - if( !pPage.is() ) return sal_False; + rtl::Reference< StgPage > pPage = rIo.Get( nFAT, true ); + if( !pPage.is() ) return false; nFAT = rIo.GetFromPage( pPage, (nPageSize >> 2 ) - 1 ); } @@ -786,7 +786,7 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) } nSize = nNew * nPageSize; rIo.aHdr.SetFATSize( nNew ); - return sal_True; + return true; } /////////////////////////// class StgDataStrm ////////////////////////////// @@ -811,7 +811,7 @@ StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r ) void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { if ( rIo.pFAT ) - pFat = new StgFAT( *rIo.pFAT, sal_True ); + pFat = new StgFAT( *rIo.pFAT, true ); OSL_ENSURE( pFat, "The pointer should not be empty!" ); @@ -829,21 +829,21 @@ void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) // Set the size of a physical stream. -sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes ) +bool StgDataStrm::SetSize( sal_Int32 nBytes ) { if ( !pFat ) - return sal_False; + return false; nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr; sal_Int32 nOldSz = nSize; if( ( nOldSz != nBytes ) ) { if( !StgStrm::SetSize( nBytes ) ) - return sal_False; + return false; sal_Int32 nMaxPage = pFat->GetMaxPage(); if( nMaxPage > rIo.GetPhysPages() ) if( !rIo.SetSize( nMaxPage ) ) - return sal_False; + return false; // If we only allocated one page or less, create this // page in the cache for faster throughput. The current // position is the former EOF point. @@ -854,14 +854,14 @@ sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes ) rIo.Copy( nPage, STG_FREE ); } } - return sal_True; + return true; } // Get the address of the data byte at a specified offset. -// If bForce = sal_True, a read of non-existent data causes +// If bForce = true, a read of non-existent data causes // a read fault. -void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty ) +void* StgDataStrm::GetPtr( sal_Int32 Pos, bool bForce, bool bDirty ) { if( Pos2Page( Pos ) ) { @@ -914,7 +914,7 @@ sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, sal_False ); + pPg = rIo.Get( nPage, false ); if( !pPg.is() ) break; memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes ); @@ -974,7 +974,7 @@ sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, sal_False ); + pPg = rIo.Get( nPage, false ); if( !pPg.is() ) break; memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes ); @@ -1017,7 +1017,7 @@ StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r ) void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { if ( rIo.pDataFAT ) - pFat = new StgFAT( *rIo.pDataFAT, sal_False ); + pFat = new StgFAT( *rIo.pDataFAT, false ); pData = rIo.pDataStrm; OSL_ENSURE( pFat && pData, "The pointers should not be empty!" ); @@ -1073,7 +1073,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) { sal_Int32 nOld = nPos; if( !SetSize( nPos + n ) ) - return sal_False; + return false; Pos2Page( nOld ); } while( n ) @@ -1126,7 +1126,7 @@ StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) SetSize( nInitSize ); } -sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) +bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { sal_uLong n = rSrc.GetSize(); sal_uLong nCur = rSrc.Tell(); @@ -1150,10 +1150,10 @@ sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) delete [] p; rSrc.Seek( nCur ); Seek( nCur ); - return sal_Bool( n == 0 ); + return n == 0; } else - return sal_False; + return false; } StgTmpStrm::~StgTmpStrm() diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 1b9f93d99567..dfd39080393a 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -30,7 +30,7 @@ class StgPage; class StgDirEntry; // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the physical FAT stream (bPhys == sal_True ) or a normal +// This stream is either the physical FAT stream (bPhys == true ) or a normal // storage stream, which then holds the FAT for small data allocations. class StgFAT @@ -41,16 +41,16 @@ class StgFAT short nEntries; // FAT entries per page short nOffset; // current offset within page sal_Int32 nLimit; // search limit recommendation - sal_Bool bPhys; // sal_True: physical FAT + bool bPhys; // true: physical FAT rtl::Reference< StgPage > GetPhysPage( sal_Int32 nPage ); - sal_Bool MakeChain( sal_Int32 nStart, sal_Int32 nPages ); - sal_Bool InitNew( sal_Int32 nPage1 ); + bool MakeChain( sal_Int32 nStart, sal_Int32 nPages ); + bool InitNew( sal_Int32 nPage1 ); public: - StgFAT( StgStrm& rStrm, sal_Bool bMark ); + StgFAT( StgStrm& rStrm, bool bMark ); sal_Int32 FindBlock( sal_Int32& nPages ); sal_Int32 GetNextPage( sal_Int32 nPg ); sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages ); - sal_Bool FreePages( sal_Int32 nStart, sal_Bool bAll ); + bool FreePages( sal_Int32 nStart, bool bAll ); sal_Int32 GetMaxPage() { return nMaxPage; } void SetLimit( sal_Int32 n ) { nLimit = n; } }; @@ -72,7 +72,7 @@ protected: short nPageSize; // logical page size std::vector<sal_Int32> m_aPagesCache; void scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize = NULL); - sal_Bool Copy( sal_Int32 nFrom, sal_Int32 nBytes ); + bool Copy( sal_Int32 nFrom, sal_Int32 nBytes ); StgStrm( StgIo& ); public: virtual ~StgStrm(); @@ -85,12 +85,12 @@ public: sal_Int32 GetPages() const; short GetOffset() const { return nOffset;} void SetEntry( StgDirEntry& ); - virtual sal_Bool SetSize( sal_Int32 ); - virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); + virtual bool SetSize( sal_Int32 ); + virtual bool Pos2Page( sal_Int32 nBytePos ); virtual sal_Int32 Read( void*, sal_Int32 ) { return 0; } virtual sal_Int32 Write( const void*, sal_Int32 ) { return 0; } - virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); - virtual sal_Bool IsSmallStrm() const { return sal_False; } + virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, bool bForce = false ); + virtual bool IsSmallStrm() const { return false; } }; // The FAT stream class provides physical access to the master FAT. @@ -98,15 +98,15 @@ public: // FAT allocator. class StgFATStrm : public StgStrm { // the master FAT stream - virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); - sal_Bool SetPage( short, sal_Int32 ); + virtual bool Pos2Page( sal_Int32 nBytePos ); + bool SetPage( short, sal_Int32 ); public: StgFATStrm( StgIo& ); virtual ~StgFATStrm() {} using StgStrm::GetPage; - sal_Int32 GetPage( short, sal_Bool, sal_uInt16 *pnMasterAlloc = 0); - virtual sal_Bool SetSize( sal_Int32 ); - virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); + sal_Int32 GetPage( short, bool, sal_uInt16 *pnMasterAlloc = 0); + virtual bool SetSize( sal_Int32 ); + virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, bool bForce = false ); }; // The stream has a size increment which normally is 1, but which can be @@ -119,9 +119,9 @@ class StgDataStrm : public StgStrm // a physical data stream public: StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 ); StgDataStrm( StgIo&, StgDirEntry& ); - void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty ); + void* GetPtr( sal_Int32 nPos, bool bForce, bool bDirty ); void SetIncrement( short n ) { nIncr = n ; } - virtual sal_Bool SetSize( sal_Int32 ); + virtual bool SetSize( sal_Int32 ); virtual sal_Int32 Read( void*, sal_Int32 ); virtual sal_Int32 Write( const void*, sal_Int32 ); }; @@ -140,7 +140,7 @@ public: StgSmallStrm( StgIo&, StgDirEntry& ); virtual sal_Int32 Read( void*, sal_Int32 ); virtual sal_Int32 Write( const void*, sal_Int32 ); - virtual sal_Bool IsSmallStrm() const { return sal_True; } + virtual bool IsSmallStrm() const { return true; } }; class StgTmpStrm : public SvMemoryStream @@ -156,7 +156,7 @@ class StgTmpStrm : public SvMemoryStream public: StgTmpStrm( sal_uLong=16 ); ~StgTmpStrm(); - sal_Bool Copy( StgTmpStrm& ); + bool Copy( StgTmpStrm& ); void SetSize( sal_uLong ); sal_uLong GetSize() const; }; |