diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-02 10:40:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-04 11:41:17 +0200 |
commit | 9743bec6d81b19d38b69d8a52d969e90c6aef1b5 (patch) | |
tree | d2be4b1bee7ecf854111a3a1172dfd9d892387a1 /sw/inc/expfld.hxx | |
parent | 56f1e2e081d29112b345df08f039a2cecbd9743d (diff) |
loplugin:useuniqueptr in SwSeqFieldList
no need to store such a small structure separately on the heap
Change-Id: I36b3ad5250718b7bdf526f5f67219740c69a549a
Reviewed-on: https://gerrit.libreoffice.org/61298
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 | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 025ff802190f..7389a6d40ec9 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -45,7 +45,7 @@ OUString ReplacePoint(const OUString& sTmpName, bool bWithCommandType = false); struct SeqFieldLstElem { OUString sDlgEntry; - sal_uInt16 const nSeqNo; + sal_uInt16 nSeqNo; SeqFieldLstElem( const OUString& rStr, sal_uInt16 nNo ) : sDlgEntry( rStr ), nSeqNo( nNo ) @@ -54,20 +54,14 @@ struct SeqFieldLstElem class SW_DLLPUBLIC SwSeqFieldList { - std::vector<SeqFieldLstElem*> maData; + std::vector<SeqFieldLstElem> maData; public: - ~SwSeqFieldList() - { - for( std::vector<SeqFieldLstElem*>::const_iterator it = maData.begin(); it != maData.end(); ++it ) - delete *it; - } - - bool InsertSort(SeqFieldLstElem* pNew); + bool InsertSort(SeqFieldLstElem aNew); bool SeekEntry(const SeqFieldLstElem& rNew, size_t* pPos) const; size_t Count() { return maData.size(); } - SeqFieldLstElem* operator[](size_t nIndex) { return maData[nIndex]; } - const SeqFieldLstElem* operator[](size_t nIndex) const { return maData[nIndex]; } + SeqFieldLstElem& operator[](size_t nIndex) { return maData[nIndex]; } + const SeqFieldLstElem& operator[](size_t nIndex) const { return maData[nIndex]; } void Clear() { maData.clear(); } }; |