diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-02 09:37:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-02 14:53:49 +0100 |
commit | e6409de0f879df204de7b07117798e2d77235458 (patch) | |
tree | 30550f58ca34f0fb9ec416b39e44ac3743af0c57 /oox | |
parent | 02b2c38acc2374abd0b38d56cd8d92b19b644105 (diff) |
don't leak pDefaultTableStyle
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/table/tableproperties.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 97ed6e708578..23c9ccd0d951 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/table/XMergeableCellRange.hpp> #include <com/sun/star/table/BorderLine2.hpp> +#include <rtl/instance.hxx> #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/propertyset.hxx" @@ -103,7 +104,10 @@ void MergeCells( const uno::Reference< XTable >& xTable, sal_Int32 nCol, sal_Int } } -static TableStyle* pDefaultTableStyle = new TableStyle(); +namespace +{ + struct theDefaultTableStyle : public ::rtl::Static< TableStyle, theDefaultTableStyle > {}; +} const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase ) { @@ -127,8 +131,9 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt ++aIter; } } + if ( !pTableStyle ) - pTableStyle = pDefaultTableStyle; + return theDefaultTableStyle::get(); return *pTableStyle; } |