Kaydet (Commit) ce26903f authored tarafından Markus Mohrhard's avatar Markus Mohrhard

export icon set data into OOXML

missing are still the Excel2010 extLst entries

Change-Id: Ic0c728613b1ee48482cbd9cef2aeccd0e0f25f72
üst 29c53246
......@@ -316,10 +316,6 @@ struct ScIconSetFormatData
class SC_DLLPUBLIC ScIconSetFormat : public ScColorFormat
{
private:
typedef boost::ptr_vector<ScColorScaleEntry>::iterator iterator;
typedef boost::ptr_vector<ScColorScaleEntry>::const_iterator const_iterator;
public:
ScIconSetFormat(ScDocument* pDoc);
ScIconSetFormat(ScDocument* pDoc, const ScIconSetFormat& rFormat);
......@@ -340,15 +336,19 @@ public:
static ScIconSetMap* getIconSetMap();
#if DUMP_FORMAT_INFO
virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
#endif
private:
typedef boost::ptr_vector<ScColorScaleEntry>::iterator iterator;
typedef boost::ptr_vector<ScColorScaleEntry>::const_iterator const_iterator;
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
#if DUMP_FORMAT_INFO
virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
#endif
private:
double GetMinValue() const;
double GetMaxValue() const;
double CalcValue(double nMin, double nMax, ScIconSetFormat::const_iterator& itr) const;
......
......@@ -988,6 +988,8 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat
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, xExtLst ) );
else if(pFormatEntry->GetType() == condformat::ICONSET)
maCFList.AppendNewRecord( new XclExpIconSet( GetRoot(), static_cast<const ScIconSetFormat&>(*pFormatEntry), nIndex ) );
}
aScRanges.Format( msSeqRef, SCA_VALID, NULL, formula::FormulaGrammar::CONV_XL_A1 );
}
......@@ -1173,6 +1175,63 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm )
}
XclExpIconSet::XclExpIconSet( const XclExpRoot& rRoot, const ScIconSetFormat& rFormat, sal_Int32 nPriority ):
XclExpRecord(),
XclExpRoot( rRoot ),
mrFormat( rFormat ),
mnPriority( nPriority )
{
const ScRange* pRange = rFormat.GetRange().front();
ScAddress aAddr = pRange->aStart;
for(ScIconSetFormat::const_iterator itr = rFormat.begin();
itr != rFormat.end(); ++itr)
{
// exact position is not important, we allow only absolute refs
XclExpCfvoList::RecordRefType xCfvo( new XclExpCfvo( GetRoot(), *itr, aAddr ) );
maCfvoList.AppendRecord( xCfvo );
}
}
namespace {
const char* getIconSetName( ScIconSetType eType )
{
ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
for(; pMap->pName; ++pMap)
{
if(pMap->eType == eType)
return pMap->pName;
}
return "";
}
}
void XclExpIconSet::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_cfRule,
XML_type, "iconSet",
XML_priority, OString::valueOf( mnPriority + 1 ).getStr(),
FSEND );
const char* pIconSetName = getIconSetName(mrFormat.GetIconSetData()->eIconSetType);
rWorksheet->startElement( XML_iconSet,
XML_iconSet, pIconSetName,
FSEND );
maCfvoList.SaveXml( rStrm );
rWorksheet->endElement( XML_iconSet );
rWorksheet->endElement( XML_cfRule );
// OOXTODO: XML_extLst
}
// ----------------------------------------------------------------------------
XclExpCondFormatBuffer::XclExpCondFormatBuffer( const XclExpRoot& rRoot, XclExtLstRef xExtLst ) :
......
......@@ -277,6 +277,20 @@ private:
rtl::OString maGuid;
};
class XclExpIconSet : public XclExpRecord, protected XclExpRoot
{
public:
explicit XclExpIconSet( const XclExpRoot& rRoot, const ScIconSetFormat& rFormat, sal_Int32 nPriority );
virtual void SaveXml( XclExpXmlStream& rStrm );
private:
typedef XclExpRecordList< XclExpCfvo > XclExpCfvoList;
XclExpCfvoList maCfvoList;
const ScIconSetFormat& mrFormat;
sal_Int32 mnPriority;
};
// ----------------------------------------------------------------------------
/** Contains all conditional formats of a specific sheet. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment