diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-31 15:40:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-12 08:43:48 +0200 |
commit | e4e4d5713e248f02faf7aa6199b11e152973de8e (patch) | |
tree | 836dffa89d0a966e41b1af8270db74b9590def22 /sw | |
parent | d4eabd5da8ea3b5ac40659c22cde19b26b3c002b (diff) |
clang-tidy readability-delete-null-pointer
which in turn triggered some loplugin:useuniqueptr
Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64
Reviewed-on: https://gerrit.libreoffice.org/38281
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/wrong.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/undo/unins.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 5 |
4 files changed, 5 insertions, 12 deletions
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index e08b6987a8d5..945104ceaabc 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -771,9 +771,7 @@ FlatFndBox::~FlatFndBox() { FndBox_** ppTmp = const_cast<FndBox_**>(pArr); delete [] ppTmp; - - if( ppItemSets ) - delete [] ppItemSets; + delete [] ppItemSets; } /// All Lines of a Box need to have same number of Boxes diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index e7f4b0d85b47..6da8afc1f209 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -83,8 +83,7 @@ void SwWrongList::ClearList() { for (SwWrongArea & i : maList) { - if (i.mpSubList) - delete i.mpSubList; + delete i.mpSubList; i.mpSubList = nullptr; } maList.clear(); @@ -573,8 +572,7 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen ) std::vector<SwWrongArea>::iterator iLoop = i1; while ( iLoop != i2 ) { - if ( (*iLoop).mpSubList ) - delete (*iLoop).mpSubList; + delete (*iLoop).mpSubList; ++iLoop; } diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 500185107abf..f6ff3e80ee4b 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -200,7 +200,7 @@ SwUndoInsert::~SwUndoInsert() rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex()); m_pUndoNodeIndex.reset(); } - else if( pText ) // the inserted text + else // the inserted text delete pText; delete pRedlData; delete pUndoText; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 1954d3039307..88b6fca91adb 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -3396,10 +3396,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) //The TOC field representation contents should be inserted into TOC section, but not after TOC section. //So we need update the document position when loading TOC representation and after loading TOC; - if (m_pPosAfterTOC) - { - delete m_pPosAfterTOC; - } + delete m_pPosAfterTOC; m_pPosAfterTOC = new SwPaM(*m_pPaM, m_pPaM); (*m_pPaM).Move(fnMoveBackward); SwPaM aRegion(*m_pPaM, m_pPaM); |