oox/source/token/tokens.txt | 2 sc/Library_scfilt.mk | 1 sc/inc/colorscale.hxx | 5 sc/source/filter/excel/excdoc.cxx | 8 - sc/source/filter/excel/xecontent.cxx | 34 ++++ sc/source/filter/excel/xeextlst.cxx | 246 +++++++++++++++++++++++++++++++++++ sc/source/filter/excel/xetable.cxx | 6 sc/source/filter/inc/xecontent.hxx | 7 sc/source/filter/inc/xeextlst.hxx | 139 +++++++++++++++++++ sc/source/filter/inc/xetable.hxx | 3 sc/source/filter/inc/xlcontent.hxx | 1 sc/source/filter/xml/xmlstyli.cxx | 4 12 files changed, 443 insertions(+), 13 deletions(-)
New commits: commit 333f9d3016bf9a246dfa96bc32c064281f36f355 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Aug 22 23:15:34 2012 +0200 sal_True -> true Change-Id: I7d8c637746d8f29704adf94b20559d539d0ec56c diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 9bf6de7..1ef7cda 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -516,7 +516,7 @@ void XMLTableStyleContext::FillPropertySet( if (!bParentSet) { AddProperty(CTF_SC_CELLSTYLE, uno::makeAny(GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TABLE_CELL, GetParentName() ))); - bParentSet = sal_True; + bParentSet = true; } sal_Int32 nNumFmt = GetNumberFormat(); if (nNumFmt >= 0) @@ -534,7 +534,7 @@ void XMLTableStyleContext::FillPropertySet( ++aItr; } AddProperty(CTF_SC_IMPORT_MAP, aConditionalFormat); - bConditionalFormatCreated = sal_True; + bConditionalFormatCreated = true; } } else if (GetFamily() == XML_STYLE_FAMILY_TABLE_TABLE) commit c346c0cfc981d18e1d5024e3abbe124fbbf4a607 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Aug 22 23:05:56 2012 +0200 support export of databar information to extlst for excel2010 Change-Id: I1aaca6676bdbba1e8f365081e3f427fb67fd873e diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index fee78ee..64979d5 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -5661,6 +5661,7 @@ wrapcoords writeProtection wsDr x +x14 xAlign xIllusions xMode @@ -5676,6 +5677,7 @@ xfrmType xl2000 xl97 xlm +xm xml xmlBased xmlCellPr diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk index 2c83049..870f28c 100644 --- a/sc/Library_scfilt.mk +++ b/sc/Library_scfilt.mk @@ -82,6 +82,7 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\ sc/source/filter/excel/xechart \ sc/source/filter/excel/xecontent \ sc/source/filter/excel/xeescher \ + sc/source/filter/excel/xeextlst \ sc/source/filter/excel/xeformula \ sc/source/filter/excel/xehelper \ sc/source/filter/excel/xelink \ diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 942f604..db13e92 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -26,6 +26,9 @@ * instead of those above. */ +#ifndef SC_COLORSCALE_HXX +#define SC_COLORSCALE_HXX + #include <boost/ptr_container/ptr_vector.hpp> #include <boost/scoped_ptr.hpp> #include <formula/grammar.hxx> @@ -258,4 +261,6 @@ private: boost::scoped_ptr<ScDataBarFormatData> mpFormatData; }; +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index e83c119..b25e4dc 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -64,6 +64,7 @@ #include "excdoc.hxx" #include "namebuff.hxx" +#include "xeextlst.hxx" #include "xcl97rec.hxx" #include "xcl97esc.hxx" @@ -524,7 +525,7 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx ) Add( new XclExpWebQueryBuffer( GetRoot() ) ); // conditional formats - Add( new XclExpCondFormatBuffer( GetRoot() ) ); + Add( new XclExpCondFormatBuffer( GetRoot(), XclExtLstRef() ) ); if( HasVbaStorage() ) if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() ) @@ -555,6 +556,7 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) // WSBOOL needs data from page settings, create it here, add it later boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) ); + XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) ); bool bFitToPages = xPageSett->GetPageData().mbFitToPages; Add( new ExcBof8 ); @@ -601,7 +603,7 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) aRecList.AppendRecord( mxCellTable->CreateRecord( EXC_ID_MERGEDCELLS ) ); // conditional formats - Add( new XclExpCondFormatBuffer( GetRoot() ) ); + Add( new XclExpCondFormatBuffer( GetRoot(), xExtLst ) ); if( HasVbaStorage() ) if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() ) @@ -636,6 +638,8 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) // all MSODRAWING and OBJ stuff of this sheet goes here aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) ); + aRecList.AppendRecord( xExtLst ); + // EOF Add( new ExcEof ); } diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index fbbfe75..ffdaa3f 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -968,7 +968,7 @@ void XclExpColScaleCol::SaveXml( XclExpXmlStream& rStrm ) // ---------------------------------------------------------------------------- -XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat ) : +XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat, XclExtLstRef xExtLst ) : XclExpRecord( EXC_ID_CONDFMT ), XclExpRoot( rRoot ) { @@ -985,7 +985,7 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat else if(pFormatEntry->GetType() == condformat::COLORSCALE) maCFList.AppendNewRecord( new XclExpColorScale( GetRoot(), static_cast<const ScColorScaleFormat&>(*pFormatEntry), nIndex ) ); else if(pFormatEntry->GetType() == condformat::DATABAR) - maCFList.AppendNewRecord( new XclExpDataBar( GetRoot(), static_cast<const ScDataBarFormat&>(*pFormatEntry), nIndex ) ); + maCFList.AppendNewRecord( new XclExpDataBar( GetRoot(), static_cast<const ScDataBarFormat&>(*pFormatEntry), nIndex, xExtLst ) ); } aScRanges.Format( msSeqRef, SCA_VALID, NULL, formula::FormulaGrammar::CONV_XL_A1 ); } @@ -1080,7 +1080,7 @@ void XclExpColorScale::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_extLst } -XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority ): +XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority, XclExtLstRef xExtLst ): XclExpRecord(), XclExpRoot( rRoot ), mrFormat( rFormat ), @@ -1093,6 +1093,16 @@ XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rF mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr ) ); mpCol.reset( new XclExpColScaleCol( GetRoot(), mrFormat.GetDataBarData()->maPositiveColor ) ); + if(xExtLst.get()) + { + XclExpExtRef pParent = xExtLst->GetItem( XclExpExtDataBarType ); + if( !pParent.get() ) + { + xExtLst->AddRecord( XclExpExtRef(new XclExpExtCondFormat( *xExtLst.get() )) ); + pParent = xExtLst->GetItem( XclExpExtDataBarType ); + } + static_cast<XclExpExtCondFormat*>(xExtLst->GetItem( XclExpExtDataBarType ).get())->AddRecord( XclExpExtConditionalFormattingRef(new XclExpExtConditionalFormatting( *pParent, rFormat, aAddr, rtl::OString("{64A12B6B-50E9-436E-8939-DBE15E5BE1DC}") )) ); + } } void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm ) @@ -1112,6 +1122,20 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm ) rWorksheet->endElement( XML_dataBar ); + // extLst entries for Excel 2010 and 2013 + rWorksheet->startElement( XML_extLst, FSEND ); + rWorksheet->startElement( XML_ext, + FSNS( XML_xmlns, XML_x14 ), "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", + XML_uri, "{B025F937-C7B1-47D3-B67F-A62EFF666E3E}", + FSEND ); + + rWorksheet->startElementNS( XML_x14, XML_id, FSEND ); + rWorksheet->write( "{64A12B6B-50E9-436E-8939-DBE15E5BE1DC}" ); + rWorksheet->endElementNS( XML_x14, XML_id ); + + rWorksheet->endElement( XML_ext ); + rWorksheet->endElement( XML_extLst ); + rWorksheet->endElement( XML_cfRule ); // OOXTODO: XML_extLst @@ -1120,7 +1144,7 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm ) // ---------------------------------------------------------------------------- -XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot ) : +XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtLstRef xExtLst ) : XclExpRoot( rRoot ) { if( const ScConditionalFormatList* pCondFmtList = GetDoc().GetCondFormList(GetCurrScTab()) ) @@ -1128,7 +1152,7 @@ XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot ) : for( ScConditionalFormatList::const_iterator itr = pCondFmtList->begin(); itr != pCondFmtList->end(); ++itr) { - XclExpCondfmtList::RecordRefType xCondfmtRec( new XclExpCondfmt( GetRoot(), *itr ) ); + XclExpCondfmtList::RecordRefType xCondfmtRec( new XclExpCondfmt( GetRoot(), *itr, xExtLst ) ); if( xCondfmtRec->IsValid() ) maCondfmtList.AppendRecord( xCondfmtRec ); } diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx new file mode 100644 index 0000000..f03b737 --- /dev/null +++ b/sc/source/filter/excel/xeextlst.cxx @@ -0,0 +1,246 @@ +#include "xeextlst.hxx" +#include "xeroot.hxx" +#include "xehelper.hxx" +#include "xestyle.hxx" +#include "xename.hxx" +#include "xecontent.hxx" +#include "tokenarray.hxx" + +using namespace ::oox; + +XclExpExt::XclExpExt( const XclExpRoot& rRoot ): + XclExpRoot(rRoot) +{ +} + +XclExtLst::XclExtLst( const XclExpRoot& rRoot ): + XclExpRoot(rRoot) +{ +} + +XclExpExtNegativeColor::XclExpExtNegativeColor( const Color& rColor ): + maColor(rColor) +{ +} + +void XclExpExtNegativeColor::SaveXml( XclExpXmlStream& rStrm ) +{ + rStrm.GetCurrentStream()->singleElementNS( XML_x14, XML_negativeFillColor, + XML_rgb, XclXmlUtils::ToOString( maColor ).getStr(), + FSEND ); +} + +XclExpExtAxisColor::XclExpExtAxisColor( const Color& rColor ): + maAxisColor(rColor) +{ +} + +void XclExpExtAxisColor::SaveXml( XclExpXmlStream& rStrm ) +{ + rStrm.GetCurrentStream()->singleElementNS( XML_x14, XML_axisColor, + XML_rgb, XclXmlUtils::ToOString( maAxisColor ).getStr(), + FSEND ); +} + +XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rSrcPos ): + XclExpRoot(rRoot), + meType(rEntry.GetType()) +{ + if( rEntry.GetType() == COLORSCALE_FORMULA ) + { + rtl::OUString aFormula = XclXmlUtils::ToOUString( GetRoot().GetDoc(), rSrcPos, rEntry.GetFormula()->Clone() ); + maValue = rtl::OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 ); + } + else + maValue = rtl::OString::valueOf(rEntry.GetValue()); +} + +namespace { + +const char* getColorScaleType( ScColorScaleEntryType eType ) +{ + switch(eType) + { + case COLORSCALE_MIN: + return "min"; + case COLORSCALE_MAX: + return "max"; + case COLORSCALE_PERCENT: + return "percent"; + case COLORSCALE_FORMULA: + return "formula"; + case COLORSCALE_AUTOMIN: + return "autoMin"; + case COLORSCALE_AUTOMAX: + return "autoMax"; + case COLORSCALE_PERCENTILE: + return "percentile"; + default: + break; + } + return "num"; +} + +} + +void XclExpExtCfvo::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->singleElementNS( XML_x14, XML_cfvo, + XML_type, getColorScaleType(meType), + XML_value, maValue.getStr(), + FSEND ); +} + +XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos ): + XclExpRoot(rRoot) +{ + const ScDataBarFormatData& rFormatData = *rFormat.GetDataBarData(); + mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos ) ); + mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos ) ); + if(rFormatData.mpNegativeColor.get()) + mpNegativeColor.reset( new XclExpExtNegativeColor( *rFormatData.mpNegativeColor.get() ) ); + else + mpNegativeColor.reset( new XclExpExtNegativeColor( rFormatData.maPositiveColor ) ); + mpAxisColor.reset( new XclExpExtAxisColor( rFormatData.maAxisColor ) ); + + meAxisPosition = rFormatData.meAxisPosition; +} + +namespace { + +const char* getAxisPosition(databar::ScAxisPostion eAxisPosition) +{ + switch(eAxisPosition) + { + case databar::NONE: + return "none"; + case databar::AUTOMATIC: + return "automatic"; + case databar::MIDDLE: + return "middle"; + } + return ""; +} + +} + +void XclExpExtDataBar::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElementNS( XML_x14, XML_dataBar, + XML_minLength, rtl::OString::valueOf(0).getStr(), + XML_maxLength, rtl::OString::valueOf(100).getStr(), + XML_axisPosition, getAxisPosition(meAxisPosition), + FSEND ); + + mpLowerLimit->SaveXml( rStrm ); + mpUpperLimit->SaveXml( rStrm ); + mpNegativeColor->SaveXml( rStrm ); + mpAxisColor->SaveXml( rStrm ); + + rWorksheet->endElementNS( XML_x14, XML_dataBar ); +} + +XclExpExtCfRule::XclExpExtCfRule( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos, const rtl::OString& rId ): + XclExpRoot(rRoot), + maId(rId) +{ + maDataBar.reset( new XclExpExtDataBar( *this, rFormat, rPos ) ); +} + +void XclExpExtCfRule::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElementNS( XML_x14, XML_cfRule, + XML_type, "dataBar", + XML_id, maId.getStr(), + FSEND ); + + maDataBar->SaveXml( rStrm ); + + rWorksheet->endElementNS( XML_x14, XML_cfRule ); + +} + +XclExpExtConditionalFormatting::XclExpExtConditionalFormatting( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos, const rtl::OString& rId ): + XclExpRoot(rRoot) +{ + maCfRule.reset( new XclExpExtCfRule( *this, rFormat, rPos, rId ) ); + maRange = rFormat.GetRange(); +} + +void XclExpExtConditionalFormatting::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElementNS( XML_x14, XML_conditionalFormatting, + FSNS( XML_xmlns, XML_xm ), "http://schemas.microsoft.com/office/excel/2006/main", + FSEND ); + + maCfRule->SaveXml( rStrm ); + rWorksheet->startElementNS( XML_xm, XML_sqref, FSEND ); + rWorksheet->write(XclXmlUtils::ToOString(maRange).getStr()); + + rWorksheet->endElementNS( XML_xm, XML_sqref ); + + rWorksheet->endElementNS( XML_x14, XML_conditionalFormatting ); +} + +XclExpExtCondFormat::XclExpExtCondFormat( const XclExpRoot& rRoot ): + XclExpExt( rRoot ) +{ + maURI = rtl::OString("{78C0D931-6437-407d-A8EE-F0AAD7539E65}"); +} + +void XclExpExtCondFormat::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElement( XML_ext, + FSNS( XML_xmlns, XML_x14 ), "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", + XML_uri, maURI.getStr(), + FSEND ); + + rWorksheet->startElementNS( XML_x14, XML_conditionalFormattings, + FSEND ); + + maCF.SaveXml( rStrm ); + + rWorksheet->endElementNS( XML_x14, XML_conditionalFormattings ); + rWorksheet->endElement( XML_ext ); +} + +void XclExpExtCondFormat::AddRecord( XclExpExtConditionalFormattingRef aEntry ) +{ + maCF.AppendRecord( aEntry ); +} + +void XclExtLst::SaveXml( XclExpXmlStream& rStrm ) +{ + if(maExtEntries.IsEmpty()) + return; + + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElement( XML_extLst, + FSEND ); + + maExtEntries.SaveXml(rStrm); + + rWorksheet->endElement( XML_extLst ); +} + +void XclExtLst::AddRecord( XclExpExtRef aEntry ) +{ + maExtEntries.AppendRecord( aEntry ); +} + +XclExpExtRef XclExtLst::GetItem( XclExpExtType eType ) +{ + size_t n = maExtEntries.GetSize(); + for( size_t i = 0; i < n; ++i ) + { + if (maExtEntries.GetRecord( i )->GetType() == eType) + return maExtEntries.GetRecord( i ); + } + + return XclExpExtRef(); +} diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index d611077..89d4e01 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -41,6 +41,7 @@ #include "xehelper.hxx" #include "xecontent.hxx" #include "xeescher.hxx" +#include "xeextlst.hxx" using namespace ::oox; @@ -2184,7 +2185,8 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : mxNoteList( new XclExpNoteList ), mxMergedcells( new XclExpMergedcells( rRoot ) ), mxHyperlinkList( new XclExpHyperlinkList ), - mxDval( new XclExpDval( rRoot ) ) + mxDval( new XclExpDval( rRoot ) ), + mxExtLst( new XclExtLst( rRoot ) ) { ScDocument& rDoc = GetDoc(); SCTAB nScTab = GetCurrScTab(); @@ -2431,6 +2433,7 @@ XclExpRecordRef XclExpCellTable::CreateRecord( sal_uInt16 nRecId ) const case EXC_ID_MERGEDCELLS: xRec = mxMergedcells; break; case EXC_ID_HLINK: xRec = mxHyperlinkList; break; case EXC_ID_DVAL: xRec = mxDval; break; + case EXC_ID_EXTLST: xRec = mxExtLst; break; default: OSL_FAIL( "XclExpCellTable::CreateRecord - unknown record id" ); } return xRec; @@ -2448,6 +2451,7 @@ void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm ) { maColInfoBfr.SaveXml( rStrm ); maRowBfr.SaveXml( rStrm ); + mxExtLst->SaveXml( rStrm ); } // ============================================================================ diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index 953a347..c6388de 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -36,6 +36,7 @@ #include "xeroot.hxx" #include "xestring.hxx" #include "xeformula.hxx" +#include "xeextlst.hxx" #include "colorscale.hxx" @@ -222,7 +223,7 @@ class ScConditionalFormat; class XclExpCondfmt : public XclExpRecord, protected XclExpRoot { public: - explicit XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat ); + explicit XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat, XclExtLstRef xExtLst ); virtual ~XclExpCondfmt(); /** Returns true, if this conditional format contains at least one cell range and CF record. */ @@ -263,7 +264,7 @@ private: class XclExpDataBar : public XclExpRecord, protected XclExpRoot { public: - explicit XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority ); + explicit XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority, XclExtLstRef xExtLst ); virtual void SaveXml( XclExpXmlStream& rStrm ); private: @@ -282,7 +283,7 @@ class XclExpCondFormatBuffer : public XclExpRecordBase, protected XclExpRoot { public: /** Constructs CONDFMT and CF records containing the conditional formats of the current sheet. */ - explicit XclExpCondFormatBuffer( const XclExpRoot& rRoot ); + explicit XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtLstRef xExtLst ); /** Writes all contained CONDFMT records with their CF records. */ virtual void Save( XclExpStream& rStrm ); diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx new file mode 100644 index 0000000..57b2efe --- /dev/null +++ b/sc/source/filter/inc/xeextlst.hxx @@ -0,0 +1,139 @@ +#ifndef SC_EXCEL_EXTLST_HXX +#define SC_EXCEL_EXTLST_HXX + +#include "xerecord.hxx" +#include "xeroot.hxx" + +#include "colorscale.hxx" + +#include <boost/scoped_ptr.hpp> + +enum XclExpExtType +{ + XclExpExtDataBarType +}; + +/** + * Base class for ext entries. Extend this class to provide the needed functionality + * + * Right now the only supported subclass is XclExpExtCondFormat + */ +class XclExpExt : public XclExpRecordBase, public XclExpRoot +{ +public: + explicit XclExpExt( const XclExpRoot& rRoot ); + virtual XclExpExtType GetType() = 0; + +protected: + rtl::OString maURI; +}; + +class XclExpExtCfvo : public XclExpRecordBase, protected XclExpRoot +{ +public: + XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + +private: + ScColorScaleEntryType meType; + rtl::OString maValue; +}; + +class XclExpExtNegativeColor +{ +public: + XclExpExtNegativeColor( const Color& rColor ); + void SaveXml( XclExpXmlStream& rStrm); + +private: + Color maColor; +}; + +class XclExpExtAxisColor +{ +public: + XclExpExtAxisColor( const Color& maColor ); + void SaveXml( XclExpXmlStream& rStrm ); + +private: + Color maAxisColor; +}; + +class XclExpExtDataBar : public XclExpRecordBase, protected XclExpRoot +{ +public: + explicit XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + +private: + databar::ScAxisPostion meAxisPosition; + + boost::scoped_ptr<XclExpExtCfvo> mpLowerLimit; + boost::scoped_ptr<XclExpExtCfvo> mpUpperLimit; + boost::scoped_ptr<XclExpExtNegativeColor> mpNegativeColor; + boost::scoped_ptr<XclExpExtAxisColor> mpAxisColor; + +}; + +typedef boost::shared_ptr<XclExpExtDataBar> XclExpExtDataBarRef; + +class XclExpExtCfRule : public XclExpRecordBase, protected XclExpRoot +{ +public: + XclExpExtCfRule( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos, const rtl::OString& rId ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + +private: + XclExpExtDataBarRef maDataBar; + rtl::OString maId; +}; + +typedef boost::shared_ptr<XclExpExt> XclExpExtRef; +typedef boost::shared_ptr<XclExpExtCfRule> XclExpExtCfRuleRef; + +class XclExpExtConditionalFormatting : public XclExpRecordBase, protected XclExpRoot +{ +public: + explicit XclExpExtConditionalFormatting( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos, const rtl::OString& rId ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + +private: + XclExpExtCfRuleRef maCfRule; + ScRangeList maRange; +}; + +typedef boost::shared_ptr<XclExpExtConditionalFormatting> XclExpExtConditionalFormattingRef; + +class XclExpExtCondFormat : public XclExpExt +{ +public: + XclExpExtCondFormat( const XclExpRoot& rRoot ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + + virtual XclExpExtType GetType() { return XclExpExtDataBarType; } + + void AddRecord( XclExpExtConditionalFormattingRef aFormat ); + +private: + XclExpRecordList< XclExpExtConditionalFormatting > maCF; +}; + +class XclExtLst : public XclExpRecordBase, public XclExpRoot +{ +public: + explicit XclExtLst( const XclExpRoot& rRoot); + virtual void SaveXml( XclExpXmlStream& rStrm ); + + void AddRecord( XclExpExtRef aEntry ); + + XclExpExtRef GetItem( XclExpExtType eType ); + +private: + XclExpRecordList< XclExpExt > maExtEntries; +}; + +typedef boost::shared_ptr< XclExtLst > XclExtLstRef; + +#endif + + diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 33b7b2c..681f47b 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -38,6 +38,7 @@ #include "xestring.hxx" #include "xeformula.hxx" #include "xestyle.hxx" +#include "xeextlst.hxx" #include <boost/shared_ptr.hpp> #include <map> @@ -1051,6 +1052,7 @@ private: typedef boost::shared_ptr< XclExpMergedcells > XclExpMergedcellsRef; typedef boost::shared_ptr< XclExpHyperlinkList > XclExpHyperlinkRef; typedef boost::shared_ptr< XclExpDval > XclExpDvalRef; + typedef boost::shared_ptr< XclExtLst > XclExtLstRef; XclExpColinfoBuffer maColInfoBfr; /// Buffer for column formatting. XclExpRowBuffer maRowBfr; /// Rows and cell records. @@ -1063,6 +1065,7 @@ private: XclExpMergedcellsRef mxMergedcells; /// MERGEDCELLS record for merged cell ranges. XclExpHyperlinkRef mxHyperlinkList; /// List of HLINK records. XclExpDvalRef mxDval; /// Data validation with DVAL and DV records. + XclExtLstRef mxExtLst; }; #endif diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx index 7f36610..f60e9f3 100644 --- a/sc/source/filter/inc/xlcontent.hxx +++ b/sc/source/filter/inc/xlcontent.hxx @@ -180,6 +180,7 @@ const sal_uInt16 EXC_WQSETT_FORMATFULL = 0x0003; // (0x0804) WEBQRYTABLES const sal_uInt16 EXC_ID_WQTABLES = 0x0804; +const sal_uInt16 EXC_ID_EXTLST = 0x9988; /// it is just a random number // ============================================================================ #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits