init repo
This commit is contained in:
1079
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/BasicChart.h
Normal file
1079
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/BasicChart.h
Normal file
File diff suppressed because it is too large
Load Diff
310
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Chart.h
Normal file
310
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Chart.h
Normal file
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
* (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_CHART_FILE_INCLUDE_H_
|
||||
#define OOX_CHART_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "Title.h"
|
||||
#include "Legend.h"
|
||||
#include "PlotArea.h"
|
||||
#include "ChartStyle.h"
|
||||
#include "../../DocxFormat/Logic/AlternateContent.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
static TCHAR* gc_sChartArea = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:areaChart><c:varyColors val=\"0\"/>%s%s%s<c:dLbls><c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:axId val=\"7622\"/><c:axId val=\"5026\"/></c:areaChart><c:catAx><c:axId val=\"7622\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"b\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"5026\"/><c:crossesAt val=\"0\"/><c:lblAlgn val=\"ctr\"/><c:auto val=\"1\"/><c:lblOffset val=\"100\"/></c:catAx><c:valAx><c:axId val=\"5026\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"l\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"7622\"/><c:crossesAt val=\"0\"/></c:valAx></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
static TCHAR* gc_sChartLine = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:lineChart><c:varyColors val=\"0\"/>%s%s%s<c:dLbls><c:dLblPos val=\"t\"/><c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:marker val=\"1\"/><c:axId val=\"3375\"/><c:axId val=\"13466\"/></c:lineChart><c:catAx><c:axId val=\"3375\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"b\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"13466\"/><c:crossesAt val=\"0\"/><c:lblAlgn val=\"ctr\"/><c:auto val=\"1\"/><c:lblOffset val=\"100\"/></c:catAx><c:valAx><c:axId val=\"13466\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"l\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"3375\"/><c:crossesAt val=\"0\"/></c:valAx></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
static TCHAR* gc_sChartPie = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:pieChart><c:varyColors val=\"1\"/>%s%s%s<c:dLbls><c:dLblPos val=\"outEnd\"/><c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:firstSliceAng val=\"0\"/></c:pieChart></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
static TCHAR* gc_sChartScatter = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:scatterChart><c:scatterStyle val=\"lineMarker\"/><c:varyColors val=\"0\" />%s%s%s<c:dLbls><c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:axId val=\"28581\"/><c:axId val=\"1636\"/></c:scatterChart><c:valAx><c:axId val=\"28581\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"b\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"1636\"/><c:crossesAt val=\"0\"/></c:valAx><c:valAx><c:axId val=\"1636\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"l\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"28581\"/><c:crossesAt val=\"0\"/></c:valAx></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
static TCHAR* gc_sChartBar = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:barChart><c:varyColors val=\"0\"/>%s%s%s<c:dLbls>%s<c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:gapWidth val=\"100\"/>%s<c:axId val=\"19816\"/><c:axId val=\"31185\"/></c:barChart><c:catAx><c:axId val=\"19816\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"b\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"31185\"/><c:crosses val=\"autoZero\"/><c:lblAlgn val=\"ctr\"/><c:auto val=\"1\"/><c:lblOffset val=\"100\"/></c:catAx><c:valAx><c:axId val=\"31185\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"l\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"19816\"/><c:crosses val=\"autoZero\"/></c:valAx></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
static TCHAR* gc_sChartStock = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><c:lang val=\"en-US\"/><c:roundedCorners val=\"0\"/>%s<c:chart>%s<c:plotArea><c:layout/><c:stockChart><c:varyColors val=\"0\"/>%s%s%s<c:dLbls><c:showLegendKey val=\"0\"/>%s<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbls><c:hiLowLines/><c:upDownBars><c:gapWidth val=\"150\"/><c:upBars/><c:downBars/></c:upDownBars><c:axId val=\"10364\"/><c:axId val=\"1630\"/></c:stockChart><c:dateAx><c:axId val=\"10364\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"b\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"1630\"/><c:crossesAt val=\"0\"/><c:auto val=\"1\"/><c:lblOffset val=\"100\"/></c:dateAx><c:valAx><c:axId val=\"1630\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling>%s%s%s<c:axPos val=\"l\"/><c:majorTickMark val=\"out\"/><c:minorTickMark val=\"none\"/><c:tickLblPos val=\"nextTo\"/>%s<c:crossAx val=\"10364\"/><c:crossesAt val=\"0\"/></c:valAx></c:plotArea>%s<c:plotVisOnly val=\"1\"/></c:chart>%s</c:chartSpace>");
|
||||
|
||||
class CChart : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChart)
|
||||
CChart()
|
||||
{
|
||||
}
|
||||
virtual ~CChart()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
virtual void toXML2(CStringWriter& writer, nullable<CChartStyle> oChartStyle, CString& sSpPr) const
|
||||
{
|
||||
if(m_oPlotArea.IsInit() && m_oPlotArea->m_oBasicChart.IsInit())
|
||||
{
|
||||
CString sChartPattern;
|
||||
bool bPie = false;
|
||||
bool bBar = false;
|
||||
bool bScatter = false;
|
||||
bool bLine = false;
|
||||
switch(m_oPlotArea->m_oBasicChart->m_eType)
|
||||
{
|
||||
case OOX::Spreadsheet::chartbasicBarChart:
|
||||
case OOX::Spreadsheet::chartbasicBar3DChart: sChartPattern = gc_sChartBar;bBar = true;break;
|
||||
case OOX::Spreadsheet::chartbasicRadarChart:
|
||||
case OOX::Spreadsheet::chartbasicAreaChart: sChartPattern = gc_sChartArea;break;
|
||||
case OOX::Spreadsheet::chartbasicLineChart:
|
||||
case OOX::Spreadsheet::chartbasicLine3DChart: sChartPattern = gc_sChartLine;bLine = true;break;
|
||||
case OOX::Spreadsheet::chartbasicPieChart:
|
||||
case OOX::Spreadsheet::chartbasicDoughnutChart: sChartPattern = gc_sChartPie;bPie = true;break;
|
||||
case OOX::Spreadsheet::chartbasicBubbleChart:
|
||||
case OOX::Spreadsheet::chartbasicScatterChart: sChartPattern = gc_sChartScatter;bScatter = true;break;
|
||||
case OOX::Spreadsheet::chartbasicStockChart: sChartPattern = gc_sChartStock;break;
|
||||
default:sChartPattern = gc_sChartLine;
|
||||
}
|
||||
|
||||
CString title;
|
||||
if(m_oTitle.IsInit())
|
||||
{
|
||||
CStringWriter sTempWriter;
|
||||
m_oTitle->toXML(sTempWriter);
|
||||
title = sTempWriter.GetCString();
|
||||
}
|
||||
CString style;
|
||||
if(oChartStyle.IsInit())
|
||||
style = oChartStyle->toXML();
|
||||
else
|
||||
{
|
||||
CChartStyle oCChartStyle;
|
||||
style = oCChartStyle.toXML();
|
||||
}
|
||||
CString sBarDir;
|
||||
CString sGrouping;
|
||||
CString sSeries;
|
||||
CString sDataLabels;
|
||||
CString sOverlap;
|
||||
CString sCatAxDelete;
|
||||
CString sCatAxMajorGrid;
|
||||
CString sCatAxTitle;
|
||||
CString sCatTxPr;
|
||||
CString sValAxDelete;
|
||||
CString sValAxMajorGrid;
|
||||
CString sValAxTitle;
|
||||
CString sValTxPr;
|
||||
m_oPlotArea->toXML2(bScatter, bLine, sBarDir, sGrouping, sSeries, sDataLabels, sOverlap, sCatAxDelete, sCatAxMajorGrid, sCatAxTitle, sCatTxPr, sValAxDelete, sValAxMajorGrid, sValAxTitle, sValTxPr);
|
||||
CStringWriter legend;
|
||||
if(m_oLegend.IsInit())
|
||||
m_oLegend->toXML(legend);
|
||||
|
||||
CString sChart;
|
||||
if(bPie)
|
||||
sChart.Format(sChartPattern, style, title, sBarDir, sGrouping, sSeries, sDataLabels, legend.GetCString(), sSpPr);
|
||||
else if(bBar)
|
||||
{
|
||||
CString sDLblPos = _T("<c:dLblPos val=\"outEnd\"/>");
|
||||
if(m_oPlotArea->m_oBasicChart.IsInit() && m_oPlotArea->m_oBasicChart->m_oGrouping.IsInit() && m_oPlotArea->m_oBasicChart->m_oGrouping->m_oVal.IsInit())
|
||||
{
|
||||
switch(m_oPlotArea->m_oBasicChart->m_oGrouping->m_oVal->GetValue())
|
||||
{
|
||||
case SimpleTypes::Spreadsheet::chartbargroupingPercentStacked : sDLblPos = _T("<c:dLblPos val=\"inEnd\"/>");break;
|
||||
case SimpleTypes::Spreadsheet::chartbargroupingStacked : sDLblPos = _T("<c:dLblPos val=\"inEnd\"/>");break;
|
||||
}
|
||||
}
|
||||
sChart.Format(sChartPattern, style, title, sBarDir, sGrouping, sSeries, sDLblPos, sDataLabels, sOverlap, sCatAxDelete, sCatAxMajorGrid, sCatAxTitle, sCatTxPr, sValAxDelete, sValAxMajorGrid, sValAxTitle, sValTxPr, legend.GetCString(), sSpPr);
|
||||
}
|
||||
else
|
||||
sChart.Format(sChartPattern, style, title, sBarDir, sGrouping, sSeries, sDataLabels, sCatAxDelete, sCatAxMajorGrid, sCatAxTitle, sCatTxPr, sValAxDelete, sValAxMajorGrid, sValAxTitle, sValTxPr, legend.GetCString(), sSpPr);
|
||||
writer.WriteStringC(sChart);
|
||||
}
|
||||
}
|
||||
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:title") == sName )
|
||||
m_oTitle = oReader;
|
||||
else if ( _T("c:legend") == sName )
|
||||
m_oLegend = oReader;
|
||||
else if ( _T("c:plotArea") == sName )
|
||||
m_oPlotArea = oReader;
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_c_Chart;
|
||||
}
|
||||
bool isValid()
|
||||
{
|
||||
if(m_oPlotArea.IsInit() && m_oPlotArea->m_oBasicChart.IsInit())
|
||||
{
|
||||
return OOX::Spreadsheet::chartbasicBubbleChart != m_oPlotArea->m_oBasicChart->m_eType;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CChartTitle> m_oTitle;
|
||||
nullable<CChartLegend> m_oLegend;
|
||||
nullable<CChartPlotArea> m_oPlotArea;
|
||||
};
|
||||
class CChartSpace : public OOX::FileGlobalEnumerated, public OOX::Spreadsheet::IFileContainer
|
||||
{
|
||||
public:
|
||||
CChartSpace()
|
||||
{
|
||||
}
|
||||
CChartSpace(const CPath& oPath)
|
||||
{
|
||||
read( oPath );
|
||||
}
|
||||
virtual ~CChartSpace()
|
||||
{
|
||||
}
|
||||
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("c:chartSpace") == sName )
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
{
|
||||
int nStylesDepth = oReader.GetDepth();
|
||||
while ( oReader.ReadNextSiblingNode( nStylesDepth ) )
|
||||
{
|
||||
sName = oReader.GetName();
|
||||
|
||||
if ( _T("c:chart") == sName )
|
||||
m_oChart = oReader;
|
||||
else if ( _T("c:style") == sName )
|
||||
m_oStyle = oReader;
|
||||
else if ( _T("mc:AlternateContent") == sName )
|
||||
m_oAlternateContent = oReader;
|
||||
else if ( _T("c:spPr") == sName )
|
||||
m_sSpPr = oReader.GetOuterXml();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
|
||||
{
|
||||
if(isValid())
|
||||
{
|
||||
write2(oPath.GetPath());
|
||||
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
|
||||
IFileContainer::Write(oPath, oDirectory, oContent);
|
||||
}
|
||||
}
|
||||
bool write2(const CString& sFilename) const
|
||||
{
|
||||
bool bRes = false;
|
||||
if(isValid())
|
||||
{
|
||||
CStringWriter sXml;
|
||||
toXML(sXml);
|
||||
|
||||
CDirectory::SaveToFile( sFilename, sXml.GetCString() );
|
||||
bRes = true;
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
bool isValid() const
|
||||
{
|
||||
return m_oChart.IsInit() && m_oChart->isValid();
|
||||
}
|
||||
void toXML(CStringWriter& sXml) const
|
||||
{
|
||||
CString sSpPr;
|
||||
if(m_sSpPr.IsInit())
|
||||
sSpPr = m_sSpPr.get();
|
||||
m_oChart->toXML2(sXml, m_oStyle, sSpPr);
|
||||
}
|
||||
virtual const OOX::FileType type() const
|
||||
{
|
||||
return OOX::Spreadsheet::FileTypes::Charts;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
const CPath& GetReadPath()
|
||||
{
|
||||
return m_oReadPath;
|
||||
}
|
||||
|
||||
private:
|
||||
CPath m_oReadPath;
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CChart> m_oChart;
|
||||
nullable<CChartStyle> m_oStyle;
|
||||
nullable<OOX::Logic::CAlternateContent> m_oAlternateContent;
|
||||
nullable<CString> m_sSpPr;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHART_FILE_INCLUDE_H_
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* (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_CHARTSTYLE_FILE_INCLUDE_H_
|
||||
#define OOX_CHARTSTYLE_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CChartStyle : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartStyle)
|
||||
CChartStyle()
|
||||
{
|
||||
}
|
||||
virtual ~CChartStyle()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
int nStyle = 0;
|
||||
if(m_oVal.IsInit())
|
||||
nStyle = m_oVal->GetValue();
|
||||
if(false == (nStyle >= 1 && nStyle <= 48))
|
||||
nStyle = 2;
|
||||
CString sXml;
|
||||
sXml.Format(_T("<mc:AlternateContent xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"><mc:Choice Requires=\"c14\" xmlns:c14=\"http://schemas.microsoft.com/office/drawing/2007/8/2/chart\"><c14:style val=\"%d\"/></mc:Choice><mc:Fallback><c:style val=\"%d\"/></mc:Fallback></mc:AlternateContent>"), 100 + nStyle, nStyle);
|
||||
return sXml;
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(toXML());
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
oReader.ReadTillEnd();
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_c_ChartStyle;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("val"), m_oVal )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oVal;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHARTSTYLE_FILE_INCLUDE_H_
|
||||
99
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/FromTo.h
Normal file
99
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/FromTo.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (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_FROMTO_FILE_INCLUDE_H_
|
||||
#define OOX_FROMTO_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CFromTo : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CFromTo)
|
||||
CFromTo()
|
||||
{
|
||||
}
|
||||
virtual ~CFromTo()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _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("xdr:col") == sName )
|
||||
m_oCol = oReader.GetText2();
|
||||
else if ( _T("xdr:colOff") == sName )
|
||||
m_oColOff = oReader.GetText2();
|
||||
else if ( _T("xdr:row") == sName )
|
||||
m_oRow = oReader.GetText2();
|
||||
else if ( _T("xdr:rowOff") == sName )
|
||||
m_oRowOff = oReader.GetText2();
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_FromTo;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCol;
|
||||
nullable<SimpleTypes::CEmu> m_oColOff;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRow;
|
||||
nullable<SimpleTypes::CEmu> m_oRowOff;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_FROMTO_FILE_INCLUDE_H_
|
||||
161
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Layout.h
Normal file
161
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Layout.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* (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_CHARTLAYOUT_FILE_INCLUDE_H_
|
||||
#define OOX_CHARTLAYOUT_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CChartManualLayout : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartManualLayout)
|
||||
CChartManualLayout() {}
|
||||
virtual ~CChartManualLayout() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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:h") == sName )
|
||||
m_oH = oReader;
|
||||
else if ( _T("c:hMode") == sName )
|
||||
m_oHMode = oReader;
|
||||
else if ( _T("c:layoutTarget") == sName )
|
||||
m_oLayoutTarget = oReader;
|
||||
else if ( _T("c:w") == sName )
|
||||
m_oW = oReader;
|
||||
else if ( _T("c:wMode") == sName )
|
||||
m_oWMode = oReader;
|
||||
else if ( _T("c:x") == sName )
|
||||
m_oX = oReader;
|
||||
else if ( _T("c:xMode") == sName )
|
||||
m_oXMode = oReader;
|
||||
else if ( _T("c:y") == sName )
|
||||
m_oY = oReader;
|
||||
else if ( _T("c:yMode") == sName )
|
||||
m_oYMode = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_ManualLayout;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oH;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oHMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartLayoutTarget> m_oLayoutTarget;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oW;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oWMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oX;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oXMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oY;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oYMode;
|
||||
};
|
||||
class CChartLayout : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartLayout)
|
||||
CChartLayout() {}
|
||||
virtual ~CChartLayout() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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:manualLayout") == sName )
|
||||
m_oManualLayout = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_Layout;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<CChartManualLayout> m_oManualLayout;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHARTLAYOUT_FILE_INCLUDE_H_
|
||||
342
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Legend.h
Normal file
342
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Legend.h
Normal file
@@ -0,0 +1,342 @@
|
||||
/*
|
||||
* (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_CHARTLEGEND_FILE_INCLUDE_H_
|
||||
#define OOX_CHARTLEGEND_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CChartManualLayout : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartManualLayout)
|
||||
CChartManualLayout() {}
|
||||
virtual ~CChartManualLayout() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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:h") == sName )
|
||||
m_oH = oReader;
|
||||
else if ( _T("c:hMode") == sName )
|
||||
m_oHMode = oReader;
|
||||
else if ( _T("c:layoutTarget") == sName )
|
||||
m_oLayoutTarget = oReader;
|
||||
else if ( _T("c:w") == sName )
|
||||
m_oW = oReader;
|
||||
else if ( _T("c:wMode") == sName )
|
||||
m_oWMode = oReader;
|
||||
else if ( _T("c:x") == sName )
|
||||
m_oX = oReader;
|
||||
else if ( _T("c:xMode") == sName )
|
||||
m_oXMode = oReader;
|
||||
else if ( _T("c:y") == sName )
|
||||
m_oY = oReader;
|
||||
else if ( _T("c:yMode") == sName )
|
||||
m_oYMode = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_ManualLayout;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oH;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oHMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartLayoutTarget> m_oLayoutTarget;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oW;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oWMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oX;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oXMode;
|
||||
nullable<ComplexTypes::Spreadsheet::CDouble> m_oY;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartHMode> m_oYMode;
|
||||
};
|
||||
class CChartLayout : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartLayout)
|
||||
CChartLayout() {}
|
||||
virtual ~CChartLayout() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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:manualLayout") == sName )
|
||||
m_oManualLayout = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_Layout;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
nullable<CChartManualLayout> m_oManualLayout;
|
||||
};
|
||||
class CChartLegendPos : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartLegendPos)
|
||||
CChartLegendPos() {}
|
||||
virtual ~CChartLegendPos() {}
|
||||
|
||||
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_c_LegendPos;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("val"), m_oVal )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<SimpleTypes::Spreadsheet::CChartLegendPos<> > m_oVal;
|
||||
};
|
||||
class CChartLegendEntry : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartLegendEntry)
|
||||
CChartLegendEntry() {}
|
||||
virtual ~CChartLegendEntry() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
if(m_oIndex.IsInit() && m_oIndex->m_oVal.IsInit() && (m_oDelete.IsInit() || m_oTxPr.IsInit()))
|
||||
{
|
||||
writer.WriteStringC(_T("<c:legendEntry>"));
|
||||
if(m_oIndex.IsInit())
|
||||
{
|
||||
CString sXml;
|
||||
sXml.Format(_T("<c:idx val=\"%d\"/>"), m_oIndex->m_oVal->GetValue());
|
||||
writer.WriteStringC(sXml);
|
||||
}
|
||||
if(m_oDelete.IsInit())
|
||||
{
|
||||
CString sXml;
|
||||
sXml.Format(_T("<c:delete val=\"%s\"/>"), m_oDelete->m_oVal.ToString2(SimpleTypes::onofftostring1));
|
||||
writer.WriteStringC(sXml);
|
||||
}
|
||||
if(m_oTxPr.IsInit() && m_oTxPr->m_oXml.IsInit())
|
||||
writer.WriteStringC(m_oTxPr->m_oXml.get2());
|
||||
writer.WriteStringC(_T("</c:legendEntry>"));
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
|
||||
if ( _T("c:idx") == sName )
|
||||
m_oIndex = oReader;
|
||||
else if ( _T("c:delete") == sName )
|
||||
m_oDelete = oReader;
|
||||
else if ( _T("c:txPr") == sName )
|
||||
m_oTxPr = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_LegendEntry;
|
||||
}
|
||||
public:
|
||||
nullable<ComplexTypes::Spreadsheet::CDecimalNumber> m_oIndex;
|
||||
nullable<ComplexTypes::Spreadsheet::COnOff2<>> m_oDelete;
|
||||
nullable<OOX::Spreadsheet::CChartRich > m_oTxPr;
|
||||
};
|
||||
class CChartLegend : public WritingElementWithChilds<CChartLegendEntry>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartLegend)
|
||||
CChartLegend()
|
||||
{
|
||||
}
|
||||
virtual ~CChartLegend()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(CString(_T("<c:legend>")));
|
||||
CString sLegendPos = _T("r");
|
||||
if(m_oLegendPos.IsInit() && m_oLegendPos->m_oVal.IsInit())
|
||||
sLegendPos = m_oLegendPos->m_oVal->ToString();
|
||||
CString sLegendPosXml;sLegendPosXml.Format(_T("<c:legendPos val=\"%s\"/>"), sLegendPos);
|
||||
for(int i = 0 , length = m_arrItems.GetSize(); i < length; ++i)
|
||||
{
|
||||
m_arrItems[i]->toXML(writer);
|
||||
}
|
||||
writer.WriteStringC(sLegendPosXml);
|
||||
writer.WriteStringC(CString(_T("<c:layout/>")));
|
||||
CString sOverlay = _T("0");
|
||||
if(m_oOverlay.IsInit())
|
||||
sOverlay = m_oOverlay->m_oVal.ToString2(SimpleTypes::onofftostring1);
|
||||
CString sOverlayXml;sOverlayXml.Format(_T("<c:overlay val=\"%s\"/>"), sOverlay);
|
||||
writer.WriteStringC(sOverlayXml);
|
||||
if(m_oTxPr.IsInit())
|
||||
m_oTxPr->toXML(writer);
|
||||
writer.WriteStringC(CString(_T("</c:legend>")));
|
||||
}
|
||||
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:overlay") == sName )
|
||||
m_oOverlay = oReader;
|
||||
else if ( _T("c:layout") == sName )
|
||||
m_oLayout = oReader;
|
||||
else if ( _T("c:legendPos") == sName )
|
||||
m_oLegendPos = oReader;
|
||||
else if ( _T("c:legendEntry") == sName )
|
||||
m_arrItems.Add(new CChartLegendEntry(oReader));
|
||||
else if ( _T("c:txPr") == sName )
|
||||
m_oTxPr = oReader;
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_c_Legend;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<ComplexTypes::Spreadsheet::COnOff2<>> m_oOverlay;
|
||||
nullable<CChartLegendPos> m_oLegendPos;
|
||||
nullable<CChartLayout> m_oLayout;
|
||||
nullable<CChartRich> m_oTxPr;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHARTLEGEND_FILE_INCLUDE_H_
|
||||
283
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/PlotArea.h
Normal file
283
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/PlotArea.h
Normal file
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* (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_CHARTPLOTAREA_FILE_INCLUDE_H_
|
||||
#define OOX_CHARTPLOTAREA_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
#include "Title.h"
|
||||
#include "BasicChart.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CChartCatAx : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartCatAx)
|
||||
CChartCatAx() {}
|
||||
virtual ~CChartCatAx() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
void toXML2(CString& sDelete, CString& sMajorGrid, CString& sAxTitle, CString& sTxPr) const
|
||||
{
|
||||
if(m_oDelete.IsInit())
|
||||
sDelete.Format(_T("<c:delete val=\"%s\"/>"), m_oDelete->m_oVal.ToString2(SimpleTypes::onofftostring1));
|
||||
if(m_oAxPos.IsInit())
|
||||
{
|
||||
CString sAxPos;
|
||||
sAxPos.Format(_T("<c:axPos %s/>"), m_oAxPos->ToString());
|
||||
}
|
||||
if(m_oMajorGridlines.IsInit() && true == m_oMajorGridlines->ToBool())
|
||||
sMajorGrid = _T("<c:majorGridlines/>");
|
||||
if(m_oTitle.IsInit())
|
||||
{
|
||||
CStringWriter temp;
|
||||
m_oTitle->toXML(temp);
|
||||
sAxTitle = temp.GetCString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(m_oTxPr.IsInit() && m_oTxPr->m_oXml.IsInit())
|
||||
{
|
||||
sTxPr = m_oTxPr->m_oXml.get();
|
||||
}
|
||||
}
|
||||
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:title") == sName )
|
||||
m_oTitle = oReader;
|
||||
else if ( _T("c:delete") == sName )
|
||||
m_oDelete = oReader;
|
||||
else if ( _T("c:majorGridlines") == sName )
|
||||
{
|
||||
m_oMajorGridlines.Init();
|
||||
m_oMajorGridlines->SetValue(SimpleTypes::onoffTrue);
|
||||
}
|
||||
else if ( _T("c:axPos") == sName )
|
||||
m_oAxPos = oReader;
|
||||
else if ( _T("c:numFmt") == sName )
|
||||
m_oNumFmt = oReader;
|
||||
else if ( _T("c:txPr") == sName )
|
||||
m_oTxPr = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_CatAx;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<CChartTitle> m_oTitle;
|
||||
nullable<ComplexTypes::Spreadsheet::COnOff2<>> m_oDelete;
|
||||
nullable<SimpleTypes::COnOff<>> m_oMajorGridlines;
|
||||
nullable<ComplexTypes::Spreadsheet::CChartAxPos> m_oAxPos;
|
||||
nullable<OOX::Spreadsheet::CNumFmt> m_oNumFmt;
|
||||
nullable<OOX::Spreadsheet::CChartRich> m_oTxPr;
|
||||
};
|
||||
class CChartPlotArea : public WritingElementWithChilds<CChartCatAx>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartPlotArea)
|
||||
CChartPlotArea()
|
||||
{
|
||||
}
|
||||
virtual ~CChartPlotArea()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
void toXML2(bool bScatter, bool bLine, CString& sBarDir, CString& sGrouping, CString& sSeries, CString& sDataLabels, CString& sOverlap, CString& sCatAxDelete, CString& sCatAxMajorGrid, CString& sCatAxTitle, CString& sCatTxPr, CString& sValAxDelete, CString& sValAxMajorGrid, CString& sValAxTitle, CString& sValTxPr) const
|
||||
{
|
||||
if(m_oBasicChart.IsInit())
|
||||
m_oBasicChart->toXML2(bScatter, bLine, sBarDir, sGrouping, sSeries, sDataLabels, sOverlap);
|
||||
if(m_oCatAx.IsInit())
|
||||
{
|
||||
m_oCatAx->toXML2(sCatAxDelete, sCatAxMajorGrid, sCatAxTitle, sCatTxPr);
|
||||
if(m_arrItems.GetSize() > 0)
|
||||
m_arrItems[0]->toXML2(sValAxDelete, sValAxMajorGrid, sValAxTitle, sValTxPr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_arrItems.GetSize() > 0)
|
||||
m_arrItems[0]->toXML2(sCatAxDelete, sCatAxMajorGrid, sCatAxTitle, sCatTxPr);
|
||||
if(m_arrItems.GetSize() > 1)
|
||||
m_arrItems[1]->toXML2(sValAxDelete, sValAxMajorGrid, sValAxTitle, sValTxPr);
|
||||
}
|
||||
}
|
||||
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:barChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicBarChart);
|
||||
}
|
||||
else if ( _T("c:bar3DChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicBar3DChart);
|
||||
}
|
||||
else if ( _T("c:lineChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicLineChart);
|
||||
}
|
||||
else if ( _T("c:line3DChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicLine3DChart);
|
||||
}
|
||||
else if ( _T("c:areaChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicAreaChart);
|
||||
}
|
||||
else if ( _T("c:area3DChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicArea3DChart);
|
||||
}
|
||||
else if ( _T("c:pieChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicPieChart);
|
||||
}
|
||||
else if ( _T("c:pie3DChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicPie3DChart);
|
||||
}
|
||||
else if ( _T("c:bubbleChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicBubbleChart);
|
||||
}
|
||||
else if ( _T("c:scatterChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicScatterChart);
|
||||
}
|
||||
else if ( _T("c:radarChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicRadarChart);
|
||||
}
|
||||
else if ( _T("c:doughnutChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicDoughnutChart);
|
||||
}
|
||||
else if ( _T("c:stockChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicStockChart);
|
||||
}
|
||||
else if ( _T("c:surfaceChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicSurfaceChart);
|
||||
}
|
||||
else if ( _T("c:surface3DChart") == sName )
|
||||
{
|
||||
m_oBasicChart = oReader;
|
||||
m_oBasicChart->setBasicType(OOX::Spreadsheet::chartbasicSurface3DChart);
|
||||
}
|
||||
else if ( _T("c:catAx") == sName || _T("c:dateAx") == sName )
|
||||
m_oCatAx = oReader;
|
||||
else if ( _T("c:valAx") == sName )
|
||||
m_arrItems.Add( new CChartCatAx(oReader));
|
||||
else if ( _T("c:serAx") == sName )
|
||||
m_oSerAx = oReader;
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_c_PlotArea;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CChartCatAx> m_oCatAx;
|
||||
nullable<CChartCatAx> m_oSerAx;
|
||||
nullable<CChartBasicChart> m_oBasicChart;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHARTPLOTAREA_FILE_INCLUDE_H_
|
||||
349
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Title.h
Normal file
349
ActiveX/Common/DocxFormat/Source/XlsxFormat/Chart/Title.h
Normal file
@@ -0,0 +1,349 @@
|
||||
/*
|
||||
* (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_CHARTTITLE_FILE_INCLUDE_H_
|
||||
#define OOX_CHARTTITLE_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CChartText : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartText)
|
||||
CChartText() {}
|
||||
virtual ~CChartText() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<a:t"));
|
||||
if(-1 != m_sText.Find(' ') || -1 != m_sText.Find('\n'))
|
||||
writer.WriteStringC(_T(" xml:space=\"preserve\""));
|
||||
writer.WriteStringC(_T(">"));
|
||||
writer.WriteStringC(XmlUtils::EncodeXmlString(m_sText));
|
||||
writer.WriteStringC(_T("</a:t>"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
m_sText = oReader.GetText2();
|
||||
}
|
||||
CString ToString() const
|
||||
{
|
||||
return m_sText;
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_a_Text;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.GetAttributesCount() <= 0 )
|
||||
return;
|
||||
|
||||
if ( !oReader.MoveToFirstAttribute() )
|
||||
return;
|
||||
|
||||
CWCharWrapper wsName = oReader.GetName();
|
||||
while( !wsName.IsNull() )
|
||||
{
|
||||
if ( _T("xml:space") == wsName )
|
||||
{
|
||||
m_oSpace = oReader.GetText();
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !oReader.MoveToNextAttribute() )
|
||||
break;
|
||||
|
||||
wsName = oReader.GetName();
|
||||
}
|
||||
|
||||
oReader.MoveToElement();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<SimpleTypes::CXmlSpace<> > m_oSpace;
|
||||
|
||||
|
||||
CString m_sText;
|
||||
|
||||
};
|
||||
class CChartRun : public WritingElementWithChilds<CChartText>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartRun)
|
||||
CChartRun()
|
||||
{
|
||||
}
|
||||
virtual ~CChartRun()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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("a:t") == sName )
|
||||
m_arrItems.Add( new CChartText( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_a_Run;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
class CChartParagraph : public WritingElementWithChilds<CChartRun>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartParagraph)
|
||||
CChartParagraph()
|
||||
{
|
||||
}
|
||||
virtual ~CChartParagraph()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
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("a:r") == sName )
|
||||
m_arrItems.Add( new CChartRun( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_a_Paragraph;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
class CChartRich : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartRich)
|
||||
CChartRich() {}
|
||||
virtual ~CChartRich() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
if(m_oXml.IsInit())
|
||||
writer.WriteStringC(m_oXml.get());
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
m_oXml.Init();
|
||||
m_oXml->AppendFormat(_T("<c:rich xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">%s</c:rich>"), oReader.GetInnerXml());
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_Rich;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CString> m_oXml;
|
||||
};
|
||||
class CChartTx : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartTx)
|
||||
CChartTx() {}
|
||||
virtual ~CChartTx() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<c:tx>"));
|
||||
if(m_oRich.IsInit())
|
||||
m_oRich->toXML(writer);
|
||||
writer.WriteStringC(_T("</c:tx>"));
|
||||
}
|
||||
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:rich") == sName )
|
||||
m_oRich = oReader;
|
||||
}
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_c_Tx;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
|
||||
|
||||
nullable<CChartRich> m_oRich;
|
||||
};
|
||||
class CChartTitle : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CChartTitle)
|
||||
CChartTitle()
|
||||
{
|
||||
}
|
||||
virtual ~CChartTitle()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<c:title>"));
|
||||
if(m_oTx.IsInit())
|
||||
m_oTx->toXML(writer);
|
||||
writer.WriteStringC(_T("<c:layout/><c:overlay val=\"0\"/>"));
|
||||
if(m_oTxPr.IsInit())
|
||||
m_oTxPr->toXML(writer);
|
||||
writer.WriteStringC(_T("</c:title>"));
|
||||
}
|
||||
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:tx") == sName )
|
||||
m_oTx = oReader;
|
||||
else if ( _T("c:txPr") == sName )
|
||||
m_oTxPr = oReader;
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_c_Title;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CChartTx> m_oTx;
|
||||
nullable<CChartRich> m_oTxPr;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_CHARTTITLE_FILE_INCLUDE_H_
|
||||
Reference in New Issue
Block a user