diff options
author | Akash Shetye <shetyeakash@gmail.com> | 2013-07-20 00:26:02 +0530 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-05 14:30:23 -0400 |
commit | b28688b74ad8ab8d3d4d11bab01d000c559811d2 (patch) | |
tree | 3464ab457e666dde16e580f13df16d6feb902757 | |
parent | 42b10065b3ba4f79487105feb9ee53a8d84e1e92 (diff) |
Made the skeleton for Table Formatting information export.
Patch adds the classes and methods needed for exporting table style data, the methods are yet to be written.
Change-Id: I499551624139bc5f7fd6b392bb7733652d8e51c6
-rw-r--r-- | sc/source/filter/excel/xeroot.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 49 | ||||
-rw-r--r-- | sc/source/filter/inc/xeroot.hxx | 5 | ||||
-rw-r--r-- | sc/source/filter/inc/xestyle.hxx | 38 |
4 files changed, 100 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index b72503f8f3d4..9df6afecddca 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -161,6 +161,12 @@ XclExpDxfs& XclExpRoot::GetDxfs() const return *mrExpData.mxDxfs; } +XclExpTableStyles& XclExpRoot::GetTableStyles() const +{ + OSL_ENSURE( mrExpData.mxTableStyles, "XclExpRoot::GetTableStyles - missign object (wrong BIFF?)"); + return *mrExpData.mxTableStyles; +} + XclExpPivotTableManager& XclExpRoot::GetPivotTableManager() const { OSL_ENSURE( mrExpData.mxPTableMgr, "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" ); @@ -206,6 +212,7 @@ void XclExpRoot::InitializeGlobals() // BIFF8: only one link manager for all sheets mrExpData.mxLocLinkMgr = mrExpData.mxGlobLinkMgr; mrExpData.mxDxfs.reset( new XclExpDxfs( GetRoot() ) ); + mrExpData.mxTableStyles.reset( new XclExpTableStyles( GetRoot() ) ); } if( GetOutput() == EXC_OUTPUT_XML_2007 ) @@ -283,6 +290,7 @@ XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const case EXC_ID_EXTERNSHEET: xRec = GetLocalLinkMgrRef(); break; case EXC_ID_NAME: xRec = mrExpData.mxNameMgr; break; case EXC_ID_DXFS: xRec = mrExpData.mxDxfs; break; + case EXC_ID_TABLESTYLES: xRec = mrExpData.mxTableStyles; break; } OSL_ENSURE( xRec, "XclExpRoot::CreateRecord - unknown record ID or missing object" ); return xRec; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 5e0e788818cf..a1a7341f384e 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3131,6 +3131,55 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) // ============================================================================ +XclExpTableStyleElement::XclExpTableStyleElement( const XclExpRoot& rRoot, OUString& rType, int iSize, int iDxfId ) + :XclExpRoot( rRoot), + maType( rType ), + maDxfId( iDxfId ), + maSize( iSize ) +{ +} + +XclExpTableStyleElement::~XclExpTableStyleElement() +{ +} + +void XclExpTableStyleElement::SaveXml( XclExpStream& rStrm ) +{ +} + +// ============================================================================ + +XclExpTableStyle::XclExpTableStyle( const XclExpRoot& rRoot, OUString& rTableStyleName ) + :XclExpRoot( rRoot ), + maTableStyleName( rTableStyleName ) +{ +} + +XclExpTableStyle::~XclExpTableStyle() +{ +} + +void XclExpTableStyle::SaveXml( XclExpXmlStream& rStrm ) +{ +} + +// =========================================================================== + +XclExpTableStyles::XclExpTableStyles( const XclExpRoot& rRoot ) + :XclExpRoot( rRoot ) +{ +} + +XclExpTableStyles::~XclExpTableStyles() +{ +} + +void XclExpTableStyles::SaveXml( XclExpXmlStream& rStrm ) +{ +} + +// ============================================================================ + XclExpXmlStyleSheet::XclExpXmlStyleSheet( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ) { diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx index a0978a72b4da..44952f088f45 100644 --- a/sc/source/filter/inc/xeroot.hxx +++ b/sc/source/filter/inc/xeroot.hxx @@ -51,6 +51,7 @@ class XclExpObjectManager; class XclExpFilterManager; class XclExpPivotTableManager; class XclExpDxfs; +class XclExpTableStyles; /** Stores global buffers and data needed for Excel export filter. */ struct XclExpRootData : public XclRootData @@ -71,6 +72,7 @@ struct XclExpRootData : public XclRootData typedef boost::shared_ptr< XclExpFilterManager > XclExpFilterMgrRef; typedef boost::shared_ptr< XclExpPivotTableManager > XclExpPTableMgrRef; typedef boost::shared_ptr< XclExpDxfs > XclExpDxfsRef; + typedef boost::shared_ptr< XclExpTableStyles > XclExpTableStylesRef; XclExpTabInfoRef mxTabInfo; /// Calc->Excel sheet index conversion. XclExpAddrConvRef mxAddrConv; /// The address converter. @@ -89,6 +91,7 @@ struct XclExpRootData : public XclRootData XclExpFilterMgrRef mxFilterMgr; /// Manager for filtered areas in all sheets. XclExpPTableMgrRef mxPTableMgr; /// All pivot tables and pivot caches. XclExpDxfsRef mxDxfs; /// All delta formatting entries + XclExpTableStylesRef mxTableStyles; /// All table styles for table formatting ScCompiler::OpCodeMapPtr mxOpCodeMap; /// mapping between op-codes and names @@ -145,6 +148,8 @@ public: XclExpPivotTableManager& GetPivotTableManager() const; /** Returns the differential formatting list */ XclExpDxfs& GetDxfs() const; + /** Returns the Table styles list*/ + XclExpTableStyles& GetTableStyles() const; /** Returns the op-code mapping */ ScCompiler::OpCodeMapPtr GetOpCodeMap() const; diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index a0903bcc49b4..6f22449a8e0b 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -42,6 +42,7 @@ const sal_uInt16 EXC_ID_FONTLIST = 0x8031; /// For internal use only. const sal_uInt16 EXC_ID_FORMATLIST = 0x801E; /// For internal use only. const sal_uInt16 EXC_ID_XFLIST = 0x8043; /// For internal use only. const sal_uInt16 EXC_ID_DXFS = 0x9999; /// For internal use only. TODO:moggi: find a better/correct value +const sal_uInt16 EXC_ID_TABLESTYLES = 0x99BE; /// Needs improvement. // PALETTE record - color information ========================================= @@ -766,6 +767,43 @@ private: // ============================================================================ +class XclExpTableStyleElement : public XclExpRecordBase, protected XclExpRoot +{ +public: + XclExpTableStyleElement( const XclExpRoot& rRoot, OUString& rType, int iSize, int iDxfId ); + virtual ~XclExpTableStyleElement(); + virtual void SaveXml( XclExpStream& rStrm ); +private: + OUString maType; + int maSize; + int maDxfId; +}; + +class XclExpTableStyle : public XclExpRecordBase, protected XclExpRoot +{ +public: + XclExpTableStyle( const XclExpRoot& rRoot, OUString& rTableStyleName ); + virtual ~XclExpTableStyle(); + virtual void SaveXml( XclExpXmlStream& rStrm ); +private: + typedef boost::ptr_vector< XclExpTableStyleElement > StyleElementContainer; + StyleElementContainer maStyleElementContainer; + OUString maTableStyleName; +}; + +class XclExpTableStyles : public XclExpRecordBase, protected XclExpRoot +{ +public: + XclExpTableStyles( const XclExpRoot& rRoot ); + virtual ~XclExpTableStyles(); + virtual void SaveXml( XclExpXmlStream& rStrm ); +private: + typedef boost::ptr_vector< XclExpTableStyle > StyleContainer; + StyleContainer maStyleContainer; +}; + +// ============================================================================ + class XclExpXmlStyleSheet : public XclExpRecordBase, protected XclExpRoot { public: |