mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Merge pull request 'feature/add-xls-writing' (#630) from feature/add-xls-writing into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/630
This commit is contained in:
@ -37,6 +37,9 @@ namespace XLS
|
||||
|
||||
AreaFormat::AreaFormat()
|
||||
{
|
||||
rgbFore.red = 0xFF;
|
||||
rgbFore.green = 0xFF;
|
||||
rgbFore.blue = 0xFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,11 +62,11 @@ public:
|
||||
|
||||
_UINT16 fls = 0;
|
||||
|
||||
bool fAuto = false;
|
||||
bool fAuto = true;
|
||||
bool fInvertNeg = false;
|
||||
|
||||
IcvChart icvFore = 0;
|
||||
IcvChart icvBack = 0;
|
||||
IcvChart icvFore = 0x004D;
|
||||
IcvChart icvBack = 0x0009;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -69,7 +69,7 @@ void AxcExt::readFields(CFRecord& record)
|
||||
|
||||
void AxcExt::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned char flags = 0;
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoMin)
|
||||
SETBIT(flags, 1, fAutoMax)
|
||||
SETBIT(flags, 2, fAutoMajor)
|
||||
|
||||
@ -50,7 +50,7 @@ public:
|
||||
|
||||
static const ElementType type = typeDataFormat;
|
||||
|
||||
_UINT16 xi = 0;
|
||||
_UINT16 xi = 0xFFFF;
|
||||
_UINT16 yi = 0;
|
||||
_UINT16 iss = 0;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
//-----------------------------
|
||||
_UINT16 frt = 0;
|
||||
bool fAutoSize = false;
|
||||
bool fAutoPosition = false;
|
||||
bool fAutoPosition = true;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -53,5 +53,15 @@ void FrtFontList::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
void FrtFontList::writeFields(CFRecord& record)
|
||||
{
|
||||
frtHeaderOld.rt = 0x085A;
|
||||
record << frtHeaderOld << verExcel;
|
||||
record.reserveNunBytes(1);
|
||||
record << cFont;
|
||||
for(auto i : rgFrtFontInfo)
|
||||
record << i;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFrtFontList;
|
||||
|
||||
|
||||
@ -71,6 +71,7 @@ void Legend::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoPosition)
|
||||
SETBIT(flags, 1, 1) //reserved
|
||||
SETBIT(flags, 2, fAutoPosX)
|
||||
SETBIT(flags, 3, fAutoPosY)
|
||||
SETBIT(flags, 4, fVert)
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
_UINT32 y = 0;
|
||||
_UINT32 dx = 0;
|
||||
_UINT32 dy = 0;
|
||||
unsigned char wSpace = 0;
|
||||
unsigned char wSpace = 1;
|
||||
|
||||
bool fAutoPosition = false;
|
||||
bool fAutoPosX = false;
|
||||
|
||||
@ -54,12 +54,12 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
//-----------------------------
|
||||
LongRGB rgb;
|
||||
_UINT16 lns = 0;
|
||||
_UINT16 we = 0;
|
||||
_UINT16 lns = 5;
|
||||
_UINT16 we = 0xFFFF;
|
||||
bool fAuto = false;
|
||||
bool fAxisOn = false;
|
||||
bool fAutoCo = false;
|
||||
IcvChart icv = 0;
|
||||
IcvChart icv = 0x004D;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -179,6 +179,36 @@ void MsoDrawing::prepareComment(const unsigned int CommentId)
|
||||
}
|
||||
}
|
||||
|
||||
void MsoDrawing::prepareChart(const unsigned int chartId, const unsigned int xPos, const unsigned int xOffset,
|
||||
const unsigned int yPos, const unsigned int yOffset)
|
||||
{
|
||||
|
||||
auto fdgPtr = new ODRAW::OfficeArtFDG;
|
||||
fdgPtr->rh_own.recInstance = chartId;
|
||||
fdgPtr->csp = 1;
|
||||
fdgPtr->spidCur = chartId;
|
||||
rgChildRec.m_OfficeArtFDG = ODRAW::OfficeArtRecordPtr(fdgPtr);
|
||||
|
||||
auto spgrContainer = new ODRAW::OfficeArtSpgrContainer(ODRAW::OfficeArtRecord::CA_Chart);
|
||||
rgChildRec.m_OfficeArtSpgrContainer = ODRAW::OfficeArtRecordPtr(spgrContainer);
|
||||
|
||||
auto SpContainer = new ODRAW::OfficeArtSpContainer(ODRAW::OfficeArtRecord::CA_Chart);
|
||||
spgrContainer->m_OfficeArtSpgrContainerFileBlock.push_back(ODRAW::OfficeArtContainerPtr(SpContainer));
|
||||
auto groupFSPGR = new ODRAW::OfficeArtFSPGR;
|
||||
groupFSPGR->xLeft = xPos;
|
||||
groupFSPGR->xRight = xOffset;
|
||||
groupFSPGR->yTop = yPos;
|
||||
groupFSPGR->yBottom = yOffset;
|
||||
SpContainer->m_OfficeArtFSPGR = ODRAW::OfficeArtRecordPtr(groupFSPGR);
|
||||
|
||||
auto fsprPtr = new ODRAW::OfficeArtFSP;
|
||||
SpContainer->m_OfficeArtFSP = ODRAW::OfficeArtRecordPtr(fsprPtr);
|
||||
fsprPtr->shape_id = 0;
|
||||
fsprPtr->spid = chartId;
|
||||
fsprPtr->fGroup = true;
|
||||
fsprPtr->fPatriarch = true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -62,6 +62,8 @@ public:
|
||||
virtual void useContinueRecords (CFRecord& record);
|
||||
|
||||
void prepareComment (const unsigned int CommentId);
|
||||
void prepareChart (const unsigned int chartId, const unsigned int xPos, const unsigned int xOffset,
|
||||
const unsigned int yPos, const unsigned int yOffset );
|
||||
|
||||
//-----------------------------
|
||||
ODRAW::OfficeArtDgContainer rgChildRec;
|
||||
|
||||
@ -37,6 +37,8 @@ namespace XLS
|
||||
|
||||
PlotGrowth::PlotGrowth()
|
||||
{
|
||||
dxPlotGrowth = 1;
|
||||
dyPlotGrowth = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -57,8 +57,8 @@ public:
|
||||
|
||||
static const ElementType type = typePos;
|
||||
|
||||
_UINT16 mdTopLt = 0;
|
||||
_UINT16 mdBotRt = 0;
|
||||
_UINT16 mdTopLt = 2;
|
||||
_UINT16 mdBotRt = 2;
|
||||
|
||||
_INT16 x1 = 0;
|
||||
_INT16 y1 = 0;
|
||||
|
||||
@ -54,8 +54,8 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 pcBubbleSizeRatio = 0;
|
||||
_UINT16 wBubbleSize = 0;
|
||||
_UINT16 pcBubbleSizeRatio = 100;
|
||||
_UINT16 wBubbleSize = 1;
|
||||
bool fBubbles = false;
|
||||
bool fShowNegBubbles = false;
|
||||
bool fHasShadow = false;
|
||||
|
||||
@ -55,8 +55,8 @@ public:
|
||||
static const ElementType type = typeScl;
|
||||
|
||||
//-----------------------------
|
||||
_INT16 nscl = 0;
|
||||
_INT16 dscl = 1;
|
||||
_INT16 nscl = 117;
|
||||
_INT16 dscl = 100;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -55,9 +55,9 @@ public:
|
||||
static const ElementType type = typeSeries;
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 sdtX = 0;
|
||||
_UINT16 sdtY = 0;
|
||||
_UINT16 sdtBSize = 0;
|
||||
_UINT16 sdtX = 1;
|
||||
_UINT16 sdtY = 0x0001;
|
||||
_UINT16 sdtBSize = 0x0001;
|
||||
|
||||
_UINT16 cValx = 0;
|
||||
_UINT16 cValy = 0;
|
||||
|
||||
@ -56,8 +56,8 @@ public:
|
||||
|
||||
//-----------------------------
|
||||
bool fManSerAlloc = false;
|
||||
bool fManPlotArea = false;
|
||||
bool fPlotVisOnly = false;
|
||||
bool fManPlotArea = false;
|
||||
bool fPlotVisOnly = true;
|
||||
bool fNotSizeWith = false;
|
||||
bool fAlwaysAutoPlotArea = false;
|
||||
unsigned char mdBlank = 0;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
//-----------------------------
|
||||
bool fFillSurface = false;
|
||||
bool fFillSurface = true;
|
||||
bool f3DPhongShade = false;
|
||||
};
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ Text::Text()
|
||||
is_area = false;
|
||||
dlp = false;
|
||||
iReadingOrder = 0;
|
||||
icvText = 0xff;
|
||||
icvText = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ public:
|
||||
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
unsigned char at = 0;
|
||||
unsigned char vat = 0;
|
||||
unsigned char at = 2;
|
||||
unsigned char vat = 2;
|
||||
|
||||
_UINT16 wBkgMode = 0;
|
||||
_UINT16 wBkgMode = 1;
|
||||
LongRGB rgbText;
|
||||
|
||||
_INT32 x = 0;
|
||||
@ -73,7 +73,7 @@ public:
|
||||
bool fAutoText = false;
|
||||
bool fGenerated = false;
|
||||
bool fDeleted = false;
|
||||
bool fAutoMode = false;
|
||||
bool fAutoMode = true;
|
||||
bool fShowLabelAndPerc = false;
|
||||
bool fShowPercent = false;
|
||||
bool fShowBubbleSizes = false;
|
||||
|
||||
@ -47,6 +47,13 @@ void FrtFontInfo::load(CFRecord& record)
|
||||
fScaled = GETBIT(flags, 0);
|
||||
}
|
||||
|
||||
void FrtFontInfo::save(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fScaled);
|
||||
record << flags << ifnt;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,9 +48,10 @@ public:
|
||||
static const ElementType type = typeFontInfo;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
bool fScaled;
|
||||
bool fScaled = false;
|
||||
FontIndex ifnt;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
} // namespace XLS
|
||||
|
||||
@ -102,11 +102,14 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
|
||||
const bool AXISPARENT::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_AxisParent == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_AxisParent);
|
||||
proc.mandatory<AxisParent>();
|
||||
else
|
||||
proc.mandatory(*m_AxisParent);
|
||||
proc.mandatory<Begin>();
|
||||
if(m_Pos != nullptr)
|
||||
proc.mandatory(*m_Pos);
|
||||
else
|
||||
proc.mandatory<Pos>();
|
||||
if(m_AXES != nullptr)
|
||||
proc.mandatory(*m_AXES);
|
||||
for(auto i: m_arCRT)
|
||||
|
||||
@ -294,6 +294,10 @@ const bool CHARTFORMATS::saveContent(BinProcessor& proc)
|
||||
return false;
|
||||
proc.mandatory(*m_ChartRect);
|
||||
proc.mandatory<Begin>();
|
||||
for(auto i : m_arFONTLIST)
|
||||
{
|
||||
proc.mandatory(*i);
|
||||
}
|
||||
if(m_Scl != nullptr)
|
||||
proc.mandatory(*m_Scl);
|
||||
else
|
||||
|
||||
@ -95,5 +95,24 @@ const bool FONTLIST::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool FONTLIST::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_fontList == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_fontList);
|
||||
if(m_startObject != nullptr)
|
||||
proc.mandatory(*m_startObject);
|
||||
for(auto i : m_fonts)
|
||||
{
|
||||
if(i.first != nullptr)
|
||||
proc.mandatory(*i.first);
|
||||
if(i.second != nullptr)
|
||||
proc.mandatory(*i.second);
|
||||
}
|
||||
if(m_endObject != nullptr)
|
||||
proc.mandatory(*m_endObject);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,7 +48,12 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
virtual const bool saveContent(BinProcessor& proc);
|
||||
|
||||
BaseObjectPtr m_fontList;
|
||||
BaseObjectPtr m_startObject;
|
||||
std::vector<std::pair<BaseObjectPtr,BaseObjectPtr>> m_fonts;
|
||||
BaseObjectPtr m_endObject;
|
||||
static const ElementType type = typeFONTLIST;
|
||||
};
|
||||
|
||||
|
||||
@ -106,9 +106,10 @@ const bool FRAME::loadContent(BinProcessor& proc)
|
||||
|
||||
const bool FRAME::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_Frame == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_Frame);
|
||||
if(m_Frame != nullptr)
|
||||
proc.mandatory(*m_Frame);
|
||||
else
|
||||
proc.mandatory<Frame>();
|
||||
proc.mandatory<Begin>();
|
||||
if(m_LineFormat != nullptr)
|
||||
proc.mandatory(*m_LineFormat);
|
||||
|
||||
@ -407,11 +407,15 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
|
||||
|
||||
const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
{
|
||||
{
|
||||
BOF bof;
|
||||
bof.dt= 0x0020;
|
||||
proc.mandatory(bof);
|
||||
}
|
||||
auto globInfo = proc.getGlobalWorkbookInfo();
|
||||
{
|
||||
if(globInfo->sheets_info.size() > globInfo->current_sheet)
|
||||
globInfo->sheets_info.at(globInfo->current_sheet).StreamPos = proc.GetRecordPosition();
|
||||
|
||||
BOF bof;
|
||||
bof.dt= 0x0020;
|
||||
proc.mandatory(bof);
|
||||
}
|
||||
if(m_WriteProtect != nullptr)
|
||||
proc.mandatory(*m_WriteProtect);
|
||||
if(m_SheetExt != nullptr)
|
||||
@ -423,6 +427,8 @@ const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
proc.mandatory(*m_PAGESETUP);
|
||||
if(m_PrintSize != nullptr)
|
||||
proc.mandatory(*m_PrintSize);
|
||||
else
|
||||
proc.mandatory<PrintSize>();
|
||||
if(!m_arRECORD12.empty())
|
||||
if(m_arRECORD12[0] != nullptr)
|
||||
proc.mandatory(*m_arRECORD12[0]);
|
||||
@ -441,6 +447,8 @@ const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
proc.mandatory(*m_PivotChartBits);
|
||||
if(m_SBaseRef != nullptr)
|
||||
proc.mandatory(*m_SBaseRef);
|
||||
if(m_OBJECTS != nullptr)
|
||||
proc.mandatory(*m_OBJECTS);
|
||||
proc.mandatory<Units>();
|
||||
if(m_CHARTFORMATS != nullptr)
|
||||
proc.mandatory(*m_CHARTFORMATS);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
#include "Ln.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/LineFormat.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -316,6 +318,49 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
XLS::BaseObjectPtr Ln::toXLS()
|
||||
{
|
||||
auto ptr = new XLS::LineFormat;
|
||||
if(w.IsInit())
|
||||
{
|
||||
switch(w.get())
|
||||
{
|
||||
case 3175: ptr->we = 0xFFFF; break; //Hairline
|
||||
case 12700: ptr->we = 0; break; //single
|
||||
case 25400: ptr->we = 1; break; //double
|
||||
case 38100: ptr->we = 2; break; //triple
|
||||
}
|
||||
}
|
||||
if(Fill.is_init())
|
||||
{
|
||||
if(Fill.m_type == UniFill::Type::noFill)
|
||||
ptr->lns = 5;
|
||||
else if(prstDash.IsInit() && prstDash->val.IsInit())
|
||||
{
|
||||
if(Fill.m_type == UniFill::Type::solidFill)
|
||||
{
|
||||
auto solid = dynamic_cast<PPTX::Logic::SolidFill*>(Fill.Fill.GetPointer());
|
||||
auto rgba = solid->Color.Color->GetRGBA(0);
|
||||
ptr->rgb.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgb.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgb.blue = GETBITS(rgba, 4, 5);
|
||||
}
|
||||
if(prstDash->val->get() == L"dash")
|
||||
ptr->lns = 1;
|
||||
else if(prstDash->val->get() == L"dot")
|
||||
ptr->lns = 2;
|
||||
else if(prstDash->val->get() == L"dashDot")
|
||||
ptr->lns = 3;
|
||||
else if(prstDash->val->get() == L"sysDashDotDot")
|
||||
ptr->lns = 4;
|
||||
else
|
||||
ptr->lns = 0;
|
||||
}
|
||||
else
|
||||
ptr->lns = 0;
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
void Ln::Merge(nullable<Ln>& line)const
|
||||
{
|
||||
if(!line.IsInit())
|
||||
|
||||
@ -63,7 +63,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
virtual void Merge(nullable<Ln>& line) const;
|
||||
virtual void Merge(Ln& line) const;
|
||||
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
#include "PrstGeom.h"
|
||||
#include "CustGeom.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FRAME.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Frame.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -276,6 +279,15 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
XLS::BaseObjectPtr SpPr::toXLSFrame()const
|
||||
{
|
||||
auto Frame = new XLS::FRAME;
|
||||
if(ln.IsInit())
|
||||
Frame->m_LineFormat = ln->toXLS();
|
||||
if(Fill.is_init())
|
||||
Frame->m_AreaFormat = Fill.toXLS();
|
||||
return XLS::BaseObjectPtr(Frame);
|
||||
}
|
||||
OOX::EElementType SpPr::getType () const
|
||||
{
|
||||
return OOX::et_a_spPr;
|
||||
|
||||
@ -72,6 +72,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
XLS::BaseObjectPtr toXLSFrame() const;
|
||||
|
||||
void Merge(SpPr& spPr)const;
|
||||
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AreaFormat.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -280,6 +282,74 @@ namespace PPTX
|
||||
Fill->toXmlWriter(pWriter);
|
||||
}
|
||||
}
|
||||
XLS::BaseObjectPtr UniFill::toXLS() const
|
||||
{
|
||||
auto ptr = new XLS::AreaFormat;
|
||||
if (Fill.is_init())
|
||||
{
|
||||
if(m_type == UniFill::Type::noFill)
|
||||
ptr->fls = 0;
|
||||
else
|
||||
{
|
||||
if(m_type == UniFill::Type::solidFill)
|
||||
{
|
||||
ptr->fls = 1;
|
||||
auto solid = dynamic_cast<PPTX::Logic::SolidFill*>(Fill.GetPointer());
|
||||
auto rgba = solid->Color.Color->GetRGBA(0);
|
||||
ptr->rgbFore.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbFore.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbFore.blue = GETBITS(rgba, 4, 5);
|
||||
}
|
||||
else if(m_type == UniFill::Type::pattFill)
|
||||
{
|
||||
auto patt = dynamic_cast<PPTX::Logic::PattFill*>(Fill.GetPointer());
|
||||
|
||||
auto rgba = patt->fgClr.Color->GetRGBA(0);
|
||||
ptr->rgbFore.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbFore.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbFore.blue = GETBITS(rgba, 4, 5);
|
||||
|
||||
rgba = patt->bgClr.Color->GetRGBA(0);
|
||||
ptr->rgbBack.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbBack.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbBack.blue = GETBITS(rgba, 4, 5);
|
||||
if(patt->prst->get() == L"pct50")
|
||||
ptr->fls = 2;
|
||||
else if(patt->prst->get() == L"pct25")
|
||||
ptr->fls = 4;
|
||||
else if(patt->prst->get() == L"dkHorz")
|
||||
ptr->fls = 5;
|
||||
else if(patt->prst->get() == L"dkVert")
|
||||
ptr->fls = 6;
|
||||
else if(patt->prst->get() == L"dnDiag")
|
||||
ptr->fls = 7;
|
||||
else if(patt->prst->get() == L"upDiag")
|
||||
ptr->fls = 8;
|
||||
else if(patt->prst->get() == L"smGrid")
|
||||
ptr->fls = 9;
|
||||
else if(patt->prst->get() == L"trellis")
|
||||
ptr->fls = 0xA;
|
||||
else if(patt->prst->get() == L"narHorz")
|
||||
ptr->fls = 0xB;
|
||||
else if(patt->prst->get() == L"ltVert")
|
||||
ptr->fls = 0xC;
|
||||
else if(patt->prst->get() == L"dashDnDiag")
|
||||
ptr->fls = 0xD;
|
||||
else if(patt->prst->get() == L"dashUpDiag")
|
||||
ptr->fls = 0xE;
|
||||
else if(patt->prst->get() == L"horzBrick")
|
||||
ptr->fls = 0xF;
|
||||
else if(patt->prst->get() == L"pct30")
|
||||
ptr->fls = 0x10;
|
||||
else if(patt->prst->get() == L"dotDmnd")
|
||||
ptr->fls = 0x11;
|
||||
else if(patt->prst->get() == L"pct5")
|
||||
ptr->fls = 0x12;
|
||||
}
|
||||
}
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
bool UniFill::is_init() const
|
||||
{
|
||||
return (Fill.IsInit());
|
||||
|
||||
@ -58,6 +58,7 @@ namespace PPTX
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
XLS::BaseObjectPtr toXLS() const;
|
||||
|
||||
virtual bool is_init() const;
|
||||
|
||||
|
||||
@ -34,6 +34,33 @@
|
||||
#include "ChartSerialize.h"
|
||||
#include "../../../DesktopEditor/common/StringExt.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/IVAXIS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DVAXIS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CRT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/LD.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Series.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/DataFormat.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/SerToCrt.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Axis.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/CatSerRange.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ValueRange.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AxcExt.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ChartFormat.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Bar.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Pie.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Line.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Area.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Surf.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Radar.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/RadarArea.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Chart3d.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
@ -1787,6 +1814,16 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Legend::toXLS()
|
||||
{
|
||||
auto ptr = new XLS::LD;
|
||||
auto legendPtr = new XLS::Legend;
|
||||
legendPtr->fAutoPosition = true;
|
||||
legendPtr->fAutoPosX = true;
|
||||
legendPtr->fAutoPosY = true;
|
||||
ptr->m_Legend = XLS::BaseObjectPtr(legendPtr);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Legend::getType() { return et_ct_Legend; }
|
||||
CT_Layout::CT_Layout()
|
||||
{
|
||||
@ -2920,6 +2957,32 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_CatAx::toXLS()
|
||||
{
|
||||
auto ivAxis = new XLS::IVAXIS;
|
||||
auto axis = new XLS::Axis;
|
||||
axis->wType = 0;
|
||||
ivAxis->m_Axis = XLS::BaseObjectPtr(axis);
|
||||
auto catSerRange = new XLS::CatSerRange;
|
||||
catSerRange->catCross = 1;
|
||||
catSerRange->catLabel = 1;
|
||||
catSerRange->catMark = 1;
|
||||
catSerRange->fBetween = true;
|
||||
ivAxis->m_CatSerRange = XLS::BaseObjectPtr(catSerRange);
|
||||
|
||||
auto axcExt = new XLS::AxcExt;
|
||||
axcExt->fAutoBase = true;
|
||||
axcExt->fAutoCross = true;
|
||||
axcExt->fAutoDate = true;
|
||||
axcExt->fAutoMajor = true;
|
||||
axcExt->fAutoMax = true;
|
||||
axcExt->fAutoMin = true;
|
||||
axcExt->fAutoMinor = true;
|
||||
axcExt->fDateAxis = true;
|
||||
ivAxis->m_AxcExt = XLS::BaseObjectPtr(axcExt);
|
||||
|
||||
return XLS::BaseObjectPtr(ivAxis);
|
||||
}
|
||||
EElementType CT_CatAx::getType() { return et_ct_catax; }
|
||||
CT_DispUnitsLbl::CT_DispUnitsLbl()
|
||||
{
|
||||
@ -3141,6 +3204,21 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ValAx::toXLS()
|
||||
{
|
||||
auto dvAxis = new XLS::DVAXIS;
|
||||
auto axis = new XLS::Axis;
|
||||
axis->wType = 1;
|
||||
dvAxis->m_Axis = XLS::BaseObjectPtr(axis);
|
||||
auto valSerRange = new XLS::ValueRange;
|
||||
valSerRange->fAutoMin = true;
|
||||
valSerRange->fAutoMax = true;
|
||||
valSerRange->fAutoMajor = true;
|
||||
valSerRange->fAutoMinor = true;
|
||||
valSerRange->fAutoCross = true;
|
||||
dvAxis->m_ValueRange = XLS::BaseObjectPtr(valSerRange);
|
||||
return XLS::BaseObjectPtr(dvAxis);
|
||||
}
|
||||
EElementType CT_ValAx::getType() { return et_ct_valax; }
|
||||
|
||||
CBaseSer::CBaseSer()
|
||||
@ -5788,6 +5866,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_SurfaceSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_SurfaceSer::getType() { return et_ct_surfaceser; }
|
||||
|
||||
CT_BandFmt::CT_BandFmt()
|
||||
@ -5911,6 +6047,24 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_SurfaceChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Surf;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_SurfaceChart::getType() { return et_ct_surfacechart; }
|
||||
|
||||
ST_SplitType CSplitType::FromString(const std::wstring &sValue)
|
||||
@ -6210,6 +6364,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_PieSer::GetXLSFormat(unsigned int chartIndex)
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_PieSer::getType() { return et_ct_pieser; }
|
||||
|
||||
CT_Bar3DChart::CT_Bar3DChart()
|
||||
@ -6318,6 +6530,48 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Bar3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Bar;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
if(m_barDir.IsInit() && m_barDir->m_eValue == 0)
|
||||
chartType->fTranspose = true;
|
||||
|
||||
if(m_gapWidth.IsInit())
|
||||
{
|
||||
_INT16 gapVal = 0;
|
||||
try
|
||||
{
|
||||
gapVal = stoi(m_gapWidth.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcGap = gapVal;
|
||||
}
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Bar3DChart::getType() { return et_ct_bar3dchart; }
|
||||
|
||||
ST_BarDir CBarDir::FromString(const std::wstring &sValue)
|
||||
@ -6493,6 +6747,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_BarSer::GetXLSFormat(const _UINT32 chartIndex) const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_BarSer::getType() { return et_ct_barser; }
|
||||
|
||||
ST_Shape CShapeType::FromString(const std::wstring &sValue)
|
||||
@ -6627,6 +6939,49 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_BarChart::toXLS(unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Bar;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
if(m_overlap.IsInit())
|
||||
{
|
||||
_INT16 overlapVal = 0;
|
||||
try
|
||||
{
|
||||
overlapVal = stoi(m_overlap.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcOverlap -= overlapVal;
|
||||
}
|
||||
if(m_barDir.IsInit() && m_barDir->m_eValue == 0)
|
||||
chartType->fTranspose = true;
|
||||
|
||||
if(m_gapWidth.IsInit())
|
||||
{
|
||||
_INT16 gapVal = 0;
|
||||
try
|
||||
{
|
||||
gapVal = stoi(m_gapWidth.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcGap = gapVal;
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_BarChart::getType() { return et_ct_barchart; }
|
||||
|
||||
CT_DoughnutChart::CT_DoughnutChart()
|
||||
@ -6783,6 +7138,33 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Pie3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Pie;
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anElev = 30;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeightPie = 100;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
|
||||
EElementType CT_Pie3DChart::getType() { return et_ct_pie3dchart; }
|
||||
|
||||
CT_PieChart::CT_PieChart()
|
||||
@ -6862,6 +7244,27 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_PieChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Pie;
|
||||
if(m_firstSliceAng.IsInit())
|
||||
chartType->anStart = m_firstSliceAng.get();
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_PieChart::getType() { return et_ct_piechart; }
|
||||
|
||||
CT_ScatterSer::CT_ScatterSer()
|
||||
@ -7020,6 +7423,63 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ScatterSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_xVal != nullptr && m_xVal->m_numRef != nullptr)
|
||||
{
|
||||
if(m_xVal->m_numRef->m_numCache != nullptr)
|
||||
series->cValx = m_xVal->m_numRef->m_numCache->m_pt.size();
|
||||
if(m_yVal->m_numRef->m_numCache != nullptr)
|
||||
series->cValy = m_yVal->m_numRef->m_numCache->m_pt.size();
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_xVal->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_xVal->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_ScatterSer::getType() { return et_ct_scatterser; }
|
||||
|
||||
ST_ScatterStyle CScatterStyle::FromString(const std::wstring &sValue)
|
||||
@ -7118,6 +7578,25 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ScatterChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Scatter;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_ScatterChart::getType() { return et_ct_scatterchart; }
|
||||
CT_RadarSer::CT_RadarSer()
|
||||
{
|
||||
@ -7232,6 +7711,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_RadarSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_RadarSer::getType() { return et_ct_radarser; }
|
||||
|
||||
ST_RadarStyle CRadarStyle::FromString(const std::wstring &sValue)
|
||||
@ -7331,6 +7868,29 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_RadarChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
XLS::BaseObjectPtr chartType;
|
||||
if(m_radarStyle.IsInit() && m_radarStyle->m_eValue == 2)
|
||||
chartType = XLS::BaseObjectPtr(new XLS::RadarArea);
|
||||
else
|
||||
chartType = XLS::BaseObjectPtr(new XLS::Radar);
|
||||
ptr->m_ChartType = chartType;
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_RadarChart::getType() { return et_ct_radarchart; }
|
||||
CT_StockChart::CT_StockChart()
|
||||
{
|
||||
@ -7600,6 +8160,67 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_LineSer::GetXLSFormat(unsigned int chartIndex)
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
for(auto i : m_dPt)
|
||||
{
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(i->m_idx.IsInit())
|
||||
dataFormat->yi = i->m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(i->m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = i->m_spPr->ln->toXLS();
|
||||
if(i->m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = i->m_spPr->Fill.toXLS();
|
||||
}
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_LineSer::getType() { return et_ct_lineser; }
|
||||
CT_UpDownBars::CT_UpDownBars()
|
||||
{
|
||||
@ -7810,6 +8431,35 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Line3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Line;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Line3DChart::getType() { return et_ct_line3dchart; }
|
||||
|
||||
ST_Grouping CGrouping::FromString(const std::wstring &sValue)
|
||||
@ -7958,6 +8608,26 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_LineChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Line;
|
||||
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_LineChart::getType() { return et_ct_linechart; }
|
||||
|
||||
CT_Area3DChart::CT_Area3DChart()
|
||||
@ -8063,6 +8733,38 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Area3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Area;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
if(m_grouping.IsInit() && m_grouping->GetValue() == st_groupingSTACKED)
|
||||
chartType->fStacked = true;
|
||||
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Area3DChart::getType() { return et_ct_area3dchart; }
|
||||
CT_AreaSer::CT_AreaSer()
|
||||
{
|
||||
@ -8215,6 +8917,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_AreaSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_AreaSer::getType() { return et_ct_areaser; }
|
||||
|
||||
CT_AreaChart::CT_AreaChart()
|
||||
@ -8314,6 +9074,27 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_AreaChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Area;
|
||||
if(m_grouping.IsInit() && m_grouping->GetValue() == st_groupingSTACKED)
|
||||
chartType->fStacked = true;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_AreaChart::getType() { return et_ct_areachart; }
|
||||
CT_PlotArea::CT_PlotArea()
|
||||
{
|
||||
|
||||
@ -789,6 +789,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
EElementType getType();
|
||||
};
|
||||
|
||||
@ -1012,6 +1013,8 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_DispUnitsLbl
|
||||
@ -1057,6 +1060,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_SerTx
|
||||
@ -1454,6 +1458,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Surface3DChart
|
||||
@ -1486,6 +1491,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_custSplit
|
||||
@ -1518,6 +1524,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(unsigned int chartIndex);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_OfPieChart
|
||||
@ -1564,6 +1571,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Bar3DChart
|
||||
@ -1586,6 +1594,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_BarChart
|
||||
@ -1608,6 +1617,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_DoughnutChart
|
||||
@ -1642,6 +1652,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PieChart
|
||||
@ -1659,6 +1670,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_ScatterSer : public CBaseSer
|
||||
@ -1682,6 +1694,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_ScatterChart
|
||||
@ -1698,6 +1711,7 @@ namespace OOX
|
||||
~CT_ScatterChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_RadarSer : public CBaseSer
|
||||
@ -1718,6 +1732,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_RadarChart
|
||||
@ -1735,6 +1750,7 @@ namespace OOX
|
||||
~CT_RadarChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_UpDownBar
|
||||
@ -1783,6 +1799,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(unsigned int chartIndex);
|
||||
EElementType getType();
|
||||
};
|
||||
|
||||
@ -1822,6 +1839,7 @@ namespace OOX
|
||||
~CT_Line3DChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_LineChart
|
||||
@ -1845,6 +1863,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_AreaSer : public CBaseSer
|
||||
@ -1867,6 +1886,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Area3DChart
|
||||
@ -1887,6 +1907,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_AreaChart
|
||||
@ -1906,6 +1927,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PlotArea
|
||||
@ -1964,6 +1986,7 @@ namespace OOX
|
||||
~CT_View3D();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PivotFmt
|
||||
|
||||
@ -85,6 +85,8 @@ namespace OOX
|
||||
virtual void read(const CPath& oRootPath, const CPath& oPath);
|
||||
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const;
|
||||
|
||||
void toXLSChart(XLS::BaseObjectPtr chartStreamPtr);
|
||||
|
||||
virtual const OOX::FileType type() const;
|
||||
|
||||
virtual const CPath DefaultDirectory() const;
|
||||
|
||||
@ -31,8 +31,26 @@
|
||||
*/
|
||||
|
||||
#include "Drawing.h"
|
||||
#include "Pos.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/OBJECTS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXISPARENT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXES.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CRT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/MsoDrawing.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Chart.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AxisParent.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Pos.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Text.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObjectLink.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/SeriesText.h"
|
||||
#include "../../PPTXFormat/Logic/Shape.h"
|
||||
#include "../Chart/Chart.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -250,6 +268,142 @@ namespace OOX
|
||||
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
|
||||
IFileContainer::Write(oPath, oDirectory, oContent);
|
||||
}
|
||||
void CDrawing::toXLSChart(XLS::BaseObjectPtr chartStreamPtr)
|
||||
{
|
||||
auto ptr = static_cast<XLS::ChartSheetSubstream*>(chartStreamPtr.get());
|
||||
|
||||
auto ChartFormatsPtr = new XLS::CHARTFORMATS;
|
||||
ptr->m_CHARTFORMATS = XLS::BaseObjectPtr(ChartFormatsPtr);
|
||||
|
||||
for(auto anchor : m_arrItems)
|
||||
{
|
||||
if(anchor->m_oElement.IsInit())
|
||||
{
|
||||
auto anchorElem = anchor->m_oElement->GetElem();
|
||||
auto graphicFrame = static_cast<PPTX::Logic::GraphicFrame*>(anchorElem.GetPointer());
|
||||
{
|
||||
|
||||
auto chartRect = new XLS::Chart;
|
||||
if(anchor->m_oPos.IsInit() && anchor->m_oPos->m_oX.IsInit())
|
||||
chartRect->x.dVal = anchor->m_oPos->m_oX->GetValue();
|
||||
if(anchor->m_oPos.IsInit() && anchor->m_oPos->m_oY.IsInit())
|
||||
chartRect->y.dVal = anchor->m_oPos->m_oY->GetValue();
|
||||
if(anchor->m_oExt.IsInit() && anchor->m_oExt->m_oCx.IsInit())
|
||||
chartRect->dx.dVal = anchor->m_oExt->m_oCx->GetValue();
|
||||
if(anchor->m_oExt.IsInit() && anchor->m_oExt->m_oCy->GetValue())
|
||||
chartRect->dy.dVal = anchor->m_oExt->m_oCy->GetValue();
|
||||
ChartFormatsPtr->m_ChartRect = XLS::BaseObjectPtr(chartRect);
|
||||
}
|
||||
if(graphicFrame->chartRec.IsInit() && graphicFrame->chartRec->id_data.IsInit())
|
||||
{
|
||||
auto chartRid = graphicFrame->chartRec->id_data.get();
|
||||
auto castedChart = Get<OOX::File>(chartRid);
|
||||
auto ChartFile = static_cast<OOX::Spreadsheet::CChartFile*>(castedChart.GetPointer());
|
||||
if(ChartFile->m_oChartSpace.m_spPr.IsInit())
|
||||
{
|
||||
ChartFormatsPtr->m_FRAME = ChartFile->m_oChartSpace.m_spPr->toXLSFrame();
|
||||
}
|
||||
if(ChartFile->m_oChartSpace.m_chart != nullptr && ChartFile->m_oChartSpace.m_chart->m_plotArea != nullptr)
|
||||
{
|
||||
auto AxisParentUnion = new XLS::AXISPARENT;
|
||||
ChartFormatsPtr->m_arAXISPARENT.push_back(XLS::BaseObjectPtr(AxisParentUnion));
|
||||
|
||||
for(auto chartIndex = 0; chartIndex < ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.size(); chartIndex ++)
|
||||
{
|
||||
if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5BARCHART)
|
||||
{
|
||||
auto barChart = static_cast<CT_BarChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(barChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5BAR3DCHART)
|
||||
{
|
||||
auto barChart = static_cast<CT_Bar3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(barChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5PIECHART)
|
||||
{
|
||||
auto PieChart = static_cast<CT_PieChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(PieChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5PIE3DCHART)
|
||||
{
|
||||
auto PieChart = static_cast<CT_Pie3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(PieChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5LINECHART)
|
||||
{
|
||||
auto LineChart = static_cast<CT_LineChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(LineChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5LINE3DCHART)
|
||||
{
|
||||
auto LineChart = static_cast<CT_Line3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(LineChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5AREACHART)
|
||||
{
|
||||
auto AreaChart = static_cast<CT_AreaChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(AreaChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5AREA3DCHART)
|
||||
{
|
||||
auto AreaChart = static_cast<CT_Area3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(AreaChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5SURFACECHART)
|
||||
{
|
||||
auto SurfaceChart = static_cast<CT_SurfaceChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(SurfaceChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5SCATTERCHART)
|
||||
{
|
||||
auto ScatterChart = static_cast<CT_ScatterChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(ScatterChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5RADARCHART)
|
||||
{
|
||||
auto ScatterChart = static_cast<CT_RadarChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(ScatterChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
|
||||
if(ChartFile->m_oChartSpace.m_chart->m_legend != nullptr && !AxisParentUnion->m_arCRT.empty())
|
||||
{
|
||||
auto crtPtr = static_cast<XLS::CRT*>(AxisParentUnion->m_arCRT.back().get());
|
||||
crtPtr->m_LD = ChartFile->m_oChartSpace.m_chart->m_legend->toXLS();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(ChartFile->m_oChartSpace.m_chart->m_title != nullptr && ChartFile->m_oChartSpace.m_chart->m_title->m_tx != nullptr)
|
||||
{
|
||||
auto labelUnion = new XLS::ATTACHEDLABEL;
|
||||
auto textRecord = new XLS::Text;
|
||||
textRecord->wBkgMode = 1;
|
||||
textRecord->at = 2;
|
||||
textRecord->vat = 1;
|
||||
auto textPos = new XLS::Pos;
|
||||
textPos->mdBotRt = 2;
|
||||
textPos->mdTopLt = 2;
|
||||
labelUnion->m_Pos = XLS::BaseObjectPtr(textPos);
|
||||
auto objLink = new XLS::ObjectLink;
|
||||
objLink->wLinkObj = 1;
|
||||
auto seriesText = new XLS::SeriesText;
|
||||
seriesText->stText = ChartFile->m_oChartSpace.m_chart->m_title->m_tx->m_oRich->GetText();
|
||||
auto aiUnion = new XLS::AI;
|
||||
auto brai = new XLS::BRAI;
|
||||
brai->rt = 1;
|
||||
aiUnion->m_BRAI = XLS::BaseObjectPtr(brai);
|
||||
aiUnion->m_SeriesText = XLS::BaseObjectPtr(seriesText);
|
||||
labelUnion->m_AI = XLS::BaseObjectPtr(aiUnion);
|
||||
labelUnion->m_ObjectLink = XLS::BaseObjectPtr(objLink);
|
||||
labelUnion->m_TextProperties = XLS::BaseObjectPtr(textRecord);
|
||||
ChartFormatsPtr->m_arATTACHEDLABEL.push_back(XLS::BaseObjectPtr(labelUnion));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const OOX::FileType CDrawing::type() const
|
||||
{
|
||||
return OOX::Spreadsheet::FileTypes::Drawings;
|
||||
|
||||
@ -218,7 +218,7 @@ namespace OOX
|
||||
objectVector.push_back(i->toBin());
|
||||
return objectVector;
|
||||
}
|
||||
void CSheets::toXLS(XLS::BaseObjectPtr stream)
|
||||
void CSheets::toXLS(XLS::BaseObjectPtr stream, const std::vector<_UINT16> &SheetTypes)
|
||||
{
|
||||
auto streamPtr = static_cast<XLS::GlobalsSubstream*>(stream.get());
|
||||
auto tabIdArray = new XLS::RRTabId;
|
||||
@ -242,6 +242,8 @@ namespace OOX
|
||||
else
|
||||
tempSheet->name_ = std::wstring(L"sheet" + std::to_wstring(SheetNum));
|
||||
streamPtr->m_arBUNDLESHEET.push_back(XLS::BaseObjectPtr(tempSheetUnion));
|
||||
if(SheetTypes.size() > SheetNum-1)
|
||||
tempSheet->dt = SheetTypes.at(SheetNum-1);
|
||||
SheetNum++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ namespace OOX
|
||||
|
||||
void fromBin(std::vector<XLS::BaseObjectPtr>& obj);
|
||||
std::vector<XLS::BaseObjectPtr> toBin();
|
||||
void toXLS(XLS::BaseObjectPtr stream);
|
||||
void toXLS(XLS::BaseObjectPtr stream, const std::vector<_UINT16> &SheetTypes);
|
||||
virtual EElementType getType () const;
|
||||
static void AddSheetRef(const std::wstring& link, const _INT32& sheetIndex);
|
||||
private:
|
||||
|
||||
@ -467,7 +467,22 @@ namespace OOX
|
||||
auto globalsSubstream = new XLS::GlobalsSubstream(XLS::WorkbookStreamObject::DefaultCodePage);
|
||||
auto objectPtr = XLS::BaseObjectPtr(globalsSubstream);
|
||||
if(m_oSheets.IsInit())
|
||||
m_oSheets->toXLS(objectPtr);
|
||||
{
|
||||
std::vector<_UINT16> SheetTypes;
|
||||
for(auto i: m_oSheets->m_arrItems)
|
||||
{
|
||||
_UINT16 type = 0;
|
||||
if(i->m_oRid.IsInit())
|
||||
{
|
||||
RId rid(i->m_oRid->GetValue());
|
||||
auto sheetFile = Get<OOX::File>(rid);
|
||||
if(sheetFile->type() == OOX::Spreadsheet::FileTypes::Chartsheets)
|
||||
type = 2;
|
||||
}
|
||||
SheetTypes.push_back(type);
|
||||
}
|
||||
m_oSheets->toXLS(objectPtr, SheetTypes);
|
||||
}
|
||||
if(m_oDefinedNames.IsInit())
|
||||
m_oDefinedNames->toXLS(objectPtr);
|
||||
if(m_oBookViews.IsInit())
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
#include "../../Binary/XlsbFormat/FileTypes_SpreadsheetBin.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SORTANDFILTER.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.h"
|
||||
@ -372,6 +373,27 @@ namespace OOX
|
||||
}
|
||||
XLS::BaseObjectPtr CWorksheet::toXLS()
|
||||
{
|
||||
if(m_bIsChartSheet)
|
||||
{
|
||||
auto chartSheetPtr = new XLS::ChartSheetSubstream(0);
|
||||
XLS::BaseObjectPtr objPtr(chartSheetPtr);
|
||||
if(m_oPageSetup.IsInit())
|
||||
chartSheetPtr->m_PAGESETUP = m_oPageSetup->toXLS();
|
||||
else
|
||||
{
|
||||
auto pageSetup = new XLS::PAGESETUP;
|
||||
chartSheetPtr->m_PAGESETUP = XLS::BaseObjectPtr(pageSetup);
|
||||
}
|
||||
if(m_oDrawing.IsInit() && m_oDrawing->m_oId.IsInit())
|
||||
{
|
||||
RId drawingId = m_oDrawing->m_oId->GetValue();
|
||||
auto castedDrawing = Get<OOX::File>(drawingId);
|
||||
auto drawingPtr = static_cast<OOX::Spreadsheet::CDrawing*>(castedDrawing.GetPointer());
|
||||
drawingPtr->toXLSChart(objPtr);
|
||||
}
|
||||
return objPtr;
|
||||
|
||||
}
|
||||
auto worksheetPtr = new XLS::WorksheetSubstream(0);
|
||||
auto sheetPtr = XLS::BaseObjectPtr(worksheetPtr);
|
||||
if(m_oSortState.IsInit() || m_oAutofilter.IsInit())
|
||||
@ -462,8 +484,6 @@ namespace OOX
|
||||
worksheetPtr->m_arPIVOTVIEW.push_back(tempPivot->m_oPivotTableDefinition->toXLS());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return sheetPtr;
|
||||
}
|
||||
void CWorksheet::WriteBin(XLS::StreamCacheWriterPtr& writer) const
|
||||
|
||||
Reference in New Issue
Block a user