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/expfld.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/expfld.hxx')
-rw-r--r-- | sw/inc/expfld.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index aefbbdbcbe0e..952e7fcc5402 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -92,7 +92,7 @@ class SW_DLLPUBLIC SwGetExpField : public SwFormulaField bool bLateInitialization; // #i82544# virtual OUString Expand() const override; - virtual SwField* Copy() const override; + virtual std::unique_ptr<SwField> Copy() const override; public: SwGetExpField( SwGetExpFieldType*, const OUString& rFormel, @@ -214,7 +214,7 @@ class SW_DLLPUBLIC SwSetExpField : public SwFormulaField SwFormatField * mpFormatField; /// pool item to which the SwSetExpField belongs virtual OUString Expand() const override; - virtual SwField* Copy() const override; + virtual std::unique_ptr<SwField> Copy() const override; public: SwSetExpField(SwSetExpFieldType*, const OUString& rFormel, sal_uLong nFormat = 0); @@ -299,7 +299,7 @@ class SW_DLLPUBLIC SwInputField : public SwField SwFormatField* mpFormatField; // attribute to which the <SwInputField> belongs to virtual OUString Expand() const override; - virtual SwField* Copy() const override; + virtual std::unique_ptr<SwField> Copy() const override; // Accessing Input Field's content const OUString& getContent() const { return aContent;} @@ -385,7 +385,7 @@ class SwTableField : public SwValueField, public SwTableFormula sal_uInt16 nSubType; virtual OUString Expand() const override; - virtual SwField* Copy() const override; + virtual std::unique_ptr<SwField> Copy() const override; /// Search TextNode containing the field. virtual const SwNode* GetNodeOfFormula() const override; |