summaryrefslogtreecommitdiff
path: root/include/editeng/outliner.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-16 15:09:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-19 08:58:46 +0200
commit74403516c94a49d8878eb5c0224e6994f204cd2a (patch)
tree839a162fc56e96649614fbbe4966b2350313e88a /include/editeng/outliner.hxx
parent330cae474bedd303e94c9fab991baaa8390f6b53 (diff)
loplugin:useuniqueptr in EditFieldInfo
Change-Id: I8c4cc4ab212409bce54b64d59d07d77a924ed11c
Diffstat (limited to 'include/editeng/outliner.hxx')
-rw-r--r--include/editeng/outliner.hxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index f6bba5cc89b6..2c2ca5f1285f 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -500,8 +500,8 @@ private:
Outliner* pOutliner;
const SvxFieldItem& rFldItem;
- Color* pTxtColor;
- Color* pFldColor;
+ std::unique_ptr<Color> pTxtColor;
+ std::unique_ptr<Color> pFldColor;
OUString aRepresentation;
@@ -518,28 +518,22 @@ public:
{
pOutliner = pOutl;
nPara = nPa; nPos = nPo;
- pTxtColor = nullptr; pFldColor = nullptr;
mpSdrPage = nullptr;
}
- ~EditFieldInfo()
- {
- delete pTxtColor;
- delete pFldColor;
- }
Outliner* GetOutliner() const { return pOutliner; }
const SvxFieldItem& GetField() const { return rFldItem; }
- Color* GetTextColor() const { return pTxtColor; }
+ Color* GetTextColor() const { return pTxtColor.get(); }
void SetTextColor( const Color& rColor )
- { delete pTxtColor; pTxtColor = new Color( rColor ); }
+ { pTxtColor.reset( new Color( rColor ) ); }
- Color* GetFieldColor() const { return pFldColor; }
+ Color* GetFieldColor() const { return pFldColor.get(); }
void SetFieldColor( const Color& rColor )
- { delete pFldColor; pFldColor = new Color( rColor ); }
+ { pFldColor.reset( new Color( rColor ) ); }
void ClearFieldColor()
- { delete pFldColor; pFldColor = nullptr; }
+ { pFldColor.reset(); }
sal_Int32 GetPara() const { return nPara; }
sal_Int32 GetPos() const { return nPos; }