diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-21 02:53:55 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-21 12:51:13 +0200 |
commit | 0019c67a587a6c780fe5ae10cedf51cd1914f811 (patch) | |
tree | 43a519dc85176f6fc2497284c2db0429d0dc6f77 /sc | |
parent | 6df9865612873b8c01bf789d6c0ac884a17f38ee (diff) |
simplify dxfs/dxf export
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 20 | ||||
-rw-r--r-- | sc/source/filter/inc/xestyle.hxx | 5 |
2 files changed, 8 insertions, 17 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 0e7c1cfe2b27..ce902cd98738 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -2916,7 +2916,7 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) { sal_uLong nScNumFmt = static_cast< sal_uInt32 >( static_cast< const SfxInt32Item* >(pPoolItem)->GetValue()); sal_uInt16 nXclNumFmt = static_cast< sal_uInt16 >( EXC_FORMAT_OFFSET8 + nIndex ); - pNumFormat = new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable )); + pNumFormat = new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() )); ++nNumFmtIndex; } @@ -2939,6 +2939,9 @@ sal_Int32 XclExpDxfs::GetDxfId( const rtl::OUString& rStyleName ) void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm ) { + if(maDxf.empty()) + return; + sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); rStyleSheet->startElement( XML_dxfs, XML_count, rtl::OString::valueOf( static_cast<sal_Int32>(maDxf.size())).getStr(), @@ -3000,16 +3003,8 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) // ============================================================================ XclExpXmlStyleSheet::XclExpXmlStyleSheet( const XclExpRoot& rRoot ) - : XclExpRoot( rRoot ), - mbDxfs(false) + : XclExpRoot( rRoot ) { - if ( ScConditionalFormatList* pList = rRoot.GetDoc().GetCondFormList() ) - { - if ( pList->Count() ) - { - mbDxfs = true; - } - } } void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm ) @@ -3030,10 +3025,7 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm ) CreateRecord( EXC_ID_FONTLIST )->SaveXml( rStrm ); CreateRecord( EXC_ID_XFLIST )->SaveXml( rStrm ); CreateRecord( EXC_ID_PALETTE )->SaveXml( rStrm ); - if(mbDxfs) - { - CreateRecord( EXC_ID_DXFS )->SaveXml( rStrm ); - } + CreateRecord( EXC_ID_DXFS )->SaveXml( rStrm ); aStyleSheet->endElement( XML_styleSheet ); diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 345d31cca34f..42a7c1bc4271 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -40,6 +40,7 @@ #include "xeroot.hxx" #include "conditio.hxx" #include <boost/shared_ptr.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/ptr_container/ptr_vector.hpp> /* ============================================================================ @@ -759,7 +760,7 @@ private: std::map<rtl::OUString, sal_Int32> maStyleNameToDxfId; DxfContainer maDxf; SvNumberFormatterPtr mxFormatter; /// Special number formatter for conversion. - NfKeywordTable* mpKeywordTable; /// Replacement table. + boost::scoped_ptr<NfKeywordTable> mpKeywordTable; /// Replacement table. }; // ============================================================================ @@ -770,8 +771,6 @@ public: explicit XclExpXmlStyleSheet( const XclExpRoot& rRoot ); virtual void SaveXml( XclExpXmlStream& rStrm ); -private: - bool mbDxfs; }; // ============================================================================ |