[Libreoffice-commits] core.git: 15 commits - sot/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Oct 8 23:06:21 PDT 2015
sot/source/sdstor/stg.cxx | 122 ++++-----
sot/source/sdstor/stgavl.cxx | 188 +++++++--------
sot/source/sdstor/stgavl.hxx | 12
sot/source/sdstor/stgcache.cxx | 140 +++++------
sot/source/sdstor/stgcache.hxx | 34 +-
sot/source/sdstor/stgdir.cxx | 510 ++++++++++++++++++++---------------------
sot/source/sdstor/stgdir.hxx | 50 ++--
sot/source/sdstor/stgelem.cxx | 324 +++++++++++++-------------
sot/source/sdstor/stgelem.hxx | 94 +++----
sot/source/sdstor/stgio.cxx | 122 ++++-----
sot/source/sdstor/stgio.hxx | 12
sot/source/sdstor/stgole.cxx | 52 ++--
sot/source/sdstor/stgole.hxx | 16 -
sot/source/sdstor/stgstrms.cxx | 192 +++++++--------
sot/source/sdstor/stgstrms.hxx | 28 +-
15 files changed, 948 insertions(+), 948 deletions(-)
New commits:
commit 854af5a574a9d0d3e8e56f83c4853cfad872f456
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Oct 9 08:04:39 2015 +0200
sot: prefix members of StgOleStream
Change-Id: I8a1fb10696a73134bf15fb7721cc5f78cc91eb98
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 9cd1798..886a730 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -166,7 +166,7 @@ bool StgCompObjStream::Store()
StgOleStream::StgOleStream( BaseStorage& rStg, bool bWr )
: StgInternalStream( rStg, OUString("\1Ole"), bWr )
{
- nFlags = 0;
+ m_nFlags = 0;
}
bool StgOleStream::Store()
@@ -176,7 +176,7 @@ bool StgOleStream::Store()
Seek( 0L );
WriteInt32( 0x02000001 ); // OLE version, format
- WriteInt32( nFlags ); // Object flags
+ WriteInt32( m_nFlags ); // Object flags
WriteInt32( 0 ); // Update Options
WriteInt32( 0 ); // reserved
WriteInt32( 0 ); // Moniker 1
diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx
index a34dbb2..b1c2db5 100644
--- a/sot/source/sdstor/stgole.hxx
+++ b/sot/source/sdstor/stgole.hxx
@@ -58,7 +58,7 @@ public:
class StgOleStream : public StgInternalStream
{
- sal_uInt32 nFlags;
+ sal_uInt32 m_nFlags;
public:
StgOleStream( BaseStorage&, bool );
bool Store();
commit cffc1d5fde23213d115d02f58e8250f6a3f705c4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:57:45 2015 +0200
sot: prefix members of StgInternalStream
Change-Id: Ie4fe557fc006414d119b64bb8d591f312a1f1f3d
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index ae84be6..9cd1798 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -36,7 +36,7 @@ StgInternalStream::StgInternalStream( BaseStorage& rStg, const OUString& rName,
StreamMode nMode = bWr
? StreamMode::WRITE | StreamMode::SHARE_DENYALL
: StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE;
- pStrm = rStg.OpenStream( rName, nMode );
+ m_pStrm = rStg.OpenStream( rName, nMode );
// set the error code right here in the stream
SetError( rStg.GetError() );
@@ -45,15 +45,15 @@ StgInternalStream::StgInternalStream( BaseStorage& rStg, const OUString& rName,
StgInternalStream::~StgInternalStream()
{
- delete pStrm;
+ delete m_pStrm;
}
sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize )
{
- if( pStrm )
+ if( m_pStrm )
{
- nSize = pStrm->Read( pData, nSize );
- SetError( pStrm->GetError() );
+ nSize = m_pStrm->Read( pData, nSize );
+ SetError( m_pStrm->GetError() );
return nSize;
}
else
@@ -62,10 +62,10 @@ sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize )
sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize )
{
- if( pStrm )
+ if( m_pStrm )
{
- nSize = pStrm->Write( pData, nSize );
- SetError( pStrm->GetError() );
+ nSize = m_pStrm->Write( pData, nSize );
+ SetError( m_pStrm->GetError() );
return nSize;
}
else
@@ -74,22 +74,22 @@ sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize )
sal_uInt64 StgInternalStream::SeekPos(sal_uInt64 const nPos)
{
- return pStrm ? pStrm->Seek( nPos ) : 0;
+ return m_pStrm ? m_pStrm->Seek( nPos ) : 0;
}
void StgInternalStream::FlushData()
{
- if( pStrm )
+ if( m_pStrm )
{
- pStrm->Flush();
- SetError( pStrm->GetError() );
+ m_pStrm->Flush();
+ SetError( m_pStrm->GetError() );
}
}
void StgInternalStream::Commit()
{
Flush();
- pStrm->Commit();
+ m_pStrm->Commit();
}
///////////////////////// class StgCompObjStream
diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx
index 6bd8914..a34dbb2 100644
--- a/sot/source/sdstor/stgole.hxx
+++ b/sot/source/sdstor/stgole.hxx
@@ -27,7 +27,7 @@
class StgInternalStream : public SvStream
{
- BaseStorageStream* pStrm;
+ BaseStorageStream* m_pStrm;
virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE;
commit e44a0d23c658c1e34ae3d57e64fee6181cb2cf8b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:56:41 2015 +0200
sot: prefix members of StgDataStrm
Change-Id: I643f0b9c6a0d2e5688f9b644666b405df2832d07
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index f843c7f..3d85481 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -814,7 +814,7 @@ void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
nStart = nPage = nBgn;
nSize = nLen;
- nIncr = 1;
+ m_nIncr = 1;
nOffset = 0;
if( nLen < 0 && pFat )
{
@@ -831,7 +831,7 @@ bool StgDataStrm::SetSize( sal_Int32 nBytes )
if ( !pFat )
return false;
- nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr;
+ nBytes = ( ( nBytes + m_nIncr - 1 ) / m_nIncr ) * m_nIncr;
sal_Int32 nOldSz = nSize;
if( ( nOldSz != nBytes ) )
{
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 227029a..36be942 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -111,13 +111,13 @@ public:
class StgDataStrm : public StgStrm // a physical data stream
{
- short nIncr; // size adjust increment
+ short m_nIncr; // size adjust increment
void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
StgDataStrm( StgIo&, StgDirEntry& );
void* GetPtr( sal_Int32 nPos, bool bForce, bool bDirty );
- void SetIncrement( short n ) { nIncr = n ; }
+ void SetIncrement( short n ) { m_nIncr = n ; }
virtual bool SetSize( sal_Int32 ) SAL_OVERRIDE;
virtual sal_Int32 Read( void*, sal_Int32 ) SAL_OVERRIDE;
virtual sal_Int32 Write( const void*, sal_Int32 ) SAL_OVERRIDE;
commit 21aa14dcde323719c65d0ab685f746d1215ebc22
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:55:46 2015 +0200
sot: prefix members of StgSmallStrm
Change-Id: I809350c076f871398024a0d1c6de098b09782f9b
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 8eb6691..f843c7f 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1015,8 +1015,8 @@ void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
if ( rIo.m_pDataFAT )
pFat = new StgFAT( *rIo.m_pDataFAT, false );
- pData = rIo.m_pDataStrm;
- OSL_ENSURE( pFat && pData, "The pointers should not be empty!" );
+ m_pData = rIo.m_pDataStrm;
+ OSL_ENSURE( pFat && m_pData, "The pointers should not be empty!" );
nPageSize = rIo.GetDataPageSize();
nStart =
@@ -1042,10 +1042,10 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
nBytes = (short) n;
if( nBytes )
{
- if( !pData || !pData->Pos2Page( nPage * nPageSize + nOffset ) )
+ if( !m_pData || !m_pData->Pos2Page( nPage * nPageSize + nOffset ) )
break;
// all reading through the stream
- short nRes = (short) pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes );
+ short nRes = (short) m_pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
@@ -1082,13 +1082,13 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
{
// all writing goes through the stream
sal_Int32 nDataPos = nPage * nPageSize + nOffset;
- if ( !pData
- || ( pData->GetSize() < ( nDataPos + nBytes )
- && !pData->SetSize( nDataPos + nBytes ) ) )
+ if ( !m_pData
+ || ( m_pData->GetSize() < ( nDataPos + nBytes )
+ && !m_pData->SetSize( nDataPos + nBytes ) ) )
break;
- if( !pData->Pos2Page( nDataPos ) )
+ if( !m_pData->Pos2Page( nDataPos ) )
break;
- short nRes = (short) pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes );
+ short nRes = (short) m_pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 61a3316..227029a 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -130,7 +130,7 @@ public:
class StgSmallStrm : public StgStrm // a logical data stream
{
- StgStrm* pData; // the data stream
+ StgStrm* m_pData; // the data stream
void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen );
commit 6829819e1c7587ff00eaef710ec3cf24a892aa98
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:54:42 2015 +0200
sot: prefix members of StgDirStrm
Change-Id: I2ae1ed9906c93f48813ccadcaa6f4b8e42bedbc9
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 04585c7..a2a82c8 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -720,34 +720,34 @@ void StgDirEntry::Invalidate( bool bDel )
StgDirStrm::StgDirStrm( StgIo& r )
: StgDataStrm( r, r.m_aHdr.GetTOCStart(), -1 )
- , pRoot( NULL )
- , nEntries( 0 )
+ , m_pRoot( NULL )
+ , m_nEntries( 0 )
{
if( r.GetError() )
return;
- nEntries = nPageSize / STGENTRY_SIZE;
+ m_nEntries = nPageSize / STGENTRY_SIZE;
if( nStart == STG_EOF )
{
StgEntry aRoot;
aRoot.Init();
aRoot.SetName( OUString("Root Entry") );
aRoot.SetType( STG_ROOT );
- pRoot = new StgDirEntry( aRoot );
- pRoot->SetDirty();
+ m_pRoot = new StgDirEntry( aRoot );
+ m_pRoot->SetDirty();
}
else
{
// temporarily use this instance as owner, so
// the TOC pages can be removed.
pEntry = reinterpret_cast<StgDirEntry*>(this); // just for a bit pattern
- SetupEntry( 0, pRoot );
+ SetupEntry( 0, m_pRoot );
pEntry = NULL;
}
}
StgDirStrm::~StgDirStrm()
{
- delete pRoot;
+ delete m_pRoot;
}
// Recursively parse the directory tree during reading the TOC stream
@@ -814,10 +814,10 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
}
if( StgAvlNode::Insert
- ( reinterpret_cast<StgAvlNode**>( pUpper ? &pUpper->m_pDown : &pRoot ), pCur ) )
+ ( reinterpret_cast<StgAvlNode**>( pUpper ? &pUpper->m_pDown : &m_pRoot ), pCur ) )
{
pCur->m_pUp = pUpper;
- pCur->m_ppRoot = &pRoot;
+ pCur->m_ppRoot = &m_pRoot;
}
else
{
@@ -855,13 +855,13 @@ bool StgDirStrm::SetSize( sal_Int32 nBytes )
bool StgDirStrm::Store()
{
- if( !pRoot || !pRoot->IsDirty() )
+ if( !m_pRoot || !m_pRoot->IsDirty() )
return true;
- if( !pRoot->StoreStreams( rIo ) )
+ if( !m_pRoot->StoreStreams( rIo ) )
return false;
// After writing all streams, the data FAT stream has changed,
// so we have to commit the root again
- pRoot->Commit();
+ m_pRoot->Commit();
// We want a completely new stream, so fake an empty stream
sal_Int32 nOldStart = nStart; // save for later deletion
sal_Int32 nOldSize = nSize;
@@ -869,26 +869,26 @@ bool StgDirStrm::Store()
nSize = nPos = 0;
nOffset = 0;
// Delete all temporary entries
- pRoot->DelTemp( false );
+ m_pRoot->DelTemp( false );
// set the entry numbers
sal_Int32 n = 0;
- pRoot->Enum( n );
+ m_pRoot->Enum( n );
if( !SetSize( n * STGENTRY_SIZE ) )
{
nStart = nOldStart; nSize = nOldSize;
- pRoot->RevertAll();
+ m_pRoot->RevertAll();
return false;
}
// set up the cache elements for the new stream
if( !Copy( STG_FREE, nSize ) )
{
- pRoot->RevertAll();
+ m_pRoot->RevertAll();
return false;
}
// Write the data to the new stream
- if( !pRoot->Store( *this ) )
+ if( !m_pRoot->Store( *this ) )
{
- pRoot->RevertAll();
+ m_pRoot->RevertAll();
return false;
}
// fill any remaining entries with empty data
@@ -900,7 +900,7 @@ bool StgDirStrm::Store()
void* p = GetEntry( n++, true );
if( !p )
{
- pRoot->RevertAll();
+ m_pRoot->RevertAll();
return false;
}
aEmpty.Store( p );
@@ -972,7 +972,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
if( StgAvlNode::Insert( reinterpret_cast<StgAvlNode**>(&rStg.m_pDown), pRes ) )
{
pRes->m_pUp = &rStg;
- pRes->m_ppRoot = &pRoot;
+ pRes->m_ppRoot = &m_pRoot;
pRes->m_bCreated =
pRes->m_bDirty = true;
}
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index bd6cfb3..25c854d 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -91,8 +91,8 @@ public:
class StgDirStrm : public StgDataStrm
{
friend class StgIterator;
- StgDirEntry* pRoot; // root of dir tree
- short nEntries; // entries per page
+ StgDirEntry* m_pRoot; // root of dir tree
+ short m_nEntries; // entries per page
void SetupEntry( sal_Int32, StgDirEntry* );
public:
explicit StgDirStrm( StgIo& );
@@ -100,7 +100,7 @@ public:
virtual bool SetSize( sal_Int32 ) SAL_OVERRIDE; // change the size
bool Store();
void* GetEntry( sal_Int32 n, bool=false );// get an entry
- StgDirEntry* GetRoot() { return pRoot; }
+ StgDirEntry* GetRoot() { return m_pRoot; }
StgDirEntry* Find( StgDirEntry&, const OUString& );
StgDirEntry* Create( StgDirEntry&, const OUString&, StgEntryType );
};
commit 4bc78704fed3a5fd52668ca678212f6b9e8d0eac
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:53:40 2015 +0200
sot: prefix members of StgTmpStrm
Change-Id: I08698db954f33d934f601bf25e510e6f4bea8d78
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index b813a36..8eb6691 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1116,7 +1116,7 @@ StgTmpStrm::StgTmpStrm( sal_uLong nInitSize )
? 16
: ( nInitSize ? nInitSize : 16 ), 4096 )
{
- pStrm = NULL;
+ m_pStrm = NULL;
// this calls FlushData, so all members should be set by this time
SetBufferSize( 0 );
if( nInitSize > THRESHOLD )
@@ -1155,22 +1155,22 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
StgTmpStrm::~StgTmpStrm()
{
- if( pStrm )
+ if( m_pStrm )
{
- pStrm->Close();
- osl::File::remove( aName );
- delete pStrm;
+ m_pStrm->Close();
+ osl::File::remove( m_aName );
+ delete m_pStrm;
}
}
sal_uLong StgTmpStrm::GetSize() const
{
sal_uLong n;
- if( pStrm )
+ if( m_pStrm )
{
- sal_uLong old = pStrm->Tell();
- n = pStrm->Seek( STREAM_SEEK_TO_END );
- pStrm->Seek( old );
+ sal_uLong old = m_pStrm->Tell();
+ n = m_pStrm->Seek( STREAM_SEEK_TO_END );
+ m_pStrm->Seek( old );
}
else
n = nEndOfData;
@@ -1179,14 +1179,14 @@ sal_uLong StgTmpStrm::GetSize() const
void StgTmpStrm::SetSize(sal_uInt64 n)
{
- if( pStrm )
- pStrm->SetStreamSize( n );
+ if( m_pStrm )
+ m_pStrm->SetStreamSize( n );
else
{
if( n > THRESHOLD )
{
- aName = utl::TempFile(0, false).GetURL();
- SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE );
+ m_aName = utl::TempFile(0, false).GetURL();
+ SvFileStream* s = new SvFileStream( m_aName, STREAM_READWRITE );
sal_uLong nCur = Tell();
sal_uLong i = nEndOfData;
std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
@@ -1231,7 +1231,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
delete s;
return;
}
- pStrm = s;
+ m_pStrm = s;
// Shrink the memory to 16 bytes, which seems to be the minimum
ReAllocateMemory( - ( (long) nEndOfData - 16 ) );
}
@@ -1249,10 +1249,10 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n )
{
- if( pStrm )
+ if( m_pStrm )
{
- n = pStrm->Read( pData, n );
- SetError( pStrm->GetError() );
+ n = m_pStrm->Read( pData, n );
+ SetError( m_pStrm->GetError() );
return n;
}
else
@@ -1263,16 +1263,16 @@ sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
{
sal_uInt32 nCur = Tell();
sal_uInt32 nNew = nCur + n;
- if( nNew > THRESHOLD && !pStrm )
+ if( nNew > THRESHOLD && !m_pStrm )
{
SetSize( nNew );
if( GetError() != SVSTREAM_OK )
return 0;
}
- if( pStrm )
+ if( m_pStrm )
{
- nNew = pStrm->Write( pData, n );
- SetError( pStrm->GetError() );
+ nNew = m_pStrm->Write( pData, n );
+ SetError( m_pStrm->GetError() );
}
else
nNew = SvMemoryStream::PutData( pData, n );
@@ -1285,7 +1285,7 @@ sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
assert(n != SAL_MAX_UINT32);
if( n == STREAM_SEEK_TO_END )
n = GetSize();
- if( n && n > THRESHOLD && !pStrm )
+ if( n && n > THRESHOLD && !m_pStrm )
{
SetSize( n );
if( GetError() != SVSTREAM_OK )
@@ -1293,10 +1293,10 @@ sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
else
return n;
}
- else if( pStrm )
+ else if( m_pStrm )
{
- n = pStrm->Seek( n );
- SetError( pStrm->GetError() );
+ n = m_pStrm->Seek( n );
+ SetError( m_pStrm->GetError() );
return n;
}
else
@@ -1305,10 +1305,10 @@ sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
void StgTmpStrm::FlushData()
{
- if( pStrm )
+ if( m_pStrm )
{
- pStrm->Flush();
- SetError( pStrm->GetError() );
+ m_pStrm->Flush();
+ SetError( m_pStrm->GetError() );
}
else
SvMemoryStream::FlushData();
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 1e46e69..61a3316 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -142,8 +142,8 @@ public:
class StgTmpStrm : public SvMemoryStream
{
- OUString aName;
- SvFileStream* pStrm;
+ OUString m_aName;
+ SvFileStream* m_pStrm;
using SvMemoryStream::GetData;
virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE;
commit 6759a5a0af782d28ae7497613cc8360951594073
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:52:46 2015 +0200
sot: prefix members of StgCompObjStream
Change-Id: I24b7b8fba581fbc5fbe7a63a6f43ff7033e149e7
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 67657b2..ae84be6 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -97,15 +97,15 @@ void StgInternalStream::Commit()
StgCompObjStream::StgCompObjStream( BaseStorage& rStg, bool bWr )
: StgInternalStream( rStg, OUString("\1CompObj"), bWr )
{
- memset( &aClsId, 0, sizeof( ClsId ) );
- nCbFormat = SotClipboardFormatId::NONE;
+ memset( &m_aClsId, 0, sizeof( ClsId ) );
+ m_nCbFormat = SotClipboardFormatId::NONE;
}
bool StgCompObjStream::Load()
{
- memset( &aClsId, 0, sizeof( ClsId ) );
- nCbFormat = SotClipboardFormatId::NONE;
- aUserName.clear();
+ memset( &m_aClsId, 0, sizeof( ClsId ) );
+ m_nCbFormat = SotClipboardFormatId::NONE;
+ m_aUserName.clear();
if( GetError() != SVSTREAM_OK )
return false;
Seek( 8L ); // skip the first part
@@ -113,7 +113,7 @@ bool StgCompObjStream::Load()
ReadInt32( nMarker );
if( nMarker == -1L )
{
- ReadClsId( *this, aClsId );
+ ReadClsId( *this, m_aClsId );
sal_Int32 nLen1 = 0;
ReadInt32( nLen1 );
if ( nLen1 > 0 )
@@ -131,8 +131,8 @@ bool StgCompObjStream::Load()
//all platforms and envs
//https://bz.apache.org/ooo/attachment.cgi?id=68668
//for a good edge-case example
- aUserName = nStrLen ? OUString( p.get(), nStrLen, RTL_TEXTENCODING_MS_1252 ) : OUString();
- nCbFormat = ReadClipboardFormat( *this );
+ m_aUserName = nStrLen ? OUString( p.get(), nStrLen, RTL_TEXTENCODING_MS_1252 ) : OUString();
+ m_nCbFormat = ReadClipboardFormat( *this );
}
else
SetError( SVSTREAM_GENERALERROR );
@@ -146,16 +146,16 @@ bool StgCompObjStream::Store()
if( GetError() != SVSTREAM_OK )
return false;
Seek( 0L );
- OString aAsciiUserName(OUStringToOString(aUserName, RTL_TEXTENCODING_MS_1252));
+ OString aAsciiUserName(OUStringToOString(m_aUserName, RTL_TEXTENCODING_MS_1252));
WriteInt16( 1 ); // Version?
WriteInt16( -2 ); // 0xFFFE = Byte Order Indicator
WriteInt32( 0x0A03 ); // Windows 3.10
WriteInt32( -1L );
- WriteClsId( *this, aClsId ); // Class ID
+ WriteClsId( *this, m_aClsId ); // Class ID
WriteInt32( aAsciiUserName.getLength() + 1 );
WriteCharPtr( aAsciiUserName.getStr() );
WriteUChar( 0 ); // string terminator
- WriteClipboardFormat( *this, nCbFormat );
+ WriteClipboardFormat( *this, m_nCbFormat );
WriteInt32( 0 ); // terminator
Commit();
return GetError() == SVSTREAM_OK;
diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx
index c108863..6bd8914 100644
--- a/sot/source/sdstor/stgole.hxx
+++ b/sot/source/sdstor/stgole.hxx
@@ -42,14 +42,14 @@ public:
class StgCompObjStream : public StgInternalStream
{
- ClsId aClsId;
- OUString aUserName;
- SotClipboardFormatId nCbFormat;
+ ClsId m_aClsId;
+ OUString m_aUserName;
+ SotClipboardFormatId m_nCbFormat;
public:
StgCompObjStream( BaseStorage&, bool );
- ClsId& GetClsId() { return aClsId; }
- OUString& GetUserName() { return aUserName; }
- SotClipboardFormatId& GetCbFormat() { return nCbFormat; }
+ ClsId& GetClsId() { return m_aClsId; }
+ OUString& GetUserName() { return m_aUserName; }
+ SotClipboardFormatId& GetCbFormat() { return m_nCbFormat; }
bool Load();
bool Store();
};
commit 0567de24079290a1379dc23b51c89e738185f30a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:51:47 2015 +0200
sot: prefix members of StgIo
Change-Id: Ibbe274514a145ab0b271100514bc3fea9f7076d5
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 9e897f4..9e17f34 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -118,7 +118,7 @@ OLEStorageBase::~OLEStorageBase()
bool OLEStorageBase::Validate_Impl( bool bWrite ) const
{
if( pIo
- && pIo->pTOC
+ && pIo->m_pTOC
&& pEntry
&& !pEntry->m_bInvalid
&& ( !bWrite || !pEntry->m_bDirect || ( nStreamMode & StreamMode::WRITE ) ) )
@@ -469,9 +469,9 @@ void Storage::Init( bool bCreate )
// the file is empty
if( !bHdrLoaded )
pIo->Init();
- if( pIo->Good() && pIo->pTOC )
+ if( pIo->Good() && pIo->m_pTOC )
{
- pEntry = pIo->pTOC->GetRoot();
+ pEntry = pIo->m_pTOC->GetRoot();
pEntry->m_nRefCnt++;
}
}
@@ -560,7 +560,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
if( bDirect && !pEntry->m_bDirect )
bDirect = false;
- StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
+ StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName );
if( !p )
{
if( !( m & StreamMode::NOCREATE ) )
@@ -573,7 +573,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
aNewName = "Temp Stg " + OUString::number( ++nTmpCount );
bTemp = true;
}
- p = pIo->pTOC->Create( *pEntry, aNewName, STG_STORAGE );
+ p = pIo->m_pTOC->Create( *pEntry, aNewName, STG_STORAGE );
if( p )
p->m_bTemp = bTemp;
}
@@ -614,7 +614,7 @@ BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, boo
if( !Validate() || !ValidateMode( m ) )
return new StorageStream( pIo, NULL, m );
- StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
+ StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName );
bool bTemp = false;
if( !p )
{
@@ -628,7 +628,7 @@ BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, boo
aNewName = "Temp Strm " + OUString::number( ++nTmpCount );
bTemp = true;
}
- p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM );
+ p = pIo->m_pTOC->Create( *pEntry, aNewName, STG_STREAM );
}
if( !p )
pIo->SetError( ( m & StreamMode::WRITE )
@@ -659,7 +659,7 @@ bool Storage::Remove( const OUString& rName )
{
if( !Validate( true ) )
return false;
- StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
+ StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName );
if( p )
{
p->Invalidate( true );
@@ -678,7 +678,7 @@ bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString&
{
if( !Validate() || !pDest || !pDest->Validate( true ) )
return false;
- StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem );
+ StgDirEntry* pElem = pIo->m_pTOC->Find( *pEntry, rElem );
if( pElem )
{
if( pElem->m_aEntry.GetType() == STG_STORAGE )
@@ -770,7 +770,7 @@ bool Storage::IsStorage( const OUString& rName ) const
{
if( Validate() )
{
- StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
+ StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName );
if( p )
return p->m_aEntry.GetType() == STG_STORAGE;
}
@@ -781,7 +781,7 @@ bool Storage::IsStream( const OUString& rName ) const
{
if( Validate() )
{
- StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
+ StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName );
if( p )
return p->m_aEntry.GetType() == STG_STREAM;
}
@@ -791,7 +791,7 @@ bool Storage::IsStream( const OUString& rName ) const
bool Storage::IsContained( const OUString& rName ) const
{
if( Validate() )
- return pIo->pTOC->Find( *pEntry, rName ) != NULL;
+ return pIo->m_pTOC->Find( *pEntry, rName ) != NULL;
else
return false;
}
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 79dcb12..04585c7 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -262,7 +262,7 @@ bool StgDirEntry::IsDirty()
void StgDirEntry::OpenStream( StgIo& rIo, bool bForceBig )
{
- sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
+ sal_Int32 nThreshold = (sal_uInt16) rIo.m_aHdr.GetThreshold();
delete m_pStgStrm;
if( !bForceBig && m_aEntry.GetSize() < nThreshold )
m_pStgStrm = new StgSmallStrm( rIo, *this );
@@ -331,7 +331,7 @@ bool StgDirEntry::SetSize( sal_Int32 nNewSize )
bool bRes = false;
StgIo& rIo = m_pStgStrm->GetIo();
- sal_Int32 nThreshold = rIo.aHdr.GetThreshold();
+ sal_Int32 nThreshold = rIo.m_aHdr.GetThreshold();
// ensure the correct storage stream!
StgStrm* pOld = NULL;
sal_uInt16 nOldSize = 0;
@@ -625,7 +625,7 @@ bool StgDirEntry::Tmp2Strm()
sal_uLong n = m_pTmpStrm->GetSize();
StgStrm* pNewStrm;
StgIo& rIo = m_pStgStrm->GetIo();
- sal_uLong nThreshold = (sal_uLong) rIo.aHdr.GetThreshold();
+ sal_uLong nThreshold = (sal_uLong) rIo.m_aHdr.GetThreshold();
if( n < nThreshold )
pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 );
else
@@ -719,7 +719,7 @@ void StgDirEntry::Invalidate( bool bDel )
// This specialized stream is the maintenance stream for the directory tree.
StgDirStrm::StgDirStrm( StgIo& r )
- : StgDataStrm( r, r.aHdr.GetTOCStart(), -1 )
+ : StgDataStrm( r, r.m_aHdr.GetTOCStart(), -1 )
, pRoot( NULL )
, nEntries( 0 )
{
@@ -907,7 +907,7 @@ bool StgDirStrm::Store()
}
// Now we can release the old stream
pFat->FreePages( nOldStart, true );
- rIo.aHdr.SetTOCStart( nStart );
+ rIo.m_aHdr.SetTOCStart( nStart );
return true;
}
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 7fa5a3e..c73811a4 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -32,19 +32,19 @@
StgIo::StgIo() : StgCache()
{
- pTOC = NULL;
- pDataFAT = NULL;
- pDataStrm = NULL;
- pFAT = NULL;
- bCopied = false;
+ m_pTOC = NULL;
+ m_pDataFAT = NULL;
+ m_pDataStrm = NULL;
+ m_pFAT = NULL;
+ m_bCopied = false;
}
StgIo::~StgIo()
{
- delete pTOC;
- delete pDataFAT;
- delete pDataStrm;
- delete pFAT;
+ delete m_pTOC;
+ delete m_pDataFAT;
+ delete m_pDataStrm;
+ delete m_pFAT;
}
// Load the header. Do not set an error code if the header is invalid.
@@ -53,9 +53,9 @@ bool StgIo::Load()
{
if( m_pStrm )
{
- if( aHdr.Load( *this ) )
+ if( m_aHdr.Load( *this ) )
{
- if( aHdr.Check() )
+ if( m_aHdr.Check() )
SetupStreams();
else
return false;
@@ -70,35 +70,35 @@ bool StgIo::Load()
bool StgIo::Init()
{
- aHdr.Init();
+ m_aHdr.Init();
SetupStreams();
return CommitAll();
}
void StgIo::SetupStreams()
{
- delete pTOC;
- delete pDataFAT;
- delete pDataStrm;
- delete pFAT;
- pTOC = NULL;
- pDataFAT = NULL;
- pDataStrm = NULL;
- pFAT = NULL;
+ delete m_pTOC;
+ delete m_pDataFAT;
+ delete m_pDataStrm;
+ delete m_pFAT;
+ m_pTOC = NULL;
+ m_pDataFAT = NULL;
+ m_pDataStrm = NULL;
+ m_pFAT = NULL;
ResetError();
- SetPhysPageSize( 1 << aHdr.GetPageSize() );
- pFAT = new StgFATStrm( *this );
- pTOC = new StgDirStrm( *this );
+ SetPhysPageSize( 1 << m_aHdr.GetPageSize() );
+ m_pFAT = new StgFATStrm( *this );
+ m_pTOC = new StgDirStrm( *this );
if( !GetError() )
{
- StgDirEntry* pRoot = pTOC->GetRoot();
+ StgDirEntry* pRoot = m_pTOC->GetRoot();
if( pRoot )
{
- pDataFAT = new StgDataStrm( *this, aHdr.GetDataFATStart(), -1 );
- pDataStrm = new StgDataStrm( *this, *pRoot );
- pDataFAT->SetIncrement( 1 << aHdr.GetPageSize() );
- pDataStrm->SetIncrement( GetDataPageSize() );
- pDataStrm->SetEntry( *pRoot );
+ m_pDataFAT = new StgDataStrm( *this, m_aHdr.GetDataFATStart(), -1 );
+ m_pDataStrm = new StgDataStrm( *this, *pRoot );
+ m_pDataFAT->SetIncrement( 1 << m_aHdr.GetPageSize() );
+ m_pDataStrm->SetIncrement( GetDataPageSize() );
+ m_pDataStrm->SetEntry( *pRoot );
}
else
SetError( SVSTREAM_FILEFORMAT_ERROR );
@@ -109,7 +109,7 @@ void StgIo::SetupStreams()
short StgIo::GetDataPageSize()
{
- return 1 << aHdr.GetDataPageSize();
+ return 1 << m_aHdr.GetDataPageSize();
}
// Commit everything
@@ -117,14 +117,14 @@ short StgIo::GetDataPageSize()
bool StgIo::CommitAll()
{
// Store the data (all streams and the TOC)
- if( pTOC && pTOC->Store() && pDataFAT )
+ if( m_pTOC && m_pTOC->Store() && m_pDataFAT )
{
if( Commit() )
{
- aHdr.SetDataFATStart( pDataFAT->GetStart() );
- aHdr.SetDataFATSize( pDataFAT->GetPages() );
- aHdr.SetTOCStart( pTOC->GetStart() );
- if( aHdr.Store( *this ) )
+ m_aHdr.SetDataFATStart( m_pDataFAT->GetStart() );
+ m_aHdr.SetDataFATSize( m_pDataFAT->GetPages() );
+ m_aHdr.SetTOCStart( m_pTOC->GetStart() );
+ if( m_aHdr.Store( *this ) )
{
m_pStrm->Flush();
sal_uLong n = m_pStrm->GetError();
@@ -166,7 +166,7 @@ EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize )
pFree = new bool[ nPages ];
rtl::Reference< StgPage > pPage;
- sal_Int32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2;
+ sal_Int32 nFatPageSize = (1 << rIo.m_aHdr.GetPageSize()) - 2;
for( sal_Int32 nPage = 0; nPage < nPages; nPage++ )
{
@@ -239,8 +239,8 @@ public:
};
Validator::Validator( StgIo &rIoP )
- : aSmallFat( rIoP, rIoP.pDataFAT, 1 << rIoP.aHdr.GetDataPageSize() ),
- aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ),
+ : aSmallFat( rIoP, rIoP.m_pDataFAT, 1 << rIoP.m_aHdr.GetDataPageSize() ),
+ aFat( rIoP, rIoP.m_pFAT, 1 << rIoP.m_aHdr.GetPageSize() ),
rIo( rIoP )
{
sal_uLong nErr = nError = FAT_OK;
@@ -255,18 +255,18 @@ Validator::Validator( StgIo &rIoP )
sal_uLong Validator::ValidateMasterFATs()
{
- sal_Int32 nCount = rIo.aHdr.GetFATSize();
+ sal_Int32 nCount = rIo.m_aHdr.GetFATSize();
sal_uLong nErr;
- if ( !rIo.pFAT )
+ if ( !rIo.m_pFAT )
return FAT_INMEMORYERROR;
for( sal_Int32 i = 0; i < nCount; i++ )
{
- if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), false ), aFat.GetPageSize(), -3 )) != FAT_OK )
+ if( ( nErr = aFat.Mark(rIo.m_pFAT->GetPage( short(i), false ), aFat.GetPageSize(), -3 )) != FAT_OK )
return nErr;
}
- if( rIo.aHdr.GetMasters() )
- if( ( nErr = aFat.Mark(rIo.aHdr.GetFATChain( ), aFat.GetPageSize(), -4 )) != FAT_OK )
+ if( rIo.m_aHdr.GetMasters() )
+ if( ( nErr = aFat.Mark(rIo.m_aHdr.GetFATChain( ), aFat.GetPageSize(), -4 )) != FAT_OK )
return nErr;
return FAT_OK;
@@ -290,7 +290,7 @@ sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
else
{
sal_Int32 nSize = p->m_aEntry.GetSize();
- if( nSize < rIo.aHdr.GetThreshold() )
+ if( nSize < rIo.m_aHdr.GetThreshold() )
nErr = aSmallFat.Mark( p->m_aEntry.GetStartPage(),nSize, -2 );
else
nErr = aFat.Mark( p->m_aEntry.GetStartPage(),nSize, -2 );
@@ -303,27 +303,27 @@ sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
sal_uLong Validator::ValidateDirectoryEntries()
{
- if ( !rIo.pTOC )
+ if ( !rIo.m_pTOC )
return FAT_INMEMORYERROR;
// Normale DirEntries
- sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() );
+ sal_uLong nErr = MarkAll( rIo.m_pTOC->GetRoot() );
if( nErr != FAT_OK )
return nErr;
// Small Data
- nErr = aFat.Mark( rIo.pTOC->GetRoot()->m_aEntry.GetStartPage(),
- rIo.pTOC->GetRoot()->m_aEntry.GetSize(), -2 );
+ nErr = aFat.Mark( rIo.m_pTOC->GetRoot()->m_aEntry.GetStartPage(),
+ rIo.m_pTOC->GetRoot()->m_aEntry.GetSize(), -2 );
if( nErr != FAT_OK )
return nErr;
// Small Data FAT
nErr = aFat.Mark(
- rIo.aHdr.GetDataFATStart(),
- rIo.aHdr.GetDataFATSize() * aFat.GetPageSize(), -2 );
+ rIo.m_aHdr.GetDataFATStart(),
+ rIo.m_aHdr.GetDataFATSize() * aFat.GetPageSize(), -2 );
if( nErr != FAT_OK )
return nErr;
// TOC
nErr = aFat.Mark(
- rIo.aHdr.GetTOCStart(), -1, -2 );
+ rIo.m_aHdr.GetTOCStart(), -1, -2 );
return nErr;
}
@@ -374,13 +374,13 @@ sal_uLong StgIo::ValidateFATs()
if( bRet1 != bRet2 )
nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR;
else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR;
- if( nErr != FAT_OK && !bCopied )
+ if( nErr != FAT_OK && !m_bCopied )
{
StgLinkArg aArg;
aArg.aFile = pFileStrm->GetFileName();
aArg.nErr = nErr;
ErrorLink::get().Call( aArg );
- bCopied = true;
+ m_bCopied = true;
}
// DBG_ASSERT( nErr == FAT_OK ,"Storage kaputt");
return nErr;
diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx
index f53652d..40a6682 100644
--- a/sot/source/sdstor/stgio.hxx
+++ b/sot/source/sdstor/stgio.hxx
@@ -50,15 +50,15 @@ struct StgLinkArg
class StgIo : public StgCache {
void SetupStreams(); // load all internal streams
- bool bCopied;
+ bool m_bCopied;
public:
StgIo();
~StgIo();
- StgHeader aHdr; // storage file header
- StgFATStrm* pFAT; // FAT stream
- StgDirStrm* pTOC; // TOC stream
- StgDataStrm* pDataFAT; // small data FAT stream
- StgDataStrm* pDataStrm; // small data stream
+ StgHeader m_aHdr; // storage file header
+ StgFATStrm* m_pFAT; // FAT stream
+ StgDirStrm* m_pTOC; // TOC stream
+ StgDataStrm* m_pDataFAT; // small data FAT stream
+ StgDataStrm* m_pDataStrm; // small data stream
short GetDataPageSize(); // get the logical data page size
bool Load(); // load a storage file
bool Init(); // set up an empty file
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 16d1db7..b813a36 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -546,7 +546,7 @@ bool StgStrm::SetSize( sal_Int32 nBytes )
StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r )
{
pFat = new StgFAT( *this, true );
- nSize = rIo.aHdr.GetFATSize() * nPageSize;
+ nSize = rIo.m_aHdr.GetFATSize() * nPageSize;
}
bool StgFATStrm::Pos2Page( sal_Int32 nBytePos )
@@ -568,7 +568,7 @@ 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;
if( nOff < StgHeader::GetFAT1Size() )
- return rIo.aHdr.GetFATPage( nOff );
+ return rIo.m_aHdr.GetFATPage( nOff );
sal_Int32 nMaxPage = nSize >> 2;
nOff = nOff - StgHeader::GetFAT1Size();
// Anzahl der Masterpages, durch die wir iterieren muessen
@@ -579,7 +579,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc
rtl::Reference< StgPage > pOldPage;
rtl::Reference< StgPage > pMaster;
- sal_Int32 nFAT = rIo.aHdr.GetFATChain();
+ sal_Int32 nFAT = rIo.m_aHdr.GetFATChain();
for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ )
{
if( nFAT == STG_EOF || nFAT == STG_FREE )
@@ -597,7 +597,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc
rIo.SetToPage( pMaster, k, STG_FREE );
// Verkettung herstellen
if( !pOldPage.is() )
- rIo.aHdr.SetFATChain( nFAT );
+ rIo.m_aHdr.SetFATChain( nFAT );
else
rIo.SetToPage( pOldPage, nMasterCount, nFAT );
if( nMaxPage >= rIo.GetPhysPages() )
@@ -616,7 +616,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc
}
else
(*pnMasterAlloc)++;
- rIo.aHdr.SetMasters( nCount + 1 );
+ rIo.m_aHdr.SetMasters( nCount + 1 );
pOldPage = pMaster;
}
}
@@ -647,7 +647,7 @@ bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
bool bRes = true;
if( nOff < StgHeader::GetFAT1Size() )
- rIo.aHdr.SetFATPage( nOff, nNewPage );
+ rIo.m_aHdr.SetFATPage( nOff, nNewPage );
else
{
nOff = nOff - StgHeader::GetFAT1Size();
@@ -658,7 +658,7 @@ bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
nOff = nOff % nMasterCount;
rtl::Reference< StgPage > pMaster;
- sal_Int32 nFAT = rIo.aHdr.GetFATChain();
+ sal_Int32 nFAT = rIo.m_aHdr.GetFATChain();
for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ )
{
if( nFAT == STG_EOF || nFAT == STG_FREE )
@@ -755,8 +755,8 @@ bool StgFATStrm::SetSize( sal_Int32 nBytes )
// MegaMasterPages were created, mark it them as used
- sal_uInt32 nMax = rIo.aHdr.GetMasters( );
- sal_uInt32 nFAT = rIo.aHdr.GetFATChain();
+ sal_uInt32 nMax = rIo.m_aHdr.GetMasters( );
+ sal_uInt32 nFAT = rIo.m_aHdr.GetFATChain();
if( nMasterAlloc )
for( sal_uInt32 nCount = 0; nCount < nMax; nCount++ )
{
@@ -782,7 +782,7 @@ bool StgFATStrm::SetSize( sal_Int32 nBytes )
}
}
nSize = nNew * nPageSize;
- rIo.aHdr.SetFATSize( nNew );
+ rIo.m_aHdr.SetFATSize( nNew );
return true;
}
@@ -807,8 +807,8 @@ 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, true );
+ if ( rIo.m_pFAT )
+ pFat = new StgFAT( *rIo.m_pFAT, true );
OSL_ENSURE( pFat, "The pointer should not be empty!" );
@@ -1013,9 +1013,9 @@ 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, false );
- pData = rIo.pDataStrm;
+ if ( rIo.m_pDataFAT )
+ pFat = new StgFAT( *rIo.m_pDataFAT, false );
+ pData = rIo.m_pDataStrm;
OSL_ENSURE( pFat && pData, "The pointers should not be empty!" );
nPageSize = rIo.GetDataPageSize();
commit 56bc686c2a0dbfffc6e9f40df0e61c7b98fb3340
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:48:45 2015 +0200
sot: prefix members of StgAvlNode
Change-Id: Ie6de63b524b99246be3d6d5d6e997c7abda675ad
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index 8baa8cf..536e7de 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -23,14 +23,14 @@
StgAvlNode::StgAvlNode()
{
- pLeft = pRight = NULL;
- nBalance = nId = 0;
+ m_pLeft = m_pRight = NULL;
+ m_nBalance = m_nId = 0;
}
StgAvlNode::~StgAvlNode()
{
- delete pLeft;
- delete pRight;
+ delete m_pLeft;
+ delete m_pRight;
}
StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
@@ -43,7 +43,7 @@ StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
short nRes = p->Compare( pFind );
if( !nRes )
return p;
- else p = ( nRes < 0 ) ? p->pLeft : p->pRight;
+ else p = ( nRes < 0 ) ? p->m_pLeft : p->m_pRight;
}
}
return NULL;
@@ -69,14 +69,14 @@ short StgAvlNode::Locate
while( pCur != NULL )
{
// check for pPivot
- if( pCur->nBalance != 0 )
+ if( pCur->m_nBalance != 0 )
*pPivot = pCur, *pParent = *pPrev;
// save pPrev location and see what direction to go
*pPrev = pCur;
nRes = pCur->Compare( pFind );
if( nRes == 0 )
break;
- else pCur = ( nRes < 0 ) ? pCur->pLeft : pCur->pRight;
+ else pCur = ( nRes < 0 ) ? pCur->m_pLeft : pCur->m_pRight;
}
}
@@ -93,37 +93,37 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
// no traversing
OSL_ENSURE( pHeavy && pNew, "The pointers is not allowed to be NULL!" );
if( pCur == pNew || !pNew )
- return nBalance;
+ return m_nBalance;
short nRes = Compare( pNew );
if( nRes > 0 )
{
- *pHeavy = pCur = pRight;
+ *pHeavy = pCur = m_pRight;
nDelta = -1;
}
else
{
- *pHeavy = pCur = pLeft;
+ *pHeavy = pCur = m_pLeft;
nDelta = 1;
}
- nBalance = 0;
+ m_nBalance = 0;
while( pCur != pNew )
{
nRes = pCur->Compare( pNew );
if( nRes > 0 )
{
// height of right increases by 1
- pCur->nBalance = -1;
- pCur = pCur->pRight;
+ pCur->m_nBalance = -1;
+ pCur = pCur->m_pRight;
}
else
{
// height of left increases by 1
- pCur->nBalance = 1;
- pCur = pCur->pLeft;
+ pCur->m_nBalance = 1;
+ pCur = pCur->m_pLeft;
}
}
- nBalance = nBalance + nDelta;
+ m_nBalance = m_nBalance + nDelta;
return nDelta;
}
@@ -131,11 +131,11 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
StgAvlNode* StgAvlNode::RotLL()
{
- assert(pLeft && "The pointer is not allowed to be NULL!");
- StgAvlNode *pHeavy = pLeft;
- pLeft = pHeavy->pRight;
- pHeavy->pRight = this;
- pHeavy->nBalance = nBalance = 0;
+ assert(m_pLeft && "The pointer is not allowed to be NULL!");
+ StgAvlNode *pHeavy = m_pLeft;
+ m_pLeft = pHeavy->m_pRight;
+ pHeavy->m_pRight = this;
+ pHeavy->m_nBalance = m_nBalance = 0;
return pHeavy;
}
@@ -143,71 +143,71 @@ StgAvlNode* StgAvlNode::RotLL()
StgAvlNode* StgAvlNode::RotLR()
{
- assert(pLeft && pLeft->pRight && "The pointer is not allowed to be NULL!");
- StgAvlNode* pHeavy = pLeft;
- StgAvlNode* pNewRoot = pHeavy->pRight;
+ assert(m_pLeft && m_pLeft->m_pRight && "The pointer is not allowed to be NULL!");
+ StgAvlNode* pHeavy = m_pLeft;
+ StgAvlNode* pNewRoot = pHeavy->m_pRight;
- pHeavy->pRight = pNewRoot->pLeft;
- pLeft = pNewRoot->pRight;
- pNewRoot->pLeft = pHeavy;
- pNewRoot->pRight = this;
+ pHeavy->m_pRight = pNewRoot->m_pLeft;
+ m_pLeft = pNewRoot->m_pRight;
+ pNewRoot->m_pLeft = pHeavy;
+ pNewRoot->m_pRight = this;
- switch( pNewRoot->nBalance )
+ switch( pNewRoot->m_nBalance )
{
case 1: // LR( b )
- nBalance = -1;
- pHeavy->nBalance = 0;
+ m_nBalance = -1;
+ pHeavy->m_nBalance = 0;
break;
case -1: // LR( c )
- pHeavy->nBalance = 1;
- nBalance = 0;
+ pHeavy->m_nBalance = 1;
+ m_nBalance = 0;
break;
case 0: // LR( a )
- nBalance = 0;
- pHeavy->nBalance = 0;
+ m_nBalance = 0;
+ pHeavy->m_nBalance = 0;
break;
}
- pNewRoot->nBalance = 0;
+ pNewRoot->m_nBalance = 0;
return pNewRoot;
}
// perform RR rotation and return new root
StgAvlNode* StgAvlNode::RotRR()
{
- assert(pRight && "The pointer is not allowed to be NULL!" );
- StgAvlNode* pHeavy = pRight;
- pRight = pHeavy->pLeft;
- pHeavy->pLeft = this;
- nBalance = pHeavy->nBalance = 0;
+ assert(m_pRight && "The pointer is not allowed to be NULL!" );
+ StgAvlNode* pHeavy = m_pRight;
+ m_pRight = pHeavy->m_pLeft;
+ pHeavy->m_pLeft = this;
+ m_nBalance = pHeavy->m_nBalance = 0;
return pHeavy;
}
// perform the RL rotation and return the new root
StgAvlNode* StgAvlNode::RotRL()
{
- assert(pRight && pRight->pLeft && "The pointer is not allowed to be NULL!");
- StgAvlNode* pHeavy = pRight;
- StgAvlNode* pNewRoot = pHeavy->pLeft;
- pHeavy->pLeft = pNewRoot->pRight;
- pRight = pNewRoot->pLeft;
- pNewRoot->pRight = pHeavy;
- pNewRoot->pLeft = this;
- switch( pNewRoot->nBalance )
+ assert(m_pRight && m_pRight->m_pLeft && "The pointer is not allowed to be NULL!");
+ StgAvlNode* pHeavy = m_pRight;
+ StgAvlNode* pNewRoot = pHeavy->m_pLeft;
+ pHeavy->m_pLeft = pNewRoot->m_pRight;
+ m_pRight = pNewRoot->m_pLeft;
+ pNewRoot->m_pRight = pHeavy;
+ pNewRoot->m_pLeft = this;
+ switch( pNewRoot->m_nBalance )
{
case -1: // RL( b )
- nBalance = 1;
- pHeavy->nBalance = 0;
+ m_nBalance = 1;
+ pHeavy->m_nBalance = 0;
break;
case 1: // RL( c )
- pHeavy->nBalance = -1;
- nBalance = 0;
+ pHeavy->m_nBalance = -1;
+ m_nBalance = 0;
break;
case 0: // RL( a )
- nBalance = 0;
- pHeavy->nBalance = 0;
+ m_nBalance = 0;
+ pHeavy->m_nBalance = 0;
break;
}
- pNewRoot->nBalance = 0;
+ pNewRoot->m_nBalance = 0;
return pNewRoot;
}
@@ -222,13 +222,13 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
if( !nRes )
{
// Element found: remove
- if( !pCur->pRight )
+ if( !pCur->m_pRight )
{
- *p = pCur->pLeft; pCur->pLeft = NULL;
+ *p = pCur->m_pLeft; pCur->m_pLeft = NULL;
}
- else if( !pCur->pLeft )
+ else if( !pCur->m_pLeft )
{
- *p = pCur->pRight; pCur->pRight = NULL;
+ *p = pCur->m_pRight; pCur->m_pRight = NULL;
}
else
{
@@ -238,28 +238,28 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
// this element with the element found.
StgAvlNode* last = pCur;
StgAvlNode* l;
- for( l = pCur->pLeft;
- l->pRight; last = l, l = l->pRight ) {}
+ for( l = pCur->m_pLeft;
+ l->m_pRight; last = l, l = l->m_pRight ) {}
// remove the element from chain
- if( l == last->pRight )
- last->pRight = l->pLeft;
+ if( l == last->m_pRight )
+ last->m_pRight = l->m_pLeft;
else
- last->pLeft = l->pLeft;
+ last->m_pLeft = l->m_pLeft;
// perform the replacement
- l->pLeft = pCur->pLeft;
- l->pRight = pCur->pRight;
+ l->m_pLeft = pCur->m_pLeft;
+ l->m_pRight = pCur->m_pRight;
*p = l;
// delete the element
- pCur->pLeft = pCur->pRight = NULL;
+ pCur->m_pLeft = pCur->m_pRight = NULL;
}
return pCur;
}
else
{
if( nRes < 0 )
- return Rem( &pCur->pLeft, pDel, bPtrs );
+ return Rem( &pCur->m_pLeft, pDel, bPtrs );
else
- return Rem( &pCur->pRight, pDel, bPtrs );
+ return Rem( &pCur->m_pRight, pDel, bPtrs );
}
}
return NULL;
@@ -269,11 +269,11 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
void StgAvlNode::StgEnum( short& n )
{
- if( pLeft )
- pLeft->StgEnum( n );
- nId = n++;
- if( pRight )
- pRight->StgEnum( n );
+ if( m_pLeft )
+ m_pLeft->StgEnum( n );
+ m_nId = n++;
+ if( m_pRight )
+ m_pRight->StgEnum( n );
}
// Add node to AVL tree.
@@ -300,32 +300,32 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
// add new node
if( nRes < 0 )
- pPrev->pLeft = pIns;
+ pPrev->m_pLeft = pIns;
else
- pPrev->pRight = pIns;
+ pPrev->m_pRight = pIns;
// rebalance tree
short nDelta = pPivot->Adjust( &pHeavy, pIns );
- if( pPivot->nBalance >= 2 || pPivot->nBalance <= -2 )
+ if( pPivot->m_nBalance >= 2 || pPivot->m_nBalance <= -2 )
{
- pHeavy = ( nDelta < 0 ) ? pPivot->pRight : pPivot->pLeft;
+ pHeavy = ( nDelta < 0 ) ? pPivot->m_pRight : pPivot->m_pLeft;
// left imbalance
if( nDelta > 0 )
- if( pHeavy->nBalance == 1 )
+ if( pHeavy->m_nBalance == 1 )
pNewRoot = pPivot->RotLL();
else
pNewRoot = pPivot->RotLR();
// right imbalance
- else if( pHeavy->nBalance == -1 )
+ else if( pHeavy->m_nBalance == -1 )
pNewRoot = pPivot->RotRR();
else
pNewRoot = pPivot->RotRL();
// relink balanced subtree
if( pParent == NULL )
*pRoot = pNewRoot;
- else if( pPivot == pParent->pLeft )
- pParent->pLeft = pNewRoot;
- else if( pPivot == pParent->pRight )
- pParent->pRight = pNewRoot;
+ else if( pPivot == pParent->m_pLeft )
+ pParent->m_pLeft = pNewRoot;
+ else if( pPivot == pParent->m_pRight )
+ pParent->m_pRight = pNewRoot;
}
return true;
}
@@ -385,9 +385,9 @@ StgAvlNode* StgAvlIterator::Find( short n )
StgAvlNode* p = m_pRoot;
while( p )
{
- if( n == p->nId )
+ if( n == p->m_nId )
break;
- else p = ( n < p->nId ) ? p->pLeft : p->pRight;
+ else p = ( n < p->m_nId ) ? p->m_pLeft : p->m_pRight;
}
return p;
}
diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx
index 5b29d0f..14f68fc 100644
--- a/sot/source/sdstor/stgavl.hxx
+++ b/sot/source/sdstor/stgavl.hxx
@@ -36,9 +36,9 @@ private:
void StgEnum( short& );
static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, bool );
protected:
- short nId; // iterator ID
- short nBalance; // indicates tree balance
- StgAvlNode* pLeft, *pRight; // leaves
+ short m_nId; // iterator ID
+ short m_nBalance; // indicates tree balance
+ StgAvlNode* m_pLeft, *m_pRight; // leaves
StgAvlNode();
public:
virtual ~StgAvlNode();
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 642049a..79dcb12 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -116,15 +116,15 @@ void StgDirEntry::Enum( sal_Int32& n )
{
sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE;
m_nEntry = n++;
- if( pLeft )
+ if( m_pLeft )
{
- static_cast<StgDirEntry*>(pLeft)->Enum( n );
- nLeft = static_cast<StgDirEntry*>(pLeft)->m_nEntry;
+ static_cast<StgDirEntry*>(m_pLeft)->Enum( n );
+ nLeft = static_cast<StgDirEntry*>(m_pLeft)->m_nEntry;
}
- if( pRight )
+ if( m_pRight )
{
- static_cast<StgDirEntry*>(pRight)->Enum( n );
- nRight = static_cast<StgDirEntry*>(pRight)->m_nEntry;
+ static_cast<StgDirEntry*>(m_pRight)->Enum( n );
+ nRight = static_cast<StgDirEntry*>(m_pRight)->m_nEntry;
}
if( m_pDown )
{
@@ -140,10 +140,10 @@ void StgDirEntry::Enum( sal_Int32& n )
void StgDirEntry::DelTemp( bool bForce )
{
- if( pLeft )
- static_cast<StgDirEntry*>(pLeft)->DelTemp( false );
- if( pRight )
- static_cast<StgDirEntry*>(pRight)->DelTemp( false );
+ if( m_pLeft )
+ static_cast<StgDirEntry*>(m_pLeft)->DelTemp( false );
+ if( m_pRight )
+ static_cast<StgDirEntry*>(m_pRight)->DelTemp( false );
if( m_pDown )
{
// If the storage is dead, of course all elements are dead, too
@@ -162,7 +162,7 @@ void StgDirEntry::DelTemp( bool bForce )
StgAvlNode::Remove( reinterpret_cast<StgAvlNode**>(&m_pUp->m_pDown), this, bDel );
if( !bDel )
{
- pLeft = pRight = m_pDown = 0;
+ m_pLeft = m_pRight = m_pDown = 0;
m_bInvalid = m_bZombie = true;
}
}
@@ -178,11 +178,11 @@ bool StgDirEntry::Store( StgDirStrm& rStrm )
return false;
// Do not store the current (maybe not committed) entry
m_aSave.Store( pEntry );
- if( pLeft )
- if( !static_cast<StgDirEntry*>(pLeft)->Store( rStrm ) )
+ if( m_pLeft )
+ if( !static_cast<StgDirEntry*>(m_pLeft)->Store( rStrm ) )
return false;
- if( pRight )
- if( !static_cast<StgDirEntry*>(pRight)->Store( rStrm ) )
+ if( m_pRight )
+ if( !static_cast<StgDirEntry*>(m_pRight)->Store( rStrm ) )
return false;
if( m_pDown )
if( !m_pDown->Store( rStrm ) )
@@ -218,11 +218,11 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
{
if( !StoreStream( rIo ) )
return false;
- if( pLeft )
- if( !static_cast<StgDirEntry*>(pLeft)->StoreStreams( rIo ) )
+ if( m_pLeft )
+ if( !static_cast<StgDirEntry*>(m_pLeft)->StoreStreams( rIo ) )
return false;
- if( pRight )
- if( !static_cast<StgDirEntry*>(pRight)->StoreStreams( rIo ) )
+ if( m_pRight )
+ if( !static_cast<StgDirEntry*>(m_pRight)->StoreStreams( rIo ) )
return false;
if( m_pDown )
if( !m_pDown->StoreStreams( rIo ) )
@@ -235,10 +235,10 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
void StgDirEntry::RevertAll()
{
m_aEntry = m_aSave;
- if( pLeft )
- static_cast<StgDirEntry*>(pLeft)->RevertAll();
- if( pRight )
- static_cast<StgDirEntry*>(pRight)->RevertAll();
+ if( m_pLeft )
+ static_cast<StgDirEntry*>(m_pLeft)->RevertAll();
+ if( m_pRight )
+ static_cast<StgDirEntry*>(m_pRight)->RevertAll();
if( m_pDown )
m_pDown->RevertAll();
}
@@ -249,9 +249,9 @@ bool StgDirEntry::IsDirty()
{
if( m_bDirty || m_bInvalid )
return true;
- if( pLeft && static_cast<StgDirEntry*>(pLeft)->IsDirty() )
+ if( m_pLeft && static_cast<StgDirEntry*>(m_pLeft)->IsDirty() )
return true;
- if( pRight && static_cast<StgDirEntry*>(pRight)->IsDirty() )
+ if( m_pRight && static_cast<StgDirEntry*>(m_pRight)->IsDirty() )
return true;
if( m_pDown && m_pDown->IsDirty() )
return true;
commit 0df69aa16a31c8aebad9ddc38072a8ec13b01dd1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:47:54 2015 +0200
sot: prefix members of StgAvlIterator
Change-Id: I39254b14b5f167cfb180f989c56d7db88b73b8f0
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index be26ac0..8baa8cf 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -373,16 +373,16 @@ bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, bool bDel )
StgAvlIterator::StgAvlIterator( StgAvlNode* p )
{
- pRoot = p;
- nCount = 0;
- nCur = 0;
+ m_pRoot = p;
+ m_nCount = 0;
+ m_nCur = 0;
if( p )
- p->StgEnum( nCount );
+ p->StgEnum( m_nCount );
}
StgAvlNode* StgAvlIterator::Find( short n )
{
- StgAvlNode* p = pRoot;
+ StgAvlNode* p = m_pRoot;
while( p )
{
if( n == p->nId )
@@ -394,13 +394,13 @@ StgAvlNode* StgAvlIterator::Find( short n )
StgAvlNode* StgAvlIterator::First()
{
- nCur = -1;
+ m_nCur = -1;
return Next();
}
StgAvlNode* StgAvlIterator::Next()
{
- return Find( ++nCur );
+ return Find( ++m_nCur );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx
index 8110961..5b29d0f 100644
--- a/sot/source/sdstor/stgavl.hxx
+++ b/sot/source/sdstor/stgavl.hxx
@@ -51,9 +51,9 @@ public:
// The iterator class provides single stepping through an AVL tree.
class StgAvlIterator {
- StgAvlNode* pRoot; // root entry (parent)
- short nCount; // tree size
- short nCur; // current element
+ StgAvlNode* m_pRoot; // root entry (parent)
+ short m_nCount; // tree size
+ short m_nCur; // current element
StgAvlNode* Find( short );
public:
explicit StgAvlIterator( StgAvlNode* );
commit b5475c7a21bd5a63ec41e1ac5d83cdbc01e63a76
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:46:16 2015 +0200
sot: prefix members of StgCache
Change-Id: If406303ec1685c9d7eebefaf172db0bbf0cd723b
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 4846fb3..0ca0e2d 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -87,16 +87,16 @@ static sal_Int32 lcl_GetPageCount( sal_uLong nFileSize, short nPageSize )
}
StgCache::StgCache()
- : nError( SVSTREAM_OK )
- , nPages( 0 )
- , nRef( 0 )
- , nReplaceIdx( 0 )
+ : m_nError( SVSTREAM_OK )
+ , m_nPages( 0 )
+ , m_nRef( 0 )
+ , m_nReplaceIdx( 0 )
, maLRUPages( 8 ) // entries in the LRU lookup
- , nPageSize( 512 )
- , pStorageStream( NULL )
- , pStrm( NULL )
- , bMyStream( false )
- , bFile( false )
+ , m_nPageSize( 512 )
+ , m_pStorageStream( NULL )
+ , m_pStrm( NULL )
+ , m_bMyStream( false )
+ , m_bFile( false )
{
}
@@ -111,11 +111,11 @@ void StgCache::SetPhysPageSize( short n )
OSL_ENSURE( n >= 512, "Unexpecte page size is provided!" );
if ( n >= 512 )
{
- nPageSize = n;
- sal_uLong nPos = pStrm->Tell();
- sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
- nPages = lcl_GetPageCount( nFileSize, nPageSize );
- pStrm->Seek( nPos );
+ m_nPageSize = n;
+ sal_uLong nPos = m_pStrm->Tell();
+ sal_uLong nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
+ m_nPages = lcl_GetPageCount( nFileSize, m_nPageSize );
+ m_pStrm->Seek( nPos );
}
}
@@ -123,8 +123,8 @@ void StgCache::SetPhysPageSize( short n )
rtl::Reference< StgPage > StgCache::Create( sal_Int32 nPg )
{
- rtl::Reference< StgPage > xElem( StgPage::Create( nPageSize, nPg ) );
- maLRUPages[ nReplaceIdx++ % maLRUPages.size() ] = xElem;
+ rtl::Reference< StgPage > xElem( StgPage::Create( m_nPageSize, nPg ) );
+ maLRUPages[ m_nReplaceIdx++ % maLRUPages.size() ] = xElem;
return xElem;
}
@@ -230,8 +230,8 @@ bool StgCache::Commit()
maDirtyPages.clear();
- pStrm->Flush();
- SetError( pStrm->GetError() );
+ m_pStrm->Flush();
+ SetError( m_pStrm->GetError() );
return true;
}
@@ -240,36 +240,36 @@ bool StgCache::Commit()
void StgCache::SetStrm( SvStream* p, bool bMy )
{
- if( pStorageStream )
+ if( m_pStorageStream )
{
- pStorageStream->ReleaseRef();
- pStorageStream = NULL;
+ m_pStorageStream->ReleaseRef();
+ m_pStorageStream = NULL;
}
- if( bMyStream )
- delete pStrm;
- pStrm = p;
- bMyStream = bMy;
+ if( m_bMyStream )
+ delete m_pStrm;
+ m_pStrm = p;
+ m_bMyStream = bMy;
}
void StgCache::SetStrm( UCBStorageStream* pStgStream )
{
- if( pStorageStream )
- pStorageStream->ReleaseRef();
- pStorageStream = pStgStream;
+ if( m_pStorageStream )
+ m_pStorageStream->ReleaseRef();
+ m_pStorageStream = pStgStream;
- if( bMyStream )
- delete pStrm;
+ if( m_bMyStream )
+ delete m_pStrm;
- pStrm = NULL;
+ m_pStrm = NULL;
- if ( pStorageStream )
+ if ( m_pStorageStream )
{
- pStorageStream->AddFirstRef();
- pStrm = pStorageStream->GetModifySvStream();
+ m_pStorageStream->AddFirstRef();
+ m_pStrm = m_pStorageStream->GetModifySvStream();
}
- bMyStream = false;
+ m_bMyStream = false;
}
void StgCache::SetDirty( const rtl::Reference< StgPage > &rPage )
@@ -296,23 +296,23 @@ bool StgCache::Open( const OUString& rName, StreamMode nMode )
SetStrm( pFileStrm, true );
if( pFileStrm->IsOpen() )
{
- sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
- nPages = lcl_GetPageCount( nFileSize, nPageSize );
- pStrm->Seek( 0L );
+ sal_uLong nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
+ m_nPages = lcl_GetPageCount( nFileSize, m_nPageSize );
+ m_pStrm->Seek( 0L );
}
else
- nPages = 0;
- bFile = true;
- SetError( bAccessDenied ? ERRCODE_IO_ACCESSDENIED : pStrm->GetError() );
+ m_nPages = 0;
+ m_bFile = true;
+ SetError( bAccessDenied ? ERRCODE_IO_ACCESSDENIED : m_pStrm->GetError() );
return Good();
}
void StgCache::Close()
{
- if( bFile )
+ if( m_bFile )
{
- static_cast<SvFileStream*>(pStrm)->Close();
- SetError( pStrm->GetError() );
+ static_cast<SvFileStream*>(m_pStrm)->Close();
+ SetError( m_pStrm->GetError() );
}
}
@@ -326,28 +326,28 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
last valid page (see document attached to the issue). In that case
(if nPage==nPages), just do nothing here and let the caller work on
the empty zero-filled buffer. */
- if ( nPage > nPages )
+ if ( nPage > m_nPages )
SetError( SVSTREAM_READ_ERROR );
- else if ( nPage < nPages )
+ else if ( nPage < m_nPages )
{
sal_uInt32 nPos = Page2Pos( nPage );
- sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg;
- sal_uInt32 nBytes = nPg2 * nPageSize;
+ sal_Int32 nPg2 = ( ( nPage + nPg ) > m_nPages ) ? m_nPages - nPage : nPg;
+ sal_uInt32 nBytes = nPg2 * m_nPageSize;
// fixed address and size for the header
if( nPage == -1 )
{
nPos = 0L, nBytes = 512;
nPg2 = nPg;
}
- if( pStrm->Tell() != nPos )
+ if( m_pStrm->Tell() != nPos )
{
- pStrm->Seek(nPos);
+ m_pStrm->Seek(nPos);
}
- pStrm->Read( pBuf, nBytes );
+ m_pStrm->Read( pBuf, nBytes );
if ( nPg != nPg2 )
SetError( SVSTREAM_READ_ERROR );
else
- SetError( pStrm->GetError() );
+ SetError( m_pStrm->GetError() );
}
}
return Good();
@@ -359,22 +359,22 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
{
sal_uInt32 nPos = Page2Pos( nPage );
sal_uInt32 nBytes = 0;
- if ( SAL_MAX_INT32 / nPg > nPageSize )
- nBytes = nPg * nPageSize;
+ if ( SAL_MAX_INT32 / nPg > m_nPageSize )
+ nBytes = nPg * m_nPageSize;
// fixed address and size for the header
// nPageSize must be >= 512, otherwise the header can not be written here, we check it on import
if( nPage == -1 )
nPos = 0L, nBytes = 512;
- if( pStrm->Tell() != nPos )
+ if( m_pStrm->Tell() != nPos )
{
- pStrm->Seek(nPos);
+ m_pStrm->Seek(nPos);
}
- sal_uLong nRes = pStrm->Write( pBuf, nBytes );
+ sal_uLong nRes = m_pStrm->Write( pBuf, nBytes );
if( nRes != nBytes )
SetError( SVSTREAM_WRITE_ERROR );
else
- SetError( pStrm->GetError() );
+ SetError( m_pStrm->GetError() );
}
return Good();
}
@@ -384,31 +384,31 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
bool StgCache::SetSize( sal_Int32 n )
{
// Add the file header
- sal_Int32 nSize = n * nPageSize + 512;
- pStrm->SetStreamSize( nSize );
- SetError( pStrm->GetError() );
- if( !nError )
- nPages = n;
+ sal_Int32 nSize = n * m_nPageSize + 512;
+ m_pStrm->SetStreamSize( nSize );
+ SetError( m_pStrm->GetError() );
+ if( !m_nError )
+ m_nPages = n;
return Good();
}
void StgCache::SetError( sal_uLong n )
{
- if( n && !nError )
- nError = n;
+ if( n && !m_nError )
+ m_nError = n;
}
void StgCache::ResetError()
{
- nError = SVSTREAM_OK;
- pStrm->ResetError();
+ m_nError = SVSTREAM_OK;
+ m_pStrm->ResetError();
}
void StgCache::MoveError( StorageBase& r )
{
- if( nError != SVSTREAM_OK )
+ if( m_nError != SVSTREAM_OK )
{
- r.SetError( nError );
+ r.SetError( m_nError );
ResetError();
}
}
@@ -418,7 +418,7 @@ void StgCache::MoveError( StorageBase& r )
sal_Int32 StgCache::Page2Pos( sal_Int32 nPage )
{
if( nPage < 0 ) nPage = 0;
- return( nPage * nPageSize ) + nPageSize;
+ return( nPage * m_nPageSize ) + m_nPageSize;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 64c3d9e..05953b9 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -45,36 +45,36 @@ class StgCache
typedef std::vector< rtl::Reference< StgPage > > LRUList;
- sal_uLong nError; // error code
- sal_Int32 nPages; // size of data area in pages
- sal_uInt16 nRef; // reference count
+ sal_uLong m_nError; // error code
+ sal_Int32 m_nPages; // size of data area in pages
+ sal_uInt16 m_nRef; // reference count
IndexToStgPage maDirtyPages; // hash of all dirty pages
- int nReplaceIdx; // index into maLRUPages to replace next
+ int m_nReplaceIdx; // index into maLRUPages to replace next
LRUList maLRUPages; // list of last few non-dirty pages.
- short nPageSize; // page size of the file
- UCBStorageStream* pStorageStream; // holds reference to UCB storage stream
+ short m_nPageSize; // page size of the file
+ UCBStorageStream* m_pStorageStream; // holds reference to UCB storage stream
void Erase( const rtl::Reference< StgPage >& ); // delete a cache element
rtl::Reference< StgPage > Create( sal_Int32 ); // create a cached page
protected:
- SvStream* pStrm; // physical stream
- bool bMyStream; // true: delete stream in dtor
- bool bFile; // true: file stream
+ SvStream* m_pStrm; // physical stream
+ bool m_bMyStream; // true: delete stream in dtor
+ bool m_bFile; // true: file stream
sal_Int32 Page2Pos( sal_Int32 ); // page address --> file position
public:
StgCache();
~StgCache();
- void IncRef() { nRef++; }
- sal_uInt16 DecRef() { return --nRef; }
+ void IncRef() { m_nRef++; }
+ sal_uInt16 DecRef() { return --m_nRef; }
void SetPhysPageSize( short );
- sal_Int32 GetPhysPages() { return nPages; }
- short GetPhysPageSize() { return nPageSize; }
- SvStream* GetStrm() { return pStrm; }
+ sal_Int32 GetPhysPages() { return m_nPages; }
+ short GetPhysPageSize() { return m_nPageSize; }
+ SvStream* GetStrm() { return m_pStrm; }
void SetStrm( SvStream*, bool );
void SetStrm( UCBStorageStream* );
- bool IsWritable() { return ( pStrm && pStrm->IsWritable() ); }
- bool Good() { return nError == SVSTREAM_OK; }
- sal_uLong GetError() { return nError; }
+ bool IsWritable() { return ( m_pStrm && m_pStrm->IsWritable() ); }
+ bool Good() { return m_nError == SVSTREAM_OK; }
+ sal_uLong GetError() { return m_nError; }
void MoveError( StorageBase& );
void SetError( sal_uLong );
void ResetError();
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index ac9afdc..7fa5a3e 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -51,7 +51,7 @@ StgIo::~StgIo()
bool StgIo::Load()
{
- if( pStrm )
+ if( m_pStrm )
{
if( aHdr.Load( *this ) )
{
@@ -126,8 +126,8 @@ bool StgIo::CommitAll()
aHdr.SetTOCStart( pTOC->GetStart() );
if( aHdr.Store( *this ) )
{
- pStrm->Flush();
- sal_uLong n = pStrm->GetError();
+ m_pStrm->Flush();
+ sal_uLong n = m_pStrm->GetError();
SetError( n );
#ifdef DBG_UTIL
if( n==0 ) ValidateFATs();
@@ -350,7 +350,7 @@ const Link<StgLinkArg&,void>& StgIo::GetErrorLink()
sal_uLong StgIo::ValidateFATs()
{
- if( bFile )
+ if( m_bFile )
{
Validator *pV = new Validator( *this );
bool bRet1 = !pV->IsError(), bRet2 = true ;
commit 0147e744e656704bbd99b918f3657ee4fe374495
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:45:11 2015 +0200
sot: prefix members of StgFAT
Change-Id: I0a22ca51d5fd8fb8dedd418932fd84fa3039c258
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 0545d7d..16d1db7 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -39,14 +39,14 @@
// 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, bool m ) : rStrm( r )
+StgFAT::StgFAT( StgStrm& r, bool m ) : m_rStrm( r )
{
- bPhys = m;
- nPageSize = rStrm.GetIo().GetPhysPageSize();
- nEntries = nPageSize >> 2;
- nOffset = 0;
- nMaxPage = 0;
- nLimit = 0;
+ m_bPhys = m;
+ m_nPageSize = m_rStrm.GetIo().GetPhysPageSize();
+ m_nEntries = m_nPageSize >> 2;
+ m_nOffset = 0;
+ m_nMaxPage = 0;
+ m_nLimit = 0;
}
// Retrieve the physical page for a given byte offset.
@@ -56,12 +56,12 @@ rtl::Reference< StgPage > StgFAT::GetPhysPage( sal_Int32 nByteOff )
rtl::Reference< StgPage > pPg;
// Position within the underlying stream
// use the Pos2Page() method of the stream
- if( rStrm.Pos2Page( nByteOff ) )
+ if( m_rStrm.Pos2Page( nByteOff ) )
{
- nOffset = rStrm.GetOffset();
- sal_Int32 nPhysPage = rStrm.GetPage();
+ m_nOffset = m_rStrm.GetOffset();
+ sal_Int32 nPhysPage = m_rStrm.GetPage();
// get the physical page (must be present)
- pPg = rStrm.GetIo().Get( nPhysPage, true );
+ pPg = m_rStrm.GetIo().Get( nPhysPage, true );
}
return pPg;
}
@@ -73,7 +73,7 @@ sal_Int32 StgFAT::GetNextPage( sal_Int32 nPg )
if( nPg >= 0 )
{
rtl::Reference< StgPage > pPg = GetPhysPage( nPg << 2 );
- nPg = pPg.is() ? StgCache::GetFromPage( pPg, nOffset >> 2 ) : STG_EOF;
+ nPg = pPg.is() ? StgCache::GetFromPage( pPg, m_nOffset >> 2 ) : STG_EOF;
}
return nPg;
}
@@ -89,13 +89,13 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
sal_Int32 nMinStart = STG_EOF, nMinLen = 0;
sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL;
sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0;
- sal_Int32 nPages = rStrm.GetSize() >> 2;
+ sal_Int32 nPages = m_rStrm.GetSize() >> 2;
bool bFound = false;
rtl::Reference< StgPage > pPg;
short nEntry = 0;
for( sal_Int32 i = 0; i < nPages; i++, nEntry++ )
{
- if( !( nEntry % nEntries ) )
+ if( !( nEntry % m_nEntries ) )
{
// load the next page for that stream
nEntry = 0;
@@ -114,7 +114,7 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
nTmpLen = 1;
if( nTmpLen == nPgs
// If we already did find a block, stop when reaching the limit
- || ( bFound && ( nEntry >= nLimit ) ) )
+ || ( bFound && ( nEntry >= m_nLimit ) ) )
break;
}
else if( nTmpLen )
@@ -172,23 +172,23 @@ bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs )
return false;
while( --nPgs )
{
- if( nOffset >= nPageSize )
+ if( m_nOffset >= m_nPageSize )
{
pPg = GetPhysPage( nPos );
if( !pPg.is() )
return false;
}
- rStrm.GetIo().SetToPage( pPg, nOffset >> 2, ++nStart );
- nOffset += 4;
+ m_rStrm.GetIo().SetToPage( pPg, m_nOffset >> 2, ++nStart );
+ m_nOffset += 4;
nPos += 4;
}
- if( nOffset >= nPageSize )
+ if( m_nOffset >= m_nPageSize )
{
pPg = GetPhysPage( nPos );
if( !pPg.is() )
return false;
}
- rStrm.GetIo().SetToPage( pPg, nOffset >> 2, STG_EOF );
+ m_rStrm.GetIo().SetToPage( pPg, m_nOffset >> 2, STG_EOF );
return true;
}
@@ -201,7 +201,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
sal_Int32 nLast = nBgn;
sal_Int32 nBegin = STG_EOF;
sal_Int32 nAlloc;
- sal_Int32 nPages = rStrm.GetSize() >> 2;
+ sal_Int32 nPages = m_rStrm.GetSize() >> 2;
short nPasses = 0;
// allow for two passes
while( nPasses < 2 )
@@ -214,8 +214,8 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
// no more blocks left in present alloc chain
if( nBegin == STG_EOF )
break;
- if( ( nBegin + nAlloc ) > nMaxPage )
- nMaxPage = nBegin + nAlloc;
+ if( ( nBegin + nAlloc ) > m_nMaxPage )
+ m_nMaxPage = nBegin + nAlloc;
if( !MakeChain( nBegin, nAlloc ) )
return STG_EOF;
if( nOrig == STG_EOF )
@@ -226,7 +226,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
rtl::Reference< StgPage > pPg = GetPhysPage( nLast << 2 );
if( !pPg.is() )
return STG_EOF;
- rStrm.GetIo().SetToPage( pPg, nOffset >> 2, nBegin );
+ m_rStrm.GetIo().SetToPage( pPg, m_nOffset >> 2, nBegin );
}
nLast = nBegin + nAlloc - 1;
nPgs -= nAlloc;
@@ -234,13 +234,13 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
if( nPgs && !nPasses )
{
// we need new, fresh space, so allocate and retry
- if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) )
+ if( !m_rStrm.SetSize( ( nPages + nPgs ) << 2 ) )
return STG_EOF;
- if( !bPhys && !InitNew( nPages ) )
+ if( !m_bPhys && !InitNew( nPages ) )
return 0;
// FIXME: this was originally "FALSE", whether or not that
// makes sense (or should be STG_EOF instead, say?)
- nPages = rStrm.GetSize() >> 2;
+ nPages = m_rStrm.GetSize() >> 2;
nPasses++;
}
else
@@ -249,7 +249,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
// now we should have a chain for the complete block
if( nBegin == STG_EOF || nPgs )
{
- rStrm.GetIo().SetError( SVSTREAM_FILEFORMAT_ERROR );
+ m_rStrm.GetIo().SetError( SVSTREAM_FILEFORMAT_ERROR );
return STG_EOF; // bad structure
}
return nOrig;
@@ -261,7 +261,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
bool StgFAT::InitNew( sal_Int32 nPage1 )
{
- sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries;
+ sal_Int32 n = ( ( m_rStrm.GetSize() >> 2 ) - nPage1 ) / m_nEntries;
if ( n > 0 )
{
while( n-- )
@@ -269,13 +269,13 @@ bool StgFAT::InitNew( sal_Int32 nPage1 )
rtl::Reference< StgPage > pPg;
// Position within the underlying stream
// use the Pos2Page() method of the stream
- rStrm.Pos2Page( nPage1 << 2 );
+ m_rStrm.Pos2Page( nPage1 << 2 );
// Initialize the page
- pPg = rStrm.GetIo().Copy( rStrm.GetPage() );
+ pPg = m_rStrm.GetIo().Copy( m_rStrm.GetPage() );
if ( !pPg.is() )
return false;
- for( short i = 0; i < nEntries; i++ )
- rStrm.GetIo().SetToPage( pPg, i, STG_FREE );
+ for( short i = 0; i < m_nEntries; i++ )
+ m_rStrm.GetIo().SetToPage( pPg, i, STG_FREE );
nPage1++;
}
}
@@ -291,9 +291,9 @@ bool StgFAT::FreePages( sal_Int32 nStart, bool bAll )
rtl::Reference< StgPage > pPg = GetPhysPage( nStart << 2 );
if( !pPg.is() )
return false;
- nStart = StgCache::GetFromPage( pPg, nOffset >> 2 );
+ nStart = StgCache::GetFromPage( pPg, m_nOffset >> 2 );
// The first released page is either set to EOF or FREE
- rStrm.GetIo().SetToPage( pPg, nOffset >> 2, bAll ? STG_FREE : STG_EOF );
+ m_rStrm.GetIo().SetToPage( pPg, m_nOffset >> 2, bAll ? STG_FREE : STG_EOF );
bAll = true;
}
return true;
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 33ff193..1e46e69 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -35,13 +35,13 @@ class StgDirEntry;
class StgFAT
{ // FAT allocator
- StgStrm& rStrm; // underlying stream
- sal_Int32 nMaxPage; // highest page allocated so far
- short nPageSize; // physical page size
- short nEntries; // FAT entries per page
- short nOffset; // current offset within page
- sal_Int32 nLimit; // search limit recommendation
- bool bPhys; // true: physical FAT
+ StgStrm& m_rStrm; // underlying stream
+ sal_Int32 m_nMaxPage; // highest page allocated so far
+ short m_nPageSize; // physical page size
+ short m_nEntries; // FAT entries per page
+ short m_nOffset; // current offset within page
+ sal_Int32 m_nLimit; // search limit recommendation
+ bool m_bPhys; // true: physical FAT
rtl::Reference< StgPage > GetPhysPage( sal_Int32 nPage );
bool MakeChain( sal_Int32 nStart, sal_Int32 nPages );
bool InitNew( sal_Int32 nPage1 );
@@ -51,8 +51,8 @@ public:
sal_Int32 GetNextPage( sal_Int32 nPg );
sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages );
bool FreePages( sal_Int32 nStart, bool bAll );
- sal_Int32 GetMaxPage() { return nMaxPage; }
- void SetLimit( sal_Int32 n ) { nLimit = n; }
+ sal_Int32 GetMaxPage() { return m_nMaxPage; }
+ void SetLimit( sal_Int32 n ) { m_nLimit = n; }
};
// The base stream class provides basic functionality for seeking
commit 745c0074f9d18f5c6184ecbd6438b04f27b756d1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Oct 8 21:43:30 2015 +0200
sot: prefix members of StgDirEntry
Change-Id: Ic861d57e62cdeec7b2864eb4d1d19a1780382313
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 787c5ad..9e897f4 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -86,17 +86,17 @@ OLEStorageBase::OLEStorageBase( StgIo* p, StgDirEntry* pe, StreamMode& nMode )
if ( p )
p->IncRef();
if( pe )
- pe->nRefCnt++;
+ pe->m_nRefCnt++;
}
OLEStorageBase::~OLEStorageBase()
{
if( pEntry )
{
- DBG_ASSERT( pEntry->nRefCnt, "RefCount unter 0" );
- if( !--pEntry->nRefCnt )
+ DBG_ASSERT( pEntry->m_nRefCnt, "RefCount unter 0" );
+ if( !--pEntry->m_nRefCnt )
{
- if( pEntry->bZombie )
+ if( pEntry->m_bZombie )
delete pEntry;
else
pEntry->Close();
@@ -120,8 +120,8 @@ bool OLEStorageBase::Validate_Impl( bool bWrite ) const
if( pIo
&& pIo->pTOC
&& pEntry
- && !pEntry->bInvalid
- && ( !bWrite || !pEntry->bDirect || ( nStreamMode & StreamMode::WRITE ) ) )
+ && !pEntry->m_bInvalid
+ && ( !bWrite || !pEntry->m_bDirect || ( nStreamMode & StreamMode::WRITE ) ) )
return true;
return false;
}
@@ -130,7 +130,7 @@ bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p )
{
if( m == INTERNAL_MODE )
return true;
- StreamMode nCurMode = ( p && p->nRefCnt ) ? p->nMode : StreamMode::SHARE_DENYALL;
+ StreamMode nCurMode = ( p && p->m_nRefCnt ) ? p->m_nMode : StreamMode::SHARE_DENYALL;
if( ( m & STREAM_READWRITE ) == StreamMode::READ )
{
// only SHARE_DENYWRITE or SHARE_DENYALL allowed
@@ -163,9 +163,9 @@ StorageStream::StorageStream( StgIo* p, StgDirEntry* q, StreamMode m )
// The dir entry may be 0; this means that the stream is invalid.
if( q && p )
{
- if( q->nRefCnt == 1 )
+ if( q->m_nRefCnt == 1 )
{
- q->nMode = m;
+ q->m_nMode = m;
q->OpenStream( *p );
}
}
@@ -179,7 +179,7 @@ StorageStream::~StorageStream()
// Do an auto-commit if the entry is open in direct mode
if( m_bAutoCommit )
Commit();
- if( pEntry && pEntry->nRefCnt && pEntry->bDirect && (m_nMode & StreamMode::WRITE) )
+ if( pEntry && pEntry->m_nRefCnt && pEntry->m_bDirect && (m_nMode & StreamMode::WRITE) )
pEntry->Commit();
}
@@ -298,10 +298,10 @@ bool StorageStream::ValidateMode( StreamMode nMode ) const
SvStorageInfo::SvStorageInfo( const StgDirEntry& rE )
{
- rE.aEntry.GetName( aName );
- bStorage = rE.aEntry.GetType() == STG_STORAGE;
- bStream = rE.aEntry.GetType() == STG_STREAM;
- nSize = bStorage ? 0 : rE.aEntry.GetSize();
+ rE.m_aEntry.GetName( aName );
+ bStorage = rE.m_aEntry.GetType() == STG_STORAGE;
+ bStream = rE.m_aEntry.GetType() == STG_STREAM;
+ nSize = bStorage ? 0 : rE.m_aEntry.GetSize();
}
/////////////////////////// class Storage
@@ -356,9 +356,9 @@ Storage::Storage( const OUString& rFile, StreamMode m, bool bDirect )
Init( ( m & ( StreamMode::TRUNC | StreamMode::NOCREATE ) ) == StreamMode::TRUNC );
if( pEntry )
{
- pEntry->bDirect = bDirect;
- pEntry->nMode = m;
- pEntry->bTemp = bTemp;
+ pEntry->m_bDirect = bDirect;
+ pEntry->m_nMode = m;
+ pEntry->m_bTemp = bTemp;
}
}
else
@@ -386,8 +386,8 @@ Storage::Storage( SvStream& r, bool bDirect )
Init( nSize == 0 );
if( pEntry )
{
- pEntry->bDirect = bDirect;
- pEntry->nMode = m_nMode;
+ pEntry->m_bDirect = bDirect;
+ pEntry->m_nMode = m_nMode;
}
pIo->MoveError( *this );
}
@@ -431,8 +431,8 @@ Storage::Storage( UCBStorageStream& rStrm, bool bDirect )
Init( nSize == 0 );
if( pEntry )
{
- pEntry->bDirect = bDirect;
- pEntry->nMode = m_nMode;
+ pEntry->m_bDirect = bDirect;
+ pEntry->m_nMode = m_nMode;
}
pIo->MoveError( *this );
@@ -472,7 +472,7 @@ void Storage::Init( bool bCreate )
if( pIo->Good() && pIo->pTOC )
{
pEntry = pIo->pTOC->GetRoot();
- pEntry->nRefCnt++;
+ pEntry->m_nRefCnt++;
}
}
@@ -482,12 +482,12 @@ Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m )
: OLEStorageBase( p, q, m_nMode ), bIsRoot( false )
{
if( q )
- q->aEntry.GetName( aName );
+ q->m_aEntry.GetName( aName );
else
m &= ~StreamMode(STREAM_READWRITE);
m_nMode = m;
- if( q && q->nRefCnt == 1 )
- q->nMode = m;
+ if( q && q->m_nRefCnt == 1 )
+ q->m_nMode = m;
}
Storage::~Storage()
@@ -498,16 +498,16 @@ Storage::~Storage()
if( pEntry )
{
// Do an auto-commit if the entry is open in direct mode
- if( pEntry->nRefCnt && pEntry->bDirect && (m_nMode & StreamMode::WRITE) )
+ if( pEntry->m_nRefCnt && pEntry->m_bDirect && (m_nMode & StreamMode::WRITE) )
Commit();
- if( pEntry->nRefCnt == 1 )
+ if( pEntry->m_nRefCnt == 1 )
pEntry->Invalidate();
}
// close the stream is root storage
if( bIsRoot )
pIo->Close();
// remove the file if temporary root storage
- if( bIsRoot && pEntry && pEntry->bTemp )
+ if( bIsRoot && pEntry && pEntry->m_bTemp )
{
osl::File::remove( GetName() );
}
@@ -516,7 +516,7 @@ Storage::~Storage()
const OUString& Storage::GetName() const
{
if( !bIsRoot && Validate() )
- pEntry->aEntry.GetName( const_cast<Storage*>(this)->aName );
+ pEntry->m_aEntry.GetName( const_cast<Storage*>(this)->aName );
return aName;
}
@@ -530,7 +530,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const
StgDirEntry* p = aIter.First();
while( p )
{
- if( !p->bInvalid )
+ if( !p->m_bInvalid )
{
SvStorageInfo aInfo( *p );
pList->push_back( aInfo );
@@ -557,7 +557,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
{
if( !Validate() || !ValidateMode( m ) )
return new Storage( pIo, NULL, m );
- if( bDirect && !pEntry->bDirect )
+ if( bDirect && !pEntry->m_bDirect )
bDirect = false;
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
@@ -575,7 +575,7 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
}
p = pIo->pTOC->Create( *pEntry, aNewName, STG_STORAGE );
if( p )
- p->bTemp = bTemp;
+ p->m_bTemp = bTemp;
}
if( !p )
pIo->SetError( ( m & StreamMode::WRITE )
@@ -583,20 +583,20 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi
}
else if( !ValidateMode( m, p ) )
p = NULL;
- if( p && p->aEntry.GetType() != STG_STORAGE )
+ if( p && p->m_aEntry.GetType() != STG_STORAGE )
{
pIo->SetError( SVSTREAM_FILE_NOT_FOUND );
p = NULL;
}
// Either direct or transacted mode is supported
- if( p && pEntry->nRefCnt == 1 )
- p->bDirect = bDirect;
+ if( p && pEntry->m_nRefCnt == 1 )
+ p->m_bDirect = bDirect;
// Dont check direct conflict if opening readonly
if( p && (m & StreamMode::WRITE ))
{
- if( p->bDirect != bDirect )
+ if( p->m_bDirect != bDirect )
SetError( SVSTREAM_ACCESS_DENIED );
}
Storage* pStg = new Storage( pIo, p, m );
@@ -636,18 +636,18 @@ BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, boo
}
else if( !ValidateMode( m, p ) )
p = NULL;
- if( p && p->aEntry.GetType() != STG_STREAM )
+ if( p && p->m_aEntry.GetType() != STG_STREAM )
{
pIo->SetError( SVSTREAM_FILE_NOT_FOUND );
p = NULL;
}
if( p )
{
- p->bTemp = bTemp;
- p->bDirect = pEntry->bDirect;
+ p->m_bTemp = bTemp;
+ p->m_bDirect = pEntry->m_bDirect;
}
StorageStream* pStm = new StorageStream( pIo, p, m );
- if( p && !p->bDirect )
+ if( p && !p->m_bDirect )
pStm->SetAutoCommit( true );
pIo->MoveError( *pStm );
return pStm;
@@ -681,11 +681,11 @@ bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString&
StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem );
if( pElem )
{
- if( pElem->aEntry.GetType() == STG_STORAGE )
+ if( pElem->m_aEntry.GetType() == STG_STORAGE )
{
// copy the entire storage
BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE );
- BaseStorage* p2 = pDest->OpenOLEStorage( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->bDirect );
+ BaseStorage* p2 = pDest->OpenOLEStorage( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->m_bDirect );
if ( p2 )
{
@@ -714,7 +714,7 @@ bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString&
{
// stream copy
BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE );
- BaseStorageStream* p2 = pDest->OpenStream( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->bDirect );
+ BaseStorageStream* p2 = pDest->OpenStream( rNew, StreamMode::WRITE | StreamMode::SHARE_DENYALL, pEntry->m_bDirect );
if ( p2 )
{
@@ -772,7 +772,7 @@ bool Storage::IsStorage( const OUString& rName ) const
{
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( p )
- return p->aEntry.GetType() == STG_STORAGE;
+ return p->m_aEntry.GetType() == STG_STORAGE;
}
return false;
}
@@ -783,7 +783,7 @@ bool Storage::IsStream( const OUString& rName ) const
{
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( p )
- return p->aEntry.GetType() == STG_STREAM;
+ return p->m_aEntry.GetType() == STG_STREAM;
}
return false;
}
@@ -842,7 +842,7 @@ void Storage::SetClass( const SvGlobalName & rClass,
if( Validate( true ) )
{
// set the class name in the root entry
- pEntry->aEntry.SetClassId( (const ClsId&) rClass.GetCLSID() );
+ pEntry->m_aEntry.SetClassId( (const ClsId&) rClass.GetCLSID() );
pEntry->SetDirty();
// then create the streams
StgCompObjStream aCompObj( *this, true );
@@ -870,7 +870,7 @@ SvGlobalName Storage::GetClassName()
pIo->ResetError();
if ( pEntry )
- return SvGlobalName( pEntry->aEntry.GetClassId() );
+ return SvGlobalName( pEntry->m_aEntry.GetClassId() );
return SvGlobalName();
}
@@ -910,13 +910,13 @@ void Storage::SetDirty()
void Storage::SetClassId( const ClsId& rId )
{
if ( pEntry )
- pEntry->aEntry.SetClassId( rId );
+ pEntry->m_aEntry.SetClassId( rId );
}
const ClsId& Storage::GetClassId() const
{
if ( pEntry )
- return pEntry->aEntry.GetClassId();
+ return pEntry->m_aEntry.GetClassId();
static ClsId aDummyId = {0,0,0,{0,0,0,0,0,0,0,0}};
return aDummyId;
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 8af41b0..642049a 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -50,12 +50,12 @@
StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_uInt64 nUnderlyingStreamSize, bool * pbOk ) : StgAvlNode()
{
- *pbOk = aEntry.Load( pBuffer, nBufferLen, nUnderlyingStreamSize );
+ *pbOk = m_aEntry.Load( pBuffer, nBufferLen, nUnderlyingStreamSize );
InitMembers();
}
-StgDirEntry::StgDirEntry( const StgEntry& r ) : StgAvlNode(), aEntry( r )
+StgDirEntry::StgDirEntry( const StgEntry& r ) : StgAvlNode(), m_aEntry( r )
{
InitMembers();
}
@@ -64,33 +64,33 @@ StgDirEntry::StgDirEntry( const StgEntry& r ) : StgAvlNode(), aEntry( r )
void StgDirEntry::InitMembers()
{
- aSave = aEntry;
- pUp =
- pDown = NULL;
- ppRoot = NULL;
- pStgStrm = NULL;
- pCurStrm =
- pTmpStrm = NULL;
- nPos =
- nEntry =
- nRefCnt = 0;
- nMode = StreamMode::READ;
- bDirect = true;
- bInvalid =
- bCreated =
- bRenamed =
- bRemoved =
- bTemp =
- bDirty =
- bZombie = false;
+ m_aSave = m_aEntry;
+ m_pUp =
+ m_pDown = NULL;
+ m_ppRoot = NULL;
+ m_pStgStrm = NULL;
+ m_pCurStrm =
+ m_pTmpStrm = NULL;
+ m_nPos =
+ m_nEntry =
+ m_nRefCnt = 0;
+ m_nMode = StreamMode::READ;
+ m_bDirect = true;
+ m_bInvalid =
+ m_bCreated =
+ m_bRenamed =
+ m_bRemoved =
+ m_bTemp =
+ m_bDirty =
+ m_bZombie = false;
}
StgDirEntry::~StgDirEntry()
{
Close();
- delete pCurStrm;
- delete pStgStrm;
- delete pDown;
+ delete m_pCurStrm;
+ delete m_pStgStrm;
+ delete m_pDown;
}
// Comparison function
@@ -101,7 +101,7 @@ short StgDirEntry::Compare( const StgAvlNode* p ) const
if ( p )
{
const StgDirEntry* pEntry = static_cast<const StgDirEntry*>(p);
- nResult = aEntry.Compare( pEntry->aEntry );
+ nResult = m_aEntry.Compare( pEntry->m_aEntry );
}
return nResult;
}
@@ -115,24 +115,24 @@ short StgDirEntry::Compare( const StgAvlNode* p ) const
void StgDirEntry::Enum( sal_Int32& n )
{
sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE;
- nEntry = n++;
+ m_nEntry = n++;
if( pLeft )
{
static_cast<StgDirEntry*>(pLeft)->Enum( n );
- nLeft = static_cast<StgDirEntry*>(pLeft)->nEntry;
+ nLeft = static_cast<StgDirEntry*>(pLeft)->m_nEntry;
}
if( pRight )
{
static_cast<StgDirEntry*>(pRight)->Enum( n );
- nRight = static_cast<StgDirEntry*>(pRight)->nEntry;
+ nRight = static_cast<StgDirEntry*>(pRight)->m_nEntry;
}
- if( pDown )
+ if( m_pDown )
{
- pDown->Enum( n ); nDown = pDown->nEntry;
+ m_pDown->Enum( n ); nDown = m_pDown->m_nEntry;
}
- aSave.SetLeaf( STG_LEFT, nLeft );
- aSave.SetLeaf( STG_RIGHT, nRight );
- aSave.SetLeaf( STG_CHILD, nDown );
+ m_aSave.SetLeaf( STG_LEFT, nLeft );
+ m_aSave.SetLeaf( STG_RIGHT, nRight );
+ m_aSave.SetLeaf( STG_CHILD, nDown );
}
// Delete all temporary entries before writing the TOC stream.
@@ -144,26 +144,26 @@ void StgDirEntry::DelTemp( bool bForce )
static_cast<StgDirEntry*>(pLeft)->DelTemp( false );
if( pRight )
static_cast<StgDirEntry*>(pRight)->DelTemp( false );
- if( pDown )
+ if( m_pDown )
{
// If the storage is dead, of course all elements are dead, too
- if( bInvalid && aEntry.GetType() == STG_STORAGE )
+ if( m_bInvalid && m_aEntry.GetType() == STG_STORAGE )
bForce = true;
- pDown->DelTemp( bForce );
+ m_pDown->DelTemp( bForce );
}
- if( ( bForce || bInvalid )
- && ( aEntry.GetType() != STG_ROOT ) /* && ( nRefCnt <= 1 ) */ )
+ if( ( bForce || m_bInvalid )
+ && ( m_aEntry.GetType() != STG_ROOT ) /* && ( nRefCnt <= 1 ) */ )
{
Close();
- if( pUp )
+ if( m_pUp )
{
// this deletes the element if refcnt == 0!
- bool bDel = nRefCnt == 0;
- StgAvlNode::Remove( reinterpret_cast<StgAvlNode**>(&pUp->pDown), this, bDel );
+ bool bDel = m_nRefCnt == 0;
+ StgAvlNode::Remove( reinterpret_cast<StgAvlNode**>(&m_pUp->m_pDown), this, bDel );
if( !bDel )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list