From c45d3badc96481db093560b94d8bf51ead6bd17c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 17 Feb 2016 13:14:50 +0200 Subject: new loplugin: commaoperator Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff --- sot/source/sdstor/stgavl.cxx | 5 ++++- sot/source/sdstor/stgcache.cxx | 8 ++++++-- sot/source/sdstor/stgdir.cxx | 14 +++++++++++--- sot/source/sdstor/stgelem.cxx | 40 +++++++++++++++++++++++++++++++++------- sot/source/sdstor/stgio.cxx | 5 ++++- sot/source/sdstor/stgstrms.cxx | 23 ++++++++++++++++++----- 6 files changed, 76 insertions(+), 19 deletions(-) (limited to 'sot') 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 ) { -- cgit