diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-21 03:12:11 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-21 12:51:13 +0200 |
commit | 9894f158a287bdfe9933df96ab117a9527e9195b (patch) | |
tree | ec18371e7921a6ba51314f35fb9bc0f71639dc5b | |
parent | 0019c67a587a6c780fe5ae10cedf51cd1914f811 (diff) |
simplify lifetime management of some variables
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/inc/xestyle.hxx | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index ce902cd98738..7d98fcf50ebc 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1234,7 +1234,7 @@ XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) : cannot convert from 'class String *' to 'class String (*)[54]' The effective result here is class String (*)[54*1] */ mxFormatter( new SvNumberFormatter( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ), - mpKeywordTable( new NfKeywordTable[ 1 ] ), + mpKeywordTable( new NfKeywordTable ), mnStdFmt( GetFormatter().GetStandardFormat( ScGlobal::eLnge ) ) { switch( GetBiff() ) @@ -1256,7 +1256,6 @@ XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) : XclExpNumFmtBuffer::~XclExpNumFmtBuffer() { - delete[] mpKeywordTable; } sal_uInt16 XclExpNumFmtBuffer::Insert( sal_uLong nScNumFmt ) @@ -1367,7 +1366,7 @@ String GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberF String XclExpNumFmtBuffer::GetFormatCode( sal_uInt16 nScNumFmt ) { - return GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable ); + return GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() ); } // XF, STYLE record - Cell formatting ========================================= @@ -2840,7 +2839,7 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF ) XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ), mxFormatter( new SvNumberFormatter( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ), - mpKeywordTable( new NfKeywordTable[ 1 ] ) + mpKeywordTable( new NfKeywordTable ) { mxFormatter->FillKeywordTable( *mpKeywordTable, LANGUAGE_ENGLISH_US ); // remap codes unknown to Excel diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 42a7c1bc4271..ba7dc67d32c8 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -322,7 +322,7 @@ private: SvNumberFormatterPtr mxFormatter; /// Special number formatter for conversion. XclExpNumFmtVec maFormatMap; /// Maps core formats to Excel indexes. - NfKeywordTable* mpKeywordTable; /// Replacement table. + boost::scoped_ptr<NfKeywordTable> mpKeywordTable; /// Replacement table. sal_uLong mnStdFmt; /// Key for standard number format. sal_uInt16 mnXclOffset; /// Offset to first user defined format. }; @@ -751,6 +751,7 @@ class XclExpDxfs : public XclExpRecordBase, protected XclExpRoot { public: XclExpDxfs( const XclExpRoot& rRoot ); + virtual ~XclExpDxfs() {} sal_Int32 GetDxfId(const rtl::OUString& rName); |