init repo

This commit is contained in:
nikolay ivanov
2014-07-05 18:22:49 +00:00
commit a8be6b9e72
17348 changed files with 9229832 additions and 0 deletions

View File

@@ -0,0 +1,219 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_COLS_FILE_INCLUDE_H_
#define OOX_COLS_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CCol : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CCol)
CCol()
{
}
virtual ~CCol()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<col"));
if(m_oBestFit.IsInit())
{
CString sVal; sVal.Format(_T(" bestFit=\"%s\""), m_oBestFit->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oCollapsed.IsInit())
{
CString sVal; sVal.Format(_T(" collapsed=\"%s\""), m_oCollapsed->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oCustomWidth.IsInit())
{
CString sVal; sVal.Format(_T(" customWidth=\"%s\""), m_oCustomWidth->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oHidden.IsInit())
{
CString sVal; sVal.Format(_T(" hidden=\"%s\""), m_oHidden->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oMin.IsInit())
{
CString sVal; sVal.Format(_T(" min=\"%d\""), m_oMin->GetValue());
writer.WriteStringC(sVal);
}
if(m_oMax.IsInit())
{
CString sVal; sVal.Format(_T(" max=\"%d\""), m_oMax->GetValue());
writer.WriteStringC(sVal);
}
if(m_oOutlineLevel.IsInit())
{
CString sVal; sVal.Format(_T(" outlineLevel=\"%d\""), m_oOutlineLevel->GetValue());
writer.WriteStringC(sVal);
}
if(m_oPhonetic.IsInit())
{
CString sVal; sVal.Format(_T(" phonetic=\"%s\""), m_oPhonetic->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oStyle.IsInit())
{
CString sVal; sVal.Format(_T(" style=\"%d\""), m_oStyle->GetValue());
writer.WriteStringC(sVal);
}
if(m_oWidth.IsInit())
{
CString sVal; sVal.Format(_T(" width=\"%s\""), SpreadsheetCommon::WriteDouble(m_oWidth->GetValue()));
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Col;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("bestFit"), m_oBestFit)
WritingElement_ReadAttributes_Read_if ( oReader, _T("collapsed"), m_oCollapsed )
WritingElement_ReadAttributes_Read_if ( oReader, _T("customWidth"), m_oCustomWidth )
WritingElement_ReadAttributes_Read_if ( oReader, _T("hidden"), m_oHidden )
WritingElement_ReadAttributes_Read_if ( oReader, _T("max"), m_oMax )
WritingElement_ReadAttributes_Read_if ( oReader, _T("min"), m_oMin )
WritingElement_ReadAttributes_Read_if ( oReader, _T("outlineLevel"), m_oOutlineLevel )
WritingElement_ReadAttributes_Read_if ( oReader, _T("phonetic"), m_oPhonetic )
WritingElement_ReadAttributes_Read_if ( oReader, _T("style"), m_oStyle )
WritingElement_ReadAttributes_Read_if ( oReader, _T("width"), m_oWidth )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::COnOff<>> m_oBestFit;
nullable<SimpleTypes::COnOff<>> m_oCollapsed;
nullable<SimpleTypes::COnOff<>> m_oCustomWidth;
nullable<SimpleTypes::COnOff<>> m_oHidden;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMax;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMin;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevel;
nullable<SimpleTypes::COnOff<>> m_oPhonetic;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oStyle;
nullable<SimpleTypes::CDouble> m_oWidth;
};
class CCols : public WritingElementWithChilds<CCol>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CCols)
CCols()
{
}
virtual ~CCols()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
{
writer.WriteStringC(_T("<cols>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</cols>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("col") == sName )
m_arrItems.Add( new CCol( oReader ));
}
}
virtual EElementType getType () const
{
return et_Cols;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
}
}
#endif // OOX_COLS_FILE_INCLUDE_H_

View File

@@ -0,0 +1,607 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_CONDITIONALFORMATTING_FILE_INCLUDE_H_
#define OOX_CONDITIONALFORMATTING_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CConditionalFormatValueObject : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CConditionalFormatValueObject)
CConditionalFormatValueObject()
{
}
virtual ~CConditionalFormatValueObject()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (m_oType.IsInit())
{
CString sValue;
CString sRoot;
sRoot.Format(_T("<cfvo type=\"%s\""), m_oType.get());
writer.WriteStringC(sRoot);
if (m_oGte.IsInit() && false == m_oGte->ToBool())
writer.WriteStringC(_T (" gte=\"0\""));
if (m_oVal.IsInit())
{
sValue.Format(_T(" val=\"%s\""), m_oVal.get());
writer.WriteStringC(sValue);
}
writer.WriteStringC(_T("/>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
}
virtual EElementType getType () const
{
return et_ConditionalFormatValueObject;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start(oReader)
WritingElement_ReadAttributes_Read_if (oReader, _T("gte") , m_oGte)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("type") , m_oType)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("val") , m_oVal)
WritingElement_ReadAttributes_End(oReader)
}
public:
nullable<SimpleTypes::COnOff<>> m_oGte;
nullable<CString> m_oType;
nullable<CString> m_oVal;
};
class CColorScale : public WritingElementWithChilds<WritingElement>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CColorScale)
CColorScale()
{
}
virtual ~CColorScale()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (3 < m_arrItems.GetSize())
{
CString sValue;
writer.WriteStringC(_T("<colorScale>"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</colorScale>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
else if (_T("color") == sName)
m_arrItems.Add(new CColor(oReader));
}
}
virtual EElementType getType () const
{
return et_ColorScale;
}
public:
};
class CDataBar : public WritingElementWithChilds<CConditionalFormatValueObject>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CDataBar)
CDataBar()
{
}
virtual ~CDataBar()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (2 == m_arrItems.GetSize() && m_oColor.IsInit())
{
CString sValue;
writer.WriteStringC(_T("<dataBar"));
if (m_oMaxLength.IsInit())
{
sValue.Format(_T(" maxLength=\"%d\""), m_oMaxLength->GetValue());
writer.WriteStringC(sValue);
}
if (m_oMaxLength.IsInit())
{
sValue.Format(_T(" maxLength=\"%d\""), m_oMaxLength->GetValue());
writer.WriteStringC(sValue);
}
if (m_oShowValue.IsInit() && false == m_oShowValue->ToBool())
{
writer.WriteStringC(_T(" showValue=\"0\""));
}
writer.WriteStringC(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
m_oColor->toXML2(writer, _T("color"));
writer.WriteStringC(_T("</dataBar>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
else if (_T("color") == sName)
m_oColor = oReader;
}
}
virtual EElementType getType () const
{
return et_DataBar;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start(oReader)
WritingElement_ReadAttributes_Read_if (oReader, _T("maxLength") , m_oMaxLength)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("minLength") , m_oMinLength)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("showValue") , m_oShowValue)
WritingElement_ReadAttributes_End(oReader)
}
public:
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMaxLength;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinLength;
nullable<SimpleTypes::COnOff<>> m_oShowValue;
nullable<CColor> m_oColor;
};
class CFormulaCF : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CFormulaCF)
CFormulaCF()
{
}
virtual ~CFormulaCF()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<formula>"));
writer.WriteStringC(XmlUtils::EncodeXmlString(m_sText));
writer.WriteStringC(_T("</formula>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if (oReader.IsEmptyNode())
return;
m_sText = oReader.GetText2();
}
virtual EElementType getType () const
{
return et_FormulaCF;
}
public:
CString m_sText;
};
class CIconSet : public WritingElementWithChilds<CConditionalFormatValueObject>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CIconSet)
CIconSet()
{
}
virtual ~CIconSet()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (1 < m_arrItems.GetSize())
{
CString sValue;
writer.WriteStringC(_T("<iconSet"));
if (m_oIconSet.IsInit())
{
sValue.Format(_T(" iconSet=\"%s\""), m_oIconSet.get());
writer.WriteStringC(sValue);
}
if (m_oPercent.IsInit() && false == m_oPercent->ToBool())
{
writer.WriteStringC(_T(" percent=\"0\""));
}
if (m_oReverse.IsInit() && true == m_oReverse->ToBool())
{
writer.WriteStringC(_T(" reverse=\"1\""));
}
if (m_oShowValue.IsInit() && false == m_oShowValue->ToBool())
{
writer.WriteStringC(_T(" showValue=\"0\""));
}
writer.WriteStringC(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</iconSet>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
}
}
virtual EElementType getType () const
{
return et_IconSet;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start(oReader)
WritingElement_ReadAttributes_Read_if (oReader, _T("iconSet") , m_oIconSet)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("percent") , m_oPercent)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("reverse") , m_oReverse)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("showValue") , m_oShowValue)
WritingElement_ReadAttributes_End(oReader)
}
public:
nullable<CString> m_oIconSet;
nullable<SimpleTypes::COnOff<>> m_oPercent;
nullable<SimpleTypes::COnOff<>> m_oReverse;
nullable<SimpleTypes::COnOff<>> m_oShowValue;
};
class CConditionalFormattingRule : public WritingElementWithChilds<WritingElement>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CConditionalFormattingRule)
CConditionalFormattingRule()
{
}
virtual ~CConditionalFormattingRule()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (m_oType.IsInit() && m_oPriority.IsInit() && 0 < m_arrItems.GetSize())
{
CString sValue;
CString sRoot;
sRoot.Format(_T("<cfRule type=\"%s\" priority=\"%d\""), m_oType.get(), m_oPriority->GetValue());
writer.WriteStringC(sRoot);
if (m_oAboveAverage.IsInit() && false == m_oAboveAverage->ToBool())
writer.WriteStringC(_T (" aboveAverage=\"0\""));
if (m_oBottom.IsInit() && true == m_oBottom->ToBool())
writer.WriteStringC(_T (" bottom=\"1\""));
if (m_oDxfId.IsInit())
{
sValue.Format(_T(" dxfId=\"%d\""), m_oDxfId->GetValue());
writer.WriteStringC(sValue);
}
if (m_oEqualAverage.IsInit() && true == m_oEqualAverage->ToBool())
writer.WriteStringC(_T (" equalAverage=\"1\""));
if (m_oOperator.IsInit())
{
sValue.Format(_T(" text=\"%s\""), m_oOperator.get());
writer.WriteStringC(sValue);
}
if (m_oPercent.IsInit() && true == m_oPercent->ToBool())
writer.WriteStringC(_T (" percent=\"1\""));
if (m_oRank.IsInit())
{
sValue.Format(_T(" rank=\"%d\""), m_oRank->GetValue());
writer.WriteStringC(sValue);
}
if (m_oStdDev.IsInit())
{
sValue.Format(_T(" stdDev=\"%d\""), m_oStdDev->GetValue());
writer.WriteStringC(sValue);
}
if (m_oStopIfTrue.IsInit() && true == m_oStopIfTrue->ToBool())
writer.WriteStringC(_T (" stopIfTrue=\"1\""));
if (m_oText.IsInit())
{
sValue.Format(_T(" text=\"%s\""), m_oText.get());
writer.WriteStringC(sValue);
}
if (m_oTimePeriod.IsInit())
{
sValue.Format(_T(" timePeriod=\"%s\""), m_oTimePeriod.get());
writer.WriteStringC(sValue);
}
writer.WriteStringC(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</cfRule>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("colorScale") == sName)
m_arrItems.Add(new CColorScale(oReader));
else if (_T("dataBar") == sName)
m_arrItems.Add(new CDataBar(oReader));
else if (_T("formula") == sName)
m_arrItems.Add(new CFormulaCF(oReader));
else if (_T("iconSet") == sName)
m_arrItems.Add(new CIconSet(oReader));
}
}
virtual EElementType getType () const
{
return et_ConditionalFormattingRule;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start(oReader)
WritingElement_ReadAttributes_Read_if (oReader, _T("aboveAverage") , m_oAboveAverage)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("bottom") , m_oBottom)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("dxfId") , m_oDxfId)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("equalAverage") , m_oEqualAverage)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("operator") , m_oOperator)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("percent") , m_oPercent)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("priority") , m_oPriority)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("rank") , m_oRank)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("stdDev") , m_oStdDev)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("stopIfTrue") , m_oStopIfTrue)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("text") , m_oText)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("timePeriod") , m_oTimePeriod)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("type") , m_oType)
WritingElement_ReadAttributes_End(oReader)
}
public:
nullable<SimpleTypes::COnOff<>> m_oAboveAverage;
nullable<SimpleTypes::COnOff<>> m_oBottom;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oDxfId;
nullable<SimpleTypes::COnOff<>> m_oEqualAverage;
nullable<CString> m_oOperator;
nullable<SimpleTypes::COnOff<>> m_oPercent;
nullable<SimpleTypes::CDecimalNumber<>> m_oPriority;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRank;
nullable<SimpleTypes::CDecimalNumber<>> m_oStdDev;
nullable<SimpleTypes::COnOff<>> m_oStopIfTrue;
nullable<CString> m_oText;
nullable<CString> m_oTimePeriod;
nullable<CString> m_oType;
};
class CConditionalFormatting : public WritingElementWithChilds<CConditionalFormattingRule>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CConditionalFormatting)
CConditionalFormatting()
{
}
virtual ~CConditionalFormatting()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (m_oSqRef.IsInit() && 0 < m_arrItems.GetSize())
{
CString sRoot;
sRoot.Format(_T("<conditionalFormatting sqref=\"%s\""), m_oSqRef->GetValue());
writer.WriteStringC(sRoot);
if (m_oPivot.IsInit() && true == m_oPivot->ToBool())
{
writer.WriteStringC(_T (" pivot=\"1\""));
}
writer.WriteStringC(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</conditionalFormatting>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfRule") == sName)
m_arrItems.Add(new CConditionalFormattingRule(oReader));
}
}
virtual EElementType getType () const
{
return et_ConditionalFormatting;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start(oReader)
WritingElement_ReadAttributes_Read_if (oReader, _T("sqref") , m_oSqRef)
WritingElement_ReadAttributes_Read_else_if (oReader, _T("pivot") , m_oPivot)
WritingElement_ReadAttributes_End(oReader)
}
public:
nullable<SimpleTypes::COnOff<>> m_oPivot;
nullable<SimpleTypes::CRelationshipId > m_oSqRef;
};
}
}
#endif // OOX_CONDITIONALFORMATTING_FILE_INCLUDE_H_

View File

@@ -0,0 +1,184 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_HYPERLINKS_FILE_INCLUDE_H_
#define OOX_HYPERLINKS_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CHyperlink : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CHyperlink)
CHyperlink()
{
}
virtual ~CHyperlink()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<hyperlink"));
if(m_oDisplay.IsInit())
{
CString sVal; sVal.Format(_T(" display=\"%s\""), XmlUtils::EncodeXmlString(m_oDisplay.get()));
writer.WriteStringC(sVal);
}
if(m_oRid.IsInit())
{
CString sVal; sVal.Format(_T(" r:id=\"%s\""), m_oRid->GetValue());
writer.WriteStringC(sVal);
}
if(m_oLocation.IsInit())
{
CString sVal; sVal.Format(_T(" location=\"%s\""), XmlUtils::EncodeXmlString(m_oLocation.get()));
writer.WriteStringC(sVal);
}
if(m_oRef.IsInit())
{
CString sVal; sVal.Format(_T(" ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef.get()));
writer.WriteStringC(sVal);
}
if(m_oTooltip.IsInit())
{
CString sVal; sVal.Format(_T(" tooltip=\"%s\""), XmlUtils::EncodeXmlString(m_oTooltip.get()));
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Hyperlink;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("display"), m_oDisplay)
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:id"), m_oRid )
WritingElement_ReadAttributes_Read_if ( oReader, _T("location"), m_oLocation )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("tooltip"), m_oTooltip )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CString> m_oDisplay;
nullable<SimpleTypes::CRelationshipId> m_oRid;
nullable<CString> m_oLocation;
nullable<CString> m_oRef;
nullable<CString> m_oTooltip;
};
class CHyperlinks : public WritingElementWithChilds<CHyperlink>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CHyperlinks)
CHyperlinks()
{
}
virtual ~CHyperlinks()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
{
writer.WriteStringC(_T("<hyperlinks>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</hyperlinks>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("hyperlink") == sName )
m_arrItems.Add( new CHyperlink( oReader ));
}
}
virtual EElementType getType () const
{
return et_Hyperlinks;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
}
}
#endif // OOX_HYPERLINKS_FILE_INCLUDE_H_

View File

@@ -0,0 +1,170 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_MERGECELLS_FILE_INCLUDE_H_
#define OOX_MERGECELLS_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CMergeCell : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CMergeCell)
CMergeCell()
{
}
virtual ~CMergeCell()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<mergeCell"));
if(m_oRef.IsInit())
{
CString sVal; sVal.Format(_T(" ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef.get()));
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_MergeCell;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CString> m_oRef;
};
class CMergeCells : public WritingElementWithChilds<CMergeCell>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CMergeCells)
CMergeCells()
{
}
virtual ~CMergeCells()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
{
writer.WriteStringC(_T("<mergeCells"));
if(m_oCount.IsInit())
{
CString sVal; sVal.Format(_T(" count=\"%d\""), m_oCount->GetValue());
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</mergeCells>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("mergeCell") == sName )
m_arrItems.Add( new CMergeCell( oReader ));
}
}
virtual EElementType getType () const
{
return et_MergeCells;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCount;
};
}
}
#endif // OOX_MERGECELLS_FILE_INCLUDE_H_

View File

@@ -0,0 +1,495 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_SHEETDATA_FILE_INCLUDE_H_
#define OOX_SHEETDATA_FILE_INCLUDE_H_
#include "../CommonInclude.h"
#include "../SharedStrings/Si.h"
namespace OOX
{
namespace Spreadsheet
{
class CFormula : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CFormula)
CFormula()
{
}
virtual ~CFormula()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<f"));
if(m_oAca.IsInit())
{
CString sVal; sVal.Format(_T(" aca=\"%s\""), m_oAca->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oBx.IsInit())
{
CString sVal; sVal.Format(_T(" bx=\"%s\""), m_oBx->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oCa.IsInit())
{
CString sVal; sVal.Format(_T(" ca=\"%s\""), m_oCa->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oDel1.IsInit())
{
CString sVal; sVal.Format(_T(" del1=\"%s\""), m_oDel1->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oDel2.IsInit())
{
CString sVal; sVal.Format(_T(" del2=\"%s\""), m_oDel2->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oDt2D.IsInit())
{
CString sVal; sVal.Format(_T(" dt2D=\"%s\""), m_oDt2D->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oDtr.IsInit())
{
CString sVal; sVal.Format(_T(" dtr=\"%s\""), m_oDtr->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oR1.IsInit())
{
CString sVal; sVal.Format(_T(" r1=\"%s\""), m_oR1.get());
writer.WriteStringC(sVal);
}
if(m_oR2.IsInit())
{
CString sVal; sVal.Format(_T(" r2=\"%s\""), m_oR2.get());
writer.WriteStringC(sVal);
}
if(m_oRef.IsInit())
{
CString sVal; sVal.Format(_T(" ref=\"%s\""), m_oRef.get());
writer.WriteStringC(sVal);
}
if(m_oSi.IsInit())
{
CString sVal; sVal.Format(_T(" si=\"%d\""), m_oSi->GetValue());
writer.WriteStringC(sVal);
}
if(m_oT.IsInit())
{
CString sVal; sVal.Format(_T(" t=\"%s\""), m_oT->ToString());
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T(">"));
writer.WriteStringC(XmlUtils::EncodeXmlString(m_sText));
writer.WriteStringC(_T("</f>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
m_sText = oReader.GetText2();
}
virtual EElementType getType () const
{
return et_Formula;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("aca"), m_oAca )
WritingElement_ReadAttributes_Read_if ( oReader, _T("bx"), m_oBx )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ca"), m_oCa )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del1"), m_oDel1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del2"), m_oDel2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dt2D"), m_oDt2D )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dtr"), m_oDtr )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r1"), m_oR1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r2"), m_oR2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("si"), m_oSi )
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oT )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::COnOff<>> m_oAca;
nullable<SimpleTypes::COnOff<>> m_oBx;
nullable<SimpleTypes::COnOff<>> m_oCa;
nullable<SimpleTypes::COnOff<>> m_oDel1;
nullable<SimpleTypes::COnOff<>> m_oDel2;
nullable<SimpleTypes::COnOff<>> m_oDt2D;
nullable<SimpleTypes::COnOff<>> m_oDtr;
nullable<CString> m_oR1;
nullable<CString> m_oR2;
nullable<CString> m_oRef;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oSi;
nullable<SimpleTypes::Spreadsheet::CCellFormulaType<>> m_oT;
CString m_sText;
};
class CCell : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CCell)
CCell()
{
}
virtual ~CCell()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<c"));
if(m_oCellMetadata.IsInit())
{
CString sVal; sVal.Format(_T(" cm=\"%d\""), m_oCellMetadata->GetValue());
writer.WriteStringC(sVal);
}
if(m_oShowPhonetic.IsInit())
{
CString sVal; sVal.Format(_T(" ph=\"%s\""), m_oShowPhonetic->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oRef.IsInit())
{
CString sVal; sVal.Format(_T(" r=\"%s\""), m_oRef.get());
writer.WriteStringC(sVal);
}
if(m_oStyle.IsInit())
{
CString sVal; sVal.Format(_T(" s=\"%d\""), m_oStyle->GetValue());
writer.WriteStringC(sVal);
}
if(m_oType.IsInit() && SimpleTypes::Spreadsheet::celltypeNumber != m_oType->GetValue())
{
CString sVal; sVal.Format(_T(" t=\"%s\""), m_oType->ToString());
writer.WriteStringC(sVal);
}
if(m_oValueMetadata.IsInit())
{
CString sVal; sVal.Format(_T(" vm=\"%d\""), m_oValueMetadata->GetValue());
writer.WriteStringC(sVal);
}
if(m_oFormula.IsInit() || m_oRichText.IsInit() || m_oValue.IsInit())
{
writer.WriteStringC(_T(">"));
if(m_oFormula.IsInit())
m_oFormula->toXML(writer);
if(m_oRichText.IsInit())
m_oRichText->toXML2(writer);
if(m_oValue.IsInit())
m_oValue->toXML2(writer, _T("v"));
writer.WriteStringC(_T("</c>"));
}
else
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("f") == sName )
m_oFormula = oReader;
else if ( _T("is") == sName )
m_oRichText = oReader;
else if ( _T("v") == sName )
m_oValue = oReader;
}
}
virtual EElementType getType () const
{
return et_Cell;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cm"), m_oCellMetadata )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ph"), m_oShowPhonetic )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("s"), m_oStyle )
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oType )
WritingElement_ReadAttributes_Read_if ( oReader, _T("vm"), m_oValueMetadata )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCellMetadata;
nullable<SimpleTypes::COnOff<>> m_oShowPhonetic;
nullable<CString> m_oRef;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oStyle;
nullable<SimpleTypes::Spreadsheet::CCellTypeType<>> m_oType;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oValueMetadata;
nullable<CFormula> m_oFormula;
nullable<CSi> m_oRichText;
nullable<CText> m_oValue;
};
class CRow : public WritingElementWithChilds<CCell>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CRow)
CRow()
{
}
virtual ~CRow()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<row"));
if(m_oCollapsed.IsInit())
{
CString sVal; sVal.Format(_T(" collapsed=\"%s\""), m_oCollapsed->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oCustomFormat.IsInit())
{
CString sVal; sVal.Format(_T(" customFormat=\"%s\""), m_oCustomFormat->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oHt.IsInit())
{
CString sVal; sVal.Format(_T(" ht=\"%s\""), SpreadsheetCommon::WriteDouble(m_oHt->GetValue()));
writer.WriteStringC(sVal);
}
if(m_oCustomHeight.IsInit())
{
CString sVal; sVal.Format(_T(" customHeight=\"%s\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oHidden.IsInit())
{
CString sVal; sVal.Format(_T(" hidden=\"%s\""), m_oHidden->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oOutlineLevel.IsInit())
{
CString sVal; sVal.Format(_T(" outlineLevel=\"%d\""), m_oOutlineLevel->GetValue());
writer.WriteStringC(sVal);
}
if(m_oPh.IsInit())
{
CString sVal; sVal.Format(_T(" ph=\"%s\""), m_oPh->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oR.IsInit())
{
CString sVal; sVal.Format(_T(" r=\"%d\""), m_oR->GetValue());
writer.WriteStringC(sVal);
}
if(m_oS.IsInit())
{
CString sVal; sVal.Format(_T(" s=\"%d\""), m_oS->GetValue());
writer.WriteStringC(sVal);
}
if(m_oThickBot.IsInit())
{
CString sVal; sVal.Format(_T(" thickBot=\"%s\""), m_oThickBot->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oThickTop.IsInit())
{
CString sVal; sVal.Format(_T(" thickTop=\"%s\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</row>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("c") == sName )
m_arrItems.Add( new CCell( oReader ));
}
}
virtual EElementType getType () const
{
return et_Row;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("collapsed"), m_oCollapsed )
WritingElement_ReadAttributes_Read_if ( oReader, _T("customFormat"), m_oCustomFormat )
WritingElement_ReadAttributes_Read_if ( oReader, _T("customHeight"), m_oCustomHeight )
WritingElement_ReadAttributes_Read_if ( oReader, _T("hidden"), m_oHidden )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ht"), m_oHt )
WritingElement_ReadAttributes_Read_if ( oReader, _T("outlineLevel"), m_oOutlineLevel )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ph"), m_oPh )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r"), m_oR )
WritingElement_ReadAttributes_Read_if ( oReader, _T("s"), m_oS )
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickBot"), m_oThickBot )
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickTop"), m_oThickTop )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::COnOff<>> m_oCollapsed;
nullable<SimpleTypes::COnOff<>> m_oCustomFormat;
nullable<SimpleTypes::COnOff<>> m_oCustomHeight;
nullable<SimpleTypes::COnOff<>> m_oHidden;
nullable<SimpleTypes::CDouble> m_oHt;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevel;
nullable<SimpleTypes::COnOff<>> m_oPh;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oR;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oS;
nullable<SimpleTypes::COnOff<>> m_oThickBot;
nullable<SimpleTypes::COnOff<>> m_oThickTop;
};
class CSheetData : public WritingElementWithChilds<CRow>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CSheetData)
CSheetData()
{
}
virtual ~CSheetData()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<sheetData>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</sheetData>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("row") == sName )
m_arrItems.Add(new CRow( oReader ));
}
}
virtual EElementType getType () const
{
return et_SheetData;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
}
}
#endif // OOX_SHEETDATA_FILE_INCLUDE_H_

View File

@@ -0,0 +1,474 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_WORKSHEET_FILE_INCLUDE_H_
#define OOX_WORKSHEET_FILE_INCLUDE_H_
#include "../CommonInclude.h"
#include "../../DocxFormat/External/HyperLink.h"
#include "../../DocxFormat/Media/Image.h"
#include "SheetData.h"
#include "Cols.h"
#include "Hyperlinks.h"
#include "MergeCells.h"
#include "WorksheetChildOther.h"
#include "../Drawing/Drawing.h"
#include "../Chart/Chart.h"
#include "../Table/Table.h"
#include "../Comments/Comments.h"
#include "ConditionalFormatting.h"
namespace OOX
{
namespace Spreadsheet
{
class CWorksheet : public OOX::File, public OOX::Spreadsheet::IFileContainer
{
public:
CWorksheet()
{
}
CWorksheet(const CPath& oPath)
{
read( oPath );
}
virtual ~CWorksheet()
{
ClearItems();
}
public:
virtual void read(const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
CWCharWrapper sName = oReader.GetName();
if ( _T("worksheet") == sName || _T("chartsheet") == sName)
{
if ( !oReader.IsEmptyNode() )
{
int nDocumentDepth = oReader.GetDepth();
while ( oReader.ReadNextSiblingNode( nDocumentDepth ) )
{
sName = oReader.GetName();
if ( _T("cols") == sName )
m_oCols = oReader;
else if ( _T("dimension") == sName )
m_oDimension = oReader;
else if ( _T("drawing") == sName )
m_oDrawing = oReader;
else if ( _T("hyperlinks") == sName )
m_oHyperlinks = oReader;
else if ( _T("mergeCells") == sName )
m_oMergeCells = oReader;
else if ( _T("pageMargins") == sName )
m_oPageMargins = oReader;
else if ( _T("pageSetup") == sName )
m_oPageSetup = oReader;
else if ( _T("printOptions") == sName )
m_oPrintOptions = oReader;
else if ( _T("sheetData") == sName )
m_oSheetData = oReader;
else if (_T("conditionalFormatting") == sName)
m_arrConditionalFormatting.Add(new CConditionalFormatting(oReader));
else if ( _T("sheetFormatPr") == sName )
m_oSheetFormatPr = oReader;
else if ( _T("sheetViews") == sName )
m_oSheetViews = oReader;
else if ( _T("autoFilter") == sName )
m_oAutofilter = oReader;
else if ( _T("tableParts") == sName )
m_oTableParts = oReader;
else if ( _T("legacyDrawing") == sName )
m_oLegacyDrawingWorksheet = oReader;
else if (_T("sheetPr") == sName)
m_oSheetPr = oReader;
}
}
if(m_oLegacyDrawingWorksheet.IsInit() && m_oLegacyDrawingWorksheet->m_oId.IsInit())
{
OOX::RId oRId(m_oLegacyDrawingWorksheet->m_oId->GetValue());
smart_ptr<OOX::File> oLegacyDrawing = IFileContainer::Find(oRId);
smart_ptr<OOX::File> oComments = IFileContainer::Get(FileTypes::Comments);
if (oComments.IsInit() && FileTypes::Comments == oComments->type() && oLegacyDrawing.IsInit() && FileTypes::LegacyDrawings == oLegacyDrawing->type())
{
OOX::Spreadsheet::CComments* pComments = static_cast<OOX::Spreadsheet::CComments*>(oComments.operator->());
OOX::Spreadsheet::CLegacyDrawing* pLegacyDrawing = static_cast<OOX::Spreadsheet::CLegacyDrawing*>(oLegacyDrawing.operator->());
PrepareComments(pComments, pLegacyDrawing);
}
}
}
}
void PrepareComments(OOX::Spreadsheet::CComments* pComments, OOX::Spreadsheet::CLegacyDrawing* pLegacyDrawing)
{
CSimpleArray<CString*> aAuthors = pComments->m_oAuthors->m_arrItems;
if(pComments->m_oCommentList.IsInit())
{
CSimpleArray<OOX::Spreadsheet::CComment*> aComments = pComments->m_oCommentList->m_arrItems;
for(int i = 0, length = aComments.GetSize(); i < length; ++i)
{
OOX::Spreadsheet::CComment* pComment = aComments[i];
if(pComment->m_oRef.IsInit() && pComment->m_oAuthorId.IsInit())
{
int nRow, nCol;
if(parseRef(pComment->m_oRef->GetValue(), nRow, nCol))
{
CCommentItem* pCommentItem = new CCommentItem();
pCommentItem->m_nRow = nRow - 1;
pCommentItem->m_nCol = nCol - 1;
unsigned int nAuthorId = pComment->m_oAuthorId->GetValue();
if(nAuthorId < (unsigned int)aAuthors.GetSize())
pCommentItem->m_sAuthor = *aAuthors[nAuthorId];
OOX::Spreadsheet::CSi* pSi = pComment->m_oText.GetPointerEmptyNullable();
if(NULL != pSi)
pCommentItem->m_oText.reset(pSi);
CString sNewId;sNewId.Format(_T("%d-%d"), pCommentItem->m_nRow.get(), pCommentItem->m_nCol.get());
m_mapComments.SetAt(sNewId, pCommentItem);
}
}
}
}
for(int i = 0, length = pLegacyDrawing->m_arrItems.GetSize(); i < length; ++i)
{
OOX::Vml::CShape* pShape = pLegacyDrawing->m_arrItems[i];
for(int j = 0, length2 = pShape->m_arrItems.GetSize(); j < length2; ++j)
{
OOX::WritingElement* pElem = pShape->m_arrItems[j];
if( OOX::et_v_ClientData == pElem->getType())
{
OOX::Vml::CClientData* pClientData = static_cast<OOX::Vml::CClientData*>(pElem);
if(pClientData->m_oRow.IsInit() && pClientData->m_oColumn.IsInit())
{
int nRow = pClientData->m_oRow->GetValue();
int nCol = pClientData->m_oColumn->GetValue();
CString sId;sId.Format(_T("%d-%d"), nRow, nCol);
CAtlMap<CString, CCommentItem*>::CPair* pPair = m_mapComments.Lookup(sId);
if(NULL != pPair)
{
CCommentItem* pCommentItem = pPair->m_value;
if(pShape->m_oGfxData.IsInit())
pCommentItem->m_sGfxdata = pShape->m_oGfxData.get2();
if(pClientData->m_oAnchor.IsInit())
{
const CString& sAnchor = pClientData->m_oAnchor.get();
CSimpleArray<int> m_aAnchor;
int nTokenPos = 0;
CString strToken = sAnchor.Tokenize(_T(","), nTokenPos);
while (!strToken.IsEmpty())
{
strToken.Trim();
m_aAnchor.Add(_wtoi(strToken));
strToken = sAnchor.Tokenize(_T(","), nTokenPos);
}
if(8 == m_aAnchor.GetSize())
{
pCommentItem->m_nLeft = m_aAnchor[0];
pCommentItem->m_nLeftOffset = m_aAnchor[1];
pCommentItem->m_nTop = m_aAnchor[2];
pCommentItem->m_nTopOffset = m_aAnchor[3];
pCommentItem->m_nRight = m_aAnchor[4];
pCommentItem->m_nRightOffset = m_aAnchor[5];
pCommentItem->m_nBottom = m_aAnchor[6];
pCommentItem->m_nBottomOffset = m_aAnchor[7];
}
}
if(pClientData->m_oMoveWithCells.IsInit())
pCommentItem->m_bMove = pClientData->m_oMoveWithCells->ToBool();
if(pClientData->m_oSizeWithCells.IsInit())
pCommentItem->m_bSize = pClientData->m_oSizeWithCells->ToBool();
for(int k = 0 ,length3 = pShape->m_oStyle->m_arrProperties.GetSize(); k < length3; ++k)
{
SimpleTypes::Vml::CCssProperty oProperty = pShape->m_oStyle->m_arrProperties[k];
if(SimpleTypes::Vml::cssptMarginLeft == oProperty.get_Type())
{
SimpleTypes::Vml::UCssValue oUCssValue= oProperty.get_Value();
if(SimpleTypes::Vml::cssunitstypeUnits == oUCssValue.oValue.eType)
{
SimpleTypes::CPoint oPoint;
oPoint.FromPoints(oUCssValue.oValue.dValue);
pCommentItem->m_dLeftMM = oPoint.ToMm();
}
}
else if(SimpleTypes::Vml::cssptMarginTop == oProperty.get_Type())
{
SimpleTypes::Vml::UCssValue oUCssValue= oProperty.get_Value();
if(SimpleTypes::Vml::cssunitstypeUnits == oUCssValue.oValue.eType)
{
SimpleTypes::CPoint oPoint;
oPoint.FromPoints(oUCssValue.oValue.dValue);
pCommentItem->m_dTopMM = oPoint.ToMm();
}
}
else if(SimpleTypes::Vml::cssptWidth == oProperty.get_Type())
{
SimpleTypes::Vml::UCssValue oUCssValue= oProperty.get_Value();
if(SimpleTypes::Vml::cssunitstypeUnits == oUCssValue.oValue.eType)
{
SimpleTypes::CPoint oPoint;
oPoint.FromPoints(oUCssValue.oValue.dValue);
pCommentItem->m_dWidthMM = oPoint.ToMm();
}
}
else if(SimpleTypes::Vml::cssptHeight == oProperty.get_Type())
{
SimpleTypes::Vml::UCssValue oUCssValue= oProperty.get_Value();
if(SimpleTypes::Vml::cssunitstypeUnits == oUCssValue.oValue.eType)
{
SimpleTypes::CPoint oPoint;
oPoint.FromPoints(oUCssValue.oValue.dValue);
pCommentItem->m_dHeightMM = oPoint.ToMm();
}
}
}
}
}
}
}
}
}
void PrepareToWrite()
{
if(false == m_oSheetFormatPr.IsInit())
m_oSheetFormatPr.Init();
if(false == m_oSheetFormatPr->m_oDefaultRowHeight.IsInit())
{
m_oSheetFormatPr->m_oDefaultRowHeight.Init();
m_oSheetFormatPr->m_oDefaultRowHeight->SetValue(15);
}
if(false == m_oSheetViews.IsInit())
m_oSheetViews.Init();
if(0 == m_oSheetViews->m_arrItems.GetSize())
m_oSheetViews->m_arrItems.Add(new CSheetView());
CSheetView* pSheetView = m_oSheetViews->m_arrItems[0];
if(false == pSheetView->m_oWorkbookViewId.IsInit())
{
pSheetView->m_oWorkbookViewId.Init();
pSheetView->m_oWorkbookViewId->SetValue(0);
}
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
CStringWriter sXml;
sXml.WriteStringC(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" mc:Ignorable=\"x14ac\" xmlns:x14ac=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\">"));
if(m_oSheetPr.IsInit())
m_oSheetPr->toXML(sXml);
if(m_oSheetViews.IsInit())
m_oSheetViews->toXML(sXml);
if(m_oSheetFormatPr.IsInit())
m_oSheetFormatPr->toXML(sXml);
if(m_oCols.IsInit())
m_oCols->toXML(sXml);
if(m_oSheetData.IsInit())
m_oSheetData->toXML(sXml);
for (int nIndex = 0, nLength = (int)m_arrConditionalFormatting.GetCount(); nIndex < nLength; ++nIndex)
m_arrConditionalFormatting[nIndex]->toXML();
if(m_oAutofilter.IsInit())
m_oAutofilter->toXML(sXml);
if(m_oMergeCells.IsInit())
m_oMergeCells->toXML(sXml);
if(m_oHyperlinks.IsInit())
m_oHyperlinks->toXML(sXml);
if(m_oPrintOptions.IsInit())
m_oPrintOptions->toXML(sXml);
if(m_oPageMargins.IsInit())
m_oPageMargins->toXML(sXml);
if(m_oPageSetup.IsInit())
m_oPageSetup->toXML(sXml);
if(m_oDrawing.IsInit())
m_oDrawing->toXML(sXml);
if(m_oLegacyDrawingWorksheet.IsInit())
m_oLegacyDrawingWorksheet->toXML(sXml);
if(m_oTableParts.IsInit())
m_oTableParts->toXML(sXml);
sXml.WriteStringC(_T("</worksheet>"));
CDirectory::SaveToFile( oPath.GetPath(), sXml.GetCString() );
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::Worksheet;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
const OOX::RId AddHyperlink (CString& sHref)
{
smart_ptr<OOX::HyperLink> oHyperlink = smart_ptr<OOX::HyperLink>( new OOX::HyperLink( OOX::CPath(sHref, false) ) );
CString sExistRId = IsExistHyperlink(oHyperlink);
if(sExistRId.IsEmpty())
{
smart_ptr<OOX::File> oHyperlinkFile = oHyperlink.smart_dynamic_cast<OOX::File>();
const OOX::RId rId = Add( oHyperlinkFile );
return rId;
}
else
{
const OOX::RId rId(sExistRId);
return rId;
}
}
static bool parseRef(CString sRef, int& nRow, int& nCol)
{
bool bRes = false;
nRow = 0;
nCol = 0;
int nLegnth = sRef.GetLength();
if(nLegnth > 0)
{
int nIndex = 0;
sRef.MakeUpper();
TCHAR cCurLetter = sRef[nIndex];
while('A' <= cCurLetter && cCurLetter <= 'Z' && nIndex < nLegnth)
{
nIndex++;
cCurLetter = sRef[nIndex];
}
if(nIndex > 0)
{
CString sAdd = sRef.Left(nIndex);
CString sDig = sRef.Right(nLegnth - nIndex);
for(int i = 0, length = sAdd.GetLength(); i < length; ++i)
{
nCol = nCol * 26 + sAdd[i] - 'A' + 1;
}
nRow = _wtoi(sDig);
bRes = true;
}
}
return bRes;
}
static CString combineRef(int nRow, int nCol)
{
nRow++;
CString sRes;
if (nCol >= 702) {
int nDig = (nCol / 676 - 1) % 26;
sRes.AppendChar('A' + nDig);
}
if (nCol >= 26) {
int nDig = (nCol / 26 - 1) % 26;
sRes.AppendChar('A' + nDig);
}
sRes.AppendChar('A' + (nCol % 26));
sRes.AppendFormat(_T("%d"), nRow);
return sRes;
}
private:
void ClearItems()
{
POSITION pos = m_mapComments.GetStartPosition();
while ( NULL != pos )
{
CAtlMap<CString, CCommentItem*>::CPair* pPair = m_mapComments.GetNext( pos );
delete pPair->m_value;
}
m_mapComments.RemoveAll();
m_arrConditionalFormatting.FreeAll();
}
private:
CPath m_oReadPath;
public:
nullable<OOX::Spreadsheet::CCols> m_oCols;
nullable<OOX::Spreadsheet::CDimension> m_oDimension;
nullable<OOX::Spreadsheet::CDrawingWorksheet> m_oDrawing;
nullable<OOX::Spreadsheet::CHyperlinks> m_oHyperlinks;
nullable<OOX::Spreadsheet::CMergeCells> m_oMergeCells;
nullable<OOX::Spreadsheet::CSheetData> m_oSheetData;
nullable<OOX::Spreadsheet::CSheetFormatPr> m_oSheetFormatPr;
nullable<OOX::Spreadsheet::CSheetViews> m_oSheetViews;
nullable<OOX::Spreadsheet::CPageMargins> m_oPageMargins;
nullable<OOX::Spreadsheet::CPageSetup> m_oPageSetup;
nullable<OOX::Spreadsheet::CPrintOptions> m_oPrintOptions;
nullable<OOX::Spreadsheet::CAutofilter> m_oAutofilter;
nullable<OOX::Spreadsheet::CTableParts> m_oTableParts;
nullable<OOX::Spreadsheet::CLegacyDrawingWorksheet> m_oLegacyDrawingWorksheet;
CAtlMap<CString, CCommentItem*> m_mapComments;
CPtrAtlArray<OOX::Spreadsheet::CConditionalFormatting*> m_arrConditionalFormatting;
nullable<OOX::Spreadsheet::CSheetPr> m_oSheetPr;
};
}
}
#endif // OOX_WORKSHEET_FILE_INCLUDE_H_

View File

@@ -0,0 +1,835 @@
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_WORKSHEETCHILDSOTHER_FILE_INCLUDE_H_
#define OOX_WORKSHEETCHILDSOTHER_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CPageMargins : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPageMargins)
CPageMargins()
{
}
virtual ~CPageMargins()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_oLeft.IsInit() || m_oTop.IsInit() || m_oRight.IsInit() || m_oBottom.IsInit() || m_oHeader.IsInit() || m_oFooter.IsInit())
{
writer.WriteStringC(CString(_T("<pageMargins")));
if(m_oLeft.IsInit())
{
CString sLeft;
sLeft.Format(_T(" left=\"%s\""), SpreadsheetCommon::WriteDouble(m_oLeft->ToInches()));
writer.WriteStringC(sLeft);
}
if(m_oRight.IsInit())
{
CString sRight;
sRight.Format(_T(" right=\"%s\""), SpreadsheetCommon::WriteDouble(m_oRight->ToInches()));
writer.WriteStringC(sRight);
}
if(m_oTop.IsInit())
{
CString sTop;
sTop.Format(_T(" top=\"%s\""), SpreadsheetCommon::WriteDouble(m_oTop->ToInches()));
writer.WriteStringC(sTop);
}
if(m_oBottom.IsInit())
{
CString sBottom;
sBottom.Format(_T(" bottom=\"%s\""), SpreadsheetCommon::WriteDouble(m_oBottom->ToInches()));
writer.WriteStringC(sBottom);
}
if(m_oHeader.IsInit())
{
CString sHeader;
sHeader.Format(_T(" header=\"%s\""), SpreadsheetCommon::WriteDouble(m_oHeader->ToInches()));
writer.WriteStringC(sHeader);
}
if(m_oFooter.IsInit())
{
CString sFooter;
sFooter.Format(_T(" footer=\"%s\""), SpreadsheetCommon::WriteDouble(m_oFooter->ToInches()));
writer.WriteStringC(sFooter);
}
writer.WriteStringC(CString(_T("/>")));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_PageMargins;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("left"), m_oLeft)
WritingElement_ReadAttributes_Read_if ( oReader, _T("top"), m_oTop)
WritingElement_ReadAttributes_Read_if ( oReader, _T("right"), m_oRight)
WritingElement_ReadAttributes_Read_if ( oReader, _T("bottom"), m_oBottom)
WritingElement_ReadAttributes_Read_if ( oReader, _T("header"), m_oHeader)
WritingElement_ReadAttributes_Read_if ( oReader, _T("footer"), m_oFooter)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CInch> m_oLeft;
nullable<SimpleTypes::CInch> m_oTop;
nullable<SimpleTypes::CInch> m_oRight;
nullable<SimpleTypes::CInch> m_oBottom;
nullable<SimpleTypes::CInch> m_oHeader;
nullable<SimpleTypes::CInch> m_oFooter;
};
class CPageSetup : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPageSetup)
CPageSetup()
{
}
virtual ~CPageSetup()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_oPaperSize.IsInit() || m_oOrientation.IsInit())
{
writer.WriteStringC(CString(_T("<pageSetup")));
if(m_oPaperSize.IsInit())
{
CString sPaperSize;
sPaperSize.Format(_T(" paperSize=\"%s\""), m_oPaperSize->ToString());
writer.WriteStringC(sPaperSize);
}
if(m_oOrientation.IsInit())
{
CString sOrientation;
sOrientation.Format(_T(" orientation=\"%s\""), m_oOrientation->ToString());
writer.WriteStringC(sOrientation);
}
writer.WriteStringC(CString(_T("/>")));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_PageSetup;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("orientation"), m_oOrientation)
WritingElement_ReadAttributes_Read_if ( oReader, _T("paperSize"), m_oPaperSize)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CPageOrientation<>> m_oOrientation;
nullable<SimpleTypes::Spreadsheet::CPageSize<>> m_oPaperSize;
};
class CPrintOptions : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPrintOptions)
CPrintOptions()
{
}
virtual ~CPrintOptions()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_oGridLines.IsInit() || m_oGridLinesSet.IsInit() || m_oHeadings.IsInit())
{
writer.WriteStringC(CString(_T("<printOptions")));
if(m_oHeadings.IsInit())
{
CString sHeadings;
sHeadings.Format(_T(" headings=\"%s\""), m_oHeadings->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sHeadings);
}
if(m_oGridLines.IsInit())
{
CString sGridLines;
sGridLines.Format(_T(" gridLines=\"%s\""), m_oGridLines->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sGridLines);
}
if(m_oGridLinesSet.IsInit())
{
CString sGridLinesSet;
sGridLinesSet.Format(_T(" gridLinesSet=\"%s\""), m_oGridLinesSet->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sGridLinesSet);
}
writer.WriteStringC(CString(_T("/>")));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_PrintOptions;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("gridLines"), m_oGridLines)
WritingElement_ReadAttributes_Read_if ( oReader, _T("gridLinesSet"), m_oGridLinesSet)
WritingElement_ReadAttributes_Read_if ( oReader, _T("headings"), m_oHeadings)
WritingElement_ReadAttributes_Read_if ( oReader, _T("horizontalCentered"), m_oHorizontalCentered)
WritingElement_ReadAttributes_Read_if ( oReader, _T("verticalCentered"), m_oVerticalCentered)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::COnOff<>> m_oGridLines;
nullable<SimpleTypes::COnOff<>> m_oGridLinesSet;
nullable<SimpleTypes::COnOff<>> m_oHeadings;
nullable<SimpleTypes::COnOff<>> m_oHorizontalCentered;
nullable<SimpleTypes::COnOff<>> m_oVerticalCentered;
};
class CDimension : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CDimension)
CDimension()
{
}
virtual ~CDimension()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Dimension;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CString> m_oRef;
};
class CSheetFormatPr : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CSheetFormatPr)
CSheetFormatPr()
{
}
virtual ~CSheetFormatPr()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<sheetFormatPr"));
if(m_oBaseColWidth.IsInit())
{
CString sVal; sVal.Format(_T(" baseColWidth=\"%d\""), m_oBaseColWidth->GetValue());
writer.WriteStringC(sVal);
}
if(m_oCustomHeight.IsInit())
{
CString sVal; sVal.Format(_T(" customHeight=\"%s\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oDefaultColWidth.IsInit())
{
CString sVal; sVal.Format(_T(" defaultColWidth=\"%s\""), SpreadsheetCommon::WriteDouble(m_oDefaultColWidth->GetValue()));
writer.WriteStringC(sVal);
}
if(m_oDefaultRowHeight.IsInit())
{
CString sVal; sVal.Format(_T(" defaultRowHeight=\"%s\""), SpreadsheetCommon::WriteDouble(m_oDefaultRowHeight->GetValue()));
writer.WriteStringC(sVal);
}
if(m_oOutlineLevelCol.IsInit())
{
CString sVal; sVal.Format(_T(" outlineLevelCol=\"%d\""), m_oOutlineLevelCol->GetValue());
writer.WriteStringC(sVal);
}
if(m_oOutlineLevelRow.IsInit())
{
CString sVal; sVal.Format(_T(" outlineLevelRow=\"%d\""), m_oOutlineLevelRow->GetValue());
writer.WriteStringC(sVal);
}
if(m_oThickBottom.IsInit())
{
CString sVal; sVal.Format(_T(" thickBottom=\"%s\""), m_oThickBottom->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oThickTop.IsInit())
{
CString sVal; sVal.Format(_T(" thickTop=\"%s\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oZeroHeight.IsInit())
{
CString sVal; sVal.Format(_T(" zeroHeight=\"%s\""), m_oZeroHeight->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_SheetFormatPr;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("baseColWidth"), m_oBaseColWidth)
WritingElement_ReadAttributes_Read_if ( oReader, _T("customHeight"), m_oCustomHeight )
WritingElement_ReadAttributes_Read_if ( oReader, _T("defaultColWidth"), m_oDefaultColWidth )
WritingElement_ReadAttributes_Read_if ( oReader, _T("defaultRowHeight"), m_oDefaultRowHeight )
WritingElement_ReadAttributes_Read_if ( oReader, _T("outlineLevelCol"), m_oOutlineLevelCol )
WritingElement_ReadAttributes_Read_if ( oReader, _T("outlineLevelRow"), m_oOutlineLevelRow )
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickBottom"), m_oThickBottom )
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickTop"), m_oThickTop )
WritingElement_ReadAttributes_Read_if ( oReader, _T("zeroHeight"), m_oZeroHeight )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oBaseColWidth;
nullable<SimpleTypes::COnOff<>> m_oCustomHeight;
nullable<SimpleTypes::CDouble> m_oDefaultColWidth;
nullable<SimpleTypes::CDouble> m_oDefaultRowHeight;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevelCol;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevelRow;
nullable<SimpleTypes::COnOff<>> m_oThickBottom;
nullable<SimpleTypes::COnOff<>> m_oThickTop;
nullable<SimpleTypes::COnOff<>> m_oZeroHeight;
};
class CPane : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPane)
CPane()
{
}
virtual ~CPane()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Pane;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("activePane") , m_oActivePane)
WritingElement_ReadAttributes_Read_if ( oReader, _T("state") , m_oState)
WritingElement_ReadAttributes_Read_if ( oReader, _T("topLeftCell") , m_oTopLeftCell)
WritingElement_ReadAttributes_Read_if ( oReader, _T("xSplit") , m_oXSplit)
WritingElement_ReadAttributes_Read_if ( oReader, _T("ySplit") , m_oYSplit)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CString> m_oActivePane;
nullable<CString> m_oState;
nullable<CString> m_oTopLeftCell;
nullable<SimpleTypes::CDouble> m_oXSplit;
nullable<SimpleTypes::CDouble> m_oYSplit;
};
class CSheetView : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CSheetView)
CSheetView()
{
}
virtual ~CSheetView()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<sheetView"));
if(m_oColorId.IsInit())
{
CString sVal; sVal.Format(_T(" colorId=\"%d\""), m_oColorId->GetValue());
writer.WriteStringC(sVal);
}
if(m_oDefaultGridColor.IsInit())
{
CString sVal; sVal.Format(_T(" defaultGridColor=\"%s\""), m_oDefaultGridColor->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oRightToLeft.IsInit())
{
CString sVal; sVal.Format(_T(" rightToLeft=\"%s\""), m_oRightToLeft->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowFormulas.IsInit())
{
CString sVal; sVal.Format(_T(" showFormulas=\"%s\""), m_oShowFormulas->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowGridLines.IsInit())
{
CString sVal; sVal.Format(_T(" showGridLines=\"%s\""), m_oShowGridLines->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowOutlineSymbols.IsInit())
{
CString sVal; sVal.Format(_T(" showOutlineSymbols=\"%s\""), m_oShowOutlineSymbols->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowRowColHeaders.IsInit())
{
CString sVal; sVal.Format(_T(" showRowColHeaders=\"%s\""), m_oShowRowColHeaders->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowRuler.IsInit())
{
CString sVal; sVal.Format(_T(" showRuler=\"%s\""), m_oShowRuler->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowWhiteSpace.IsInit())
{
CString sVal; sVal.Format(_T(" showWhiteSpace=\"%s\""), m_oShowWhiteSpace->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oShowZeros.IsInit())
{
CString sVal; sVal.Format(_T(" showZeros=\"%s\""), m_oShowZeros->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oWabSelected.IsInit())
{
CString sVal; sVal.Format(_T(" tabSelected=\"%s\""), m_oWabSelected->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oTopLeftCell.IsInit())
{
CString sVal; sVal.Format(_T(" topLeftCell=\"%s\""), m_oTopLeftCell.get());
writer.WriteStringC(sVal);
}
if(m_oView.IsInit())
{
CString sVal; sVal.Format(_T(" view=\"%s\""), m_oView->ToString());
writer.WriteStringC(sVal);
}
if(m_oWindowProtection.IsInit())
{
CString sVal; sVal.Format(_T(" windowProtection=\"%s\""), m_oWindowProtection->ToString2(SimpleTypes::onofftostring1));
writer.WriteStringC(sVal);
}
if(m_oWorkbookViewId.IsInit())
{
CString sVal; sVal.Format(_T(" workbookViewId=\"%d\""), m_oWorkbookViewId->GetValue());
writer.WriteStringC(sVal);
}
if(m_oZoomScale.IsInit())
{
CString sVal; sVal.Format(_T(" zoomScale=\"%d\""), m_oZoomScale->GetValue());
writer.WriteStringC(sVal);
}
if(m_oZoomScaleNormal.IsInit())
{
CString sVal; sVal.Format(_T(" zoomScaleNormal=\"%d\""), m_oZoomScaleNormal->GetValue());
writer.WriteStringC(sVal);
}
if(m_oZoomScalePageLayoutView.IsInit())
{
CString sVal; sVal.Format(_T(" zoomScalePageLayoutView=\"%d\""), m_oZoomScalePageLayoutView->GetValue());
writer.WriteStringC(sVal);
}
if(m_oZoomScaleSheetLayoutView.IsInit())
{
CString sVal; sVal.Format(_T(" zoomScaleSheetLayoutView=\"%d\""), m_oZoomScaleSheetLayoutView->GetValue());
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if (oReader.IsEmptyNode())
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
CWCharWrapper sName = oReader.GetName();
if (_T("pane") == sName)
m_oPane = oReader;
}
}
virtual EElementType getType () const
{
return et_SheetView;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("colorId"), m_oColorId)
WritingElement_ReadAttributes_Read_if ( oReader, _T("defaultGridColor"), m_oDefaultGridColor)
WritingElement_ReadAttributes_Read_if ( oReader, _T("rightToLeft"), m_oRightToLeft)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showFormulas"), m_oShowFormulas)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showGridLines"), m_oShowGridLines)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showOutlineSymbols"), m_oShowOutlineSymbols)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showRowColHeaders"), m_oShowRowColHeaders)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showRuler"), m_oShowRuler)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showWhiteSpace"), m_oShowWhiteSpace)
WritingElement_ReadAttributes_Read_if ( oReader, _T("showZeros"), m_oShowZeros)
WritingElement_ReadAttributes_Read_if ( oReader, _T("tabSelected"), m_oWabSelected)
WritingElement_ReadAttributes_Read_if ( oReader, _T("topLeftCell"), m_oTopLeftCell)
WritingElement_ReadAttributes_Read_if ( oReader, _T("view"), m_oView)
WritingElement_ReadAttributes_Read_if ( oReader, _T("windowProtection"), m_oWindowProtection)
WritingElement_ReadAttributes_Read_if ( oReader, _T("workbookViewId"), m_oWorkbookViewId)
WritingElement_ReadAttributes_Read_if ( oReader, _T("zoomScale"), m_oZoomScale)
WritingElement_ReadAttributes_Read_if ( oReader, _T("zoomScaleNormal"), m_oZoomScaleNormal)
WritingElement_ReadAttributes_Read_if ( oReader, _T("zoomScalePageLayoutView"), m_oZoomScalePageLayoutView)
WritingElement_ReadAttributes_Read_if ( oReader, _T("zoomScaleSheetLayoutView"), m_oZoomScaleSheetLayoutView)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CPane> m_oPane;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oColorId;
nullable<SimpleTypes::COnOff<>> m_oDefaultGridColor;
nullable<SimpleTypes::COnOff<>> m_oRightToLeft;
nullable<SimpleTypes::COnOff<>> m_oShowFormulas;
nullable<SimpleTypes::COnOff<>> m_oShowGridLines;
nullable<SimpleTypes::COnOff<>> m_oShowOutlineSymbols;
nullable<SimpleTypes::COnOff<>> m_oShowRowColHeaders;
nullable<SimpleTypes::COnOff<>> m_oShowRuler;
nullable<SimpleTypes::COnOff<>> m_oShowWhiteSpace;
nullable<SimpleTypes::COnOff<>> m_oShowZeros;
nullable<SimpleTypes::COnOff<>> m_oWabSelected;
nullable<CString> m_oTopLeftCell;
nullable<SimpleTypes::Spreadsheet::CSheetViewType<>>m_oView;
nullable<SimpleTypes::COnOff<>> m_oWindowProtection;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oWorkbookViewId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScale;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScaleNormal;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScalePageLayoutView;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScaleSheetLayoutView;
};
class CSheetViews : public WritingElementWithChilds<CSheetView>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CSheetViews)
CSheetViews()
{
}
virtual ~CSheetViews()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
{
writer.WriteStringC(_T("<sheetViews>"));
for(int i = 0, length = m_arrItems.GetSize(); i< length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteStringC(_T("</sheetViews>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("sheetView") == sName )
m_arrItems.Add( new CSheetView( oReader ));
}
}
virtual EElementType getType () const
{
return et_SheetViews;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
};
class CSheetPr : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CSheetPr)
CSheetPr()
{
}
virtual ~CSheetPr()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if (m_oTabColor.IsInit())
{
writer.WriteStringC(_T("<sheetPr>"));
m_oTabColor->toXML2(writer, _T("tabColor"));
writer.WriteStringC(_T("</sheetPr>"));
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("tabColor") == sName )
m_oTabColor = oReader;
}
}
virtual EElementType getType () const
{
return et_SheetPr;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("codeName"), m_oCodeName )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("enableFormatConditionsCalculation"), m_oEnableFormatConditionsCalculation )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("filterMode"), m_oFilterMode )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("published"), m_oPublished )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("syncHorizontal"), m_oSyncHorizontal )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("syncRef"), m_oSyncRef )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("syncVertical"), m_oSyncVertical )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("transitionEntry"), m_oTransitionEntry )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("transitionEvaluation"), m_oTransitionEvaluation )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<CColor> m_oTabColor;
nullable<CString> m_oCodeName;
nullable<SimpleTypes::COnOff<>> m_oEnableFormatConditionsCalculation;
nullable<SimpleTypes::COnOff<>> m_oFilterMode;
nullable<SimpleTypes::COnOff<>> m_oPublished;
nullable<SimpleTypes::COnOff<>> m_oSyncHorizontal;
nullable<CString> m_oSyncRef;
nullable<SimpleTypes::COnOff<>> m_oSyncVertical;
nullable<SimpleTypes::COnOff<>> m_oTransitionEntry;
nullable<SimpleTypes::COnOff<>> m_oTransitionEvaluation;
};
}
}
#endif // OOX_WORKSHEETCHILDSOTHER_FILE_INCLUDE_H_