diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-04 10:07:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-10 12:27:54 +0200 |
commit | 1a33947a91685808fd5f6d4903b6ae896686066d (patch) | |
tree | 2a9454c3df148a16c3d4b14c3cfd1c9e10916da3 /sw/inc/fldbas.hxx | |
parent | b7e75f974962db49d29d2f5261dce4de5cd42d3e (diff) |
pass SwField around by std::unique_ptr
Fix leak in SwFieldPage::InsertField, where it interacts badly with
SwFieldMgr::UpdateCurField
The awkward
return std::unique_ptr<SwField>(pTmp.release());
code is because clang 3.8.0 doesn't seem able to do auto-upcast of
std::unique_ptr.
Change-Id: I05b748e9cda145fd972a01bfa343239df32368b9
Reviewed-on: https://gerrit.libreoffice.org/57197
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/fldbas.hxx')
-rw-r--r-- | sw/inc/fldbas.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index fcb55df88b4c..0093ce66b337 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -283,7 +283,7 @@ private: SwFieldType* m_pType; virtual OUString Expand() const = 0; - virtual SwField* Copy() const = 0; + virtual std::unique_ptr<SwField> Copy() const = 0; protected: void SetFormat(sal_uInt32 const nSet) { @@ -316,7 +316,7 @@ public: /// @return name or content. virtual OUString GetFieldName() const; - SwField * CopyField() const; + std::unique_ptr<SwField> CopyField() const; /// ResId SwFieldIds Which() const |