sc/source/filter/excel/xeroot.cxx | 8 ++++++ sc/source/filter/excel/xestyle.cxx | 49 +++++++++++++++++++++++++++++++++++++ sc/source/filter/inc/xeroot.hxx | 5 +++ sc/source/filter/inc/xestyle.hxx | 38 ++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+)
New commits: commit 7f2fe9e846f244447fe4e0da089034e57ea6708f Author: Akash Shetye <shetyeak...@gmail.com> Date: Sat Jul 20 00:26:02 2013 +0530 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 diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index b72503f..9df6afe 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 368cd2d..9b52289 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3130,6 +3130,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 a0978a7..44952f0 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 a0903bc..6f22449 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: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits