summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-02-17 13:14:50 +0200
committerNoel Grandin <noel@peralex.com>2016-02-23 08:08:56 +0200
commitc45d3badc96481db093560b94d8bf51ead6bd17c (patch)
tree4bb6c9220678a12b327e46ca2acd01e77fc8e2c4 /sot
parent003d0ccf902d2449320dd24119564565a384f365 (diff)
new loplugin: commaoperator
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgavl.cxx5
-rw-r--r--sot/source/sdstor/stgcache.cxx8
-rw-r--r--sot/source/sdstor/stgdir.cxx14
-rw-r--r--sot/source/sdstor/stgelem.cxx40
-rw-r--r--sot/source/sdstor/stgio.cxx5
-rw-r--r--sot/source/sdstor/stgstrms.cxx23
6 files changed, 76 insertions, 19 deletions
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index fac1ed72cf5c..b7a3d9f9b2ea 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -70,7 +70,10 @@ short StgAvlNode::Locate
{
// check for pPivot
if( pCur->m_nBalance != 0 )
- *pPivot = pCur, *pParent = *pPrev;
+ {
+ *pPivot = pCur;
+ *pParent = *pPrev;
+ }
// save pPrev location and see what direction to go
*pPrev = pCur;
nRes = pCur->Compare( pFind );
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index e7e40cf453cf..832fde7406e2 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -336,7 +336,8 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
// fixed address and size for the header
if( nPage == -1 )
{
- nPos = 0L, nBytes = 512;
+ nPos = 0L;
+ nBytes = 512;
nPg2 = nPg;
}
if( m_pStrm->Tell() != nPos )
@@ -365,7 +366,10 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
// 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;
+ {
+ nPos = 0L;
+ nBytes = 512;
+ }
if( m_pStrm->Tell() != nPos )
{
m_pStrm->Seek(nPos);
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 7436764c00bd..8e8eaa08edd1 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -200,7 +200,8 @@ bool StgDirEntry::StoreStream( StgIo& rIo )
if( !m_pStgStrm )
{
OpenStream( rIo );
- delete m_pStgStrm, m_pStgStrm = nullptr;
+ delete m_pStgStrm;
+ m_pStgStrm = nullptr;
}
else
m_pStgStrm->SetSize( 0 );
@@ -532,7 +533,11 @@ bool StgDirEntry::Commit()
if( m_aEntry.GetType() == STG_STREAM )
{
if( m_pTmpStrm )
- delete m_pCurStrm, m_pCurStrm = m_pTmpStrm, m_pTmpStrm = nullptr;
+ {
+ delete m_pCurStrm;
+ m_pCurStrm = m_pTmpStrm;
+ m_pTmpStrm = nullptr;
+ }
if( m_bRemoved )
// Delete the stream if needed
if( m_pStgStrm )
@@ -616,7 +621,10 @@ bool StgDirEntry::Tmp2Strm()
{
// We did commit once, but have not written since then
if( !m_pTmpStrm )
- m_pTmpStrm = m_pCurStrm, m_pCurStrm = nullptr;
+ {
+ m_pTmpStrm = m_pCurStrm;
+ m_pCurStrm = nullptr;
+ }
if( m_pTmpStrm )
{
OSL_ENSURE( m_pStgStrm, "The pointer may not be NULL!" );
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index b0b7ac0ee23f..7e2c5fbd458d 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -221,39 +221,65 @@ void StgHeader::SetFATPage( short n, sal_Int32 nb )
if( n >= 0 && n < cFATPagesInHeader )
{
if( m_nMasterFAT[ n ] != nb )
- m_bDirty = sal_uInt8(true), m_nMasterFAT[ n ] = nb;
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nMasterFAT[ n ] = nb;
+ }
}
}
void StgHeader::SetTOCStart( sal_Int32 n )
{
- if( n != m_nTOCstrm ) m_bDirty = sal_uInt8(true), m_nTOCstrm = n;
+ if( n != m_nTOCstrm )
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nTOCstrm = n;
+ }
}
void StgHeader::SetDataFATStart( sal_Int32 n )
{
- if( n != m_nDataFAT ) m_bDirty = sal_uInt8(true), m_nDataFAT = n;
+ if( n != m_nDataFAT )
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nDataFAT = n;
+ }
}
void StgHeader::SetDataFATSize( sal_Int32 n )
{
- if( n != m_nDataFATSize ) m_bDirty = sal_uInt8(true), m_nDataFATSize = n;
+ if( n != m_nDataFATSize )
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nDataFATSize = n;
+ }
}
void StgHeader::SetFATSize( sal_Int32 n )
{
- if( n != m_nFATSize ) m_bDirty = sal_uInt8(true), m_nFATSize = n;
+ if( n != m_nFATSize )
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nFATSize = n;
+ }
}
void StgHeader::SetFATChain( sal_Int32 n )
{
if( n != m_nMasterChain )
- m_bDirty = sal_uInt8(true), m_nMasterChain = n;
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nMasterChain = n;
+ }
}
void StgHeader::SetMasters( sal_Int32 n )
{
- if( n != m_nMaster ) m_bDirty = sal_uInt8(true), m_nMaster = n;
+ if( n != m_nMaster )
+ {
+ m_bDirty = sal_uInt8(true);
+ m_nMaster = n;
+ }
}
///////////////////////////// class StgEntry
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 3ae6b11b5468..cfb29fd7c7a0 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -195,7 +195,10 @@ bool EasyFat::HasUnrefChains()
sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect )
{
if( nCount > 0 )
- --nCount /= GetPageSize(), nCount++;
+ {
+ --nCount /= GetPageSize();
+ nCount++;
+ }
sal_Int32 nCurPage = nPage;
while( nCount != 0 )
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index a67a663101f4..ffc27a4f52fa 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -110,8 +110,10 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
if( nTmpLen )
nTmpLen++;
else
- nTmpStart = i,
+ {
+ nTmpStart = i;
nTmpLen = 1;
+ }
if( nTmpLen == nPgs
// If we already did find a block, stop when reaching the limit
|| ( bFound && ( nEntry >= m_nLimit ) ) )
@@ -120,12 +122,17 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
else if( nTmpLen )
{
if( nTmpLen > nPgs && nTmpLen < nMaxLen )
+ {
// block > requested size
- nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = true;
+ nMaxLen = nTmpLen;
+ nMaxStart = nTmpStart;
+ bFound = true;
+ }
else if( nTmpLen >= nMinLen )
{
// block < requested size
- nMinLen = nTmpLen, nMinStart = nTmpStart;
+ nMinLen = nTmpLen;
+ nMinStart = nTmpStart;
bFound = true;
if( nTmpLen == nPgs )
break;
@@ -138,11 +145,17 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
if( nTmpLen )
{
if( nTmpLen > nPgs && nTmpLen < nMaxLen )
+ {
// block > requested size
- nMaxLen = nTmpLen, nMaxStart = nTmpStart;
+ nMaxLen = nTmpLen;
+ nMaxStart = nTmpStart;
+ }
else if( nTmpLen >= nMinLen )
+ {
// block < requested size
- nMinLen = nTmpLen, nMinStart = nTmpStart;
+ nMinLen = nTmpLen;
+ nMinStart = nTmpStart;
+ }
}
if( nMinStart != STG_EOF && nMaxStart != STG_EOF )
{