diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-23 14:22:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-24 08:35:05 +0200 |
commit | 63ba8ffa5c390c04e22a74015a64cefc2bf228ea (patch) | |
tree | ea3a5f375e394024ea40581200880c4073097722 /sc/inc | |
parent | e2282a94558d6d92ed5f170e3dde6f26bfe383db (diff) |
loplugin:useuniqueptr in ScValidationDataList
Change-Id: Icbf8eb814e7d3bd57e78d2d1a97eb44bbfd2a432
Reviewed-on: https://gerrit.libreoffice.org/57874
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/document.hxx | 6 | ||||
-rw-r--r-- | sc/inc/validat.hxx | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 4fcee74748ca..7d34bd38a6a4 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -357,7 +357,7 @@ private: VclPtr<VirtualDevice> mpVirtualDevice_100th_mm; std::unique_ptr<ScDrawLayer> mpDrawLayer; // SdrModel rtl::Reference<XColorList> pColorList; - ScValidationDataList* pValidationList; // validity + std::unique_ptr<ScValidationDataList> pValidationList; // validity SvNumberFormatterIndexTable* pFormatExchangeList; // for application of number formats TableContainer maTabs; std::vector<OUString> maTabNames; // for undo document, we need the information tab name <-> index @@ -1703,8 +1703,8 @@ public: SC_DLLPUBLIC ScConditionalFormatList* GetCondFormList( SCTAB nTab ) const; - const ScValidationDataList* GetValidationList() const { return pValidationList;} - ScValidationDataList* GetValidationList() { return pValidationList;} + const ScValidationDataList* GetValidationList() const { return pValidationList.get();} + ScValidationDataList* GetValidationList() { return pValidationList.get();} SC_DLLPUBLIC void ApplyAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem& rAttr ); diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index dc694069fca0..945cd9e6bc0e 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -190,13 +190,13 @@ private: struct CompareScValidationDataPtr { - bool operator()( ScValidationData* const& lhs, ScValidationData* const& rhs ) const { return (*lhs)<(*rhs); } + bool operator()( std::unique_ptr<ScValidationData> const& lhs, std::unique_ptr<ScValidationData> const& rhs ) const { return (*lhs)<(*rhs); } }; class ScValidationDataList { private: - typedef std::set<ScValidationData*, CompareScValidationDataPtr> ScValidationDataListDataType; + typedef std::set<std::unique_ptr<ScValidationData>, CompareScValidationDataPtr> ScValidationDataListDataType; ScValidationDataListDataType maData; public: @@ -212,8 +212,8 @@ public: iterator end(); const_iterator end() const; - void InsertNew( ScValidationData* pNew ) - { if (!maData.insert(pNew).second) delete pNew; } + void InsertNew( std::unique_ptr<ScValidationData> pNew ) + { maData.insert(std::move(pNew)); } ScValidationData* GetData( sal_uInt32 nKey ); |