summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-07 15:47:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-08 08:45:41 +0200
commit7764ae70b04058a64a3999529e98d1115ba59d1c (patch)
tree23a78251b97610b7a948ef776dfbcbc48aefbd8d /sw
parent37d5bf82eae7e6d611879d1132b1f6fdafdeb9ed (diff)
clang bugprone-unused-return-value
most of these changes just make the change of ownership when using std::unique_ptr clearer, but there is one definite leak fix in PlainTextFilterDetect::detect Change-Id: I8282a68007222a4fee84004f394bde0cca8569e9 Reviewed-on: https://gerrit.libreoffice.org/60159 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/swcrsr.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 2b934cb6c576..1b74af2faa58 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -964,7 +964,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
{
// put cursor as copy of current into ring
// chaining points always to first created, so forward
- std::unique_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
+ SwCursor* pSav = Create( this ); // save the current cursor
// if already outside of body text search from this position or start at
// 1. base section
@@ -995,7 +995,6 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
- pSav.release();
if( !( FindRanges::InSelAll & eFndRngs ))
{
@@ -1021,7 +1020,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else if( FindRanges::InSelAll & eFndRngs )
{
- std::unique_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor
+ SwCursor* pSav = Create( this ); // save the current cursor
const SwNode* pSttNd = ( FindRanges::InBodyOnly & eFndRngs )
? rNds.GetEndOfContent().StartOfSectionNode()
@@ -1048,7 +1047,6 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
- pSav.release();
while( GetNext() != this )
delete GetNext();