diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-25 09:31:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-26 09:48:14 +0000 |
commit | 71c60f8f8956414034d105fe4cc64c12d3a5d2e3 (patch) | |
tree | f202bee77a10783e635f2aad352e5c200f5c6f21 | |
parent | faace681fc6575dd8a16b0c8fead3ea7f0b93fe3 (diff) |
coverity#982279 Resource leak in object
Change-Id: I8a616dee5795c3614baa69840b3a8808ef89b650
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index 47d90d487287..f983f7e1f4c1 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -133,7 +133,7 @@ public: private: std::vector< ColorScaleRuleModelEntry > maEntries; - ScIconSetFormatData* mpFormatData; + std::unique_ptr<ScIconSetFormatData> mxFormatData; OUString maIconSetType; }; diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index f6e432cbb2a8..6937ac756947 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -287,7 +287,7 @@ void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScA IconSetRule::IconSetRule( const CondFormat& rFormat ): WorksheetHelper( rFormat ), - mpFormatData( new ScIconSetFormatData ) + mxFormatData( new ScIconSetFormatData ) { } @@ -302,8 +302,8 @@ void IconSetRule::importCfvo( const AttributeList& rAttribs ) void IconSetRule::importAttribs( const AttributeList& rAttribs ) { maIconSetType = rAttribs.getString( XML_iconSet, OUString("3TrafficLights1") ); - mpFormatData->mbShowValue = rAttribs.getBool( XML_showValue, true ); - mpFormatData->mbReverse = rAttribs.getBool( XML_reverse, false ); + mxFormatData->mbShowValue = rAttribs.getBool( XML_showValue, true ); + mxFormatData->mbReverse = rAttribs.getBool( XML_reverse, false ); } void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScAddress& rPos ) @@ -311,7 +311,7 @@ void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScA for(size_t i = 0; i < maEntries.size(); ++i) { ScColorScaleEntry* pModelEntry = ConvertToModel( maEntries[i], pDoc, rPos ); - mpFormatData->maEntries.push_back(pModelEntry); + mxFormatData->maEntries.push_back(pModelEntry); } ScIconSetType eIconSetType = IconSet_3TrafficLights1; @@ -324,8 +324,8 @@ void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScA break; } } - mpFormatData->eIconSetType = eIconSetType; - pFormat->SetIconSetData(mpFormatData); + mxFormatData->eIconSetType = eIconSetType; + pFormat->SetIconSetData(mxFormatData.release()); } CondFormatRuleModel::CondFormatRuleModel() : |