summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-25 16:37:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 08:39:11 +0200
commit715eaef7c405f161c6471dc88ae6290e8ca905d8 (patch)
tree1c146731bf9a307e9a67a44623c6be7eb3e2cba1 /sw
parent242129b92e843bb828a829e37841b2a3ef02633f (diff)
loplugin:useuniqueptr in WW8PLCFx_SubDoc
Change-Id: If8b9b999fd46022b5be0a3353e58653f5a42a06c Reviewed-on: https://gerrit.libreoffice.org/58022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx10
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx6
2 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index b3787451fca1..d3eb848e097a 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -3880,15 +3880,15 @@ WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib,
{
if( nLenRef && nLenText )
{
- pRef = new WW8PLCF(*pSt, nFcRef, nLenRef, nStruct, nStartCp);
- pText = new WW8PLCF(*pSt, nFcText, nLenText, 0, nStartCp);
+ pRef.reset(new WW8PLCF(*pSt, nFcRef, nLenRef, nStruct, nStartCp));
+ pText.reset(new WW8PLCF(*pSt, nFcText, nLenText, 0, nStartCp));
}
}
WW8PLCFx_SubDoc::~WW8PLCFx_SubDoc()
{
- delete pRef;
- delete pText;
+ pRef.reset();
+ pText.reset();
}
sal_uInt32 WW8PLCFx_SubDoc::GetIdx() const
@@ -3916,7 +3916,7 @@ bool WW8PLCFx_SubDoc::SeekPos( WW8_CP nCpPos )
WW8_CP WW8PLCFx_SubDoc::Where()
{
- return ( pRef ) ? pRef->Where() : WW8_CP_MAX;
+ return pRef ? pRef->Where() : WW8_CP_MAX;
}
void WW8PLCFx_SubDoc::GetSprms(WW8PLCFxDesc* p)
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 26cb6179a9c1..76cbb187fc71 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -696,8 +696,8 @@ public:
class WW8PLCFx_SubDoc : public WW8PLCFx
{
private:
- WW8PLCF* pRef;
- WW8PLCF* pText;
+ std::unique_ptr<WW8PLCF> pRef;
+ std::unique_ptr<WW8PLCF> pText;
WW8PLCFx_SubDoc(const WW8PLCFx_SubDoc&) = delete;
WW8PLCFx_SubDoc& operator=(const WW8PLCFx_SubDoc&) = delete;
@@ -719,7 +719,7 @@ public:
virtual void GetSprms(WW8PLCFxDesc* p) override;
virtual void advance() override;
- long Count() const { return ( pRef ) ? pRef->GetIMax() : 0; }
+ long Count() const { return pRef ? pRef->GetIMax() : 0; }
};
/// Iterator for fields