summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-23 09:27:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-23 10:55:54 +0200
commit312e83325c81aa0c22573621802eb622357c7a7b (patch)
treefcb66afa10f9d5e7a62b11739d7e473ffcfa2fb0 /sw
parentb3f4d69d31757d4bf446628636e493d2e4826088 (diff)
loplugin:useuniqueptr in SwFltStackEntry
Change-Id: I849c1d0377a3d8a5dafedb017a6dfdb3189b799d Reviewed-on: https://gerrit.libreoffice.org/59486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/basflt/fltshell.cxx6
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx2
3 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index def8b749b91e..8b219d2b60b3 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -101,10 +101,10 @@ static OUString lcl_getTypePath(OUString& rType)
}
// Stack entry for all text attributes
-SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt)
+SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, std::unique_ptr<SfxPoolItem> pHt)
: m_aMkPos(rStartPos)
, m_aPtPos(rStartPos)
- , pAttr( pHt ) // store a copy of the attribute
+ , pAttr( std::move(pHt) )
, m_isAnnotationOnEnd(false)
, mnStartCP(-1)
, mnEndCP(-1)
@@ -295,7 +295,7 @@ void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr
}
else
{
- SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, rAttr.Clone() );
+ SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, std::unique_ptr<SfxPoolItem>(rAttr.Clone()) );
pTmp->SetStartCP(GetCurrAttrCP());
m_Entries.push_back(std::unique_ptr<SwFltStackEntry>(pTmp));
}
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 3b84675a9a30..032ccbe00d81 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -101,7 +101,7 @@ public:
sal_Int32 mnEndCP;
bool bIsParaEnd;
- SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt );
+ SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, std::unique_ptr<SfxPoolItem> pHt );
SW_DLLPUBLIC ~SwFltStackEntry();
SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos);
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 2ea8b649d46c..dcf3d289d311 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -682,7 +682,7 @@ namespace sw
void RedlineStack::open(const SwPosition& rPos, const SfxPoolItem& rAttr)
{
OSL_ENSURE(rAttr.Which() == RES_FLTR_REDLINE, "not a redline");
- maStack.emplace_back(new SwFltStackEntry(rPos,rAttr.Clone()));
+ maStack.emplace_back(new SwFltStackEntry(rPos, std::unique_ptr<SfxPoolItem>(rAttr.Clone())));
}
class SameOpenRedlineType