Kaydet (Commit) 715eaef7 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in WW8PLCFx_SubDoc

Change-Id: If8b9b999fd46022b5be0a3353e58653f5a42a06c
Reviewed-on: https://gerrit.libreoffice.org/58022
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 242129b9
...@@ -3880,15 +3880,15 @@ WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib, ...@@ -3880,15 +3880,15 @@ WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib,
{ {
if( nLenRef && nLenText ) if( nLenRef && nLenText )
{ {
pRef = new WW8PLCF(*pSt, nFcRef, nLenRef, nStruct, nStartCp); pRef.reset(new WW8PLCF(*pSt, nFcRef, nLenRef, nStruct, nStartCp));
pText = new WW8PLCF(*pSt, nFcText, nLenText, 0, nStartCp); pText.reset(new WW8PLCF(*pSt, nFcText, nLenText, 0, nStartCp));
} }
} }
WW8PLCFx_SubDoc::~WW8PLCFx_SubDoc() WW8PLCFx_SubDoc::~WW8PLCFx_SubDoc()
{ {
delete pRef; pRef.reset();
delete pText; pText.reset();
} }
sal_uInt32 WW8PLCFx_SubDoc::GetIdx() const sal_uInt32 WW8PLCFx_SubDoc::GetIdx() const
...@@ -3916,7 +3916,7 @@ bool WW8PLCFx_SubDoc::SeekPos( WW8_CP nCpPos ) ...@@ -3916,7 +3916,7 @@ bool WW8PLCFx_SubDoc::SeekPos( WW8_CP nCpPos )
WW8_CP WW8PLCFx_SubDoc::Where() 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) void WW8PLCFx_SubDoc::GetSprms(WW8PLCFxDesc* p)
......
...@@ -696,8 +696,8 @@ public: ...@@ -696,8 +696,8 @@ public:
class WW8PLCFx_SubDoc : public WW8PLCFx class WW8PLCFx_SubDoc : public WW8PLCFx
{ {
private: private:
WW8PLCF* pRef; std::unique_ptr<WW8PLCF> pRef;
WW8PLCF* pText; std::unique_ptr<WW8PLCF> pText;
WW8PLCFx_SubDoc(const WW8PLCFx_SubDoc&) = delete; WW8PLCFx_SubDoc(const WW8PLCFx_SubDoc&) = delete;
WW8PLCFx_SubDoc& operator=(const WW8PLCFx_SubDoc&) = delete; WW8PLCFx_SubDoc& operator=(const WW8PLCFx_SubDoc&) = delete;
...@@ -719,7 +719,7 @@ public: ...@@ -719,7 +719,7 @@ public:
virtual void GetSprms(WW8PLCFxDesc* p) override; virtual void GetSprms(WW8PLCFxDesc* p) override;
virtual void advance() override; virtual void advance() override;
long Count() const { return ( pRef ) ? pRef->GetIMax() : 0; } long Count() const { return pRef ? pRef->GetIMax() : 0; }
}; };
/// Iterator for fields /// Iterator for fields
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment