From 8c7a237d0db3a279ac39e8b2697b2a50ac46db00 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Feb 2016 16:04:08 +0200 Subject: loplugin:commaoperator in sw/ Change-Id: I9b00755707687e4c10c02bf49866571f2c44d8ba (cherry picked from commit c17ead7dc9c9dce23033fdda9c316f27a0225b17) --- sw/source/core/bastyp/bparr.cxx | 12 ++-- sw/source/core/bastyp/breakit.cxx | 6 +- sw/source/core/bastyp/calc.cxx | 20 +++++-- sw/source/core/bastyp/index.cxx | 3 +- sw/source/core/crsr/crsrsh.cxx | 21 ++++--- sw/source/core/crsr/swcrsr.cxx | 6 +- sw/source/core/crsr/trvltbl.cxx | 3 +- .../core/doc/DocumentContentOperationsManager.cxx | 13 ++++- sw/source/core/doc/DocumentRedlineManager.cxx | 29 ++++++--- sw/source/core/doc/doc.cxx | 3 +- sw/source/core/doc/docbm.cxx | 3 +- sw/source/core/doc/doccomp.cxx | 49 ++++++++++++---- sw/source/core/doc/docfmt.cxx | 5 +- sw/source/core/doc/doclay.cxx | 5 +- sw/source/core/doc/docnew.cxx | 3 +- sw/source/core/doc/docnum.cxx | 15 ++++- sw/source/core/doc/docredln.cxx | 9 ++- sw/source/core/doc/docsort.cxx | 31 +++++++--- sw/source/core/doc/notxtfrm.cxx | 10 +++- sw/source/core/doc/number.cxx | 11 +++- sw/source/core/doc/poolfmt.cxx | 15 +++-- sw/source/core/doc/swserv.cxx | 3 +- sw/source/core/doc/tblrwcl.cxx | 20 +++++-- sw/source/core/docnode/section.cxx | 5 +- sw/source/core/edit/acorrect.cxx | 5 +- sw/source/core/edit/autofmt.cxx | 38 +++++++++--- sw/source/core/edit/edlingu.cxx | 9 ++- sw/source/core/edit/edtab.cxx | 10 +++- sw/source/core/fields/reffld.cxx | 3 +- sw/source/core/frmedt/fefly1.cxx | 5 +- sw/source/core/frmedt/fetab.cxx | 3 +- sw/source/core/inc/mvsave.hxx | 4 +- sw/source/core/layout/layact.cxx | 6 +- sw/source/core/layout/pagechg.cxx | 2 +- sw/source/core/text/inftxt.cxx | 2 +- sw/source/core/text/pormulti.cxx | 2 +- sw/source/core/txtnode/fmtatr2.cxx | 5 +- sw/source/core/txtnode/ndtxt.cxx | 5 +- sw/source/core/undo/undel.cxx | 8 ++- sw/source/core/undo/undobj.cxx | 13 ++++- sw/source/core/undo/unins.cxx | 13 ++++- sw/source/core/undo/unmove.cxx | 5 +- sw/source/core/undo/unnum.cxx | 3 +- sw/source/core/undo/unovwr.cxx | 5 +- sw/source/core/undo/unredln.cxx | 16 +++-- sw/source/core/undo/unsect.cxx | 5 +- sw/source/core/undo/untbl.cxx | 35 ++++++++--- sw/source/core/undo/untblk.cxx | 3 +- sw/source/core/unocore/unoframe.cxx | 5 +- sw/source/core/view/vnew.cxx | 5 +- sw/source/filter/ascii/parasc.cxx | 3 +- sw/source/filter/basflt/fltini.cxx | 5 +- sw/source/filter/html/htmlftn.cxx | 3 +- sw/source/filter/html/swhtml.cxx | 5 +- sw/source/filter/ww8/docxexport.cxx | 18 ++++-- sw/source/filter/ww8/rtfsdrexport.cxx | 6 +- sw/source/filter/ww8/wrtw8esh.cxx | 6 +- sw/source/filter/ww8/wrtw8sty.cxx | 15 ++++- sw/source/filter/ww8/wrtww8.cxx | 3 +- sw/source/filter/ww8/ww8par.cxx | 16 +++-- sw/source/filter/ww8/ww8par2.cxx | 12 ++-- sw/source/filter/ww8/ww8par3.cxx | 3 +- sw/source/filter/ww8/ww8par5.cxx | 5 +- sw/source/filter/ww8/ww8par6.cxx | 21 ++++--- sw/source/filter/xml/xmltexti.cxx | 3 +- sw/source/ui/dbui/dbinsdlg.cxx | 9 ++- sw/source/ui/dbui/mmoutputpage.cxx | 4 +- sw/source/ui/frmdlg/frmpage.cxx | 2 +- sw/source/ui/index/swuiidxmrk.cxx | 20 +++++-- sw/source/ui/table/tautofmt.cxx | 5 +- sw/source/uibase/app/mainwn.cxx | 5 +- sw/source/uibase/dochdl/swdtflvr.cxx | 5 +- sw/source/uibase/docvw/edtwin.cxx | 68 +++++++++++++++++----- sw/source/uibase/docvw/edtwin2.cxx | 5 +- sw/source/uibase/shells/annotsh.cxx | 10 +++- sw/source/uibase/shells/basesh.cxx | 5 +- sw/source/uibase/shells/drwtxtex.cxx | 10 +++- sw/source/uibase/shells/tabsh.cxx | 36 +++++++++--- sw/source/uibase/uiview/view2.cxx | 10 +++- sw/source/uibase/utlui/shdwcrsr.cxx | 3 +- 80 files changed, 620 insertions(+), 216 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index 5612103f1c1c..df38c74d33f3 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -439,9 +439,9 @@ sal_uInt16 BigPtrArray::Compress( short nMax ) for( sal_uInt16 nCount = n, nOff = pLast->nElem; nCount; --nCount, ++pElem ) { - *pElem = *pFrom++, - (*pElem)->pBlock = pLast, - (*pElem)->nOffset = nOff++; + *pElem = *pFrom++; + (*pElem)->pBlock = pLast; + (*pElem)->nOffset = nOff++; } // adjustment @@ -454,12 +454,14 @@ sal_uInt16 BigPtrArray::Compress( short nMax ) { // than remove delete[] p->pData; - delete p, p = nullptr; + delete p; + p = nullptr; ++nBlkdel; } else { - pElem = p->pData, pFrom = pElem + n; + pElem = p->pData; + pFrom = pElem + n; int nCount = p->nElem; while( nCount-- ) { diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx index 9314a01ac4fc..3819d1b8e881 100644 --- a/sw/source/core/bastyp/breakit.cxx +++ b/sw/source/core/bastyp/breakit.cxx @@ -38,12 +38,14 @@ SwBreakIt* g_pBreakIt = nullptr; void SwBreakIt::_Create( const uno::Reference & rxContext ) { - delete g_pBreakIt, g_pBreakIt = new SwBreakIt( rxContext ); + delete g_pBreakIt; + g_pBreakIt = new SwBreakIt( rxContext ); } void SwBreakIt::_Delete() { - delete g_pBreakIt, g_pBreakIt = nullptr; + delete g_pBreakIt; + g_pBreakIt = nullptr; } SwBreakIt * SwBreakIt::Get() diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index f03a943cc74f..69c6e0a417b5 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -758,9 +758,15 @@ SwCalcOper SwCalc::GetToken() { SwCalcOper eTmp2; if( '=' == ch ) - eCurrOper = SwCalcOper('='), eTmp2 = CALC_EQ; + { + eCurrOper = SwCalcOper('='); + eTmp2 = CALC_EQ; + } else - eCurrOper = CALC_NOT, eTmp2 = CALC_NEQ; + { + eCurrOper = CALC_NOT; + eTmp2 = CALC_NEQ; + } if( aRes.EndPos < sCommand.getLength() && '=' == sCommand[aRes.EndPos] ) @@ -1200,9 +1206,15 @@ SwSbxValue SwCalc::Term() if( fNum > 0 ) { while( fNum < 1.0 ) - fNum *= 10.0, --nExp; + { + fNum *= 10.0; + --nExp; + } while( fNum >= 10.0 ) - fNum /= 10.0, ++nExp; + { + fNum /= 10.0; + ++nExp; + } } nExp = 15 - nExp; if( nExp > 15 ) diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index dac9ba9c2769..e9eddd7eacf7 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -288,7 +288,8 @@ void SwIndexReg::MoveTo( SwIndexReg& rArr ) pIdx->Assign( &rArr, pIdx->GetIndex() ); pIdx = pNext; } - m_pFirst = nullptr, m_pLast = nullptr; + m_pFirst = nullptr; + m_pLast = nullptr; } } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index a3375beceeb0..89a3438f6d08 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -868,7 +868,8 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) void SwCursorShell::TableCursorToCursor() { OSL_ENSURE( m_pTableCursor, "TableCursorToCursor: Why?" ); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; } void SwCursorShell::BlockCursorToCursor() @@ -884,7 +885,8 @@ void SwCursorShell::BlockCursorToCursor() else m_pCurrentCursor->DeleteMark(); } - delete m_pBlockCursor, m_pBlockCursor = nullptr; + delete m_pBlockCursor; + m_pBlockCursor = nullptr; } void SwCursorShell::CursorToBlockCursor() @@ -923,7 +925,8 @@ void SwCursorShell::ClearMark() *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint(); m_pCurrentCursor->GetPtPos() = m_pTableCursor->GetPtPos(); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; m_pCurrentCursor->SwSelPaintRects::Show(); } else @@ -1605,7 +1608,8 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) m_pCurrentCursor->DeleteMark(); *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint(); m_pCurrentCursor->GetPtPos() = m_pTableCursor->GetPtPos(); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; } m_pVisibleCursor->Hide(); // always hide visible Cursor @@ -3170,7 +3174,8 @@ sal_uLong SwCursorShell::Find( const SearchOptions& rSearchOpt, { if( m_pTableCursor ) GetCursor(); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed sal_uLong nRet = m_pCurrentCursor->Find( rSearchOpt, bSearchInNotes, eStart, eEnd, bCancel, eRng, bReplace ); @@ -3187,7 +3192,8 @@ sal_uLong SwCursorShell::Find( const SwTextFormatColl& rFormatColl, { if( m_pTableCursor ) GetCursor(); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed sal_uLong nRet = m_pCurrentCursor->Find( rFormatColl, eStart, eEnd, bCancel, eRng, pReplFormat ); @@ -3206,7 +3212,8 @@ sal_uLong SwCursorShell::Find( const SfxItemSet& rSet, { if( m_pTableCursor ) GetCursor(); - delete m_pTableCursor, m_pTableCursor = nullptr; + delete m_pTableCursor; + m_pTableCursor = nullptr; SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed sal_uLong nRet = m_pCurrentCursor->Find( rSet, bNoCollections, eStart, eEnd, bCancel, eRng, pSearchOpt, rReplSet ); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index de2417f1c70e..edd72bfc9965 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2114,8 +2114,10 @@ SwTableCursor::SwTableCursor( const SwPosition &rPos, SwPaM* pRing ) { m_bParked = false; m_bChanged = false; - m_nTablePtNd = 0, m_nTableMkNd = 0; - m_nTablePtCnt = 0, m_nTableMkCnt = 0; + m_nTablePtNd = 0; + m_nTableMkNd = 0; + m_nTablePtCnt = 0; + m_nTableMkCnt = 0; } SwTableCursor::~SwTableCursor() {} diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 1aa1e581bf68..dfd6da6b63f4 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -871,7 +871,8 @@ void SwCursorShell::SaveTableBoxContent( const SwPosition* pPos ) void SwCursorShell::ClearTableBoxContent() { - delete m_pBoxIdx, m_pBoxIdx = nullptr; + delete m_pBoxIdx; + m_pBoxIdx = nullptr; m_pBoxPtr = nullptr; } diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index b2b49eedf6ce..7aa3bdf24b97 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1615,10 +1615,16 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, cons nDiff = nEnd - nStt +1; SwNode* pNd = m_rDoc.GetNodes()[ nStt ]; if( pNd->IsContentNode() && pStt->nContent.GetIndex() ) - ++nStt, --nDiff; + { + ++nStt; + --nDiff; + } if( (pNd = m_rDoc.GetNodes()[ nEnd ])->IsContentNode() && static_cast(pNd)->Len() != pEnd->nContent.GetIndex() ) - --nEnd, --nDiff; + { + --nEnd; + --nDiff; + } if( nDiff && lcl_ChkFlyFly( pDoc, nStt, nEnd, rPos.nNode.GetIndex() ) ) { @@ -2249,7 +2255,8 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod else { aIdx = rRange.aStart; - delete pUndo, pUndo = nullptr; + delete pUndo; + pUndo = nullptr; } // move the Flys to the new position diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 9f7620878e02..4974408b1a08 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -893,7 +893,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall if( bDelete ) { - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; bCompress = true; } } @@ -1093,7 +1094,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall case POS_INSIDE: case POS_EQUAL: - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; bCompress = true; break; @@ -1211,7 +1213,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall bCompress = true; } - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; break; case POS_OUTSIDE: @@ -1303,7 +1306,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall case POS_EQUAL: { pRedl->PushData( *pNewRedl ); - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; if( IsHideChanges( meRedlineMode )) { pRedl->Hide(0, mpRedlineTable->GetPos(pRedl)); @@ -1511,7 +1515,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall case POS_EQUAL: case POS_INSIDE: - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; break; case POS_OUTSIDE: @@ -1552,9 +1557,11 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall case POS_INSIDE: if( pRedl->IsOwnRedline( *pNewRedl ) && pRedl->CanCombine( *pNewRedl )) + { // own one can be ignored completely - delete pNewRedl, pNewRedl = nullptr; - + delete pNewRedl; + pNewRedl = nullptr; + } else if( *pREnd == *pEnd ) // or else only shorten the current one pRedl->SetEnd( *pStt, pREnd ); @@ -1669,7 +1676,8 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pNewRedl ); meRedlineMode = eOld; } - delete pNewRedl, pNewRedl = nullptr; + delete pNewRedl; + pNewRedl = nullptr; } _CHECK_REDLINE( *this ) @@ -2643,7 +2651,10 @@ void DocumentRedlineManager::SetAutoFormatRedlineComment( const OUString* pText, *mpAutoFormatRedlnComment = *pText; } else - delete mpAutoFormatRedlnComment, mpAutoFormatRedlnComment = nullptr; + { + delete mpAutoFormatRedlnComment; + mpAutoFormatRedlnComment = nullptr; + } mnAutoFormatRedlnCommentNo = nSeqNo; } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index deeda828c619..ab82f98d98b7 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -968,7 +968,8 @@ void SwDoc::CalculatePagePairsForProspectPrinting( else if ( !bPrintRightPages ) { ++nStep; - ++nSPg, --nEPg; + ++nSPg; + --nEPg; } // the number of 'virtual' pages to be printed diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 90f466fd3d8f..d75eb64ec2ea 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -705,7 +705,8 @@ namespace sw { namespace mark && pMark->GetOtherMarkPos().nNode == rEnd && pMark->GetOtherMarkPos().nContent == *pEndIdx ) ) ) { - bIsPosInRange = true, bIsOtherPosInRange = true; + bIsPosInRange = true; + bIsOtherPosInRange = true; } if ( bIsPosInRange diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index a6fad31d95a6..91aa08a286a0 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -470,7 +470,8 @@ sal_uLong CompareData::ShowDiffs( const CompareData& rData ) ++nCnt; } - ++nStt1, ++nStt2; + ++nStt1; + ++nStt2; } return nCnt; } @@ -488,7 +489,8 @@ bool CompareData::HasDiffs( const CompareData& rData ) const bRet = true; break; } - ++nStt1, ++nStt2; + ++nStt1; + ++nStt2; } return bRet; } @@ -528,7 +530,7 @@ static const sal_uLong primes[] = pDataArr = new _HashData[ nSize ]; pDataArr[0].nNext = 0; - pDataArr[0].nHash = 0, + pDataArr[0].nHash = 0; pDataArr[0].pLine = nullptr; nPrime = primes[0]; @@ -683,7 +685,10 @@ void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard ) /* Cancel provisional discards at end, and shrink the run. */ while( j > n && 2 == pDiscard[j - 1] ) - pDiscard[ --j ] = 0, --provisional; + { + pDiscard[ --j ] = 0; + --provisional; + } /* Now we have the length of a run of discardable lines whose first and last are not provisional. */ @@ -731,7 +736,10 @@ void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard ) if (j >= 8 && pDiscard[n + j] == 1) break; if (pDiscard[n + j] == 2) - consec = 0, pDiscard[n + j] = 0; + { + consec = 0; + pDiscard[n + j] = 0; + } else if (pDiscard[n + j] == 0) consec = 0; else @@ -749,7 +757,10 @@ void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard ) if (j >= 8 && pDiscard[n - j] == 1) break; if (pDiscard[n - j] == 2) - consec = 0, pDiscard[n - j] = 0; + { + consec = 0; + pDiscard[n - j] = 0; + } else if (pDiscard[n - j] == 0) consec = 0; else @@ -819,12 +830,18 @@ void Compare::CompareSequence::Compare( sal_uLong nStt1, sal_uLong nEnd1, /* Slide down the bottom initial diagonal. */ while( nStt1 < nEnd1 && nStt2 < nEnd2 && rMoved1.GetIndex( nStt1 ) == rMoved2.GetIndex( nStt2 )) - ++nStt1, ++nStt2; + { + ++nStt1; + ++nStt2; + } /* Slide up the top initial diagonal. */ while( nEnd1 > nStt1 && nEnd2 > nStt2 && rMoved1.GetIndex( nEnd1 - 1 ) == rMoved2.GetIndex( nEnd2 - 1 )) - --nEnd1, --nEnd2; + { + --nEnd1; + --nEnd2; + } /* Handle simple cases. */ if( nStt1 == nEnd1 ) @@ -893,7 +910,10 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1, y = x - d; while( sal_uLong(x) < nEnd1 && sal_uLong(y) < nEnd2 && rMoved1.GetIndex( x ) == rMoved2.GetIndex( y )) - ++x, ++y; + { + ++x; + ++y; + } pFDiag[d] = x; if( odd && bmin <= d && d <= bmax && pBDiag[d] <= pFDiag[d] ) { @@ -916,7 +936,10 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1, y = x - d; while( sal_uLong(x) > nStt1 && sal_uLong(y) > nStt2 && rMoved1.GetIndex( x - 1 ) == rMoved2.GetIndex( y - 1 )) - --x, --y; + { + --x; + --y; + } pBDiag[d] = x; if (!odd && fmin <= d && d <= fmax && pBDiag[d] <= pFDiag[d]) { @@ -1954,7 +1977,8 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline) case POS_INSIDE: case POS_EQUAL: - delete pDestRedl, pDestRedl = nullptr; + delete pDestRedl; + pDestRedl = nullptr; // break; -> no break !!!! case POS_COLLIDE_END: @@ -2335,7 +2359,8 @@ int CommonSubseq::FindLCS( int *pLcs1, int *pLcs2, int nStt1, int nEnd1, nIdx2--; else { - nIdx1--, nIdx2--; + nIdx1--; + nIdx2--; pLcs1[ nIdx ] = nIdx1 + nStt1; pLcs2[ nIdx ] = nIdx2 + nStt2; nIdx--; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 298b50882cff..08c3fcbce6e8 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -366,8 +366,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, ++aTmpStt; } if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetContentNode()->Len() ) + { // set up a later, and all CharFormatAttr -> TextFormatAttr - ++aTmpEnd, bAdd = false; + ++aTmpEnd; + bAdd = false; + } else if( pStt->nNode != pEnd->nNode || !pStt->nContent.GetIndex() ) { SwTextNode* pTNd = aTmpEnd.GetNode().GetTextNode(); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 6c5dfdd0433e..30f3f8872c0a 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1328,7 +1328,10 @@ static OUString lcl_GetUniqueFlyName(const SwDoc* pDoc, sal_uInt16 nDefStrId, RE // so determine the number nNum = n * 8; while( nTmp & 1 ) - ++nNum, nTmp >>= 1; + { + ++nNum; + nTmp >>= 1; + } break; } } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 9f44b12502ac..3c04abe971ed 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -733,7 +733,8 @@ void SwDoc::ClearDoc() GetDocumentFieldsManager().ClearFieldTypes(); - delete mpNumberFormatter, mpNumberFormatter = nullptr; + delete mpNumberFormatter; + mpNumberFormatter = nullptr; getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD ); pFirstNd->ChgFormatColl( getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD )); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index e60d415fc226..c9a64faf0ec7 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1441,9 +1441,15 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext, const SwTextNode* pLast; if( bNext ) - ++aIdx, pLast = pNd; + { + ++aIdx; + pLast = pNd; + } else - --aIdx, pLast = nullptr; + { + --aIdx; + pLast = nullptr; + } while( bNext ? ( aIdx.GetIndex() < aIdx.GetNodes().Count() - 1 ) : aIdx.GetIndex() != 0 ) @@ -2265,7 +2271,10 @@ OUString SwDoc::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) c // identify the Number nNum = n * 8; while( nTmp & 1 ) - ++nNum, nTmp >>= 1; + { + ++nNum; + nTmp >>= 1; + } break; } } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 4c2a77325b9b..df26133c26b3 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -430,7 +430,8 @@ bool SwRedlineTable::InsertWithValidRanges( SwRangeRedline* p, sal_uInt16* pInsP } while( aNewStt < *pEnd ); delete pNew; - delete p, p = nullptr; + delete p; + p = nullptr; return bAnyIns; } @@ -1457,7 +1458,8 @@ void SwRangeRedline::MoveFromSection(size_t nMyPos) { pDoc->getIDocumentContentOperations().DeleteSection( &pContentSect->GetNode() ); } - delete pContentSect, pContentSect = nullptr; + delete pContentSect; + pContentSect = nullptr; // adjustment of redline table positions must take start and // end into account, not point and mark. @@ -1480,7 +1482,8 @@ void SwRangeRedline::SetContentIdx( const SwNodeIndex* pIdx ) } else if( !pIdx && pContentSect ) { - delete pContentSect, pContentSect = nullptr; + delete pContentSect; + pContentSect = nullptr; bIsVisible = false; } else diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 520500047ef9..8f7c0afcef19 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -90,11 +90,16 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt, void SwSortElement::Finit() { - delete pOptions, pOptions = nullptr; - delete pLocale, pLocale = nullptr; - delete pLastAlgorithm, pLastAlgorithm = nullptr; - delete pSortCollator, pSortCollator = nullptr; - delete pLclData, pLclData = nullptr; + delete pOptions; + pOptions = nullptr; + delete pLocale; + pLocale = nullptr; + delete pLastAlgorithm; + pLastAlgorithm = nullptr; + delete pSortCollator; + pSortCollator = nullptr; + delete pLclData; + pLclData = nullptr; pDoc = nullptr; pBox = nullptr; } @@ -128,9 +133,15 @@ int SwSortElement::keycompare(const SwSortElement& rCmp, sal_uInt16 nKey) const const SwSortKey* pSrtKey = pOptions->aKeys[ nKey ]; if( pSrtKey->eSortOrder == SRT_ASCENDING ) - pOrig = this, pCmp = &rCmp; + { + pOrig = this; + pCmp = &rCmp; + } else - pOrig = &rCmp, pCmp = this; + { + pOrig = &rCmp; + pCmp = this; + } if( pSrtKey->bIsNumeric ) { @@ -369,7 +380,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) else { getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, USHRT_MAX ); - delete pRedlPam, pRedlPam = nullptr; + delete pRedlPam; + pRedlPam = nullptr; } } @@ -460,7 +472,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) if( pRedlUndo ) pRedlUndo->SetOffset( aSttIdx ); - delete pRedlPam, pRedlPam = nullptr; + delete pRedlPam; + pRedlPam = nullptr; } GetIDocumentUndoRedo().DoUndo( bUndo ); if( bUndo ) diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 622919364ed7..3c4b25b77600 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -927,10 +927,16 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr { OutputDevice* pVout; if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() ) - pVout = pOut, pOut = pShell->GetOut(); + { + pVout = pOut; + pOut = pShell->GetOut(); + } else if( pShell->GetWin() && OUTDEV_VIRDEV == pOut->GetOutDevType() ) - pVout = pOut, pOut = pShell->GetWin(); + { + pVout = pOut; + pOut = pShell->GetWin(); + } else pVout = nullptr; diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index e4152e5b10ba..f3372869c76e 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -619,9 +619,16 @@ void SwNumRule::Set( sal_uInt16 i, const SwNumFormat* pNumFormat ) } } else if( !pNumFormat ) - delete pOld, maFormats[ i ] = nullptr, mbInvalidRuleFlag = true; + { + delete pOld; + maFormats[ i ] = nullptr; + mbInvalidRuleFlag = true; + } else if( *pOld != *pNumFormat ) - *pOld = *pNumFormat, mbInvalidRuleFlag = true; + { + *pOld = *pNumFormat; + mbInvalidRuleFlag = true; + } } OUString SwNumRule::MakeNumString( const SwNodeNum& rNum, bool bInclStrings, diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 722ba67f5e7a..4c812b51d657 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -80,19 +80,24 @@ void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem ) switch( rItem.Which() ) { case RES_CHRATR_FONTSIZE: - nWhCJK = RES_CHRATR_CJK_FONTSIZE, nWhCTL = RES_CHRATR_CTL_FONTSIZE; + nWhCJK = RES_CHRATR_CJK_FONTSIZE; + nWhCTL = RES_CHRATR_CTL_FONTSIZE; break; case RES_CHRATR_FONT: - nWhCJK = RES_CHRATR_CJK_FONT, nWhCTL = RES_CHRATR_CTL_FONT; + nWhCJK = RES_CHRATR_CJK_FONT; + nWhCTL = RES_CHRATR_CTL_FONT; break; case RES_CHRATR_LANGUAGE: - nWhCJK = RES_CHRATR_CJK_LANGUAGE, nWhCTL = RES_CHRATR_CTL_LANGUAGE; + nWhCJK = RES_CHRATR_CJK_LANGUAGE; + nWhCTL = RES_CHRATR_CTL_LANGUAGE; break; case RES_CHRATR_POSTURE: - nWhCJK = RES_CHRATR_CJK_POSTURE, nWhCTL = RES_CHRATR_CTL_POSTURE; + nWhCJK = RES_CHRATR_CJK_POSTURE; + nWhCTL = RES_CHRATR_CTL_POSTURE; break; case RES_CHRATR_WEIGHT: - nWhCJK = RES_CHRATR_CJK_WEIGHT, nWhCTL = RES_CHRATR_CTL_WEIGHT; + nWhCJK = RES_CHRATR_CJK_WEIGHT; + nWhCTL = RES_CHRATR_CTL_WEIGHT; break; } diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 589e0f4d066e..bef09f11b3eb 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -260,7 +260,8 @@ void SwServerObject::SetNoServer() ::sw::mark::DdeBookmark* const pDdeBookmark = dynamic_cast< ::sw::mark::DdeBookmark* >(CNTNT_TYPE.pBkmk); if(pDdeBookmark) { - CNTNT_TYPE.pBkmk = nullptr, eType = NONE_SERVER; + CNTNT_TYPE.pBkmk = nullptr; + eType = NONE_SERVER; pDdeBookmark->SetRefObject(nullptr); } } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index eca9a38f8170..15ae0f2381ff 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -3150,7 +3150,10 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, ::lcl_DeleteBox_Recursive(rParam, *pBox, bCheck); if( !rParam.bLeft ) - --n, --nCntEnd; + { + --n; + --nCntEnd; + } } } else if( bChgLowers ) @@ -3204,7 +3207,10 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, { // Then change the loop variable when deleting to the right if( !rParam.bLeft ) - --n, --nCntEnd; + { + --n; + --nCntEnd; + } } else { @@ -4216,9 +4222,15 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType, SwTableLines::size_type nStt; SwTableLines::size_type nEnd; if( bTop ) - nStt = 0, nEnd = nBaseLinePos; + { + nStt = 0; + nEnd = nBaseLinePos; + } else - nStt = nBaseLinePos + 1, nEnd = pLines->size(); + { + nStt = nBaseLinePos + 1; + nEnd = pLines->size(); + } // Get the current Lines' height if( TBLFIX_CHGPROP == m_eTableChgMode ) diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 77863891d5f3..74fd835a7fc0 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1337,7 +1337,10 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) } if( pCpyRg && pSrcDoc == pDoc && pCpyRg->aStart < rInsPos && rInsPos < pCpyRg->aEnd ) - delete pCpyRg, pCpyRg = nullptr; + { + delete pCpyRg; + pCpyRg = nullptr; + } } else if( pSrcDoc != pDoc ) pCpyRg = new SwNodeRange( pSrcDoc->GetNodes().GetEndOfExtras(), 2, diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index ef4efb130f65..3874940a29e5 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -470,7 +470,10 @@ void SwDontExpandItem::SaveDontExpandItems( const SwPosition& rPos ) const sal_Int32 n = rPos.nContent.GetIndex(); if( !pTextNd->GetAttr( *pDontExpItems, n, n, n != pTextNd->GetText().getLength() )) - delete pDontExpItems, pDontExpItems = nullptr; + { + delete pDontExpItems; + pDontExpItems = nullptr; + } } } diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index bd5e6a52a191..82b58222a81c 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -457,9 +457,13 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTextNode& rNd, sal_uInt16 *pDigitLvl switch (rText[n]) { case ' ': if( 3 == ++nBlnk ) - ++nLvl, nBlnk = 0; + { + ++nLvl; + nBlnk = 0; + } break; - case '\t': ++nLvl, nBlnk = 0; + case '\t': ++nLvl; + nBlnk = 0; break; default: if( pDigitLvl ) @@ -798,14 +802,26 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos, #endif { if( bIsUpper ) - cNumTyp = '0' + SVX_NUM_ROMAN_UPPER, eTmpScan = UPPER_ROMAN; + { + cNumTyp = '0' + SVX_NUM_ROMAN_UPPER; + eTmpScan = UPPER_ROMAN; + } else - cNumTyp = '0' + SVX_NUM_ROMAN_LOWER, eTmpScan = LOWER_ROMAN; + { + cNumTyp = '0' + SVX_NUM_ROMAN_LOWER; + eTmpScan = LOWER_ROMAN; + } } else if( bIsUpper ) - cNumTyp = '0' + SVX_NUM_CHARS_UPPER_LETTER, eTmpScan = UPPER_ALPHA; + { + cNumTyp = '0' + SVX_NUM_CHARS_UPPER_LETTER; + eTmpScan = UPPER_ALPHA; + } else - cNumTyp = '0' + SVX_NUM_CHARS_LOWER_LETTER, eTmpScan = LOWER_ALPHA; + { + cNumTyp = '0' + SVX_NUM_CHARS_LOWER_LETTER; + eTmpScan = LOWER_ALPHA; + } // Switch to roman numbers (only for c/d!) if( 1 == nDigitCnt && ( eScan & (UPPER_ALPHA|LOWER_ALPHA) ) && @@ -817,9 +833,15 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos, sal_Unicode c = '0'; nStart = 3 == nStart ? 100 : 500; if( UPPER_ALPHA == eTmpScan ) - eTmpScan = UPPER_ROMAN, c += SVX_NUM_ROMAN_UPPER; + { + eTmpScan = UPPER_ROMAN; + c += SVX_NUM_ROMAN_UPPER; + } else - eTmpScan = LOWER_ROMAN, c += SVX_NUM_ROMAN_LOWER; + { + eTmpScan = LOWER_ROMAN; + c += SVX_NUM_ROMAN_LOWER; + } ( eScan &= ~(UPPER_ALPHA|LOWER_ALPHA)) |= eTmpScan; if( pNumTypes ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index a92705eef782..1beec4c00b89 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -667,13 +667,15 @@ void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection { OSL_ENSURE( g_pSpellIter, "where is my Iterator?" ); g_pSpellIter->_End(bRestoreSelection); - delete g_pSpellIter, g_pSpellIter = nullptr; + delete g_pSpellIter; + g_pSpellIter = nullptr; } if (pConvArgs && g_pConvIter && g_pConvIter->GetSh() == this) { OSL_ENSURE( g_pConvIter, "where is my Iterator?" ); g_pConvIter->_End(); - delete g_pConvIter, g_pConvIter = nullptr; + delete g_pConvIter; + g_pConvIter = nullptr; } } @@ -766,7 +768,8 @@ void SwEditShell::HyphEnd() { OSL_ENSURE( g_pHyphIter, "No Iterator" ); g_pHyphIter->End(); - delete g_pHyphIter, g_pHyphIter = nullptr; + delete g_pHyphIter; + g_pHyphIter = nullptr; } } diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 6ff9ca6c8811..531e51fd5e09 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -482,13 +482,19 @@ bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const bNew == pChkNd->GetTable().IsNewModel() && // Consider table in table case pChkNd->EndOfSectionIndex() == pTableNd->GetIndex() - 1 ) - *pChkNxtPrv = true, bRet = true; // using Prev is possible + { + *pChkNxtPrv = true; + bRet = true; // using Prev is possible + } else { pChkNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode(); if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr && bNew == pChkNd->GetTable().IsNewModel() ) - *pChkNxtPrv = false, bRet = true; // using Next is possible + { + *pChkNxtPrv = false; + bRet = true; // using Next is possible + } } } else diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index a36e3aac1206..3f65157233c0 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -120,7 +120,8 @@ bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos, const SwFrame* pTmpFrame = aArr[ nCnt ]; bVert = pTmpFrame->IsVertical(); bR2L = pTmpFrame->IsRightToLeft(); - --nCnt, --nRefCnt; + --nCnt; + --nRefCnt; } // If a counter overflows? diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index e41ae588bd58..491a1c1ce4ff 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1189,7 +1189,10 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrameFormatSetRange ); pSet->Put( *pItem ); if( !sw_ChkAndSetNewAnchor( *pFly, *pSet )) - delete pSet, pSet = nullptr; + { + delete pSet; + pSet = nullptr; + } } if( GetDoc()->SetFrameFormatToFly( *pFlyFormat, *pNewFormat, pSet, bKeepOrient )) diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 1565fc66839a..8dc56713ba17 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -2204,7 +2204,8 @@ bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff ) *const_cast(static_cast(pFrame)->GetTabBox()), eType, nDiff, nLogDiff ); - delete pLastCols, pLastCols = nullptr; + delete pLastCols; + pLastCols = nullptr; EndAllActionAndCall(); if( bRet && (eType & (nsTableChgWidthHeightType::WH_FLAG_BIGGER | nsTableChgWidthHeightType::WH_FLAG_INSDEL)) == nsTableChgWidthHeightType::WH_FLAG_INSDEL ) diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index e6b94dedd318..36db7b08cc15 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -157,7 +157,9 @@ public: sal_uInt32 nArrOrdNum ); _ZSortFly& operator=( const _ZSortFly& rCpy ) { - pFormat = rCpy.pFormat, pAnchor = rCpy.pAnchor, nOrdNum = rCpy.nOrdNum; + pFormat = rCpy.pFormat; + pAnchor = rCpy.pAnchor; + nOrdNum = rCpy.nOrdNum; return *this; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 62a64a4eea2f..4b026079ac87 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -331,7 +331,8 @@ void SwLayAction::Action(OutputDevice* pRenderContext) //TurboMode? Hands-off during idle-format if ( IsPaint() && !IsIdle() && TurboAction() ) { - delete m_pWait, m_pWait = nullptr; + delete m_pWait; + m_pWait = nullptr; m_pRoot->ResetTurboFlag(); m_bActionInProgress = false; m_pRoot->DeleteEmptySct(); @@ -359,7 +360,8 @@ void SwLayAction::Action(OutputDevice* pRenderContext) } m_pRoot->DeleteEmptySct(); - delete m_pWait, m_pWait = nullptr; + delete m_pWait; + m_pWait = nullptr; //Turbo-Action permitted again for all cases. m_pRoot->ResetTurboFlag(); diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 1c9e8033c8f1..9f2c94c51eca 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -171,7 +171,7 @@ SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPg else m_bHasGrid = false; SetMaxFootnoteHeight( pPgDsc->GetFootnoteInfo().GetHeight() ? - pPgDsc->GetFootnoteInfo().GetHeight() : LONG_MAX ), + pPgDsc->GetFootnoteInfo().GetHeight() : LONG_MAX ); mnFrameType = FRM_PAGE; m_bInvalidLayout = m_bInvalidContent = m_bInvalidSpelling = m_bInvalidSmartTags = m_bInvalidAutoCmplWrds = m_bInvalidWordCount = true; m_bInvalidFlyLayout = m_bInvalidFlyContent = m_bInvalidFlyInCnt = m_bFootnotePage = m_bEndNotePage = false; diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 9c768ae12511..ed7d4163459f 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -486,7 +486,7 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos ) void SwTextPaintInfo::CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrame *pFrame, const SwRect &rPaint ) { CtorInitTextSizeInfo( pRenderContext, pFrame ); - aTextFly.CtorInitTextFly( pFrame ), + aTextFly.CtorInitTextFly( pFrame ); aPaintRect = rPaint; nSpaceIdx = 0; pSpaceAdd = nullptr; diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index f720384413d5..56e5df1240a9 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -538,7 +538,7 @@ SwRubyPortion::SwRubyPortion( const SwRubyPortion& rRuby, sal_Int32 nEnd ) : nRubyOffset( rRuby.GetRubyOffset() ), nAdjustment( rRuby.GetAdjustment() ) { - SetDirection( rRuby.GetDirection() ), + SetDirection( rRuby.GetDirection() ); SetTop( rRuby.OnTop() ); SetRuby(); } diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index d6388ec4881d..d4a481268029 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -249,7 +249,10 @@ void SwFormatINetFormat::SetMacroTable( const SvxMacroTableDtor* pNewTable ) mpMacroTable = new SvxMacroTableDtor( *pNewTable ); } else - delete mpMacroTable, mpMacroTable = nullptr; + { + delete mpMacroTable; + mpMacroTable = nullptr; + } } void SwFormatINetFormat::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro ) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index ca19a59804cf..257c95ed6d3c 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2982,7 +2982,10 @@ static void Replace0xFF( } } else - ++nPos, ++nEndPos; + { + ++nPos; + ++nEndPos; + } nPos = rText.indexOf(cSrchChr, nPos); } } diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index a9c7dca25ba5..0fa089763fc1 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -128,7 +128,10 @@ SwUndoDelete::SwUndoDelete( { m_pRedlSaveData = new SwRedlineSaveDatas; if( !FillSaveData( rPam, *m_pRedlSaveData )) - delete m_pRedlSaveData, m_pRedlSaveData = nullptr; + { + delete m_pRedlSaveData; + m_pRedlSaveData = nullptr; + } } if( !pHistory ) @@ -964,7 +967,8 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext) "SwUndoDelete::Redo: used to have redline data, but now none?"); if (!bSuccess) { - delete m_pRedlSaveData, m_pRedlSaveData = nullptr; + delete m_pRedlSaveData; + m_pRedlSaveData = nullptr; } } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 928b831d66ca..e1198ec8c01b 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -65,8 +65,11 @@ void SwUndRng::SetValues( const SwPaM& rPam ) nEndContent = pEnd->nContent.GetIndex(); } else + { // no selection !! - nEndNode = 0, nEndContent = COMPLETE_STRING; + nEndNode = 0; + nEndContent = COMPLETE_STRING; + } nSttNode = pStt->nNode.GetIndex(); nSttContent = pStt->nContent.GetIndex(); @@ -825,7 +828,10 @@ void SwUndoSaveSection::SaveSection( pRedlSaveData = new SwRedlineSaveDatas; if( !SwUndo::FillSaveData( aPam, *pRedlSaveData )) - delete pRedlSaveData, pRedlSaveData = nullptr; + { + delete pRedlSaveData; + pRedlSaveData = nullptr; + } nStartPos = rRange.aStart.GetIndex(); @@ -879,7 +885,8 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos if( pRedlSaveData ) { SwUndo::SetSaveData( *pDoc, *pRedlSaveData ); - delete pRedlSaveData, pRedlSaveData = nullptr; + delete pRedlSaveData; + pRedlSaveData = nullptr; } } } diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 38c532c26d7b..436a00683ef6 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -639,7 +639,10 @@ SwUndoReplace::Impl::Impl( } if( !pHistory->Count() ) - delete pHistory, pHistory = nullptr; + { + delete pHistory; + pHistory = nullptr; + } const sal_Int32 nECnt = m_bSplitNext ? pNd->GetText().getLength() : pEnd->nContent.GetIndex(); @@ -766,7 +769,10 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); m_nSetPos = pHistory->Count(); if( !m_nSetPos ) - delete pHistory, pHistory = nullptr; + { + delete pHistory; + pHistory = nullptr; + } } rDoc.getIDocumentContentOperations().ReplaceRange( rPam, m_sIns, m_bRegExp ); @@ -965,7 +971,8 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext) pNd->GetTable().GetFrameFormat()->SetFormatAttr( SvxFormatKeepItem(true, RES_KEEP) ); } NODE.pUndoInsNd->UndoImpl(rContext); - delete NODE.pUndoInsNd, NODE.pUndoInsNd = nullptr; + delete NODE.pUndoInsNd; + NODE.pUndoInsNd = nullptr; } } diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index c66c8a34f6fd..5d6f7c664908 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -341,7 +341,10 @@ void SwUndoMove::DelFootnote( const SwPaM& rRange ) nsDelContentType::DELCNT_FTN ); if( pHistory && !pHistory->Count() ) - delete pHistory, pHistory = nullptr; + { + delete pHistory; + pHistory = nullptr; + } } } diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index a93ae0cb6b5b..a313693311af 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -52,7 +52,8 @@ SwUndoInsNum::SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule, sReplaceRule( rReplaceRule ), nLRSavePos( 0 ) { // No selection! - nEndNode = 0, nEndContent = COMPLETE_STRING; + nEndNode = 0; + nEndContent = COMPLETE_STRING; nSttNode = rPos.nNode.GetIndex(); nSttContent = rPos.nContent.GetIndex(); } diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index d532c9601f7d..4de509e38a61 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -51,7 +51,10 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, rPos.nNode, rPos.nContent.GetIndex()+1 ); pRedlSaveData = new SwRedlineSaveDatas; if( !FillSaveData( aPam, *pRedlSaveData, false )) - delete pRedlSaveData, pRedlSaveData = nullptr; + { + delete pRedlSaveData; + pRedlSaveData = nullptr; + } } nSttNode = rPos.nNode.GetIndex(); diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index 5970b44471f3..9e4c7e767b28 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -58,7 +58,10 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange ) mpRedlSaveData = new SwRedlineSaveDatas; if( !FillSaveData( rRange, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId )) - delete mpRedlSaveData, mpRedlSaveData = nullptr; + { + delete mpRedlSaveData; + mpRedlSaveData = nullptr; + } else { mbHiddenRedlines = HasHiddenRedlines( *mpRedlSaveData ); @@ -379,7 +382,10 @@ SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl ) pRedlSaveData = new SwRedlineSaveDatas; if( !FillSaveData( rRedl, *pRedlSaveData, false )) - delete pRedlSaveData, pRedlSaveData = nullptr; + { + delete pRedlSaveData; + pRedlSaveData = nullptr; + } } SwUndoCompDoc::~SwUndoCompDoc() @@ -476,10 +482,12 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext) if( pUnDel2 ) { pUnDel2->UndoImpl(rContext); - delete pUnDel2, pUnDel2 = nullptr; + delete pUnDel2; + pUnDel2 = nullptr; } pUnDel->UndoImpl(rContext); - delete pUnDel, pUnDel = nullptr; + delete pUnDel; + pUnDel = nullptr; SetPaM(rPam); diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index dbbea4a9fbe9..d588a0227a2d 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -58,7 +58,10 @@ static SfxItemSet* lcl_GetAttrSet( const SwSection& rSect ) pAttr->ClearItem( RES_PROTECT ); pAttr->ClearItem( RES_CNTNT ); if( !pAttr->Count() ) - delete pAttr, pAttr = nullptr; + { + delete pAttr; + pAttr = nullptr; + } } } return pAttr; diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 9fc23f2752dd..0b6d5f571091 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -309,7 +309,8 @@ void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & rContext) *pDDEFieldType)); SwDDETable* pDDETable = new SwDDETable( pTableNode->GetTable(), pNewType ); pTableNode->SetNewTable( pDDETable ); - delete pDDEFieldType, pDDEFieldType = nullptr; + delete pDDEFieldType; + pDDEFieldType = nullptr; } if( (pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) || @@ -371,7 +372,10 @@ SwTableToTextSave::SwTableToTextSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEnd m_pHstry->CopyFormatAttr( *pNd->GetpSwAttrSet(), nNd ); if( !m_pHstry->Count() ) - delete m_pHstry, m_pHstry = nullptr; + { + delete m_pHstry; + m_pHstry = nullptr; + } // METADATA: store m_pMetadataUndoStart = pNd->CreateUndo(); @@ -427,7 +431,10 @@ SwUndoTableToText::SwUndoTableToText( const SwTable& rTable, sal_Unicode cCh ) } if( !pHistory->Count() ) - delete pHistory, pHistory = nullptr; + { + delete pHistory; + pHistory = nullptr; + } } SwUndoTableToText::~SwUndoTableToText() @@ -471,7 +478,8 @@ void SwUndoTableToText::UndoImpl(::sw::UndoRedoContext & rContext) *pDDEFieldType)); SwDDETable* pDDETable = new SwDDETable( pTableNd->GetTable(), pNewType ); pTableNd->SetNewTable( pDDETable, false ); - delete pDDEFieldType, pDDEFieldType = nullptr; + delete pDDEFieldType; + pDDEFieldType = nullptr; } if( bCheckNumFormat ) @@ -2560,7 +2568,8 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) if( pEntry->pBoxNumAttr ) { rBox.ClaimFrameFormat()->SetFormatAttr( *pEntry->pBoxNumAttr ); - delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = nullptr; + delete pEntry->pBoxNumAttr; + pEntry->pBoxNumAttr = nullptr; } if( aTmpSet.Count() ) @@ -2651,7 +2660,8 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) if( pEntry->pBoxNumAttr ) { rBox.ClaimFrameFormat()->SetFormatAttr( *pEntry->pBoxNumAttr ); - delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = nullptr; + delete pEntry->pBoxNumAttr; + pEntry->pBoxNumAttr = nullptr; } if( aTmpSet.Count() ) @@ -2692,7 +2702,10 @@ void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); pEntry->pBoxNumAttr->Put( rBox.GetFrameFormat()->GetAttrSet() ); if( !pEntry->pBoxNumAttr->Count() ) - delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = nullptr; + { + delete pEntry->pBoxNumAttr; + pEntry->pBoxNumAttr = nullptr; + } _DEBUG_REDLINE( pDoc ) } @@ -2811,7 +2824,10 @@ bool SwUndoTableCpyTable::InsertRow( SwTable& rTable, const SwSelBoxes& rBoxes, if( bRet ) pInsRowUndo->SaveNewBoxes( *pTableNd, aTmpLst ); else - delete pInsRowUndo, pInsRowUndo = nullptr; + { + delete pInsRowUndo; + pInsRowUndo = nullptr; + } return bRet; } @@ -2858,7 +2874,8 @@ void SwUndoCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) { pDel->UndoImpl(rContext); - delete pDel, pDel = nullptr; + delete pDel; + pDel = nullptr; } SwUndoSplitTable::SwUndoSplitTable( const SwTableNode& rTableNd, diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 81f21533f6bf..762e3d6e6eef 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -126,7 +126,8 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, pFrameFormats->erase( it ); } } - delete pFrameFormats, pFrameFormats = nullptr; + delete pFrameFormats; + pFrameFormats = nullptr; } } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 1682401bbb08..d9ed63c14d24 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1565,7 +1565,10 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& pSet->Put( *pItem ); if ( pFormat->GetDoc()->GetEditShell() != nullptr && !sw_ChkAndSetNewAnchor( *pFly, *pSet ) ) - delete pSet, pSet = nullptr; + { + delete pSet; + pSet = nullptr; + } } } } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index b49ce2ca1575..9bd1868f33f0 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -344,7 +344,10 @@ SwViewShell::~SwViewShell() if ( mpDoc ) { if( !mpDoc->release() ) - delete mpDoc, mpDoc = nullptr; + { + delete mpDoc; + mpDoc = nullptr; + } else GetLayout()->ResetNewLayout(); } diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index aec0ecd8aa3b..0b2b7871b293 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -234,7 +234,8 @@ sal_uLong SwASCIIParser::CallParser() pDoc->getIDocumentContentOperations().InsertItemSet( *pInsPam, *pItemSet ); } } - delete pItemSet, pItemSet = nullptr; + delete pItemSet; + pItemSet = nullptr; } delete pInsPam; diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 18c175caa6d3..a149396d794c 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -130,7 +130,10 @@ Filters::~Filters() { SwReaderWriterEntry& rEntry = aReaderWriter[n]; if( rEntry.bDelReader && rEntry.pReader ) - delete rEntry.pReader, rEntry.pReader = nullptr; + { + delete rEntry.pReader; + rEntry.pReader = nullptr; + } } } diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 314a515f2e8a..81cdc0ad5afd 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -328,7 +328,8 @@ void SwHTMLWriter::OutFootEndNotes() #if OSL_DEBUG_LEVEL > 0 sal_uInt16 nFootnote = m_nFootNote, nEn = m_nEndNote; #endif - m_nFootNote = 0, m_nEndNote = 0; + m_nFootNote = 0; + m_nEndNote = 0; for( auto *pTextFootnote : *m_pFootEndNotes ) { diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index a151ff19938a..7a6def77a8a0 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -856,7 +856,10 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() ) } if( SVPAR_PENDING != GetStatus() ) - delete m_pSttNdIdx, m_pSttNdIdx = nullptr; + { + delete m_pSttNdIdx; + m_pSttNdIdx = nullptr; + } // sollte der Parser der Letzte sein, der das Doc haelt, dann braucht // man hier auch nichts mehr tun, Doc wird gleich zerstoert! diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 0e501c0d21f4..b7d98fb2626b 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -476,8 +476,10 @@ void DocxExport::ExportDocument_Impl() WriteEmbeddings(); m_aLinkedTextboxesHelper.clear(); //final cleanup - delete m_pStyles, m_pStyles = nullptr; - delete m_pSections, m_pSections = nullptr; + delete m_pStyles; + m_pStyles = nullptr; + delete m_pSections; + m_pSections = nullptr; } void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum ) @@ -1478,10 +1480,14 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur DocxExport::~DocxExport() { - delete m_pSdrExport, m_pSdrExport = nullptr; - delete m_pVMLExport, m_pVMLExport = nullptr; - delete m_pAttrOutput, m_pAttrOutput = nullptr; - delete m_pDrawingML, m_pDrawingML = nullptr; + delete m_pSdrExport; + m_pSdrExport = nullptr; + delete m_pVMLExport; + m_pVMLExport = nullptr; + delete m_pAttrOutput; + m_pAttrOutput = nullptr; + delete m_pDrawingML; + m_pDrawingML = nullptr; } DocxSettingsData::DocxSettingsData() diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index c9d386a34a03..9e45602cf380 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -48,8 +48,10 @@ RtfSdrExport::RtfSdrExport(RtfExport& rExport) RtfSdrExport::~RtfSdrExport() { - delete mpOutStrm, mpOutStrm = nullptr; - delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = nullptr; + delete mpOutStrm; + mpOutStrm = nullptr; + delete[] m_pShapeTypeWritten; + m_pShapeTypeWritten = nullptr; } void RtfSdrExport::OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 648e6454fa7f..d4bac28e8bf9 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1526,7 +1526,8 @@ void WW8Export::WriteEscher() pFib->fcDggInfo = nStart; pFib->lcbDggInfo = pTableStrm->Tell() - nStart; - delete m_pEscher, m_pEscher = nullptr; + delete m_pEscher; + m_pEscher = nullptr; } } @@ -2424,7 +2425,8 @@ void SwEscherEx::FinishEscher() { pEscherStrm->Seek(0); rWrt.pTableStrm->WriteStream( *pEscherStrm ); - delete pEscherStrm, pEscherStrm = nullptr; + delete pEscherStrm; + pEscherStrm = nullptr; } /** method to perform conversion of positioning attributes with the help diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 74dc7f335716..7ef8b1c79d41 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -445,9 +445,15 @@ void MSWordStyles::SetStyleDefaults( const SwFormat& rFormat, bool bPap ) bool aFlags[ static_cast< sal_uInt16 >(RES_FRMATR_END) - RES_CHRATR_BEGIN ]; sal_uInt16 nStt, nEnd, n; if( bPap ) - nStt = RES_PARATR_BEGIN, nEnd = RES_FRMATR_END; + { + nStt = RES_PARATR_BEGIN; + nEnd = RES_FRMATR_END; + } else - nStt = RES_CHRATR_BEGIN, nEnd = RES_TXTATR_END; + { + nStt = RES_CHRATR_BEGIN; + nEnd = RES_TXTATR_END; + } // dynamic defaults const SfxItemPool& rPool = *rFormat.GetAttrSet().GetPool(); @@ -1803,7 +1809,10 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) rWrt.pFib->ccpHdr = nCpEnd - nCpStart; } else - delete pTextPos, pTextPos = nullptr; + { + delete pTextPos; + pTextPos = nullptr; + } return rWrt.pFib->ccpHdr != 0; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index ca2fc2ca447c..2e33088414bf 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3587,7 +3587,8 @@ WW8Export::WW8Export( SwWW8Writer *pWriter, WW8Export::~WW8Export() { - delete m_pAttrOutput, m_pAttrOutput = nullptr; + delete m_pAttrOutput; + m_pAttrOutput = nullptr; } AttributeOutputBase& WW8Export::AttrOutput() const diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 628662eb4f7a..71049f03c775 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2478,7 +2478,10 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) // cache current paragraph if(m_pPreviousNumPaM) - delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; + { + delete m_pPreviousNumPaM; + m_pPreviousNumPaM = nullptr; + } m_pPreviousNumPaM = new SwPaM(*m_pPaM, m_pPaM); m_pPrevNumRule = pRule; @@ -2488,14 +2491,18 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) // If the previous paragraph has numbering but the current one does not // we need to add a space after the previous paragraph SetLowerSpacing(*m_pPreviousNumPaM, GetParagraphAutoSpace(m_pWDop->fDontUseHTMLAutoSpacing)); - delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; + delete m_pPreviousNumPaM; + m_pPreviousNumPaM = nullptr; m_pPrevNumRule = nullptr; } else { // clear paragraph cache if(m_pPreviousNumPaM) - delete m_pPreviousNumPaM, m_pPreviousNumPaM = nullptr; + { + delete m_pPreviousNumPaM; + m_pPreviousNumPaM = nullptr; + } m_pPrevNumRule = pRule; } @@ -4136,7 +4143,8 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) CloseAttrEnds(); - delete m_pPlcxMan, m_pPlcxMan = nullptr; + delete m_pPlcxMan; + m_pPlcxMan = nullptr; return bJoined; } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 27b82a46c63d..620f65c77247 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1133,9 +1133,12 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS) nLen -= 2 * ( nCols + 1 ); if( nCols != nOldCols ) // different column count { - delete[] pTCs, pTCs = nullptr; - delete[] pSHDs, pSHDs = nullptr; - delete[] pNewSHDs, pNewSHDs = nullptr; + delete[] pTCs; + pTCs = nullptr; + delete[] pSHDs; + pSHDs = nullptr; + delete[] pNewSHDs; + pNewSHDs = nullptr; } short nFileCols = nLen / ( bVer67 ? 10 : 20 ); // really saved @@ -2682,7 +2685,8 @@ void WW8TabDesc::FinishSwTable() pIo->m_pCtrlStck->SetAttr( *pIo->m_pPaM->GetPoint(), 0, false); MoveOutsideTable(); - delete pTmpPos, pTmpPos = nullptr; + delete pTmpPos; + pTmpPos = nullptr; aDup.Insert(*pIo->m_pPaM->GetPoint()); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 804e285374da..eaefccb993cc 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -313,7 +313,8 @@ eF_ResT SwWW8ImplReader::Read_F_HTMLControl(WW8FieldDesc*, OUString&) void SwWW8ImplReader::DeleteFormImpl() { - delete m_pFormImpl, m_pFormImpl = nullptr; + delete m_pFormImpl; + m_pFormImpl = nullptr; } // Hilfs-Deklarationen diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index cdfa30f11b71..b6d70adcb925 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -183,7 +183,10 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) case 0x0c: case 0x0d: if( bAllowCr ) - aVal = aVal.replaceAt( nI, 1, "\n" ), bSetAsHex = false; + { + aVal = aVal.replaceAt( nI, 1, "\n" ); + bSetAsHex = false; + } else bSetAsHex = true; break; diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 092f5650f3eb..e421bc08bd19 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2276,7 +2276,10 @@ WW8FlyPara *SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, pRet->ApplyTabPos(pTabPos); if (pRet->IsEmpty()) - delete pRet, pRet = nullptr; + { + delete pRet; + pRet = nullptr; + } return pRet; } @@ -2582,7 +2585,8 @@ void SwWW8ImplReader::StopApo() m_pSFlyPara->pFlyFormat->SetFormatAttr(aSize); } - delete m_pSFlyPara->pMainTextPos, m_pSFlyPara->pMainTextPos = nullptr; + delete m_pSFlyPara->pMainTextPos; + m_pSFlyPara->pMainTextPos = nullptr; // To create the SwFrames when inserting into an existing document, fltshell.cxx // will call pFlyFrame->MakeFrames() when setting the FltAnchor attribute @@ -3329,10 +3333,10 @@ void SwWW8ImplReader::Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pData sal_Unicode cStt = 0, cEnd = 0; switch( SVBT16ToShort( pData+1 ) ) { - case 1: cStt = '(', cEnd = ')'; break; - case 2: cStt = '[', cEnd = ']'; break; - case 3: cStt = '<', cEnd = '>'; break; - case 4: cStt = '{', cEnd = '}'; break; + case 1: cStt = '('; cEnd = ')'; break; + case 2: cStt = '['; cEnd = ']'; break; + case 3: cStt = '<'; cEnd = '>'; break; + case 4: cStt = '{'; cEnd = '}'; break; } NewAttr( SvxTwoLinesItem( true, cStt, cEnd, RES_CHRATR_TWO_LINES )); } @@ -4976,7 +4980,10 @@ void SwWW8ImplReader::Read_ApoPPC( sal_uInt16, const sal_uInt8* pData, short ) m_vColl[m_nAktColl].m_pWWFly = pFly; pFly->Read(*pData, m_pStyles); if (pFly->IsEmpty()) - delete m_vColl[m_nAktColl].m_pWWFly, m_vColl[m_nAktColl].m_pWWFly = nullptr; + { + delete m_vColl[m_nAktColl].m_pWWFly; + m_vColl[m_nAktColl].m_pWWFly = nullptr; + } } } diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index a57a910aee9b..14dc44856df1 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -941,7 +941,8 @@ void SwXMLTextImportHelper::endAppletOrPlugin( aCommandSequence[nIndex].Handle = -1; aCommandSequence[nIndex].Value = makeAny( OUString((*aIter).second) ); aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE; - ++aIter, ++nIndex; + ++aIter; + ++nIndex; } // unfortunately the names of the properties are depending on the object diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index cc3befe72043..63c28e3a3e4f 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -769,8 +769,10 @@ IMPL_LINK_TYPED( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void pTableSet->Put( *pDlg->GetOutputItemSet() ); else if( bNewSet ) { - delete pTableSet, pTableSet = nullptr; - delete pRep, pRep = nullptr; + delete pTableSet; + pTableSet = nullptr; + delete pRep; + pRep = nullptr; } } @@ -1753,7 +1755,8 @@ void SwInsertDBColAutoPilot::Load() else m_pLbDbParaColl->SelectEntryPos( 0 ); - delete pTAutoFormat, pTAutoFormat = nullptr; + delete pTAutoFormat; + pTAutoFormat = nullptr; sTmp = pNewData->sTAutoFormatNm; if( !sTmp.isEmpty() ) { diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index eaf6d5f9efa2..45e844de2e9c 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -284,8 +284,8 @@ SwMailMergeOutputPage::SwMailMergeOutputPage(SwMailMergeWizard* _pParent) m_pPrintNowPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, PrintHdl_Impl)); m_pPrinterSettingsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, PrinterSetupHdl_Impl)); - m_pSendAsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendAsHdl_Impl)), - m_pSendDocumentsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendDocumentsHdl_Impl)), + m_pSendAsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendAsHdl_Impl)); + m_pSendDocumentsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendDocumentsHdl_Impl)); m_pSendAsLB->SetSelectHdl(LINK(this, SwMailMergeOutputPage, SendTypeHdl_Impl)); OutputTypeHdl_Impl(m_pSaveStartDocRB); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 93ede702cb09..5e7a65bd05eb 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2280,7 +2280,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) const SwFormatVertOrient& rVert = static_cast(rSet.Get(RES_VERT_ORIENT)); m_nOldH = rHori.GetHoriOrient(); m_nOldHRel = rHori.GetRelationOrient(); - m_nOldV = rVert.GetVertOrient(), + m_nOldV = rVert.GetVertOrient(); m_nOldVRel = rVert.GetRelationOrient(); if (eAnchorId == FLY_AT_PAGE) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index e11ae70fdf1b..b64ecf87bbe2 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -221,11 +221,17 @@ void SwIndexMarkPane::InitControls() pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_PRV ); if( pMoveMark != pMark ) - pSh->GotoTOXMark( *pMoveMark, TOX_NXT ), bShow = true; + { + pSh->GotoTOXMark( *pMoveMark, TOX_NXT ); + bShow = true; + } m_pPrevBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_NXT ); if( pMoveMark != pMark ) - pSh->GotoTOXMark( *pMoveMark, TOX_PRV ), bShow = true; + { + pSh->GotoTOXMark( *pMoveMark, TOX_PRV ); + bShow = true; + } m_pNextBT->Enable( pMoveMark != pMark ); if( bShow ) { @@ -236,11 +242,17 @@ void SwIndexMarkPane::InitControls() pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_PRV ); if( pMoveMark != pMark ) - pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT ), bShow = true; + { + pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT ); + bShow = true; + } m_pPrevSameBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_NXT ); if( pMoveMark != pMark ) - pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV ), bShow = true; + { + pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV ); + bShow = true; + } m_pNextSameBT->Enable( pMoveMark != pMark ); if( bShow ) { diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 89d26ccb7db4..65360ec29d5f 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -271,7 +271,10 @@ void SwAutoFormatDlg::FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const rToFill = new SwTableAutoFormat( (*pTableTable)[ nIndex ] ); } else - delete rToFill, rToFill = nullptr; + { + delete rToFill; + rToFill = nullptr; + } } // Handler: diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx index 4e4c32bbb36c..f842fb4ba368 100644 --- a/sw/source/uibase/app/mainwn.cxx +++ b/sw/source/uibase/app/mainwn.cxx @@ -112,7 +112,10 @@ void EndProgress( SwDocShell *pDocShell ) //#112337# it may happen that the container has been removed //while rescheduling if ( pProgressContainer && pProgressContainer->empty() ) - delete pProgressContainer, pProgressContainer = nullptr; + { + delete pProgressContainer; + pProgressContainer = nullptr; + } } } } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 846ff8543e12..f9d0569265cf 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1707,7 +1707,10 @@ bool SwTransferable::_PasteFileContent( TransferableDataHelper& rData, if( IsError( aReader.Read( *pRead )) ) nResId = STR_ERROR_CLPBRD_READ; else - nResId = 0, bRet = true; + { + nResId = 0; + bRet = true; + } rSh.SetChgLnk( aOldLink ); if( bRet ) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index c0131d1568db..513000842a0c 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -697,7 +697,8 @@ void SwEditWin::LeaveArea(const Point &rPos) JustifyAreaTimer(); if( !m_aTimer.IsActive() ) m_aTimer.Start(); - delete m_pShadCursor, m_pShadCursor = nullptr; + delete m_pShadCursor; + m_pShadCursor = nullptr; } inline void SwEditWin::EnterArea() @@ -1387,7 +1388,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) // running on a document, no order is being taken return; - delete m_pShadCursor, m_pShadCursor = nullptr; + delete m_pShadCursor; + m_pShadCursor = nullptr; m_aKeyInputFlushTimer.Stop(); bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() && @@ -1924,17 +1926,25 @@ KEYINPUT_CHECKTABLE_INSDEL: !rSh.GetNumRuleAtCurrCursorPos()->IsOutlineRule() && !rSh.HasSelection() && rSh.IsSttPara() && rSh.IsEndPara() ) - eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff; - + { + eKeyState = KS_NumOff; + eNextKeyState = KS_OutlineLvOff; + } //RETURN for new paragraph with AutoFormatting else if( pACfg && pACfg->IsAutoFormatByInput() && !(nSelectionType & (nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE | nsSelectionType::SEL_FRM | nsSelectionType::SEL_TBL_CELLS | nsSelectionType::SEL_DRW | nsSelectionType::SEL_DRW_TXT)) ) - eKeyState = KS_CheckAutoCorrect, eNextKeyState = KS_AutoFormatByInput; + { + eKeyState = KS_CheckAutoCorrect; + eNextKeyState = KS_AutoFormatByInput; + } else - eNextKeyState = eKeyState, eKeyState = KS_CheckAutoCorrect; + { + eNextKeyState = eKeyState; + eKeyState = KS_CheckAutoCorrect; + } } } break; @@ -2079,7 +2089,10 @@ KEYINPUT_CHECKTABLE_INSDEL: if( rSh.HasSelection() || rSh.HasReadonlySel() ) eKeyState = KS_NextCell; else - eKeyState = KS_CheckAutoCorrect, eNextKeyState = KS_NextCell; + { + eKeyState = KS_CheckAutoCorrect; + eNextKeyState = KS_NextCell; + } } else if ( rSh.GetSelectionType() & (nsSelectionType::SEL_GRF | @@ -2131,7 +2144,10 @@ KEYINPUT_CHECKTABLE_INSDEL: if( rSh.HasSelection() || rSh.HasReadonlySel() ) eKeyState = KS_PrevCell; else - eKeyState = KS_CheckAutoCorrect, eNextKeyState = KS_PrevCell; + { + eKeyState = KS_CheckAutoCorrect; + eNextKeyState = KS_PrevCell; + } } else if ( rSh.GetSelectionType() & (nsSelectionType::SEL_GRF | @@ -2305,7 +2321,10 @@ KEYINPUT_CHECKTABLE_INSDEL: FlushInBuffer(); if( m_rView.KeyInput( aKeyEvent ) ) - bFlushBuffer = true, bNormalChar = false; + { + bFlushBuffer = true; + bNormalChar = false; + } else { // Because Sfx accelerators are only called when they were @@ -2826,7 +2845,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } m_bWasShdwCursor = nullptr != m_pShadCursor; - delete m_pShadCursor, m_pShadCursor = nullptr; + delete m_pShadCursor; + m_pShadCursor = nullptr; const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) ); @@ -2980,7 +3000,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) m_bIsInMove = false; m_aStartPos = rMEvt.GetPosPixel(); - m_aRszMvHdlPt.X() = 0, m_aRszMvHdlPt.Y() = 0; + m_aRszMvHdlPt.X() = 0; + m_aRszMvHdlPt.Y() = 0; SwTab nMouseTabCol = SwTab::COL_NONE; const bool bTmp = !rSh.IsDrawCreate() && !m_pApplyTempl && !rSh.IsInSelect() && @@ -3786,7 +3807,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) return ; if( m_pShadCursor && 0 != (rMEvt.GetModifier() + rMEvt.GetButtons() ) ) - delete m_pShadCursor, m_pShadCursor = nullptr; + { + delete m_pShadCursor; + m_pShadCursor = nullptr; + } bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly(); @@ -3818,7 +3842,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) const bool bInsWin = rSh.VisArea().IsInside( aDocPt ) || comphelper::LibreOfficeKit::isActive(); if( m_pShadCursor && !bInsWin ) - delete m_pShadCursor, m_pShadCursor = nullptr; + { + delete m_pShadCursor; + m_pShadCursor = nullptr; + } if( bInsWin && m_pRowColumnSelectionStart ) { @@ -4266,7 +4293,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } if( bDelShadCursor && m_pShadCursor ) - delete m_pShadCursor, m_pShadCursor = nullptr; + { + delete m_pShadCursor; + m_pShadCursor = nullptr; + } m_bWasShdwCursor = false; } @@ -4289,7 +4319,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) bool bCallShadowCursor = m_bWasShdwCursor; m_bWasShdwCursor = false; if( m_pShadCursor ) - delete m_pShadCursor, m_pShadCursor = nullptr; + { + delete m_pShadCursor; + m_pShadCursor = nullptr; + } if( m_pRowColumnSelectionStart ) DELETEZ( m_pRowColumnSelectionStart ); @@ -5310,7 +5343,10 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) case CommandEventId::StartAutoScroll: case CommandEventId::AutoScroll: if( m_pShadCursor ) - delete m_pShadCursor, m_pShadCursor = nullptr; + { + delete m_pShadCursor; + m_pShadCursor = nullptr; + } bCallBase = !m_rView.HandleWheelCommands( rCEvt ); break; diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index a15a681cbc03..5f97ff06a9f9 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -452,8 +452,11 @@ void SwEditWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect Rectangle aRect( m_pShadCursor->GetRect()); // fully resides inside? if( rRect.IsInside( aRect ) ) + { // dann aufheben - delete m_pShadCursor, m_pShadCursor = nullptr; + delete m_pShadCursor; + m_pShadCursor = nullptr; + } else if( rRect.IsOver( aRect )) { // resides somewhat above, then everything is clipped outside diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 3e8b08591ab1..a8e7d505b09b 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -756,7 +756,10 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) aEditAttr.GetItemState( EE_PARA_JUST, false, &pAdjust); if( !pAdjust || IsInvalidItem( pAdjust )) - rSet.InvalidateItem( nSlotId ), nSlotId = 0; + { + rSet.InvalidateItem( nSlotId ); + nSlotId = 0; + } else { if ( eAdjust == static_cast(pAdjust)->GetAdjust()) @@ -784,7 +787,10 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) aEditAttr.GetItemState( EE_PARA_SBL, false, &pLSpace ); if( !pLSpace || IsInvalidItem( pLSpace )) - rSet.InvalidateItem( nSlotId ), nSlotId = 0; + { + rSet.InvalidateItem( nSlotId ); + nSlotId = 0; + } else { if( nLSpace == static_cast(pLSpace)->GetPropLineSpace() ) diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index f062f094d1a6..7761c7c0d775 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -1261,7 +1261,10 @@ IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void) lcl_UpdateIMapDlg( rSh ); if( !bProtect && SID_IMAP == nSlot ) - bSetState = true, bState = nullptr != pDlg; + { + bSetState = true; + bState = nullptr != pDlg; + } } break; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 377753d781fb..be855ea713eb 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -633,7 +633,10 @@ ASK_ADJUST: aEditAttr.GetItemState( EE_PARA_JUST, false, &pAdjust); if( !pAdjust || IsInvalidItem( pAdjust )) - rSet.InvalidateItem( nSlotId ), nSlotId = 0; + { + rSet.InvalidateItem( nSlotId ); + nSlotId = 0; + } else bFlag = eAdjust == static_cast(pAdjust)->GetAdjust(); } @@ -703,7 +706,10 @@ ASK_LINESPACE: aEditAttr.GetItemState( EE_PARA_SBL, false, &pLSpace ); if( !pLSpace || IsInvalidItem( pLSpace )) - rSet.InvalidateItem( nSlotId ), nSlotId = 0; + { + rSet.InvalidateItem( nSlotId ); + nSlotId = 0; + } else if( nLSpace == static_cast(pLSpace)-> GetPropLineSpace() ) bFlag = true; diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index c9ea88a49c18..871a5aefd270 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -243,10 +243,12 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) nLeft = nRight = nLR / 2; break; case text::HoriOrientation::LEFT: - nRight = nLR; nLeft = 0; + nRight = nLR; + nLeft = 0; break; case text::HoriOrientation::RIGHT: - nLeft = nLR, nRight = 0; + nLeft = nLR; + nRight = 0; break; case text::HoriOrientation::LEFT_AND_WIDTH: nRight = nLR - nLeft; @@ -524,17 +526,35 @@ void SwTableShell::Execute(SfxRequest &rReq) bool bLine = false; if( aBox.GetTop() != nullptr ) - aBox.SetLine(&aBorderLine, SvxBoxItemLine::TOP), bLine |= true; + { + aBox.SetLine(&aBorderLine, SvxBoxItemLine::TOP); + bLine |= true; + } if( aBox.GetBottom() != nullptr ) - aBox.SetLine(&aBorderLine, SvxBoxItemLine::BOTTOM), bLine |= true; + { + aBox.SetLine(&aBorderLine, SvxBoxItemLine::BOTTOM); + bLine |= true; + } if( aBox.GetLeft() != nullptr ) - aBox.SetLine(&aBorderLine, SvxBoxItemLine::LEFT), bLine |= true; + { + aBox.SetLine(&aBorderLine, SvxBoxItemLine::LEFT); + bLine |= true; + } if( aBox.GetRight() != nullptr ) - aBox.SetLine(&aBorderLine, SvxBoxItemLine::RIGHT), bLine |= true; + { + aBox.SetLine(&aBorderLine, SvxBoxItemLine::RIGHT); + bLine |= true; + } if( aInfo.GetHori() != nullptr ) - aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::HORI), bLine |= true; + { + aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::HORI); + bLine |= true; + } if( aInfo.GetVert() != nullptr ) - aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::VERT), bLine |= true; + { + aInfo.SetLine(&aBorderLine, SvxBoxInfoItemLine::VERT); + bLine |= true; + } aCoreSet.Put( aBox ); aCoreSet.Put( aInfo ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index a8c83ce524ce..abb22eb2f985 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2002,7 +2002,10 @@ bool SwView::JumpToSwMark( const OUString& rMark ) } } else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) ) - m_pWrtShell->GotoMark( ppMark->get(), false, true ), bRet = true; + { + m_pWrtShell->GotoMark( ppMark->get(), false, true ); + bRet = true; + } else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) { m_pWrtShell->addCurrentPosition(); bRet = m_pWrtShell->GotoINetAttr( *pINet->GetTextINetFormat() ); @@ -2026,7 +2029,10 @@ bool SwView::JumpToSwMark( const OUString& rMark ) } } else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark))) - m_pWrtShell->GotoMark( ppMark->get(), false, true ), bRet = true; + { + m_pWrtShell->GotoMark( ppMark->get(), false, true ); + bRet = true; + } else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) bRet = m_pWrtShell->GotoINetAttr( *pINet->GetTextINetFormat() ); diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index a67eaa8e037f..5be560b490c5 100644 --- a/sw/source/uibase/utlui/shdwcrsr.cxx +++ b/sw/source/uibase/utlui/shdwcrsr.cxx @@ -61,7 +61,8 @@ void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft ) while( aPt1.Y() <= aPt2.Y() ) { pWin->DrawLine( aPt1, aPt2 ); - aPt1.Y()++, aPt2.Y()--; + aPt1.Y()++; + aPt2.Y()--; aPt2.X() = aPt1.X() += nDiff; } } -- cgit v1.2.3