diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-24 20:46:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-26 09:48:13 +0000 |
commit | cc5ceadf55b6f20575e819f6c5be6720093811ed (patch) | |
tree | e08791e0b15b77a6874d139006e33dc46bcf3126 /sc | |
parent | 6809783a988ff2271850bb3b5f8843f03fb658c9 (diff) |
coverity#735393 Resource leak in object
Change-Id: Ib39befba388568004a4cda57a1b161ba2a80c822
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index b3dc63801b20..47d90d487287 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -113,10 +113,10 @@ public: void SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr ); - ScDataBarFormatData* getDataBarFormatData() { return mpFormat; } + ScDataBarFormatData* getDataBarFormatData() { return mxFormat.get(); } private: - ScDataBarFormatData* mpFormat; + std::unique_ptr<ScDataBarFormatData> mxFormat; boost::scoped_ptr<ColorScaleRuleModelEntry> mpUpperLimit; boost::scoped_ptr<ColorScaleRuleModelEntry> mpLowerLimit; diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 3b10686bdd27..f6e432cbb2a8 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -232,9 +232,9 @@ void ColorScaleRule::AddEntries( ScColorScaleFormat* pFormat, ScDocument* pDoc, DataBarRule::DataBarRule( const CondFormat& rFormat ): WorksheetHelper( rFormat ), - mpFormat(new ScDataBarFormatData) + mxFormat(new ScDataBarFormatData) { - mpFormat->meAxisPosition = databar::NONE; + mxFormat->meAxisPosition = databar::NONE; } void DataBarRule::importColor( const AttributeList& rAttribs ) @@ -250,7 +250,7 @@ void DataBarRule::importColor( const AttributeList& rAttribs ) ::Color aColor = RgbToRgbComponents( nColor ); - mpFormat->maPositiveColor = aColor; + mxFormat->maPositiveColor = aColor; } void DataBarRule::importCfvo( const AttributeList& rAttribs ) @@ -272,7 +272,7 @@ void DataBarRule::importCfvo( const AttributeList& rAttribs ) void DataBarRule::importAttribs( const AttributeList& rAttribs ) { - mpFormat->mbOnlyBar = !rAttribs.getBool( XML_showValue, true ); + mxFormat->mbOnlyBar = !rAttribs.getBool( XML_showValue, true ); } void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr ) @@ -280,9 +280,9 @@ void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScA ScColorScaleEntry* pUpperEntry = ConvertToModel( *mpUpperLimit.get(), pDoc, rAddr); ScColorScaleEntry* pLowerEntry = ConvertToModel( *mpLowerLimit.get(), pDoc, rAddr); - mpFormat->mpUpperLimit.reset( pUpperEntry ); - mpFormat->mpLowerLimit.reset( pLowerEntry ); - pFormat->SetDataBarData(mpFormat); + mxFormat->mpUpperLimit.reset( pUpperEntry ); + mxFormat->mpLowerLimit.reset( pLowerEntry ); + pFormat->SetDataBarData(mxFormat.release()); } IconSetRule::IconSetRule( const CondFormat& rFormat ): |