Commit bde2c73f authored by ElenaSubbotina's avatar ElenaSubbotina

XlsFormat - pivot charts

parent 66fe9e64
......@@ -51,7 +51,6 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeBRAI;
......
......@@ -81,8 +81,6 @@ const bool CHART::loadContent(BinProcessor& proc)
elements_.pop_back();
count--;
}
// reader.SeekNextSubstream();
return true;
}
......
......@@ -69,6 +69,14 @@ const bool PIVOTVIEW::loadContent(BinProcessor& proc)
m_PIVOTCORE = elements_.back();
elements_.pop_back();
PIVOTCORE *core = dynamic_cast<PIVOTCORE*>(m_PIVOTCORE.get());
SxView* view = dynamic_cast<SxView*>(core->m_SxView.get());
if (view)
{
name = view->stTable.value();
}
if (proc.optional<PIVOTFRT>())
{
m_PIVOTFRT = elements_.back();
......
......@@ -55,6 +55,7 @@ public:
BaseObjectPtr m_PIVOTFRT;
//----------------------------------
int indexCache;
std::wstring name;
};
} // namespace XLS
......
......@@ -31,38 +31,36 @@
*/
#include "SERIESFORMAT.h"
#include <Logic/Biff_records/Series.h>
#include <Logic/Biff_records/Begin.h>
#include <Logic/Biff_records/SerToCrt.h>
#include <Logic/Biff_records/SerParent.h>
#include <Logic/Biff_records/SerAuxTrend.h>
#include <Logic/Biff_records/SerAuxErrBar.h>
#include <Logic/Biff_records/LegendException.h>
#include <Logic/Biff_records/End.h>
#include <Logic/Biff_records/SerAuxTrend.h>
#include <Logic/Biff_records/SerAuxErrBar.h>
#include <Logic/Biff_records/AttachedLabel.h>
#include <Logic/Biff_unions/AI.h>
#include <Logic/Biff_unions/SS.h>
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
#include <Logic/Biff_unions/TEXTPROPS.h>
#include <Logic/Biff_unions/CHARTFOMATS.h>
#include "AI.h"
#include "SS.h"
#include "ATTACHEDLABEL.h"
#include "TEXTPROPS.h"
#include "CHARTFOMATS.h"
#include "../Biff_records/Series.h"
#include "../Biff_records/Begin.h"
#include "../Biff_records/SerToCrt.h"
#include "../Biff_records/SerParent.h"
#include "../Biff_records/SerAuxTrend.h"
#include "../Biff_records/SerAuxErrBar.h"
#include "../Biff_records/LegendException.h"
#include "../Biff_records/End.h"
#include "../Biff_records/SerAuxTrend.h"
#include "../Biff_records/SerAuxErrBar.h"
#include "../Biff_records/AttachedLabel.h"
#include "../Biff_records/BRAI.h"
namespace XLS
{
SERIESFORMAT::SERIESFORMAT()
{
}
SERIESFORMAT::~SERIESFORMAT()
{
}
// (SerToCrt / (SerParent (SerAuxTrend / SerAuxErrBar)))
class Parenthesis_SERIESFORMAT_1: public ABNFParenthesis
{
......@@ -353,5 +351,6 @@ int SERIESFORMAT::serialize_parent(std::wostream & _stream, CHARTFORMATS* chart_
return 0;
}
} // namespace XLS
......@@ -75,7 +75,6 @@ public:
//-----------------------------------------------------------------------
BaseObjectPtr m_SERIESFORMAT_ext;
};
} // namespace XLS
......@@ -32,64 +32,65 @@
#include "ChartSheetSubstream.h"
#include <Logic/Biff_records/WriteProtect.h>
#include <Logic/Biff_records/SheetExt.h>
#include <Logic/Biff_records/WebPub.h>
#include <Logic/Biff_records/HFPicture.h>
#include <Logic/Biff_records/PrintSize.h>
#include <Logic/Biff_records/HeaderFooter.h>
#include <Logic/Biff_records/Fbi.h>
#include <Logic/Biff_records/Fbi2.h>
#include <Logic/Biff_records/ClrtClient.h>
#include <Logic/Biff_records/Palette.h>
#include <Logic/Biff_records/SXViewLink.h>
#include <Logic/Biff_records/PivotChartBits.h>
#include <Logic/Biff_records/SBaseRef.h>
#include <Logic/Biff_records/MsoDrawingGroup.h>
#include <Logic/Biff_records/Units.h>
#include <Logic/Biff_records/CodeName.h>
#include <Logic/Biff_records/EOF.h>
#include <Logic/Biff_records/BOF.h>
#include <Logic/Biff_records/AreaFormat.h>
#include <Logic/Biff_records/SerToCrt.h>
#include <Logic/Biff_records/AxisParent.h>
#include <Logic/Biff_records/Series.h>
#include <Logic/Biff_records/BRAI.h>
#include <Logic/Biff_records/SIIndex.h>
#include <Logic/Biff_records/DataFormat.h>
#include <Logic/Biff_records/Text.h>
#include <Logic/Biff_records/Pos.h>
#include <Logic/Biff_records/Pie.h>
#include <Logic/Biff_records/ShtProps.h>
#include <Logic/Biff_records/Chart3d.h>
#include <Logic/Biff_records/ChartFormat.h>
#include <Logic/Biff_records/Legend.h>
#include <Logic/Biff_records/AttachedLabel.h>
#include <Logic/Biff_records/DataLabExtContents.h>
#include <Logic/Biff_records/CrtLine.h>
#include <Logic/Biff_records/Dat.h>
#include <Logic/Biff_records/Chart.h>
#include <Logic/Biff_records/ExternSheet.h>
#include <Logic/Biff_unions/PAGESETUP.h>
#include <Logic/Biff_unions/BACKGROUND.h>
#include <Logic/Biff_unions/PROTECTION_COMMON.h>
#include <Logic/Biff_unions/OBJECTS.h>
#include <Logic/Biff_unions/CHARTFOMATS.h>
#include <Logic/Biff_unions/SERIESDATA.h>
#include <Logic/Biff_unions/WINDOW.h>
#include <Logic/Biff_unions/CUSTOMVIEW.h>
#include <Logic/Biff_unions/CRTMLFRT.h>
#include <Logic/Biff_unions/FRAME.h>
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
#include <Logic/Biff_unions/SERIESFORMAT.h>
#include <Logic/Biff_unions/CRT.h>
#include <Logic/Biff_unions/AXISPARENT.h>
#include <Logic/Biff_unions/AXES.h>
#include <Logic/Biff_unions/SS.h>
#include <Logic/Biff_unions/AI.h>
#include <Logic/Biff_unions/LD.h>
#include <Logic/Biff_unions/DAT.h>
#include "Biff_records/WriteProtect.h"
#include "Biff_records/SheetExt.h"
#include "Biff_records/WebPub.h"
#include "Biff_records/HFPicture.h"
#include "Biff_records/PrintSize.h"
#include "Biff_records/HeaderFooter.h"
#include "Biff_records/Fbi.h"
#include "Biff_records/Fbi2.h"
#include "Biff_records/ClrtClient.h"
#include "Biff_records/Palette.h"
#include "Biff_records/SXViewLink.h"
#include "Biff_records/PivotChartBits.h"
#include "Biff_records/SBaseRef.h"
#include "Biff_records/MsoDrawingGroup.h"
#include "Biff_records/Units.h"
#include "Biff_records/CodeName.h"
#include "Biff_records/EOF.h"
#include "Biff_records/BOF.h"
#include "Biff_records/AreaFormat.h"
#include "Biff_records/SerToCrt.h"
#include "Biff_records/AxisParent.h"
#include "Biff_records/Series.h"
#include "Biff_records/BRAI.h"
#include "Biff_records/SIIndex.h"
#include "Biff_records/DataFormat.h"
#include "Biff_records/Text.h"
#include "Biff_records/Pos.h"
#include "Biff_records/Pie.h"
#include "Biff_records/ShtProps.h"
#include "Biff_records/Chart3d.h"
#include "Biff_records/ChartFormat.h"
#include "Biff_records/Legend.h"
#include "Biff_records/AttachedLabel.h"
#include "Biff_records/DataLabExtContents.h"
#include "Biff_records/CrtLine.h"
#include "Biff_records/Dat.h"
#include "Biff_records/Chart.h"
#include "Biff_records/ExternSheet.h"
#include "Biff_unions/PAGESETUP.h"
#include "Biff_unions/BACKGROUND.h"
#include "Biff_unions/PROTECTION_COMMON.h"
#include "Biff_unions/OBJECTS.h"
#include "Biff_unions/CHARTFOMATS.h"
#include "Biff_unions/SERIESDATA.h"
#include "Biff_unions/WINDOW.h"
#include "Biff_unions/CUSTOMVIEW.h"
#include "Biff_unions/CRTMLFRT.h"
#include "Biff_unions/FRAME.h"
#include "Biff_unions/ATTACHEDLABEL.h"
#include "Biff_unions/SERIESFORMAT.h"
#include "Biff_unions/CRT.h"
#include "Biff_unions/AXISPARENT.h"
#include "Biff_unions/AXES.h"
#include "Biff_unions/SS.h"
#include "Biff_unions/AI.h"
#include "Biff_unions/LD.h"
#include "Biff_unions/DAT.h"
#include "Biff_unions/PIVOTVIEW.h"
#include "../../XlsXlsxConverter/XlsConverter.h"
#include "../../XlsXlsxConverter/xlsx_conversion_context.h"
......@@ -377,15 +378,14 @@ void ChartSheetSubstream::recalc(SERIESDATA* data)
{
}
int ChartSheetSubstream::serialize (std::wostream & _stream)
int ChartSheetSubstream::serialize(std::wostream & _stream)
{
AreaFormat *chart_area_format = NULL;
CHARTFORMATS *chart_formats = dynamic_cast<CHARTFORMATS*>(m_CHARTFORMATS.get());
if (!chart_formats) return 0;
AreaFormat *chart_area_format = NULL;
FRAME *chart_frame = dynamic_cast<FRAME*>(chart_formats->m_FRAME.get());
if (chart_frame)
chart_area_format = dynamic_cast<AreaFormat*>(chart_frame->m_AreaFormat.get());
if (chart_frame) chart_area_format = dynamic_cast<AreaFormat*>(chart_frame->m_AreaFormat.get());
ShtProps *sht_props = dynamic_cast<ShtProps*>(chart_formats->m_ShtProps.get());
Chart *chart_rect = dynamic_cast<Chart*>(chart_formats->m_ChartRect.get());
......@@ -453,6 +453,40 @@ int ChartSheetSubstream::serialize (std::wostream & _stream)
}
}
}
if (m_SXViewLink)
{
CP_XML_NODE(L"c:extLst")
{
CP_XML_NODE(L"c:ext")
{
CP_XML_ATTR(L"uri", L"{781A3756-C4B2-4CAC-9D66-4F8BD8637D16}");
CP_XML_ATTR(L"xmlns:c14", L"http://schemas.microsoft.com/office/drawing/2007/8/2/chart");
CP_XML_NODE(L"c14:pivotOptions")
{
CP_XML_NODE(L"c14:dropZoneFilter")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneCategories")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneData")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneSeries")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZonesVisible")
{
CP_XML_ATTR(L"val", 1);
}
}
}
}
}
}
if (chart_rect)
......@@ -733,7 +767,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
}
format->serialize(CP_XML_STREAM());
for (int i = 0 ; i < it->second.size(); i++)
for (size_t i = 0 ; i < it->second.size(); i++)
{
SERIESFORMAT * series = dynamic_cast<SERIESFORMAT *>(chart_formats->m_arSERIESFORMAT[it->second[i]].get());
if (series == NULL) continue;
......@@ -766,6 +800,11 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
serialize_dPt(CP_XML_STREAM(), it->second[i], crt, (std::max)(ser->cValx, ser->cValy));//+bubbles
/* if (arPivotData.empty() == false)
{
series->set_ref(arPivotData, i * 2);
}*/
if (crt->m_iChartType == CHART_TYPE_Scatter ||
crt->m_iChartType == CHART_TYPE_Bubble)
{
......@@ -777,6 +816,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
}
else
{
serialize_ser(L"c:cat", CP_XML_STREAM(), series_id, series->m_arAI[2], ser->sdtX, ser->cValx);
serialize_ser(L"c:val", CP_XML_STREAM(), series_id, series->m_arAI[1], ser->sdtY, ser->cValy);
}
......
......@@ -77,10 +77,10 @@ public:
std::vector<BaseObjectPtr> m_arCUSTOMVIEW;
BaseObjectPtr m_Units;
BaseObjectPtr m_ExternSheet;
BaseObjectPtr m_SXViewLink;
BaseObjectPtr m_PivotChartBits;
BaseObjectPtr m_SBaseRef;
private:
void recalc(CHARTFORMATS* charts);
......@@ -88,10 +88,7 @@ private:
std::map<int, std::vector<int>> m_mapTypeChart;//тут нужен несортированый .. пока оставим этот
GlobalWorkbookInfoPtr pGlobalWorkbookInfo;
};
} // namespace XLS
......
......@@ -31,48 +31,49 @@
*/
#include "WorksheetSubstream.h"
#include <Logic/Biff_records/Uncalced.h>
#include <Logic/Biff_records/Index.h>
#include <Logic/Biff_unions/GLOBALS.h>
#include <Logic/Biff_unions/PAGESETUP.h>
#include <Logic/Biff_records/Dimensions.h>
#include <Logic/Biff_records/HFPicture.h>
#include <Logic/Biff_records/Note.h>
#include <Logic/Biff_records/DxGCol.h>
#include <Logic/Biff_records/MergeCells.h>
#include <Logic/Biff_records/LRng.h>
#include <Logic/Biff_records/CodeName.h>
#include <Logic/Biff_records/WebPub.h>
#include <Logic/Biff_records/Window1.h>
#include <Logic/Biff_records/CellWatch.h>
#include <Logic/Biff_records/SheetExt.h>
#include <Logic/Biff_records/EOF.h>
#include <Logic/Biff_records/BOF.h>
#include <Logic/Biff_records/DefaultRowHeight.h>
#include <Logic/Biff_records/Label.h>
#include <Logic/Biff_unions/BACKGROUND.h>
#include <Logic/Biff_unions/BIGNAME.h>
#include <Logic/Biff_unions/PROTECTION_COMMON.h>
#include <Logic/Biff_unions/COLUMNS.h>
#include <Logic/Biff_unions/SCENARIOS.h>
#include <Logic/Biff_unions/SORTANDFILTER.h>
#include <Logic/Biff_unions/CELLTABLE.h>
#include <Logic/Biff_unions/OBJECTS.h>
#include <Logic/Biff_unions/PIVOTVIEW.h>
#include <Logic/Biff_unions/DCON.h>
#include <Logic/Biff_unions/WINDOW.h>
#include <Logic/Biff_unions/CUSTOMVIEW.h>
#include <Logic/Biff_unions/SORT.h>
#include <Logic/Biff_unions/QUERYTABLE.h>
#include <Logic/Biff_unions/PHONETICINFO.h>
#include <Logic/Biff_unions/CONDFMTS.h>
#include <Logic/Biff_unions/HLINK.h>
#include <Logic/Biff_unions/DVAL.h>
#include <Logic/Biff_unions/FEAT.h>
#include <Logic/Biff_unions/FEAT11.h>
#include <Logic/Biff_unions/RECORD12.h>
#include <Logic/Biff_unions/SHFMLA_SET.h>
#include "Biff_records/Uncalced.h"
#include "Biff_records/Index.h"
#include "Biff_unions/GLOBALS.h"
#include "Biff_unions/PAGESETUP.h"
#include "Biff_records/Dimensions.h"
#include "Biff_records/HFPicture.h"
#include "Biff_records/Note.h"
#include "Biff_records/DxGCol.h"
#include "Biff_records/MergeCells.h"
#include "Biff_records/LRng.h"
#include "Biff_records/CodeName.h"
#include "Biff_records/WebPub.h"
#include "Biff_records/Window1.h"
#include "Biff_records/CellWatch.h"
#include "Biff_records/SheetExt.h"
#include "Biff_records/EOF.h"
#include "Biff_records/BOF.h"
#include "Biff_records/DefaultRowHeight.h"
#include "Biff_records/Label.h"
#include "Biff_unions/BACKGROUND.h"
#include "Biff_unions/BIGNAME.h"
#include "Biff_unions/PROTECTION_COMMON.h"
#include "Biff_unions/COLUMNS.h"
#include "Biff_unions/SCENARIOS.h"
#include "Biff_unions/SORTANDFILTER.h"
#include "Biff_unions/CELLTABLE.h"
#include "Biff_unions/OBJECTS.h"
#include "Biff_unions/PIVOTVIEW.h"
#include "Biff_unions/DCON.h"
#include "Biff_unions/WINDOW.h"
#include "Biff_unions/CUSTOMVIEW.h"
#include "Biff_unions/SORT.h"
#include "Biff_unions/QUERYTABLE.h"
#include "Biff_unions/PHONETICINFO.h"
#include "Biff_unions/CONDFMTS.h"
#include "Biff_unions/HLINK.h"
#include "Biff_unions/DVAL.h"
#include "Biff_unions/FEAT.h"
#include "Biff_unions/FEAT11.h"
#include "Biff_unions/RECORD12.h"
#include "Biff_unions/SHFMLA_SET.h"
#include "Biff_structures/ODRAW/OfficeArtDgContainer.h"
......@@ -292,6 +293,9 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
m_arPIVOTVIEW.insert(m_arPIVOTVIEW.begin(), elements_.back());
elements_.pop_back();
count--;
PIVOTVIEW *view = dynamic_cast<PIVOTVIEW*>(m_arPIVOTVIEW.back().get());
mapPivotViews.insert(std::make_pair(view->name, m_arPIVOTVIEW.back()));
}
}break;
case rt_DCon:
......
......@@ -90,6 +90,9 @@ public:
std::vector<BiffStructurePtr> m_arHFPictureDrawing;
//-------------------------------------------------------------------
std::map<std::wstring, BaseObjectPtr> mapPivotViews;
private:
void LoadHFPicture(); //todoooo - обобщить
......
......@@ -357,7 +357,9 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook)
xls_global_info->current_sheet = -1;
xlsx_context->start_table(xls_global_info->sheets_names.size() > i ? xls_global_info->sheets_names[i] : L"ChartSheet_" + std::to_wstring(count_chart_sheets));
convert_chart_sheet(dynamic_cast<XLS::ChartSheetSubstream*>(woorkbook->m_arWorksheetSubstream[i].get()));
XLS::ChartSheetSubstream* chart = dynamic_cast<XLS::ChartSheetSubstream*>(woorkbook->m_arWorksheetSubstream[i].get());
convert_chart_sheet(chart);
}
xlsx_context->end_table();
......@@ -369,7 +371,7 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook)
}
}
void XlsConverter::convert(XLS::WorksheetSubstream* sheet)
void XlsConverter::convert (XLS::WorksheetSubstream* sheet)
{
if (sheet == NULL) return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment