mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
odf sparkline
This commit is contained in:
@ -2009,10 +2009,10 @@ namespace SimpleTypes
|
|||||||
|
|
||||||
ESparklineAxisMinMax ST_SparklineAxisMinMax::FromString(const std::wstring &sValue)
|
ESparklineAxisMinMax ST_SparklineAxisMinMax::FromString(const std::wstring &sValue)
|
||||||
{
|
{
|
||||||
if(L"individual" == sValue) this->m_eValue = Individual;
|
if(L"individual" == sValue) this->m_eValue = Individual;
|
||||||
else if(L"group" == sValue) this->m_eValue = Group;
|
else if(L"group" == sValue) this->m_eValue = Group;
|
||||||
else if(L"custom" == sValue) this->m_eValue = Custom;
|
else if(L"custom" == sValue) this->m_eValue = Custom;
|
||||||
else this->m_eValue = Individual;
|
else this->m_eValue = Individual;
|
||||||
return this->m_eValue;
|
return this->m_eValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -468,14 +468,13 @@ namespace OOX
|
|||||||
}
|
}
|
||||||
void CSparklineGroup::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
void CSparklineGroup::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||||
{
|
{
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
WritingElement_ReadAttributes_Start( oReader )
|
WritingElement_ReadAttributes_Start( oReader )
|
||||||
|
WritingElement_ReadAttributes_Read_if ( oReader, _T("manualMax"), m_oManualMax )
|
||||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("manualMax"), m_oManualMax )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("manualMin"), m_oManualMin )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("manualMin"), m_oManualMin )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("lineWeight"),m_oLineWeight )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("lineWeight"), m_oLineWeight )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("type"), m_oType )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("type"), m_oType )
|
WritingElement_ReadAttributes_Read_else_if (oReader, _T("xr2:uid"), m_oUId )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("dateAxis"), m_oDateAxis )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("dateAxis"), m_oDateAxis )
|
||||||
else if(_T("displayEmptyCellsAs") == wsName)
|
else if(_T("displayEmptyCellsAs") == wsName)
|
||||||
{
|
{
|
||||||
ST_DispBlanksAs eVal;
|
ST_DispBlanksAs eVal;
|
||||||
@ -486,19 +485,19 @@ namespace OOX
|
|||||||
m_oDisplayEmptyCellsAs.get2() = eVal;
|
m_oDisplayEmptyCellsAs.get2() = eVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("markers"), m_oMarkers )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("markers"), m_oMarkers )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("high"), m_oHigh )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("high"), m_oHigh )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("low"), m_oLow )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("low"), m_oLow )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("first"), m_oFirst )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("first"), m_oFirst )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("last"), m_oLast )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("last"), m_oLast )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("negative"), m_oNegative )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("negative"), m_oNegative )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("displayXAxis"), m_oDisplayXAxis )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("displayXAxis"), m_oDisplayXAxis )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("displayHidden"), m_oDisplayHidden )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("displayHidden"), m_oDisplayHidden )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minAxisType"), m_oMinAxisType )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minAxisType"), m_oMinAxisType )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxAxisType"), m_oMaxAxisType )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxAxisType"), m_oMaxAxisType )
|
||||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rightToLeft"), m_oRightToLeft )
|
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rightToLeft"), m_oRightToLeft )
|
||||||
|
|
||||||
WritingElement_ReadAttributes_End( oReader )
|
WritingElement_ReadAttributes_End( oReader )
|
||||||
}
|
}
|
||||||
|
|
||||||
CSparklineGroups::CSparklineGroups()
|
CSparklineGroups::CSparklineGroups()
|
||||||
|
|||||||
@ -69,8 +69,8 @@ namespace OOX
|
|||||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
|
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
nullable<std::wstring> m_oRef;
|
nullable<std::wstring> m_oRef;
|
||||||
nullable<std::wstring> m_oSqRef;
|
nullable<std::wstring> m_oSqRef;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CSparklines : public WritingElementWithChilds<CSparkline>
|
class CSparklines : public WritingElementWithChilds<CSparkline>
|
||||||
@ -144,6 +144,8 @@ namespace OOX
|
|||||||
nullable<OOX::Spreadsheet::CColor> m_oColorLow;
|
nullable<OOX::Spreadsheet::CColor> m_oColorLow;
|
||||||
nullable<std::wstring> m_oRef;
|
nullable<std::wstring> m_oRef;
|
||||||
nullable<CSparklines> m_oSparklines;
|
nullable<CSparklines> m_oSparklines;
|
||||||
|
|
||||||
|
nullable_string m_oUId;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CSparklineGroups : public WritingElementWithChilds<CSparklineGroup>
|
class CSparklineGroups : public WritingElementWithChilds<CSparklineGroup>
|
||||||
|
|||||||
@ -629,7 +629,11 @@ enum ElementType
|
|||||||
typeCalcextDateIs,
|
typeCalcextDateIs,
|
||||||
typeCalcextCondition,
|
typeCalcextCondition,
|
||||||
typeCalcextConditionalFormat,
|
typeCalcextConditionalFormat,
|
||||||
typeCalcextConditionalFormats
|
typeCalcextConditionalFormats,
|
||||||
|
typeCalcextSparklineGroups,
|
||||||
|
typeCalcextSparklineGroup,
|
||||||
|
typeCalcextSparklines,
|
||||||
|
typeCalcextSparkline
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -568,7 +568,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
|||||||
if (!c2.empty() && c2.substr(0, 1) == L":")
|
if (!c2.empty() && c2.substr(0, 1) == L":")
|
||||||
c2 = c2.substr(1);
|
c2 = c2.substr(1);
|
||||||
|
|
||||||
s = sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"");
|
s = (sheet.empty() ? L"" : (sheet + L".")) + c1 + (c2.empty() ? L"" : (L":" + (sheet.empty() ? L"" : (sheet + L".")) + c2)) + std::wstring(L"");
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,7 +150,8 @@ SOURCES += \
|
|||||||
../../DataTypes/timeperiod.cpp \
|
../../DataTypes/timeperiod.cpp \
|
||||||
../../DataTypes/messagetype.cpp \
|
../../DataTypes/messagetype.cpp \
|
||||||
../../DataTypes/stylecellprotect.cpp \
|
../../DataTypes/stylecellprotect.cpp \
|
||||||
\
|
../../DataTypes/sparklines.cpp \
|
||||||
|
\
|
||||||
../../Reader/Format/abstract_xml.cpp \
|
../../Reader/Format/abstract_xml.cpp \
|
||||||
../../Reader/Format/anim_elements.cpp \
|
../../Reader/Format/anim_elements.cpp \
|
||||||
../../Reader/Format/calcs_styles.cpp \
|
../../Reader/Format/calcs_styles.cpp \
|
||||||
|
|||||||
@ -139,3 +139,4 @@
|
|||||||
#include "../../DataTypes/timeperiod.cpp"
|
#include "../../DataTypes/timeperiod.cpp"
|
||||||
#include "../../DataTypes/stylecellprotect.cpp"
|
#include "../../DataTypes/stylecellprotect.cpp"
|
||||||
#include "../../DataTypes/mathvariant.cpp"
|
#include "../../DataTypes/mathvariant.cpp"
|
||||||
|
#include "../../DataTypes/sparklines.cpp"
|
||||||
|
|||||||
@ -252,6 +252,7 @@
|
|||||||
<ClInclude Include="..\..\DataTypes\scripttype.h" />
|
<ClInclude Include="..\..\DataTypes\scripttype.h" />
|
||||||
<ClInclude Include="..\..\DataTypes\shadowtype.h" />
|
<ClInclude Include="..\..\DataTypes\shadowtype.h" />
|
||||||
<ClInclude Include="..\..\DataTypes\smil_transitiontype.h" />
|
<ClInclude Include="..\..\DataTypes\smil_transitiontype.h" />
|
||||||
|
<ClInclude Include="..\..\DataTypes\sparklines.h" />
|
||||||
<ClInclude Include="..\..\DataTypes\stylecellprotect.h" />
|
<ClInclude Include="..\..\DataTypes\stylecellprotect.h" />
|
||||||
<ClInclude Include="..\..\DataTypes\stylefamily.h" />
|
<ClInclude Include="..\..\DataTypes\stylefamily.h" />
|
||||||
<ClInclude Include="..\..\DataTypes\stylehorizontalpos.h" />
|
<ClInclude Include="..\..\DataTypes\stylehorizontalpos.h" />
|
||||||
@ -368,6 +369,7 @@
|
|||||||
<ClCompile Include="..\..\DataTypes\scripttype.cpp" />
|
<ClCompile Include="..\..\DataTypes\scripttype.cpp" />
|
||||||
<ClCompile Include="..\..\DataTypes\shadowtype.cpp" />
|
<ClCompile Include="..\..\DataTypes\shadowtype.cpp" />
|
||||||
<ClCompile Include="..\..\DataTypes\smil_transitiontype.cpp" />
|
<ClCompile Include="..\..\DataTypes\smil_transitiontype.cpp" />
|
||||||
|
<ClCompile Include="..\..\DataTypes\sparklines.cpp" />
|
||||||
<ClCompile Include="..\..\DataTypes\stylecellprotect.cpp" />
|
<ClCompile Include="..\..\DataTypes\stylecellprotect.cpp" />
|
||||||
<ClCompile Include="..\..\DataTypes\stylefamily.cpp" />
|
<ClCompile Include="..\..\DataTypes\stylefamily.cpp" />
|
||||||
<ClCompile Include="..\..\DataTypes\stylehorizontalpos.cpp" />
|
<ClCompile Include="..\..\DataTypes\stylehorizontalpos.cpp" />
|
||||||
|
|||||||
@ -356,6 +356,9 @@
|
|||||||
<ClInclude Include="..\..\Common\utils.h" />
|
<ClInclude Include="..\..\Common\utils.h" />
|
||||||
<ClInclude Include="..\..\Common\writedocelement.h" />
|
<ClInclude Include="..\..\Common\writedocelement.h" />
|
||||||
<ClInclude Include="..\..\Common\errors.h" />
|
<ClInclude Include="..\..\Common\errors.h" />
|
||||||
|
<ClInclude Include="..\..\DataTypes\sparklines.h">
|
||||||
|
<Filter>datatypes odf</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\Common\CPColorUtils.cpp" />
|
<ClCompile Include="..\..\Common\CPColorUtils.cpp" />
|
||||||
@ -690,5 +693,8 @@
|
|||||||
<ClCompile Include="..\..\Common\readdocelement.cpp" />
|
<ClCompile Include="..\..\Common\readdocelement.cpp" />
|
||||||
<ClCompile Include="..\..\Common\utils.cpp" />
|
<ClCompile Include="..\..\Common\utils.cpp" />
|
||||||
<ClCompile Include="..\..\Common\logging.cpp" />
|
<ClCompile Include="..\..\Common\logging.cpp" />
|
||||||
|
<ClCompile Include="..\..\DataTypes\sparklines.cpp">
|
||||||
|
<Filter>datatypes odf</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@ -614,6 +614,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\Reader\Format\table_pptx.cpp">
|
<ClCompile Include="..\..\Reader\Format\table_pptx.cpp">
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\Reader\Format\table_xlsx.cpp">
|
<ClCompile Include="..\..\Reader\Format\table_xlsx.cpp">
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
|||||||
@ -87,6 +87,7 @@ public:
|
|||||||
std::wstringstream controls_;
|
std::wstringstream controls_;
|
||||||
std::wstringstream protection_;
|
std::wstringstream protection_;
|
||||||
std::wstringstream breaks_;
|
std::wstringstream breaks_;
|
||||||
|
std::wstringstream sparklines_;
|
||||||
|
|
||||||
rels sheet_rels_;
|
rels sheet_rels_;
|
||||||
|
|
||||||
@ -199,6 +200,10 @@ std::wostream & xlsx_xml_worksheet::breaks()
|
|||||||
{
|
{
|
||||||
return impl_->breaks_;
|
return impl_->breaks_;
|
||||||
}
|
}
|
||||||
|
std::wostream& xlsx_xml_worksheet::sparklines()
|
||||||
|
{
|
||||||
|
return impl_->sparklines_;
|
||||||
|
}
|
||||||
//---------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------
|
||||||
rels & xlsx_xml_worksheet::sheet_rels()
|
rels & xlsx_xml_worksheet::sheet_rels()
|
||||||
{
|
{
|
||||||
@ -215,6 +220,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
|||||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||||
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
||||||
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||||
|
CP_XML_ATTR(L"xmlns:xr2", L"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2");
|
||||||
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||||
CP_XML_ATTR(L"mc:Ignorable",L"x14ac");
|
CP_XML_ATTR(L"mc:Ignorable",L"x14ac");
|
||||||
CP_XML_ATTR(L"xmlns:x14ac", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
|
CP_XML_ATTR(L"xmlns:x14ac", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
|
||||||
@ -305,16 +311,31 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
|||||||
CP_XML_STREAM() << impl_->picture_background_.str();
|
CP_XML_STREAM() << impl_->picture_background_.str();
|
||||||
|
|
||||||
std::wstring dataValidations14 = impl_->dataValidationsX14_.str();
|
std::wstring dataValidations14 = impl_->dataValidationsX14_.str();
|
||||||
if (false == dataValidations14.empty())
|
std::wstring sparklines = impl_->sparklines_.str();
|
||||||
|
|
||||||
|
if (false == dataValidations14.empty() || false == sparklines.empty())
|
||||||
{
|
{
|
||||||
CP_XML_NODE(L"extLst")
|
CP_XML_NODE(L"extLst")
|
||||||
{
|
{
|
||||||
CP_XML_NODE(L"ext")
|
if (false == dataValidations14.empty())
|
||||||
{
|
{
|
||||||
CP_XML_ATTR(L"uri", L"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}");
|
CP_XML_NODE(L"ext")
|
||||||
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
{
|
||||||
|
CP_XML_ATTR(L"uri", L"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}");
|
||||||
|
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||||
|
|
||||||
CP_XML_STREAM() << dataValidations14;
|
CP_XML_STREAM() << dataValidations14;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (false == sparklines.empty())
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"ext")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"uri", L"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}");
|
||||||
|
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||||
|
|
||||||
|
CP_XML_STREAM() << sparklines;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,7 @@ public:
|
|||||||
std::wostream & controls();
|
std::wostream & controls();
|
||||||
std::wostream & protection();
|
std::wostream & protection();
|
||||||
std::wostream & breaks();
|
std::wostream & breaks();
|
||||||
|
std::wostream & sparklines();
|
||||||
|
|
||||||
rels & sheet_rels(); //hyperlink, background image, external, media ...
|
rels & sheet_rels(); //hyperlink, background image, external, media ...
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
#include <xml/xmlchar.h>
|
#include <xml/xmlchar.h>
|
||||||
|
|
||||||
#include "../Format/odf_document.h"
|
#include "../Format/odf_document.h"
|
||||||
|
#include "../../Formulas/formulasconvert.h"
|
||||||
|
|
||||||
#include "serialize_elements.h"
|
#include "serialize_elements.h"
|
||||||
#include "calcs_styles.h"
|
#include "calcs_styles.h"
|
||||||
@ -53,31 +54,58 @@ namespace odf_reader {
|
|||||||
|
|
||||||
void calcext_data_bar_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_data_bar_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:axis-color", calcext_axis_color_);
|
CP_APPLY_ATTR(L"calcext:axis-color", axis_color_);
|
||||||
CP_APPLY_ATTR(L"calcext:positive-color", calcext_positive_color_);
|
CP_APPLY_ATTR(L"calcext:positive-color", positive_color_);
|
||||||
CP_APPLY_ATTR(L"calcext:negative-color", calcext_negative_color_);
|
CP_APPLY_ATTR(L"calcext:negative-color", negative_color_);
|
||||||
CP_APPLY_ATTR(L"calcext:min-length", calcext_min_length_);
|
CP_APPLY_ATTR(L"calcext:min-length", min_length_);
|
||||||
CP_APPLY_ATTR(L"calcext:max-length", calcext_max_length_);
|
CP_APPLY_ATTR(L"calcext:max-length", max_length_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void calcext_icon_set_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_icon_set_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:icon-set-type", calcext_icon_set_type_);
|
CP_APPLY_ATTR(L"calcext:icon-set-type", icon_set_type_);
|
||||||
|
|
||||||
}
|
}
|
||||||
void calcext_condition_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_condition_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:base-cell-address", calcext_base_cell_address_);
|
CP_APPLY_ATTR(L"calcext:base-cell-address", base_cell_address_);
|
||||||
CP_APPLY_ATTR(L"calcext:apply-style-name", calcext_apply_style_name_);
|
CP_APPLY_ATTR(L"calcext:apply-style-name", apply_style_name_);
|
||||||
CP_APPLY_ATTR(L"calcext:value", calcext_value_);
|
CP_APPLY_ATTR(L"calcext:value", value_);
|
||||||
}
|
}
|
||||||
void calcext_date_is_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_date_is_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:style", calcext_style_);
|
CP_APPLY_ATTR(L"calcext:style", style_);
|
||||||
CP_APPLY_ATTR(L"calcext:date", calcext_date_);
|
CP_APPLY_ATTR(L"calcext:date", date_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_group_attr::add_attributes(const xml::attributes_wc_ptr& Attributes)
|
||||||
|
{
|
||||||
|
CP_APPLY_ATTR(L"calcext:id", id_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:type", type_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:line-width", line_width_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:first", first_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:last", last_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:markers", markers_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:display-hidden", display_hidden_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:right-to-left", right_to_left_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:display-x-axis", display_x_axis_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:display-empty-cells-as", display_empty_cells_as_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:min-axis-type", min_axis_type_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:max-axis-type", max_axis_type_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:manual-min", manual_min_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-series", color_series_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-negative", color_negative_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-axis", color_axis_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-markers", color_markers_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-first", color_first_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-last", color_last_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-high", color_high_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:color-low", color_low_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:date-axis", date_axis_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:high", high_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:low", low_);
|
||||||
}
|
}
|
||||||
// calcext_conditional_formats
|
// calcext_conditional_formats
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_conditional_formats::ns = L"calcext";
|
const wchar_t * calcext_conditional_formats::ns = L"calcext";
|
||||||
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
|
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
|
||||||
|
|
||||||
@ -97,13 +125,13 @@ void calcext_conditional_formats::xlsx_convert(oox::xlsx_conversion_context & Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
// calcext_conditional_format
|
// calcext_conditional_format
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_conditional_format::ns = L"calcext";
|
const wchar_t * calcext_conditional_format::ns = L"calcext";
|
||||||
const wchar_t * calcext_conditional_format::name = L"conditional-format";
|
const wchar_t * calcext_conditional_format::name = L"conditional-format";
|
||||||
|
|
||||||
void calcext_conditional_format::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_conditional_format::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:target-range-address", calcext_target_range_address_);
|
CP_APPLY_ATTR(L"calcext:target-range-address", target_range_address_);
|
||||||
}
|
}
|
||||||
void calcext_conditional_format::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
void calcext_conditional_format::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||||
{
|
{
|
||||||
@ -111,9 +139,9 @@ void calcext_conditional_format::add_child_element( xml::sax * Reader, const std
|
|||||||
}
|
}
|
||||||
void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Context)
|
void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||||
{
|
{
|
||||||
if (!calcext_target_range_address_) return;
|
if (!target_range_address_) return;
|
||||||
|
|
||||||
Context.get_conditionalFormatting_context().start(*calcext_target_range_address_);
|
Context.get_conditionalFormatting_context().start(*target_range_address_);
|
||||||
|
|
||||||
for (size_t i = 0 ; i < content_.size(); i++)
|
for (size_t i = 0 ; i < content_.size(); i++)
|
||||||
{
|
{
|
||||||
@ -123,13 +151,13 @@ void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// calcext_data_bar
|
// calcext_data_bar
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_data_bar::ns = L"calcext";
|
const wchar_t * calcext_data_bar::ns = L"calcext";
|
||||||
const wchar_t * calcext_data_bar::name = L"data-bar";
|
const wchar_t * calcext_data_bar::name = L"data-bar";
|
||||||
|
|
||||||
void calcext_data_bar::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_data_bar::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:show-value", calcext_show_value_);
|
CP_APPLY_ATTR(L"calcext:show-value", show_value_);
|
||||||
attr_.add_attributes(Attributes);
|
attr_.add_attributes(Attributes);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -140,13 +168,13 @@ void calcext_data_bar::add_child_element( xml::sax * Reader, const std::wstring
|
|||||||
void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
|
void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||||
{
|
{
|
||||||
Context.get_conditionalFormatting_context().add_rule(2);
|
Context.get_conditionalFormatting_context().add_rule(2);
|
||||||
if (calcext_show_value_)
|
if (show_value_)
|
||||||
Context.get_conditionalFormatting_context().set_showVal(*calcext_show_value_);
|
Context.get_conditionalFormatting_context().set_showVal(*show_value_);
|
||||||
|
|
||||||
if (attr_.calcext_positive_color_)
|
if (attr_.positive_color_)
|
||||||
Context.get_conditionalFormatting_context().add_color(L"ff" + attr_.calcext_positive_color_->get_hex_value());
|
Context.get_conditionalFormatting_context().add_color(L"ff" + attr_.positive_color_->get_hex_value());
|
||||||
|
|
||||||
Context.get_conditionalFormatting_context().set_dataBar(attr_.calcext_min_length_, attr_.calcext_max_length_);
|
Context.get_conditionalFormatting_context().set_dataBar(attr_.min_length_, attr_.max_length_);
|
||||||
|
|
||||||
for (size_t i = 0 ; i < content_.size(); i++)
|
for (size_t i = 0 ; i < content_.size(); i++)
|
||||||
{
|
{
|
||||||
@ -154,7 +182,7 @@ void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// calcext_color_scale
|
// calcext_color_scale
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_color_scale::ns = L"calcext";
|
const wchar_t * calcext_color_scale::ns = L"calcext";
|
||||||
const wchar_t * calcext_color_scale::name = L"color-scale";
|
const wchar_t * calcext_color_scale::name = L"color-scale";
|
||||||
|
|
||||||
@ -174,13 +202,13 @@ void calcext_color_scale::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// calcext_icon_set
|
// calcext_icon_set
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_icon_set::ns = L"calcext";
|
const wchar_t * calcext_icon_set::ns = L"calcext";
|
||||||
const wchar_t * calcext_icon_set::name = L"icon-set";
|
const wchar_t * calcext_icon_set::name = L"icon-set";
|
||||||
|
|
||||||
void calcext_icon_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_icon_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:show-value", calcext_show_value_);
|
CP_APPLY_ATTR(L"calcext:show-value", show_value_);
|
||||||
attr_.add_attributes(Attributes);
|
attr_.add_attributes(Attributes);
|
||||||
}
|
}
|
||||||
void calcext_icon_set::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
void calcext_icon_set::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||||
@ -191,8 +219,8 @@ void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
{
|
{
|
||||||
Context.get_conditionalFormatting_context().add_rule(4);
|
Context.get_conditionalFormatting_context().add_rule(4);
|
||||||
|
|
||||||
if (calcext_show_value_)
|
if (show_value_)
|
||||||
Context.get_conditionalFormatting_context().set_showVal(*calcext_show_value_);
|
Context.get_conditionalFormatting_context().set_showVal(*show_value_);
|
||||||
|
|
||||||
for (size_t i = 0 ; i < content_.size(); i++)
|
for (size_t i = 0 ; i < content_.size(); i++)
|
||||||
{
|
{
|
||||||
@ -201,14 +229,14 @@ void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// calcext_formatting_entry
|
// calcext_formatting_entry
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_formatting_entry::ns = L"calcext";
|
const wchar_t * calcext_formatting_entry::ns = L"calcext";
|
||||||
const wchar_t * calcext_formatting_entry::name = L"formatting-entry";
|
const wchar_t * calcext_formatting_entry::name = L"formatting-entry";
|
||||||
|
|
||||||
void calcext_formatting_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_formatting_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:value", calcext_value_);
|
CP_APPLY_ATTR(L"calcext:value", value_);
|
||||||
CP_APPLY_ATTR(L"calcext:type", calcext_type_);
|
CP_APPLY_ATTR(L"calcext:type", type_);
|
||||||
}
|
}
|
||||||
void calcext_formatting_entry::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
void calcext_formatting_entry::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||||
{
|
{
|
||||||
@ -216,20 +244,20 @@ void calcext_formatting_entry::add_child_element( xml::sax * Reader, const std::
|
|||||||
}
|
}
|
||||||
void calcext_formatting_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
|
void calcext_formatting_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||||
{
|
{
|
||||||
calcext_type::type type_ = calcext_type_.get_value_or(calcext_type::Number).get_type();
|
calcext_type::type t = type_.get_value_or(calcext_type::Number).get_type();
|
||||||
Context.get_conditionalFormatting_context().add_sfv((int)type_, calcext_value_.get_value_or(L""));
|
Context.get_conditionalFormatting_context().add_sfv((int)t, value_.get_value_or(L""));
|
||||||
}
|
}
|
||||||
|
|
||||||
// calcext_color_scale_entry
|
// calcext_color_scale_entry
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_color_scale_entry::ns = L"calcext";
|
const wchar_t * calcext_color_scale_entry::ns = L"calcext";
|
||||||
const wchar_t * calcext_color_scale_entry::name = L"color-scale-entry";
|
const wchar_t * calcext_color_scale_entry::name = L"color-scale-entry";
|
||||||
|
|
||||||
void calcext_color_scale_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
void calcext_color_scale_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||||
{
|
{
|
||||||
CP_APPLY_ATTR(L"calcext:value", calcext_value_);
|
CP_APPLY_ATTR(L"calcext:value", value_);
|
||||||
CP_APPLY_ATTR(L"calcext:type", calcext_type_);
|
CP_APPLY_ATTR(L"calcext:type", type_);
|
||||||
CP_APPLY_ATTR(L"calcext:color", calcext_color_);
|
CP_APPLY_ATTR(L"calcext:color", color_);
|
||||||
}
|
}
|
||||||
void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||||
{
|
{
|
||||||
@ -237,16 +265,16 @@ void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const std:
|
|||||||
}
|
}
|
||||||
void calcext_color_scale_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
|
void calcext_color_scale_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||||
{
|
{
|
||||||
if (calcext_color_)
|
if (color_)
|
||||||
Context.get_conditionalFormatting_context().add_color(L"ff" + calcext_color_->get_hex_value());
|
Context.get_conditionalFormatting_context().add_color(L"ff" + color_->get_hex_value());
|
||||||
else
|
else
|
||||||
Context.get_conditionalFormatting_context().add_color(L"ffffffff");
|
Context.get_conditionalFormatting_context().add_color(L"ffffffff");
|
||||||
|
|
||||||
calcext_type::type type_ = calcext_type_.get_value_or(calcext_type::Number).get_type();
|
calcext_type::type t = type_.get_value_or(calcext_type::Number).get_type();
|
||||||
Context.get_conditionalFormatting_context().add_sfv((int)type_, calcext_value_.get_value_or(L""));
|
Context.get_conditionalFormatting_context().add_sfv((int)t, value_.get_value_or(L""));
|
||||||
}
|
}
|
||||||
// calcext_condition
|
// calcext_condition
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_condition::ns = L"calcext";
|
const wchar_t * calcext_condition::ns = L"calcext";
|
||||||
const wchar_t * calcext_condition::name = L"condition";
|
const wchar_t * calcext_condition::name = L"condition";
|
||||||
|
|
||||||
@ -262,11 +290,11 @@ void calcext_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
{
|
{
|
||||||
Context.get_conditionalFormatting_context().add_rule(1);
|
Context.get_conditionalFormatting_context().add_rule(1);
|
||||||
|
|
||||||
if (attr_.calcext_value_)
|
if (attr_.value_)
|
||||||
{
|
{
|
||||||
Context.get_conditionalFormatting_context().set_formula(*attr_.calcext_value_);
|
Context.get_conditionalFormatting_context().set_formula(*attr_.value_);
|
||||||
}
|
}
|
||||||
std::wstring style_name = attr_.calcext_apply_style_name_.get_value_or(L"");
|
std::wstring style_name = attr_.apply_style_name_.get_value_or(L"");
|
||||||
|
|
||||||
int dxfId = Context.get_dxfId_style(style_name);
|
int dxfId = Context.get_dxfId_style(style_name);
|
||||||
|
|
||||||
@ -274,7 +302,7 @@ void calcext_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
Context.get_conditionalFormatting_context().set_dxf(dxfId);
|
Context.get_conditionalFormatting_context().set_dxf(dxfId);
|
||||||
}
|
}
|
||||||
// calcext_condition
|
// calcext_condition
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------------------------------------
|
||||||
const wchar_t * calcext_date_is::ns = L"calcext";
|
const wchar_t * calcext_date_is::ns = L"calcext";
|
||||||
const wchar_t * calcext_date_is::name = L"date-is";
|
const wchar_t * calcext_date_is::name = L"date-is";
|
||||||
|
|
||||||
@ -290,15 +318,205 @@ void calcext_date_is::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
{
|
{
|
||||||
Context.get_conditionalFormatting_context().add_rule(5);
|
Context.get_conditionalFormatting_context().add_rule(5);
|
||||||
|
|
||||||
Context.get_conditionalFormatting_context().set_time_period(attr_.calcext_date_.get_value_or(odf_types::time_period::today).get_type());
|
Context.get_conditionalFormatting_context().set_time_period(attr_.date_.get_value_or(odf_types::time_period::today).get_type());
|
||||||
|
|
||||||
std::wstring style_name = attr_.calcext_style_.get_value_or(L"");
|
std::wstring style_name = attr_.style_.get_value_or(L"");
|
||||||
|
|
||||||
int dxfId = Context.get_dxfId_style(style_name);
|
int dxfId = Context.get_dxfId_style(style_name);
|
||||||
|
|
||||||
if (dxfId >= 0)
|
if (dxfId >= 0)
|
||||||
Context.get_conditionalFormatting_context().set_dxf(dxfId);
|
Context.get_conditionalFormatting_context().set_dxf(dxfId);
|
||||||
}
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline_groups::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline_groups::name = L"sparkline-groups";
|
||||||
|
|
||||||
|
void calcext_sparkline_groups::add_attributes(const xml::attributes_wc_ptr& Attributes)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void calcext_sparkline_groups::add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_groups::xlsx_convert(oox::xlsx_conversion_context& Context)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(Context.current_sheet().sparklines())
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:sparklineGroups")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"xmlns:xm", L"http://schemas.microsoft.com/office/excel/2006/main");
|
||||||
|
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group *group = dynamic_cast<calcext_sparkline_group*>(content_[i].get());
|
||||||
|
group->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline_group::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline_group::name = L"sparkline-group";
|
||||||
|
|
||||||
|
void calcext_sparkline_group::add_attributes(const xml::attributes_wc_ptr& Attributes)
|
||||||
|
{
|
||||||
|
attr_.add_attributes(Attributes);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_group::add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_group::serialize(std::wostream& strm)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(strm)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:sparklineGroup")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR_OPT(L"xr2:uid", attr_.id_);
|
||||||
|
CP_XML_ATTR_OPT(L"type", attr_.type_);
|
||||||
|
CP_XML_ATTR_OPT(L"ref", attr_.ref_);
|
||||||
|
CP_XML_ATTR_OPT(L"lineWeight", attr_.line_width_);
|
||||||
|
CP_XML_ATTR_OPT(L"markers", attr_.markers_);
|
||||||
|
CP_XML_ATTR_OPT(L"first", attr_.first_);
|
||||||
|
CP_XML_ATTR_OPT(L"last", attr_.last_);
|
||||||
|
CP_XML_ATTR_OPT(L"high", attr_.high_);
|
||||||
|
CP_XML_ATTR_OPT(L"low", attr_.low_);
|
||||||
|
CP_XML_ATTR_OPT(L"displayXAxis", attr_.display_x_axis_);
|
||||||
|
CP_XML_ATTR_OPT(L"displayHidden", attr_.display_hidden_);
|
||||||
|
CP_XML_ATTR_OPT(L"dateAxis", attr_.date_axis_);
|
||||||
|
CP_XML_ATTR_OPT(L"negative", attr_.negative_);
|
||||||
|
CP_XML_ATTR_OPT(L"displayEmptyCellsAs", attr_.display_empty_cells_as_);
|
||||||
|
CP_XML_ATTR_OPT(L"minAxisType", attr_.min_axis_type_);
|
||||||
|
CP_XML_ATTR_OPT(L"maxAxisType", attr_.max_axis_type_);
|
||||||
|
CP_XML_ATTR_OPT(L"rightToLeft", attr_.right_to_left_);
|
||||||
|
CP_XML_ATTR_OPT(L"manualMax", attr_.manual_max_);
|
||||||
|
CP_XML_ATTR_OPT(L"manualMin", attr_.manual_min_);
|
||||||
|
|
||||||
|
|
||||||
|
if (attr_.color_series_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorSeries")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_series_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_negative_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorNegative")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_negative_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_axis_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorAxis")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_axis_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_markers_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorMarkers")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_markers_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_first_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorFirst")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_first_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_last_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorLast")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_last_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_high_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorHigh")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_high_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attr_.color_low_)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:colorLow")
|
||||||
|
{
|
||||||
|
CP_XML_ATTR(L"rgb", attr_.color_low_->get_hex_value(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
calcext_sparklines* sparklines = dynamic_cast<calcext_sparklines*>(content_[i].get());
|
||||||
|
sparklines->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparklines::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparklines::name = L"sparklines";
|
||||||
|
|
||||||
|
void calcext_sparklines::add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparklines::serialize(std::wostream& strm)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(strm)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:sparklines")
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
calcext_sparkline* sparkline = dynamic_cast<calcext_sparkline*>(content_[i].get());
|
||||||
|
sparkline->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline::name = L"sparkline";
|
||||||
|
|
||||||
|
void calcext_sparkline::add_attributes(const xml::attributes_wc_ptr& Attributes)
|
||||||
|
{
|
||||||
|
CP_APPLY_ATTR(L"calcext:data-range", data_range_);
|
||||||
|
CP_APPLY_ATTR(L"calcext:cell-address", cell_address_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline::serialize(std::wostream& strm)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(strm)
|
||||||
|
{
|
||||||
|
CP_XML_NODE(L"x14:sparkline")
|
||||||
|
{
|
||||||
|
if (data_range_)
|
||||||
|
{
|
||||||
|
formulasconvert::odf2oox_converter converter;
|
||||||
|
std::wstring f = converter.convert_named_ref(*data_range_);
|
||||||
|
|
||||||
|
CP_XML_NODE(L"xm:f")
|
||||||
|
{
|
||||||
|
CP_XML_STREAM() << XmlUtils::EncodeXmlString(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cell_address_)
|
||||||
|
{
|
||||||
|
formulasconvert::odf2oox_converter converter;
|
||||||
|
std::wstring ref = converter.convert_named_ref(*cell_address_, false);
|
||||||
|
|
||||||
|
CP_XML_NODE(L"xm:sqref")
|
||||||
|
{
|
||||||
|
CP_XML_STREAM() << XmlUtils::EncodeXmlString(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,7 @@
|
|||||||
#include "../../DataTypes/iconset_type.h"
|
#include "../../DataTypes/iconset_type.h"
|
||||||
#include "../../DataTypes/calcext_type.h"
|
#include "../../DataTypes/calcext_type.h"
|
||||||
#include "../../DataTypes/timeperiod.h"
|
#include "../../DataTypes/timeperiod.h"
|
||||||
|
#include "../../DataTypes/sparklines.h"
|
||||||
|
|
||||||
namespace cpdoccore {
|
namespace cpdoccore {
|
||||||
namespace odf_reader {
|
namespace odf_reader {
|
||||||
@ -52,11 +53,11 @@ class calcext_data_bar_attr
|
|||||||
public:
|
public:
|
||||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
|
|
||||||
_CP_OPT(odf_types::color) calcext_axis_color_;
|
_CP_OPT(odf_types::color) axis_color_;
|
||||||
_CP_OPT(odf_types::color) calcext_positive_color_;
|
_CP_OPT(odf_types::color) positive_color_;
|
||||||
_CP_OPT(odf_types::color) calcext_negative_color_;
|
_CP_OPT(odf_types::color) negative_color_;
|
||||||
_CP_OPT(int) calcext_max_length_;
|
_CP_OPT(int) max_length_;
|
||||||
_CP_OPT(int) calcext_min_length_;
|
_CP_OPT(int) min_length_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class calcext_condition_attr
|
class calcext_condition_attr
|
||||||
@ -64,10 +65,9 @@ class calcext_condition_attr
|
|||||||
public:
|
public:
|
||||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
|
|
||||||
_CP_OPT(std::wstring) calcext_base_cell_address_;
|
_CP_OPT(std::wstring) base_cell_address_;
|
||||||
_CP_OPT(std::wstring) calcext_apply_style_name_;
|
_CP_OPT(std::wstring) apply_style_name_;
|
||||||
_CP_OPT(std::wstring) calcext_value_;
|
_CP_OPT(std::wstring) value_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class calcext_icon_set_attr
|
class calcext_icon_set_attr
|
||||||
@ -75,7 +75,7 @@ class calcext_icon_set_attr
|
|||||||
public:
|
public:
|
||||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
|
|
||||||
_CP_OPT(odf_types::iconset_type) calcext_icon_set_type_;
|
_CP_OPT(odf_types::iconset_type) icon_set_type_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -84,10 +84,46 @@ class calcext_date_is_attr
|
|||||||
public:
|
public:
|
||||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
|
|
||||||
_CP_OPT(std::wstring) calcext_style_;
|
_CP_OPT(std::wstring) style_;
|
||||||
_CP_OPT(odf_types::time_period) calcext_date_;
|
_CP_OPT(odf_types::time_period) date_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
class calcext_sparkline_group_attr
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void add_attributes(const xml::attributes_wc_ptr& Attributes);
|
||||||
|
|
||||||
|
_CP_OPT(std::wstring) id_;
|
||||||
|
_CP_OPT(std::wstring) ref_;
|
||||||
|
_CP_OPT(odf_types::sparkline_type) type_;
|
||||||
|
_CP_OPT(odf_types::length) line_width_;
|
||||||
|
_CP_OPT(bool) first_;
|
||||||
|
_CP_OPT(bool) last_;
|
||||||
|
_CP_OPT(bool) display_hidden_;
|
||||||
|
_CP_OPT(bool) right_to_left_;
|
||||||
|
_CP_OPT(bool) display_x_axis_;
|
||||||
|
_CP_OPT(bool) date_axis_;
|
||||||
|
_CP_OPT(bool) negative_;
|
||||||
|
_CP_OPT(bool) markers_;
|
||||||
|
_CP_OPT(bool) high_;
|
||||||
|
_CP_OPT(bool) low_;
|
||||||
|
|
||||||
|
_CP_OPT(odf_types::sparkline_empty) display_empty_cells_as_;
|
||||||
|
_CP_OPT(odf_types::sparkline_axis_type) min_axis_type_;
|
||||||
|
_CP_OPT(odf_types::sparkline_axis_type) max_axis_type_;
|
||||||
|
_CP_OPT(double) manual_min_;
|
||||||
|
_CP_OPT(double) manual_max_;
|
||||||
|
|
||||||
|
_CP_OPT(odf_types::color) color_series_;
|
||||||
|
_CP_OPT(odf_types::color) color_negative_;
|
||||||
|
_CP_OPT(odf_types::color) color_axis_;
|
||||||
|
_CP_OPT(odf_types::color) color_markers_;
|
||||||
|
_CP_OPT(odf_types::color) color_first_;
|
||||||
|
_CP_OPT(odf_types::color) color_last_;
|
||||||
|
_CP_OPT(odf_types::color) color_high_;
|
||||||
|
_CP_OPT(odf_types::color) color_low_;
|
||||||
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// calcext:color-scale-entry
|
// calcext:color-scale-entry
|
||||||
@ -97,7 +133,7 @@ public:
|
|||||||
static const wchar_t * ns;
|
static const wchar_t * ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t * name;
|
||||||
static const xml::NodeType xml_type = xml::typeElement;
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
static const ElementType type = typeCalcextColorScaleEntry;
|
static const ElementType type = typeCalcextColorScaleEntry;
|
||||||
CPDOCCORE_DEFINE_VISITABLE()
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
@ -105,9 +141,9 @@ public:
|
|||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||||
|
|
||||||
_CP_OPT(odf_types::color) calcext_color_;
|
_CP_OPT(odf_types::color) color_;
|
||||||
_CP_OPT(std::wstring) calcext_value_;
|
_CP_OPT(std::wstring) value_;
|
||||||
_CP_OPT(odf_types::calcext_type) calcext_type_;
|
_CP_OPT(odf_types::calcext_type) type_;
|
||||||
|
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_color_scale_entry);
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_color_scale_entry);
|
||||||
@ -119,7 +155,7 @@ public:
|
|||||||
static const wchar_t * ns;
|
static const wchar_t * ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t * name;
|
||||||
static const xml::NodeType xml_type = xml::typeElement;
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
static const ElementType type = typeCalcextFormattingEntry;
|
static const ElementType type = typeCalcextFormattingEntry;
|
||||||
CPDOCCORE_DEFINE_VISITABLE()
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
@ -127,8 +163,8 @@ public:
|
|||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||||
|
|
||||||
_CP_OPT(std::wstring) calcext_value_;
|
_CP_OPT(std::wstring) value_;
|
||||||
_CP_OPT(odf_types::calcext_type) calcext_type_;
|
_CP_OPT(odf_types::calcext_type) type_;
|
||||||
|
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_formatting_entry);
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_formatting_entry);
|
||||||
@ -140,7 +176,7 @@ public:
|
|||||||
static const wchar_t * ns;
|
static const wchar_t * ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t * name;
|
||||||
static const xml::NodeType xml_type = xml::typeElement;
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
static const ElementType type = typeCalcextIconSet;
|
static const ElementType type = typeCalcextIconSet;
|
||||||
CPDOCCORE_DEFINE_VISITABLE()
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
@ -148,9 +184,9 @@ public:
|
|||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||||
|
|
||||||
_CP_OPT(bool) calcext_show_value_;
|
_CP_OPT(bool) show_value_;
|
||||||
calcext_icon_set_attr attr_;
|
calcext_icon_set_attr attr_;
|
||||||
office_element_ptr_array content_;
|
office_element_ptr_array content_;
|
||||||
|
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_icon_set);
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_icon_set);
|
||||||
@ -170,9 +206,9 @@ public:
|
|||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||||
|
|
||||||
_CP_OPT(bool) calcext_show_value_;
|
_CP_OPT(bool) show_value_;
|
||||||
calcext_data_bar_attr attr_;
|
calcext_data_bar_attr attr_;
|
||||||
office_element_ptr_array content_;
|
office_element_ptr_array content_;
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_data_bar)
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_data_bar)
|
||||||
|
|
||||||
@ -202,7 +238,7 @@ public:
|
|||||||
static const wchar_t * ns;
|
static const wchar_t * ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t * name;
|
||||||
static const xml::NodeType xml_type = xml::typeElement;
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
static const ElementType type = typeCalcextDateIs;
|
static const ElementType type = typeCalcextDateIs;
|
||||||
CPDOCCORE_DEFINE_VISITABLE()
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||||
@ -248,7 +284,7 @@ public:
|
|||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||||
|
|
||||||
_CP_OPT(std::wstring) calcext_target_range_address_;
|
_CP_OPT(std::wstring) target_range_address_;
|
||||||
|
|
||||||
office_element_ptr_array content_;
|
office_element_ptr_array content_;
|
||||||
|
|
||||||
@ -256,23 +292,101 @@ public:
|
|||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_format)
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_format)
|
||||||
|
|
||||||
// calcext:conditional-formats
|
// calcext:conditional-formats
|
||||||
class calcext_conditional_formats: public office_element_impl<calcext_conditional_formats>
|
class calcext_conditional_formats : public office_element_impl<calcext_conditional_formats>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const wchar_t * ns;
|
static const wchar_t* ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t* name;
|
||||||
static const xml::NodeType xml_type = xml::typeElement;
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
static const ElementType type = typeCalcextConditionalFormats;
|
static const ElementType type = typeCalcextConditionalFormats;
|
||||||
CPDOCCORE_DEFINE_VISITABLE()
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
virtual void add_attributes(const xml::attributes_wc_ptr& Attributes);
|
||||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
virtual void add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
|
||||||
|
virtual void xlsx_convert(oox::xlsx_conversion_context& Context);
|
||||||
|
|
||||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
|
||||||
|
|
||||||
office_element_ptr_array content_;
|
office_element_ptr_array content_;
|
||||||
|
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_formats)
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_formats)
|
||||||
|
|
||||||
|
// calcext:sparkline-groups
|
||||||
|
class calcext_sparkline_groups : public office_element_impl<calcext_sparkline_groups>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklineGroups;
|
||||||
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
|
virtual void add_attributes(const xml::attributes_wc_ptr& Attributes);
|
||||||
|
virtual void add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
|
||||||
|
virtual void xlsx_convert(oox::xlsx_conversion_context& Context);
|
||||||
|
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline_groups)
|
||||||
|
|
||||||
|
// calcext:sparkline-group
|
||||||
|
class calcext_sparkline_group : public office_element_impl<calcext_sparkline_group>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklineGroup;
|
||||||
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
|
virtual void add_attributes(const xml::attributes_wc_ptr& Attributes);
|
||||||
|
virtual void add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
|
||||||
|
void serialize(std::wostream& strm);
|
||||||
|
|
||||||
|
calcext_sparkline_group_attr attr_;
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline_group)
|
||||||
|
|
||||||
|
// calcext:sparklines
|
||||||
|
class calcext_sparklines : public office_element_impl<calcext_sparklines>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklines;
|
||||||
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
|
virtual void add_attributes(const xml::attributes_wc_ptr& Attributes) {}
|
||||||
|
virtual void add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
|
||||||
|
void serialize(std::wostream& strm);
|
||||||
|
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparklines)
|
||||||
|
|
||||||
|
// calcext:sparkline
|
||||||
|
class calcext_sparkline : public office_element_impl<calcext_sparkline>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklines;
|
||||||
|
CPDOCCORE_DEFINE_VISITABLE()
|
||||||
|
|
||||||
|
virtual void add_attributes(const xml::attributes_wc_ptr& Attributes);
|
||||||
|
virtual void add_child_element(xml::sax* Reader, const std::wstring& Ns, const std::wstring& Name) {}
|
||||||
|
|
||||||
|
void serialize(std::wostream& strm);
|
||||||
|
|
||||||
|
_CP_OPT(std::wstring) data_range_;
|
||||||
|
_CP_OPT(std::wstring) cell_address_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,7 +214,11 @@ void table_table::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
|||||||
{
|
{
|
||||||
CP_CREATE_ELEMENT(office_forms_);
|
CP_CREATE_ELEMENT(office_forms_);
|
||||||
}
|
}
|
||||||
else
|
else if CP_CHECK_NAME(L"calcext", L"sparkline-groups")
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(sparkline_groups_);
|
||||||
|
}
|
||||||
|
else
|
||||||
CP_NOT_APPLICABLE_ELM();
|
CP_NOT_APPLICABLE_ELM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -687,9 +687,11 @@ public:
|
|||||||
office_element_ptr table_table_source_;
|
office_element_ptr table_table_source_;
|
||||||
|
|
||||||
office_element_ptr conditional_formats_;
|
office_element_ptr conditional_formats_;
|
||||||
|
office_element_ptr sparkline_groups_;
|
||||||
|
|
||||||
office_element_ptr table_shapes_;
|
office_element_ptr table_shapes_;
|
||||||
office_element_ptr_array table_named_;
|
office_element_ptr_array table_named_;
|
||||||
|
|
||||||
office_element_ptr office_forms_;
|
office_element_ptr office_forms_;
|
||||||
//office-dde-source
|
//office-dde-source
|
||||||
//table-scenario
|
//table-scenario
|
||||||
|
|||||||
@ -399,6 +399,11 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
|
|||||||
if (conditional_formats_)
|
if (conditional_formats_)
|
||||||
conditional_formats_->xlsx_convert(Context);
|
conditional_formats_->xlsx_convert(Context);
|
||||||
|
|
||||||
|
if (sparkline_groups_)
|
||||||
|
{
|
||||||
|
sparkline_groups_->xlsx_convert(Context);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0 ; i < table_named_.size(); i++)
|
for (size_t i = 0 ; i < table_named_.size(); i++)
|
||||||
{
|
{
|
||||||
table_named_[i]->xlsx_convert(Context);
|
table_named_[i]->xlsx_convert(Context);
|
||||||
|
|||||||
@ -52,6 +52,7 @@
|
|||||||
#include "../../../OOXML/XlsxFormat/Pivot/PivotTable.h"
|
#include "../../../OOXML/XlsxFormat/Pivot/PivotTable.h"
|
||||||
#include "../../../OOXML/XlsxFormat/Pivot/PivotCacheDefinition.h"
|
#include "../../../OOXML/XlsxFormat/Pivot/PivotCacheDefinition.h"
|
||||||
#include "../../../OOXML/XlsxFormat/Pivot/PivotCacheRecords.h"
|
#include "../../../OOXML/XlsxFormat/Pivot/PivotCacheRecords.h"
|
||||||
|
#include "../../../OOXML/XlsxFormat/Worksheets/Sparkline.h"
|
||||||
|
|
||||||
#include "../../../OOXML/DocxFormat/VmlDrawing.h"
|
#include "../../../OOXML/DocxFormat/VmlDrawing.h"
|
||||||
#include "../../../OOXML/DocxFormat/Media/ActiveX.h"
|
#include "../../../OOXML/DocxFormat/Media/ActiveX.h"
|
||||||
@ -353,7 +354,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
|||||||
}
|
}
|
||||||
//todooo для оптимизации - перенести мержи в начало
|
//todooo для оптимизации - перенести мержи в начало
|
||||||
|
|
||||||
//выносные части таблицы
|
|
||||||
if (oox_sheet->m_oTableParts.IsInit())
|
if (oox_sheet->m_oTableParts.IsInit())
|
||||||
{
|
{
|
||||||
for (size_t i=0 ; i < oox_sheet->m_oTableParts->m_arrItems.size(); i++)
|
for (size_t i=0 ; i < oox_sheet->m_oTableParts->m_arrItems.size(); i++)
|
||||||
@ -378,30 +378,27 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
|||||||
}
|
}
|
||||||
convert(oox_sheet->m_oDataValidations.GetPointer());
|
convert(oox_sheet->m_oDataValidations.GetPointer());
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//колонки
|
if (oox_sheet->m_oColBreaks.IsInit())
|
||||||
if (oox_sheet->m_oColBreaks.IsInit())
|
{
|
||||||
|
for (size_t i = 0; i < oox_sheet->m_oColBreaks->m_arrItems.size(); i++)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < oox_sheet->m_oColBreaks->m_arrItems.size(); i++)
|
OOX::Spreadsheet::CBreak* break_ = dynamic_cast<OOX::Spreadsheet::CBreak*>(oox_sheet->m_oColBreaks->m_arrItems[i]);
|
||||||
{
|
if (break_->m_oId.IsInit())
|
||||||
OOX::Spreadsheet::CBreak *break_ = dynamic_cast<OOX::Spreadsheet::CBreak*>(oox_sheet->m_oColBreaks->m_arrItems[i]);
|
ods_context->current_table()->add_column_break(break_->m_oId->GetValue());
|
||||||
if (break_->m_oId.IsInit())
|
|
||||||
ods_context->current_table()->add_column_break(break_->m_oId->GetValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ods_context->start_columns();
|
|
||||||
for (size_t col = 0 ; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.size(); col++)
|
|
||||||
{
|
|
||||||
convert(oox_sheet->m_oCols->m_arrItems[col]);
|
|
||||||
}
|
}
|
||||||
ods_context->end_columns();
|
}
|
||||||
|
ods_context->start_columns();
|
||||||
|
for (size_t col = 0; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.size(); col++)
|
||||||
|
{
|
||||||
|
convert(oox_sheet->m_oCols->m_arrItems[col]);
|
||||||
|
}
|
||||||
|
ods_context->end_columns();
|
||||||
|
|
||||||
//мержи
|
|
||||||
for (size_t mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
|
for (size_t mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
|
||||||
{
|
{
|
||||||
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
|
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
|
||||||
ods_context->add_merge_cells(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get());
|
ods_context->add_merge_cells(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get());
|
||||||
}
|
}
|
||||||
//строки
|
|
||||||
if (oox_sheet->m_oSheetData.IsInit() )
|
if (oox_sheet->m_oSheetData.IsInit() )
|
||||||
{
|
{
|
||||||
if (oox_sheet->m_oRowBreaks.IsInit())
|
if (oox_sheet->m_oRowBreaks.IsInit())
|
||||||
@ -442,13 +439,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
|||||||
convert(oox_sheet->m_oOleObjects.GetPointer(), oox_sheet);
|
convert(oox_sheet->m_oOleObjects.GetPointer(), oox_sheet);
|
||||||
convert(oox_sheet->m_oControls.GetPointer(), oox_sheet);
|
convert(oox_sheet->m_oControls.GetPointer(), oox_sheet);
|
||||||
|
|
||||||
//сортировки
|
|
||||||
//convert(oox_sheet->m_oSortState.GetPointer());
|
//convert(oox_sheet->m_oSortState.GetPointer());
|
||||||
|
|
||||||
//автофильтры
|
|
||||||
convert(oox_sheet->m_oAutofilter.GetPointer());
|
convert(oox_sheet->m_oAutofilter.GetPointer());
|
||||||
|
|
||||||
//условное форматирование
|
|
||||||
if (!oox_sheet->m_arrConditionalFormatting.empty() || oox_sheet->m_oExtLst.IsInit())
|
if (!oox_sheet->m_arrConditionalFormatting.empty() || oox_sheet->m_oExtLst.IsInit())
|
||||||
{
|
{
|
||||||
std::multimap<int, OOX::Spreadsheet::CConditionalFormatting*> mapSorted;
|
std::multimap<int, OOX::Spreadsheet::CConditionalFormatting*> mapSorted;
|
||||||
@ -504,19 +498,22 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
ods_context->start_conditional_formats();
|
|
||||||
|
if (arUnsorted.size() + mapSorted.size() > 0)
|
||||||
for (size_t fmt =0; fmt < arUnsorted.size(); fmt++)
|
|
||||||
{
|
{
|
||||||
convert(arUnsorted[fmt]);
|
ods_context->start_conditional_formats();
|
||||||
|
|
||||||
|
for (size_t fmt = 0; fmt < arUnsorted.size(); fmt++)
|
||||||
|
{
|
||||||
|
convert(arUnsorted[fmt]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::multimap<int, OOX::Spreadsheet::CConditionalFormatting*>::iterator it = mapSorted.begin(); it != mapSorted.end(); ++it)
|
||||||
|
{
|
||||||
|
convert(it->second);
|
||||||
|
}
|
||||||
|
ods_context->end_conditional_formats();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::multimap<int, OOX::Spreadsheet::CConditionalFormatting*>::iterator it = mapSorted.begin();
|
|
||||||
it != mapSorted.end(); ++it)
|
|
||||||
{
|
|
||||||
convert(it->second);
|
|
||||||
}
|
|
||||||
ods_context->end_conditional_formats();
|
|
||||||
}
|
}
|
||||||
OoxConverter::convert(oox_sheet->m_oExtLst.GetPointer());
|
OoxConverter::convert(oox_sheet->m_oExtLst.GetPointer());
|
||||||
|
|
||||||
@ -2559,7 +2556,9 @@ void XlsxConverter::convert(OOX::Spreadsheet::CBorderProp *borderProp, std::wstr
|
|||||||
}
|
}
|
||||||
void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::color) & odf_color)//стоит ли сюда тащить odf_writer type???
|
void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::color) & odf_color)//стоит ли сюда тащить odf_writer type???
|
||||||
{
|
{
|
||||||
if (!color)return;
|
odf_color = boost::none;
|
||||||
|
|
||||||
|
if (!color) return;
|
||||||
|
|
||||||
unsigned char ucA = 0, ucR =0, ucG =0, ucB = 0;
|
unsigned char ucA = 0, ucR =0, ucG =0, ucB = 0;
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -3326,13 +3325,72 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po
|
|||||||
if (oox_from_to->m_oColOff.IsInit()) pos->col_off = oox_from_to->m_oColOff->GetValue();//pt
|
if (oox_from_to->m_oColOff.IsInit()) pos->col_off = oox_from_to->m_oColOff->GetValue();//pt
|
||||||
}
|
}
|
||||||
|
|
||||||
void XlsxConverter::convert(OOX::Spreadsheet::CSparklineGroups *sparkline)
|
void XlsxConverter::convert(OOX::Spreadsheet::CSparklineGroups *sparklineGroups)
|
||||||
{
|
{
|
||||||
if (!sparkline)return;
|
if (!sparklineGroups) return;
|
||||||
|
|
||||||
|
ods_context->current_table()->start_sparkline_groups();
|
||||||
|
for (size_t i = 0; i < sparklineGroups->m_arrItems.size(); ++i)
|
||||||
|
{
|
||||||
|
ods_context->current_table()->start_sparkline_group();
|
||||||
|
convert(sparklineGroups->m_arrItems[i]);
|
||||||
|
ods_context->current_table()->end_sparkline_group();
|
||||||
|
}
|
||||||
|
ods_context->current_table()->end_sparkline_groups();
|
||||||
|
}
|
||||||
|
void XlsxConverter::convert(OOX::Spreadsheet::CSparklineGroup* sparklineGroup)
|
||||||
|
{
|
||||||
|
if (!sparklineGroup) return;
|
||||||
|
|
||||||
|
if (sparklineGroup->m_oUId.IsInit()) ods_context->current_table()->set_sparkline_id(*sparklineGroup->m_oUId);
|
||||||
|
if (sparklineGroup->m_oManualMax.IsInit()) ods_context->current_table()->set_sparkline_manual_max(sparklineGroup->m_oManualMax->GetValue());
|
||||||
|
if (sparklineGroup->m_oManualMin.IsInit()) ods_context->current_table()->set_sparkline_manual_min(sparklineGroup->m_oManualMin->GetValue());
|
||||||
|
if (sparklineGroup->m_oLineWeight.IsInit()) ods_context->current_table()->set_sparkline_line_weight(sparklineGroup->m_oLineWeight->GetValue());
|
||||||
|
if (sparklineGroup->m_oType.IsInit()) ods_context->current_table()->set_sparkline_type(sparklineGroup->m_oType->GetValue());
|
||||||
|
|
||||||
|
if (sparklineGroup->m_oDateAxis.IsInit()) ods_context->current_table()->set_sparkline_date_axis(sparklineGroup->m_oDateAxis->ToBool());
|
||||||
|
if (sparklineGroup->m_oDisplayEmptyCellsAs.IsInit()) ods_context->current_table()->set_sparkline_emptyCellsAs(*sparklineGroup->m_oDisplayEmptyCellsAs);
|
||||||
|
if (sparklineGroup->m_oMarkers.IsInit()) ods_context->current_table()->set_sparkline_markers(sparklineGroup->m_oMarkers->ToBool());
|
||||||
|
if (sparklineGroup->m_oHigh.IsInit()) ods_context->current_table()->set_sparkline_high(sparklineGroup->m_oHigh->ToBool());
|
||||||
|
if (sparklineGroup->m_oLow.IsInit()) ods_context->current_table()->set_sparkline_low(sparklineGroup->m_oLow->ToBool());
|
||||||
|
if (sparklineGroup->m_oFirst.IsInit()) ods_context->current_table()->set_sparkline_first(sparklineGroup->m_oFirst->ToBool());
|
||||||
|
if (sparklineGroup->m_oLast.IsInit()) ods_context->current_table()->set_sparkline_last(sparklineGroup->m_oLast->ToBool());
|
||||||
|
if (sparklineGroup->m_oNegative.IsInit()) ods_context->current_table()->set_sparkline_negative(sparklineGroup->m_oNegative->ToBool());
|
||||||
|
if (sparklineGroup->m_oDisplayXAxis.IsInit()) ods_context->current_table()->set_sparkline_display_xAxis(sparklineGroup->m_oDisplayXAxis->ToBool());
|
||||||
|
if (sparklineGroup->m_oDisplayHidden.IsInit()) ods_context->current_table()->set_sparkline_display_hidden(sparklineGroup->m_oDisplayHidden->ToBool());
|
||||||
|
if (sparklineGroup->m_oRightToLeft.IsInit()) ods_context->current_table()->set_sparkline_rtl(sparklineGroup->m_oRightToLeft->ToBool());
|
||||||
|
if (sparklineGroup->m_oMinAxisType.IsInit()) ods_context->current_table()->set_sparkline_minAxisType(sparklineGroup->m_oMinAxisType->GetValue());
|
||||||
|
if (sparklineGroup->m_oMaxAxisType.IsInit()) ods_context->current_table()->set_sparkline_maxAxisType(sparklineGroup->m_oMaxAxisType->GetValue());
|
||||||
|
|
||||||
|
_CP_OPT(odf_types::color) color;
|
||||||
|
convert(sparklineGroup->m_oColorSeries.GetPointer(), color); ods_context->current_table()->set_sparkline_color_series(color);
|
||||||
|
convert(sparklineGroup->m_oColorNegative.GetPointer(), color); ods_context->current_table()->set_sparkline_color_negative(color);
|
||||||
|
convert(sparklineGroup->m_oColorAxis.GetPointer(), color); ods_context->current_table()->set_sparkline_color_axis(color);
|
||||||
|
convert(sparklineGroup->m_oColorMarkers.GetPointer(), color); ods_context->current_table()->set_sparkline_color_markers(color);
|
||||||
|
convert(sparklineGroup->m_oColorFirst.GetPointer(), color); ods_context->current_table()->set_sparkline_color_first(color);
|
||||||
|
convert(sparklineGroup->m_oColorLast.GetPointer(), color); ods_context->current_table()->set_sparkline_color_last(color);
|
||||||
|
convert(sparklineGroup->m_oColorHigh.GetPointer(), color); ods_context->current_table()->set_sparkline_color_high(color);
|
||||||
|
convert(sparklineGroup->m_oColorLow.GetPointer(), color); ods_context->current_table()->set_sparkline_color_low(color);
|
||||||
|
|
||||||
|
convert(sparklineGroup->m_oSparklines.GetPointer());
|
||||||
|
}
|
||||||
|
void XlsxConverter::convert(OOX::Spreadsheet::CSparklines *sparklines)
|
||||||
|
{
|
||||||
|
if (!sparklines) return;
|
||||||
|
|
||||||
|
ods_context->current_table()->start_sparklines();
|
||||||
|
for (size_t i = 0; i < sparklines->m_arrItems.size(); ++i)
|
||||||
|
{
|
||||||
|
ods_context->current_table()->start_sparkline();
|
||||||
|
ods_context->current_table()->set_sparkline_range(*sparklines->m_arrItems[i]->m_oRef);
|
||||||
|
ods_context->current_table()->set_sparkline_cell(*sparklines->m_arrItems[i]->m_oSqRef);
|
||||||
|
ods_context->current_table()->end_sparkline();
|
||||||
|
}
|
||||||
|
ods_context->current_table()->end_sparklines();
|
||||||
}
|
}
|
||||||
void XlsxConverter::convert(OOX::Spreadsheet::CAltTextTable *alt_text)
|
void XlsxConverter::convert(OOX::Spreadsheet::CAltTextTable *alt_text)
|
||||||
{
|
{
|
||||||
if (!alt_text)return;
|
if (!alt_text) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt)
|
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt)
|
||||||
@ -3343,9 +3401,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_f
|
|||||||
{
|
{
|
||||||
ods_context->current_table()->start_conditional_format(oox_cond_fmt->m_oSqRef.get());
|
ods_context->current_table()->start_conditional_format(oox_cond_fmt->m_oSqRef.get());
|
||||||
|
|
||||||
for (size_t i=0; i< oox_cond_fmt->m_arrItems.size(); i++)
|
for (size_t i = 0; i < oox_cond_fmt->m_arrItems.size(); i++)
|
||||||
|
{
|
||||||
convert(oox_cond_fmt->m_arrItems[i]);//rule
|
convert(oox_cond_fmt->m_arrItems[i]);//rule
|
||||||
|
}
|
||||||
ods_context->current_table()->end_conditional_format();
|
ods_context->current_table()->end_conditional_format();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,9 @@ namespace OOX
|
|||||||
class CPictureWorksheet;
|
class CPictureWorksheet;
|
||||||
class CHeaderFooter;
|
class CHeaderFooter;
|
||||||
class CSparklineGroups;
|
class CSparklineGroups;
|
||||||
|
class CSparklineGroup;
|
||||||
|
class CSparklines;
|
||||||
|
class CSparkline;
|
||||||
class CAltTextTable;
|
class CAltTextTable;
|
||||||
class CExternalLink;
|
class CExternalLink;
|
||||||
class CDataValidations;
|
class CDataValidations;
|
||||||
@ -242,6 +245,9 @@ namespace Oox2Odf
|
|||||||
void convert(OOX::Spreadsheet::CSi *oox_rtf_text);
|
void convert(OOX::Spreadsheet::CSi *oox_rtf_text);
|
||||||
|
|
||||||
void convert(OOX::Spreadsheet::CSparklineGroups *sparkline);
|
void convert(OOX::Spreadsheet::CSparklineGroups *sparkline);
|
||||||
|
void convert(OOX::Spreadsheet::CSparklineGroup *sparkline);
|
||||||
|
void convert(OOX::Spreadsheet::CSparklines *sparkline);
|
||||||
|
|
||||||
void convert(OOX::Spreadsheet::CAltTextTable *alt_text);
|
void convert(OOX::Spreadsheet::CAltTextTable *alt_text);
|
||||||
|
|
||||||
void convert(double oox_size, _CP_OPT(odf_types::length) & odf_size);
|
void convert(double oox_size, _CP_OPT(odf_types::length) & odf_size);
|
||||||
|
|||||||
@ -65,6 +65,33 @@ void calcext_date_is_attr::serialize(CP_ATTR_NODE)
|
|||||||
CP_XML_ATTR_OPT(L"calcext:style", calcext_style_);
|
CP_XML_ATTR_OPT(L"calcext:style", calcext_style_);
|
||||||
CP_XML_ATTR_OPT(L"calcext:date", calcext_date_);
|
CP_XML_ATTR_OPT(L"calcext:date", calcext_date_);
|
||||||
}
|
}
|
||||||
|
void calcext_sparkline_group_attr::serialize(CP_ATTR_NODE)
|
||||||
|
{
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:id", id_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:type", type_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:line-width", line_width_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:first", first_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:last", last_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:markers", markers_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:display-hidden", display_hidden_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:right-to-left", right_to_left_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:display-x-axis", display_x_axis_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:display-empty-cells-as", display_empty_cells_as_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:date-axis", date_axis_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:min-axis-type", min_axis_type_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:max-axis-type", max_axis_type_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:manual-min", manual_min_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-series", color_series_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-negative", color_negative_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-axis", color_axis_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-markers", color_markers_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-first", color_first_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-last", color_last_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-high", color_high_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:color-low", color_low_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// calcext_conditional_formats
|
// calcext_conditional_formats
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
const wchar_t * calcext_conditional_formats::ns = L"calcext";
|
const wchar_t * calcext_conditional_formats::ns = L"calcext";
|
||||||
@ -269,5 +296,98 @@ void calcext_date_is::serialize(std::wostream & _Wostream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline_groups::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline_groups::name = L"sparkline-groups";
|
||||||
|
|
||||||
|
void calcext_sparkline_groups::create_child_element(const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_groups::add_child_element(const office_element_ptr& child_element)
|
||||||
|
{
|
||||||
|
content_.push_back(child_element);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_groups::serialize(std::wostream& _Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(_Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_NODE_SIMPLE()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
content_[i]->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline_group::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline_group::name = L"sparkline-group";
|
||||||
|
|
||||||
|
void calcext_sparkline_group::create_child_element(const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_group::add_child_element(const office_element_ptr& child_element)
|
||||||
|
{
|
||||||
|
content_.push_back(child_element);
|
||||||
|
}
|
||||||
|
void calcext_sparkline_group::serialize(std::wostream& _Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(_Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_NODE_SIMPLE()
|
||||||
|
{
|
||||||
|
attr_.serialize(CP_GET_XML_NODE());
|
||||||
|
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
content_[i]->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparklines::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparklines::name = L"sparklines";
|
||||||
|
|
||||||
|
void calcext_sparklines::create_child_element(const std::wstring& Ns, const std::wstring& Name)
|
||||||
|
{
|
||||||
|
CP_CREATE_ELEMENT(content_);
|
||||||
|
}
|
||||||
|
void calcext_sparklines::add_child_element(const office_element_ptr& child_element)
|
||||||
|
{
|
||||||
|
content_.push_back(child_element);
|
||||||
|
}
|
||||||
|
void calcext_sparklines::serialize(std::wostream& _Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(_Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_NODE_SIMPLE()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < content_.size(); i++)
|
||||||
|
{
|
||||||
|
content_[i]->serialize(CP_XML_STREAM());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
const wchar_t* calcext_sparkline::ns = L"calcext";
|
||||||
|
const wchar_t* calcext_sparkline::name = L"sparkline";
|
||||||
|
|
||||||
|
void calcext_sparkline::serialize(std::wostream& _Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_WRITER(_Wostream)
|
||||||
|
{
|
||||||
|
CP_XML_NODE_SIMPLE()
|
||||||
|
{
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:data-range", data_range_);
|
||||||
|
CP_XML_ATTR_OPT(L"calcext:cell-address", cell_address_);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,9 @@
|
|||||||
#include "../DataTypes/iconset_type.h"
|
#include "../DataTypes/iconset_type.h"
|
||||||
#include "../DataTypes/calcext_type.h"
|
#include "../DataTypes/calcext_type.h"
|
||||||
#include "../DataTypes/timeperiod.h"
|
#include "../DataTypes/timeperiod.h"
|
||||||
|
#include "../DataTypes/sparklines.h"
|
||||||
|
#include "../DataTypes/length.h"
|
||||||
|
#include "../DataTypes/bool.h"
|
||||||
|
|
||||||
namespace cpdoccore {
|
namespace cpdoccore {
|
||||||
namespace odf_writer {
|
namespace odf_writer {
|
||||||
@ -86,6 +89,41 @@ public:
|
|||||||
_CP_OPT(odf_types::time_period) calcext_date_;
|
_CP_OPT(odf_types::time_period) calcext_date_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
class calcext_sparkline_group_attr
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void serialize(CP_ATTR_NODE);
|
||||||
|
|
||||||
|
_CP_OPT(std::wstring) id_;
|
||||||
|
_CP_OPT(std::wstring) ref_;
|
||||||
|
_CP_OPT(odf_types::sparkline_type) type_;
|
||||||
|
_CP_OPT(odf_types::length) line_width_;
|
||||||
|
_CP_OPT(odf_types::Bool) first_;
|
||||||
|
_CP_OPT(odf_types::Bool) last_;
|
||||||
|
_CP_OPT(odf_types::Bool) high_;
|
||||||
|
_CP_OPT(odf_types::Bool) low_;
|
||||||
|
_CP_OPT(odf_types::Bool) display_hidden_;
|
||||||
|
_CP_OPT(odf_types::Bool) right_to_left_;
|
||||||
|
_CP_OPT(odf_types::Bool) display_x_axis_;
|
||||||
|
_CP_OPT(odf_types::Bool) date_axis_;
|
||||||
|
_CP_OPT(odf_types::Bool) negative_;
|
||||||
|
_CP_OPT(odf_types::Bool) markers_;
|
||||||
|
|
||||||
|
_CP_OPT(odf_types::sparkline_empty) display_empty_cells_as_;
|
||||||
|
_CP_OPT(odf_types::sparkline_axis_type) min_axis_type_;
|
||||||
|
_CP_OPT(odf_types::sparkline_axis_type) max_axis_type_;
|
||||||
|
_CP_OPT(double) manual_min_;
|
||||||
|
_CP_OPT(double) manual_max_;
|
||||||
|
|
||||||
|
_CP_OPT(odf_types::color) color_series_;
|
||||||
|
_CP_OPT(odf_types::color) color_negative_;
|
||||||
|
_CP_OPT(odf_types::color) color_axis_;
|
||||||
|
_CP_OPT(odf_types::color) color_markers_;
|
||||||
|
_CP_OPT(odf_types::color) color_first_;
|
||||||
|
_CP_OPT(odf_types::color) color_last_;
|
||||||
|
_CP_OPT(odf_types::color) color_high_;
|
||||||
|
_CP_OPT(odf_types::color) color_low_;
|
||||||
|
};
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// calcext:color-scale-entry
|
/// calcext:color-scale-entry
|
||||||
@ -236,8 +274,7 @@ public:
|
|||||||
static const wchar_t * ns;
|
static const wchar_t * ns;
|
||||||
static const wchar_t * name;
|
static const wchar_t * name;
|
||||||
|
|
||||||
static const ElementType type = typeCalcextConditionalFormat;
|
static const ElementType type = typeCalcextConditionalFormat;
|
||||||
|
|
||||||
|
|
||||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||||
virtual void add_child_element( const office_element_ptr & child_element);
|
virtual void add_child_element( const office_element_ptr & child_element);
|
||||||
@ -273,5 +310,80 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_formats)
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_formats)
|
||||||
|
|
||||||
|
// calcext:sparkline-groups
|
||||||
|
class calcext_sparkline_groups : public office_element_impl<calcext_sparkline_groups>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklineGroups;
|
||||||
|
|
||||||
|
virtual void create_child_element(const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
virtual void add_child_element(const office_element_ptr& child_element);
|
||||||
|
|
||||||
|
virtual void serialize(std::wostream& _Wostream);
|
||||||
|
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline_groups)
|
||||||
|
|
||||||
|
// calcext:sparkline-group
|
||||||
|
class calcext_sparkline_group : public office_element_impl<calcext_sparkline_group>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklineGroup;
|
||||||
|
|
||||||
|
virtual void create_child_element(const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
virtual void add_child_element(const office_element_ptr& child_element);
|
||||||
|
|
||||||
|
virtual void serialize(std::wostream& _Wostream);
|
||||||
|
|
||||||
|
calcext_sparkline_group_attr attr_;
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline_group)
|
||||||
|
|
||||||
|
// calcext:sparklines
|
||||||
|
class calcext_sparklines : public office_element_impl<calcext_sparklines>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklines;
|
||||||
|
|
||||||
|
virtual void create_child_element(const std::wstring& Ns, const std::wstring& Name);
|
||||||
|
virtual void add_child_element(const office_element_ptr& child_element);
|
||||||
|
|
||||||
|
virtual void serialize(std::wostream& _Wostream);
|
||||||
|
|
||||||
|
office_element_ptr_array content_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparklines)
|
||||||
|
|
||||||
|
// calcext:sparkline
|
||||||
|
class calcext_sparkline : public office_element_impl<calcext_sparkline>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const wchar_t* ns;
|
||||||
|
static const wchar_t* name;
|
||||||
|
static const xml::NodeType xml_type = xml::typeElement;
|
||||||
|
static const ElementType type = typeCalcextSparklines;
|
||||||
|
|
||||||
|
virtual void create_child_element(const std::wstring& Ns, const std::wstring& Name) {}
|
||||||
|
virtual void add_child_element(const office_element_ptr& child_element) {}
|
||||||
|
|
||||||
|
virtual void serialize(std::wostream& _Wostream);
|
||||||
|
|
||||||
|
_CP_OPT(std::wstring) data_range_;
|
||||||
|
_CP_OPT(std::wstring) cell_address_;
|
||||||
|
};
|
||||||
|
CP_REGISTER_OFFICE_ELEMENT2(calcext_sparkline)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1643,7 +1643,7 @@ void ods_table_state::add_default_cell( int repeated)
|
|||||||
}
|
}
|
||||||
end_cell();
|
end_cell();
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////
|
//--------------------------------------------------------------------------------------------
|
||||||
void ods_table_state::start_pilot_table(office_element_ptr & elm)
|
void ods_table_state::start_pilot_table(office_element_ptr & elm)
|
||||||
{
|
{
|
||||||
pilot_table_state_.elm = elm;
|
pilot_table_state_.elm = elm;
|
||||||
@ -1651,6 +1651,256 @@ void ods_table_state::start_pilot_table(office_element_ptr & elm)
|
|||||||
void ods_table_state::end_pilot_table()
|
void ods_table_state::end_pilot_table()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
|
void ods_table_state::start_sparkline_groups()
|
||||||
|
{
|
||||||
|
office_element_ptr elm;
|
||||||
|
create_element(L"calcext", L"sparkline-groups", elm, context_);
|
||||||
|
|
||||||
|
current_level_.back()->add_child_element(elm);
|
||||||
|
current_level_.push_back(elm);
|
||||||
|
}
|
||||||
|
void ods_table_state::end_sparkline_groups()
|
||||||
|
{
|
||||||
|
current_level_.pop_back();
|
||||||
|
}
|
||||||
|
void ods_table_state::start_sparkline_group()
|
||||||
|
{
|
||||||
|
office_element_ptr elm;
|
||||||
|
create_element(L"calcext", L"sparkline-group", elm, context_);
|
||||||
|
|
||||||
|
current_level_.back()->add_child_element(elm);
|
||||||
|
current_level_.push_back(elm);
|
||||||
|
}
|
||||||
|
void ods_table_state::end_sparkline_group()
|
||||||
|
{
|
||||||
|
current_level_.pop_back();
|
||||||
|
}
|
||||||
|
void ods_table_state::start_sparklines()
|
||||||
|
{
|
||||||
|
office_element_ptr elm;
|
||||||
|
create_element(L"calcext", L"sparklines", elm, context_);
|
||||||
|
|
||||||
|
current_level_.back()->add_child_element(elm);
|
||||||
|
current_level_.push_back(elm);
|
||||||
|
}
|
||||||
|
void ods_table_state::end_sparklines()
|
||||||
|
{
|
||||||
|
current_level_.pop_back();
|
||||||
|
}
|
||||||
|
void ods_table_state::start_sparkline()
|
||||||
|
{
|
||||||
|
office_element_ptr elm;
|
||||||
|
create_element(L"calcext", L"sparkline", elm, context_);
|
||||||
|
|
||||||
|
current_level_.back()->add_child_element(elm);
|
||||||
|
current_level_.push_back(elm);
|
||||||
|
}
|
||||||
|
void ods_table_state::end_sparkline()
|
||||||
|
{
|
||||||
|
current_level_.pop_back();
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_range(const std::wstring& ref)
|
||||||
|
{
|
||||||
|
calcext_sparkline* sparkline = dynamic_cast<calcext_sparkline*> (current_level_.back().get());
|
||||||
|
if (!sparkline) return;
|
||||||
|
|
||||||
|
std::wstring f = formulas_converter_table.convert_named_ref(ref);
|
||||||
|
|
||||||
|
sparkline->data_range_ = f;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_cell(const std::wstring& ref)
|
||||||
|
{
|
||||||
|
calcext_sparkline* sparkline = dynamic_cast<calcext_sparkline*> (current_level_.back().get());
|
||||||
|
if (!sparkline) return;
|
||||||
|
|
||||||
|
std::wstring f = formulas_converter_table.convert_named_ref(ref);
|
||||||
|
|
||||||
|
sparkline->cell_address_ = f;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_id(const std::wstring& val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.id_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_type(int type)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.type_ = (odf_types::sparkline_type::type)type;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_manual_max(double val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.manual_max_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_manual_min(double val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.manual_min_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_line_weight(double val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.line_width_ = odf_types::length(val, odf_types::length::pt);
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_minAxisType(int val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.min_axis_type_ = (odf_types::sparkline_axis_type::type)val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_maxAxisType(int val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.max_axis_type_ = (odf_types::sparkline_axis_type::type)val;
|
||||||
|
}
|
||||||
|
void ods_table_state:: set_sparkline_markers(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.markers_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_date_axis(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.date_axis_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_emptyCellsAs(int val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.display_empty_cells_as_ = (odf_types::sparkline_empty::type)val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_high(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.high_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_low(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.low_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_first(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.first_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_last(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.last_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_negative(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.display_hidden_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_display_xAxis(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.display_hidden_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_display_hidden(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.display_hidden_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_rtl(bool val)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.right_to_left_ = val;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_series(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_series_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_negative(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_negative_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_axis(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_axis_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_markers(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_markers_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_first(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_first_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_last(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_last_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_high(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_high_ = color;
|
||||||
|
}
|
||||||
|
void ods_table_state::set_sparkline_color_low(_CP_OPT(odf_types::color)& color)
|
||||||
|
{
|
||||||
|
calcext_sparkline_group* sparkline_group = dynamic_cast<calcext_sparkline_group*> (current_level_.back().get());
|
||||||
|
if (!sparkline_group) return;
|
||||||
|
|
||||||
|
sparkline_group->attr_.color_low_ = color;
|
||||||
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
void ods_table_state::start_conditional_formats()
|
void ods_table_state::start_conditional_formats()
|
||||||
{
|
{
|
||||||
office_element_ptr elm;
|
office_element_ptr elm;
|
||||||
@ -1658,7 +1908,6 @@ void ods_table_state::start_conditional_formats()
|
|||||||
|
|
||||||
current_level_.back()->add_child_element(elm);
|
current_level_.back()->add_child_element(elm);
|
||||||
current_level_.push_back(elm);
|
current_level_.push_back(elm);
|
||||||
|
|
||||||
}
|
}
|
||||||
void ods_table_state::end_conditional_formats()
|
void ods_table_state::end_conditional_formats()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -403,6 +403,44 @@ public:
|
|||||||
void start_pilot_table(office_element_ptr & elm);
|
void start_pilot_table(office_element_ptr & elm);
|
||||||
void end_pilot_table();
|
void end_pilot_table();
|
||||||
|
|
||||||
|
void start_sparkline_groups();
|
||||||
|
void start_sparkline_group();
|
||||||
|
void set_sparkline_id(const std::wstring& val);
|
||||||
|
void set_sparkline_type(int type);
|
||||||
|
void set_sparkline_manual_max(double val);
|
||||||
|
void set_sparkline_manual_min(double val);
|
||||||
|
void set_sparkline_line_weight(double val);
|
||||||
|
void set_sparkline_minAxisType(int val);
|
||||||
|
void set_sparkline_maxAxisType(int val);
|
||||||
|
void set_sparkline_emptyCellsAs(int val);
|
||||||
|
void set_sparkline_markers(bool val);
|
||||||
|
void set_sparkline_date_axis(bool val);
|
||||||
|
void set_sparkline_high(bool val);
|
||||||
|
void set_sparkline_low(bool val);
|
||||||
|
void set_sparkline_first(bool val);
|
||||||
|
void set_sparkline_last(bool val);
|
||||||
|
void set_sparkline_negative(bool val);
|
||||||
|
void set_sparkline_display_xAxis(bool val);
|
||||||
|
void set_sparkline_display_hidden(bool val);
|
||||||
|
void set_sparkline_rtl(bool val);
|
||||||
|
|
||||||
|
void set_sparkline_color_series(_CP_OPT(odf_types::color) &color);
|
||||||
|
void set_sparkline_color_negative(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_axis(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_markers(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_first(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_last(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_high(_CP_OPT(odf_types::color)& color);
|
||||||
|
void set_sparkline_color_low(_CP_OPT(odf_types::color)& color);
|
||||||
|
|
||||||
|
void start_sparklines();
|
||||||
|
void start_sparkline();
|
||||||
|
void set_sparkline_range(const std::wstring& ref);
|
||||||
|
void set_sparkline_cell(const std::wstring& ref);
|
||||||
|
void end_sparkline();
|
||||||
|
void end_sparklines();
|
||||||
|
void end_sparkline_group();
|
||||||
|
void end_sparkline_groups();
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
void add_hyperlink(const std::wstring & ref,int col, int row, const std::wstring & link, const std::wstring & location);
|
void add_hyperlink(const std::wstring & ref,int col, int row, const std::wstring & link, const std::wstring & location);
|
||||||
|
|
||||||
|
|||||||
@ -250,6 +250,10 @@ void table_table::add_child_element( const office_element_ptr & child_element)
|
|||||||
{
|
{
|
||||||
table_conditional_formats_ = child_element;
|
table_conditional_formats_ = child_element;
|
||||||
}
|
}
|
||||||
|
else if (type_ == typeCalcextSparklineGroups)
|
||||||
|
{
|
||||||
|
table_sparkline_groups_ = child_element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void table_table::serialize(std::wostream & _Wostream)
|
void table_table::serialize(std::wostream & _Wostream)
|
||||||
@ -269,8 +273,9 @@ void table_table::serialize(std::wostream & _Wostream)
|
|||||||
table_columns_and_groups_.serialize(CP_XML_STREAM());
|
table_columns_and_groups_.serialize(CP_XML_STREAM());
|
||||||
table_rows_and_groups_.serialize(CP_XML_STREAM());
|
table_rows_and_groups_.serialize(CP_XML_STREAM());
|
||||||
|
|
||||||
if (table_named_expressions_) table_named_expressions_->serialize(CP_XML_STREAM());
|
if (table_named_expressions_) table_named_expressions_->serialize(CP_XML_STREAM());
|
||||||
if (table_conditional_formats_) table_conditional_formats_->serialize(CP_XML_STREAM());
|
if (table_conditional_formats_) table_conditional_formats_->serialize(CP_XML_STREAM());
|
||||||
|
if (table_sparkline_groups_) table_sparkline_groups_->serialize(CP_XML_STREAM());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -622,6 +622,7 @@ public:
|
|||||||
office_element_ptr table_shapes_;
|
office_element_ptr table_shapes_;
|
||||||
table_columns_and_groups table_columns_and_groups_;//table-columns-and-groups
|
table_columns_and_groups table_columns_and_groups_;//table-columns-and-groups
|
||||||
table_rows_and_groups table_rows_and_groups_;
|
table_rows_and_groups table_rows_and_groups_;
|
||||||
|
office_element_ptr table_sparkline_groups_;
|
||||||
|
|
||||||
office_element_ptr office_forms_;
|
office_element_ptr office_forms_;
|
||||||
//office-dde-source
|
//office-dde-source
|
||||||
|
|||||||
Reference in New Issue
Block a user