diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-07 08:53:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-07 10:57:16 +0200 |
commit | fe5afeda8c0a99bc97e1b2009b554d3a2ef4da70 (patch) | |
tree | 2cd06dd8c057e43626bc7b55d12341075ebed9ab /oox/source/drawingml | |
parent | 48806ad275b0c4c8fa3eb1637684092266ec6a0d (diff) |
ofz#9747 Indirect-leak
Change-Id: I1063fbe9f41833c70e28343dd8d2392acd579d6d
Reviewed-on: https://gerrit.libreoffice.org/58665
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/table/tableproperties.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 3be685a954d3..00c5b765cfca 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -234,7 +234,7 @@ TableStyle* CreateTableStyle(const OUString& styleId) return pTableStyle; } -const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase, TableStyle*& rTableStyleToDelete ) +const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr<TableStyle>& rTableStyleToDelete ) { ::oox::core::XmlFilterBase& rBase( const_cast< ::oox::core::XmlFilterBase& >( rFilterBase ) ); @@ -257,8 +257,8 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt //if the pptx just has table style id, but no table style content, we will create the table style ourselves if (!pTableStyle) { - rTableStyleToDelete = CreateTableStyle(aStyleId); - pTableStyle = rTableStyleToDelete; + rTableStyleToDelete.reset(CreateTableStyle(aStyleId)); + pTableStyle = rTableStyleToDelete.get(); } } @@ -277,8 +277,8 @@ void TableProperties::pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBa CreateTableColumns( xColumnRowRange->getColumns(), mvTableGrid ); CreateTableRows( xColumnRowRange->getRows(), mvTableRows ); - TableStyle* pTableStyleToDelete = nullptr; - const TableStyle& rTableStyle( getUsedTableStyle( rFilterBase, pTableStyleToDelete ) ); + std::unique_ptr<TableStyle> xTableStyleToDelete; + const TableStyle& rTableStyle( getUsedTableStyle( rFilterBase, xTableStyleToDelete ) ); sal_Int32 nRow = 0; for (auto & tableRow : mvTableRows) { @@ -301,7 +301,7 @@ void TableProperties::pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBa ++nRow; } - delete pTableStyleToDelete; + xTableStyleToDelete.reset(); } } } } |