mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
XlsFormat - charts - правка ошибок по результатам тестирования
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67460 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
af42ed98e7
commit
fd650e7e08
@ -32,7 +32,9 @@ void AreaFormat::writeFields(CFRecord& record)
|
||||
void AreaFormat::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> rgbFore >> rgbBack >> fls >> flags >> icvFore >> icvBack;
|
||||
|
||||
fAuto = GETBIT(flags, 0);
|
||||
fInvertNeg = GETBIT(flags, 1);
|
||||
}
|
||||
@ -41,11 +43,18 @@ int AreaFormat::serialize(std::wostream & _stream)
|
||||
{
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill")
|
||||
if (fls == (_UINT16)0)
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
CP_XML_NODE(L"a:noFill");
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill")
|
||||
{
|
||||
CP_XML_ATTR(L"val", rgbFore.strRGB);
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", rgbFore.strRGB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,21 +49,21 @@ int BopPop::serialize(std::wostream & _stream)
|
||||
{
|
||||
CP_XML_ATTR (L"val", pcGap);
|
||||
}
|
||||
CP_XML_NODE(L"c:splitType")
|
||||
{
|
||||
switch(split)
|
||||
{
|
||||
case 0: CP_XML_ATTR (L"val" , L"pos"); break;
|
||||
case 1: CP_XML_ATTR (L"val" , L"val"); break;
|
||||
case 2: CP_XML_ATTR (L"val" , L"percent"); break;
|
||||
case 3: CP_XML_ATTR (L"val" , L"cust"); break;
|
||||
default:
|
||||
CP_XML_ATTR (L"val" , L"auto"); break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fAutoSplit == (unsigned char)0)
|
||||
{
|
||||
CP_XML_NODE(L"c:splitType")
|
||||
{
|
||||
switch(split)
|
||||
{
|
||||
case 0: CP_XML_ATTR (L"val" , L"pos"); break;
|
||||
case 1: CP_XML_ATTR (L"val" , L"val"); break;
|
||||
case 2: CP_XML_ATTR (L"val" , L"percent"); break;
|
||||
case 3: CP_XML_ATTR (L"val" , L"cust"); break;
|
||||
default:
|
||||
CP_XML_ATTR (L"val" , L"auto"); break;
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:splitPos")
|
||||
{
|
||||
CP_XML_ATTR (L"val", iSplitPos);
|
||||
|
||||
@ -37,7 +37,7 @@ int Chart3DBarShape::serialize(std::wostream & _stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:shape")
|
||||
{
|
||||
if (taper >=0 && taper < 3 && riser == (unsigned char)0)
|
||||
if (riser == (unsigned char)0)
|
||||
{
|
||||
switch(taper)
|
||||
{
|
||||
@ -47,7 +47,14 @@ int Chart3DBarShape::serialize(std::wostream & _stream)
|
||||
}
|
||||
}
|
||||
else
|
||||
CP_XML_ATTR(L"val", L"cylinder");
|
||||
{
|
||||
switch(taper)
|
||||
{
|
||||
case 0: CP_XML_ATTR(L"val", L"cylinder"); break;
|
||||
case 1: CP_XML_ATTR(L"val", L"cone"); break;
|
||||
case 2: CP_XML_ATTR(L"val", L"coneToMax");break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -25,29 +25,16 @@ public:
|
||||
//-----------------------------
|
||||
BIFF_DWORD dwCheckSum;
|
||||
BIFF_BYTE autolayouttype;
|
||||
|
||||
CrtLayout12Mode wXMode;
|
||||
CrtLayout12Mode wYMode;
|
||||
CrtLayout12Mode wWidthMode;
|
||||
CrtLayout12Mode wHeightMode;
|
||||
|
||||
BIFF_DOUBLE x;
|
||||
BIFF_DOUBLE y;
|
||||
BIFF_DOUBLE dx;
|
||||
BIFF_DOUBLE dy;
|
||||
|
||||
public:
|
||||
//BO_ATTRIB_MARKUP_BEGIN
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(dwCheckSum)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(autolayouttype)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(wXMode)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(wYMode)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(wWidthMode)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(wHeightMode)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(x)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(y)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(dx)
|
||||
//BO_ATTRIB_MARKUP_ATTRIB(dy)
|
||||
//BO_ATTRIB_MARKUP_END
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -37,10 +37,10 @@ int CrtLine::serialize(std::wostream & _stream)
|
||||
std::wstring sNode;
|
||||
switch (id)
|
||||
{
|
||||
case 0: sNode = L"c:dropLines"; break; //m_iChartType == 2 || m_iChartType == 3 (line & area & stock)
|
||||
case 1: sNode = L"c:hiLowLines"; break; // m_iChartType == 2, 11 (line & stock)
|
||||
case 2: sNode = L"c:serLines"; break; // m_iChartType == 1 || m_iChartType == 8 (bar & ofPie)
|
||||
case 3: sNode = L"c:leaderLines"; break; // m_iChartType == 3 (pie)
|
||||
case 0: sNode = L"c:dropLines"; break; // m_iChartType == CHART_TYPE_Line , CHART_TYPE_Area, CHART_TYPE_Stock
|
||||
case 1: sNode = L"c:hiLowLines"; break; // m_iChartType == CHART_TYPE_Line, CHART_TYPE_Stock
|
||||
case 2: sNode = L"c:serLines"; break; // m_iChartType == CHART_TYPE_Bar || m_iChartType == CHART_TYPE_BopPop
|
||||
case 3: sNode = L"c:leaderLines"; break; // m_iChartType == CHART_TYPE_Pie
|
||||
}
|
||||
if (sNode.empty())
|
||||
return 0;
|
||||
@ -74,7 +74,7 @@ int CrtLine::serialize(std::wostream & _stream)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_iChartType == 2)
|
||||
if (m_iChartType == /*CHART_TYPE_Line*/2)
|
||||
{
|
||||
CP_XML_NODE(L"c:marker") { CP_XML_ATTR (L"val" , L"1"); }
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ void Frame::writeFields(CFRecord& record)
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoSize);
|
||||
SETBIT(flags, 1, fAutoPosition);
|
||||
|
||||
record << frt << flags;
|
||||
}
|
||||
|
||||
@ -33,6 +34,7 @@ void Frame::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
record >> frt >> flags;
|
||||
|
||||
fAutoSize = GETBIT(flags, 0);
|
||||
fAutoPosition = GETBIT(flags, 1);
|
||||
}
|
||||
|
||||
@ -107,10 +107,11 @@ int Legend::serialize(std::wostream & _stream, int size)
|
||||
if (fAutoPosX == false) CP_XML_NODE(L"c:x") {CP_XML_ATTR(L"val", x / 4000.);}
|
||||
if (fAutoPosY == false) CP_XML_NODE(L"c:y") {CP_XML_ATTR(L"val", y / 4000.);}
|
||||
|
||||
if (fAutoPosX == false) CP_XML_NODE(L"c:w") {CP_XML_ATTR(L"val", (dx )/ 4000.);}
|
||||
if (fAutoPosY == false) CP_XML_NODE(L"c:h") {CP_XML_ATTR(L"val", (dy )/ 4000.);}
|
||||
if (fAutoPosX == false) CP_XML_NODE(L"c:w") {CP_XML_ATTR(L"val", (dx )/ 4000. + 0.01);}
|
||||
if (fAutoPosY == false) CP_XML_NODE(L"c:h") {CP_XML_ATTR(L"val", (dy )/ 4000. + 0.01);}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:overlay") {CP_XML_ATTR(L"val", 0);}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -23,9 +23,11 @@ BaseObjectPtr LineFormat::clone()
|
||||
void LineFormat::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
|
||||
SETBIT(flags, 0, fAuto);
|
||||
SETBIT(flags, 2, fAxisOn);
|
||||
SETBIT(flags, 3, fAutoCo);
|
||||
|
||||
record << rgb << lns << we << flags << icv;
|
||||
}
|
||||
|
||||
@ -42,44 +44,49 @@ void LineFormat::readFields(CFRecord& record)
|
||||
|
||||
int LineFormat::serialize(std::wostream & _stream)
|
||||
{
|
||||
if ( lns == (_UINT16) 5 ) return 0; //none
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"a:ln")
|
||||
{
|
||||
switch(we)
|
||||
{
|
||||
case 0xFFFF: CP_XML_ATTR(L"w", 3175); break; //Hairline
|
||||
case 0: CP_XML_ATTR(L"w", 12700); break; //single
|
||||
case 1: CP_XML_ATTR(L"w", 25400); break; //double
|
||||
case 2: CP_XML_ATTR(L"w", 38100); break; //triple
|
||||
case 0xFFFF: CP_XML_ATTR(L"w", 3175); break; //Hairline
|
||||
case 0: CP_XML_ATTR(L"w", 12700); break; //single
|
||||
case 1: CP_XML_ATTR(L"w", 25400); break; //double
|
||||
case 2: CP_XML_ATTR(L"w", 38100); break; //triple
|
||||
}
|
||||
CP_XML_NODE(L"a:solidFill")
|
||||
if (lns == (_UINT16) 5)
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", rgb.strRGB);
|
||||
}
|
||||
CP_XML_NODE(L"a:noFill");
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill")
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", rgb.strRGB);
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:prstDash")
|
||||
{
|
||||
CP_XML_NODE(L"a:prstDash")
|
||||
{
|
||||
switch(lns)
|
||||
{
|
||||
case 1: CP_XML_ATTR(L"val", L"dash"); break; //Dash
|
||||
case 2: CP_XML_ATTR(L"val", L"dot"); break; //Dot
|
||||
case 3: CP_XML_ATTR(L"val", L"dashDot"); break; //Dash-dot
|
||||
case 4: CP_XML_ATTR(L"val", L"sysDashDotDot"); break; //Dash dot-dot
|
||||
case 0:
|
||||
default:CP_XML_ATTR(L"val", L"solid"); break; //Solid
|
||||
}
|
||||
}
|
||||
switch(lns)
|
||||
{
|
||||
case 1: CP_XML_ATTR(L"val", L"dash"); break; //Dash
|
||||
case 2: CP_XML_ATTR(L"val", L"dot"); break; //Dot
|
||||
case 3: CP_XML_ATTR(L"val", L"dashDot"); break; //Dash-dot
|
||||
case 4: CP_XML_ATTR(L"val", L"sysDashDotDot"); break; //Dash dot-dot
|
||||
case 0:
|
||||
default:CP_XML_ATTR(L"val", L"solid"); break; //Solid
|
||||
case 6: break; //Dark gray pattern
|
||||
case 7: break; //Medium gray pattern
|
||||
case 8: break; //Light gray patternn
|
||||
}
|
||||
}
|
||||
switch(lns)
|
||||
{
|
||||
case 6: break; //Dark gray pattern
|
||||
case 7: break; //Medium gray pattern
|
||||
case 8: break; //Light gray patternn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
|
||||
#include "Pos.h"
|
||||
#include "Frame.h"
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
namespace XLS
|
||||
@ -53,6 +55,16 @@ void Pos::readFields(CFRecord& record)
|
||||
|
||||
int Pos::serialize(std::wostream & _stream)
|
||||
{
|
||||
bool bPosition = true;
|
||||
bool bSize = true;
|
||||
|
||||
if (m_Frame)
|
||||
{
|
||||
Frame* Frame_ = dynamic_cast<Frame*>(m_Frame.get());
|
||||
|
||||
bPosition = !Frame_->fAutoPosition;
|
||||
bSize = !Frame_->fAutoSize;
|
||||
}
|
||||
double x = x1 / 4000.;
|
||||
double y = y1 / 4000.;
|
||||
|
||||
@ -63,25 +75,32 @@ int Pos::serialize(std::wostream & _stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:layout")
|
||||
{
|
||||
CP_XML_NODE(L"c:manualLayout")
|
||||
if (bPosition || bSize)
|
||||
{
|
||||
if (m_iLinkObject == 1) x += 0.5 + (w > 0 ? w : 0);
|
||||
if (m_iLinkObject == 2) x += 0.5 + (w > 0 ? w : 0);
|
||||
if (m_iLinkObject == 3) y += 0 + (h > 0 ? h : 0);
|
||||
|
||||
CP_XML_NODE(L"c:xMode") {CP_XML_ATTR(L"val", L"edge");}
|
||||
CP_XML_NODE(L"c:yMode") {CP_XML_ATTR(L"val", L"edge");}
|
||||
|
||||
if (x < 0) x = 0;
|
||||
if (y < 0) y = 0;
|
||||
|
||||
CP_XML_NODE(L"c:x") {CP_XML_ATTR(L"val", x);}
|
||||
CP_XML_NODE(L"c:y") {CP_XML_ATTR(L"val", y);}
|
||||
|
||||
if (m_iLinkObject != 1 && m_iLinkObject != 2 && m_iLinkObject != 3) //title, axis title vert, axis title horiz
|
||||
CP_XML_NODE(L"c:manualLayout")
|
||||
{
|
||||
if (w > 0) CP_XML_NODE(L"c:w") {CP_XML_ATTR(L"val", w);}
|
||||
if (h > 0) CP_XML_NODE(L"c:h") {CP_XML_ATTR(L"val", h);}
|
||||
if (m_iLinkObject == 1) x += 0.5 + (w > 0 ? w : 0);
|
||||
if (m_iLinkObject == 2) x += 0.5 + (w > 0 ? w : 0);
|
||||
if (m_iLinkObject == 3) y += 0 + (h > 0 ? h : 0);
|
||||
|
||||
CP_XML_NODE(L"c:xMode") {CP_XML_ATTR(L"val", L"edge");}
|
||||
CP_XML_NODE(L"c:yMode") {CP_XML_ATTR(L"val", L"edge");}
|
||||
|
||||
//if (x < 0) x = 0;
|
||||
//if (y < 0) y = 0;
|
||||
|
||||
if (bPosition)
|
||||
{
|
||||
if (x >= 0 && x < 1) CP_XML_NODE(L"c:x") {CP_XML_ATTR(L"val", x);}
|
||||
if (y >= 0 && y < 1) CP_XML_NODE(L"c:y") {CP_XML_ATTR(L"val", y);}
|
||||
}
|
||||
|
||||
if (bSize && m_iLinkObject != 1 && m_iLinkObject != 2 && m_iLinkObject != 3)
|
||||
//title, axis title vert, axis title horiz
|
||||
{
|
||||
if (w > 0 && w < 1) CP_XML_NODE(L"c:w") {CP_XML_ATTR(L"val", w);}
|
||||
if (h > 0 && h < 1) CP_XML_NODE(L"c:h") {CP_XML_ATTR(L"val", h);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,8 @@ public:
|
||||
|
||||
//-----------------------------
|
||||
|
||||
short m_iLinkObject;
|
||||
short m_iLinkObject;
|
||||
BaseObjectPtr m_Frame;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ void ShtProps::readFields(CFRecord& record)
|
||||
fManSerAlloc = GETBIT(flags, 0);
|
||||
fPlotVisOnly = GETBIT(flags, 1);
|
||||
fNotSizeWith = GETBIT(flags, 2);
|
||||
fManPlotArea = GETBIT(flags, 3);
|
||||
fAlwaysAutoPlotArea = GETBIT(flags, 4);
|
||||
|
||||
record.skipNunBytes(1); // reserved2
|
||||
|
||||
@ -24,6 +24,7 @@ public:
|
||||
|
||||
//-----------------------------
|
||||
BIFF_BOOL fManSerAlloc;
|
||||
BIFF_BOOL fManPlotArea;
|
||||
BIFF_BOOL fPlotVisOnly;
|
||||
BIFF_BOOL fNotSizeWith;
|
||||
BIFF_BOOL fAlwaysAutoPlotArea;
|
||||
|
||||
@ -49,7 +49,7 @@ public:
|
||||
Icv icvText;
|
||||
BIFF_BYTE dlp;
|
||||
BIFF_BYTE iReadingOrder;
|
||||
BIFF_WORD trot;
|
||||
_UINT16 trot;
|
||||
|
||||
//-----------------------------
|
||||
bool is_area;
|
||||
|
||||
@ -19,7 +19,7 @@ public:
|
||||
virtual const bool loadContent (BinProcessor& proc);
|
||||
|
||||
int serialize (std::wostream & _stream);
|
||||
int serialize (std::wostream & _stream, bool position = true);
|
||||
int serialize (std::wostream & _stream, bool position);
|
||||
int serialize_rPr (std::wostream & _stream, int iFmt, bool rtl = false, bool defRPr = false);
|
||||
int serialize_txPr (std::wostream & _stream);
|
||||
|
||||
|
||||
@ -164,6 +164,14 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
|
||||
bool rtl = false;
|
||||
if((textProps) && (textProps->iReadingOrder == (unsigned char)2)) rtl = true;
|
||||
|
||||
FRAME *FRAME_ = dynamic_cast<FRAME*> (m_FRAME.get());
|
||||
Pos *Pos_ = dynamic_cast<Pos*> (m_Pos.get());
|
||||
|
||||
if (FRAME_ && Pos_)
|
||||
{
|
||||
Pos_->m_Frame = FRAME_->m_Frame;
|
||||
}
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
if (seriesText)
|
||||
@ -176,9 +184,13 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
|
||||
{
|
||||
if (textProps)
|
||||
{
|
||||
if (textProps->trot != 0)
|
||||
//if (textProps->trot != 0)
|
||||
{
|
||||
if (textProps->trot == (_UINT16)0xffff) CP_XML_ATTR(L"vert", L"vert");
|
||||
if (textProps->trot == (_UINT16)0xff)
|
||||
{
|
||||
CP_XML_ATTR(L"rot", 0);
|
||||
CP_XML_ATTR(L"vert", L"wordArtVert");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (textProps->trot > 90) CP_XML_ATTR(L"rot", (textProps->trot - 90) * 60000);
|
||||
|
||||
@ -235,7 +235,7 @@ int AXES::serialize(std::wostream & _stream, bool secondary)
|
||||
{
|
||||
ATTACHEDLABEL *label = dynamic_cast<ATTACHEDLABEL *> (m_arATTACHEDLABEL[i].get() );
|
||||
|
||||
label->serialize(CP_XML_STREAM(), false);
|
||||
label->serialize(CP_XML_STREAM());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,18 +241,19 @@ const bool CRT::loadContent(BinProcessor& proc)
|
||||
m_bIs3D = true;
|
||||
}
|
||||
|
||||
m_iChartType = 1;
|
||||
m_iChartType = CHART_TYPE_Bar;
|
||||
|
||||
switch(m_ChartType->get_type())
|
||||
{
|
||||
case typeBar: m_iChartType = 1; break;
|
||||
case typeLine: m_iChartType = 2; break;
|
||||
case typePie: m_iChartType = 3; break;
|
||||
case typeArea: m_iChartType = 4; break;
|
||||
case typeSurf: m_iChartType = 5; break;
|
||||
case typeRadar: m_iChartType = 6; break;
|
||||
case typeRadarArea: m_iChartType = 7; break;
|
||||
case typeBopPop: m_iChartType = 8; break;
|
||||
case typeScatter: m_iChartType = 9; break;
|
||||
case typeBar: m_iChartType = CHART_TYPE_Bar; break;
|
||||
case typeLine: m_iChartType = CHART_TYPE_Line; break;
|
||||
case typePie: m_iChartType = CHART_TYPE_Pie; break;
|
||||
case typeArea: m_iChartType = CHART_TYPE_Area; break;
|
||||
case typeSurf: m_iChartType = CHART_TYPE_Surf; break;
|
||||
case typeRadar: m_iChartType = CHART_TYPE_Radar; break;
|
||||
case typeRadarArea: m_iChartType = CHART_TYPE_RadarArea; break;
|
||||
case typeBopPop: m_iChartType = CHART_TYPE_BopPop; break;
|
||||
case typeScatter: m_iChartType = CHART_TYPE_Scatter; break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -277,7 +278,7 @@ std::wstring CRT::getOoxChartType()
|
||||
|
||||
if ((dropBar) && (dropBar->pcGap != (short)1))
|
||||
{
|
||||
m_iChartType = 11;
|
||||
m_iChartType = CHART_TYPE_Stock;
|
||||
return L"c:stockChart";
|
||||
}
|
||||
}
|
||||
@ -288,7 +289,7 @@ std::wstring CRT::getOoxChartType()
|
||||
Pie * p = dynamic_cast<Pie *>(m_ChartType.get());
|
||||
if (p->pcDonut.value() && p->pcDonut > 0)
|
||||
{
|
||||
m_iChartType = 12;
|
||||
m_iChartType = CHART_TYPE_Doughnut;
|
||||
return L"c:doughnutChart";
|
||||
}
|
||||
else return (m_bIs3D ? L"c:pie3DChart" : L"c:pieChart");
|
||||
@ -307,10 +308,10 @@ std::wstring CRT::getOoxChartType()
|
||||
Scatter * sc = dynamic_cast<Scatter *>(m_ChartType.get());
|
||||
if ((sc->fBubbles.value()) && (sc->fBubbles))
|
||||
{
|
||||
m_iChartType = 10;
|
||||
m_iChartType = CHART_TYPE_Bubble;
|
||||
return L"c:bubbleChart";
|
||||
}
|
||||
else return L"c:scatterChart";
|
||||
else return L"c:scatterChart";
|
||||
}break;
|
||||
case typeRadar: return L"c:radarChart";
|
||||
case typeRadarArea: return L"c:radarChart";
|
||||
|
||||
@ -73,15 +73,29 @@ const bool FRAME::loadContent(BinProcessor& proc)
|
||||
|
||||
int FRAME::serialize(std::wostream & _stream)
|
||||
{
|
||||
AreaFormat * area = dynamic_cast<AreaFormat*>(m_AreaFormat.get());
|
||||
LineFormat * line = dynamic_cast<LineFormat*>(m_LineFormat.get());
|
||||
|
||||
bool bArea = m_GELFRAME ? true : false;
|
||||
if (!bArea && (area) && (area->fAuto == false)) bArea = true;
|
||||
|
||||
bool bLine = false;
|
||||
if ((line) && (line->fAuto == false)) bLine = true;
|
||||
|
||||
if (!bArea && !bLine) return 0;
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:spPr")
|
||||
{
|
||||
if (m_GELFRAME)
|
||||
m_GELFRAME->serialize(CP_XML_STREAM());
|
||||
else if (m_AreaFormat) m_AreaFormat->serialize(CP_XML_STREAM());
|
||||
if (bArea)
|
||||
{
|
||||
if (m_GELFRAME)
|
||||
m_GELFRAME->serialize(CP_XML_STREAM());
|
||||
else if (m_AreaFormat) m_AreaFormat->serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
if (m_LineFormat) m_LineFormat->serialize(CP_XML_STREAM());
|
||||
if (m_LineFormat && bLine) m_LineFormat->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -194,25 +194,27 @@ int SS::serialize_default(std::wostream & _stream, int series_type, int ind )
|
||||
{
|
||||
}
|
||||
}
|
||||
//if (m_MarkerFormat && series_type != 10)
|
||||
//if (m_MarkerFormat && series_type != CHART_TYPE_Bubble)
|
||||
// m_MarkerFormat->serialize(_stream);
|
||||
//else
|
||||
//{
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (series_data_format->iss)
|
||||
// //todooo
|
||||
//}
|
||||
if (m_PieFormat && (series_type == 12 || series_type == 8 || series_type == 3))
|
||||
if (m_PieFormat && (series_type == CHART_TYPE_Doughnut ||
|
||||
series_type == CHART_TYPE_BopPop ||
|
||||
series_type == CHART_TYPE_Pie))
|
||||
{
|
||||
m_PieFormat->serialize(_stream);
|
||||
}
|
||||
if (m_Chart3DBarShape && series_type == 1 && m_is3D)
|
||||
if (m_Chart3DBarShape && series_type == CHART_TYPE_Bar && m_is3D)
|
||||
{
|
||||
m_Chart3DBarShape->serialize(_stream);
|
||||
}
|
||||
|
||||
if (series_format)
|
||||
{
|
||||
if (series_type == 2 || series_type == 6 || series_type == 9)
|
||||
if (series_type == CHART_TYPE_Line || series_type == CHART_TYPE_Radar || series_type == CHART_TYPE_Scatter)
|
||||
{
|
||||
CP_XML_NODE(L"c:smooth")
|
||||
{
|
||||
@ -253,7 +255,9 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt)
|
||||
{
|
||||
CP_XML_NODE(L"c:spPr")
|
||||
{
|
||||
if ((series_type != 2 && series_type != 9 && series_type != 11) || m_is3D == true ) //line & scatter & stock
|
||||
if (m_is3D == true || ( series_type != CHART_TYPE_Line &&
|
||||
series_type != CHART_TYPE_Scatter &&
|
||||
series_type != CHART_TYPE_Stock))
|
||||
{
|
||||
if (m_GELFRAME && bArea)
|
||||
{
|
||||
@ -285,13 +289,14 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt)
|
||||
else
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (automatic)
|
||||
if ( series_type != 2 || m_is3D == true ) //line & !3dLine
|
||||
if ( series_type != CHART_TYPE_Line || m_is3D == true ) //line & !3dLine
|
||||
ind = 31; //black
|
||||
CP_XML_NODE(L"a:ln")
|
||||
{
|
||||
CP_XML_ATTR(L"w", 12700);//single
|
||||
|
||||
if (series_type == 9 || series_type == 11) //points only - todooo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ala 95 <20><><EFBFBD><EFBFBD><EFBFBD> & stork
|
||||
if (series_type == CHART_TYPE_Scatter || series_type == CHART_TYPE_Stock)
|
||||
//points only - todooo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ala 95 <20><><EFBFBD><EFBFBD><EFBFBD> & stork
|
||||
{
|
||||
CP_XML_NODE(L"a:noFill");
|
||||
}
|
||||
@ -313,12 +318,16 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_PieFormat && (series_type == 12 || series_type == 8 || series_type == 3))
|
||||
if (m_PieFormat && (series_type == CHART_TYPE_Doughnut ||
|
||||
series_type == CHART_TYPE_BopPop ||
|
||||
series_type == CHART_TYPE_Pie))
|
||||
m_PieFormat->serialize(_stream);
|
||||
|
||||
if (m_MarkerFormat && series_type != 10 && series_type != 1)
|
||||
if (m_MarkerFormat && series_type != CHART_TYPE_Bubble &&
|
||||
series_type != CHART_TYPE_Bar &&
|
||||
series_type != CHART_TYPE_BopPop )
|
||||
m_MarkerFormat->serialize(_stream);
|
||||
else if (/*series_type == 2 ||*/ series_type == 9)
|
||||
else if (/*series_type == CHART_TYPE_Line ||*/ series_type == CHART_TYPE_Scatter)
|
||||
{
|
||||
CP_XML_NODE(L"c:marker");
|
||||
}
|
||||
@ -336,12 +345,12 @@ int SS::serialize2(std::wostream & _stream, int series_type)
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
if (m_Chart3DBarShape && series_type == 1 && m_is3D)
|
||||
if (m_Chart3DBarShape && series_type == CHART_TYPE_Bar && m_is3D)
|
||||
{
|
||||
m_Chart3DBarShape->serialize(_stream);
|
||||
}
|
||||
|
||||
if (series_type == 10)
|
||||
if (series_type == CHART_TYPE_Bubble)
|
||||
{
|
||||
if ((series_format) && (series_format->f3DBubbles == true))
|
||||
{
|
||||
@ -349,7 +358,9 @@ int SS::serialize2(std::wostream & _stream, int series_type)
|
||||
}
|
||||
}
|
||||
|
||||
if ((series_type == 2 || series_type == 6 || series_type == 9) && m_isAutoLine == false)
|
||||
if (m_isAutoLine == false && ( series_type == CHART_TYPE_Line ||
|
||||
series_type == CHART_TYPE_Radar ||
|
||||
series_type == CHART_TYPE_Scatter))
|
||||
{
|
||||
if (series_format)
|
||||
{
|
||||
|
||||
@ -2,6 +2,19 @@
|
||||
|
||||
#include <Logic/CompositeObject.h>
|
||||
|
||||
#define CHART_TYPE_Bar 1
|
||||
#define CHART_TYPE_Line 2
|
||||
#define CHART_TYPE_Pie 3
|
||||
#define CHART_TYPE_Area 4
|
||||
#define CHART_TYPE_Surf 5
|
||||
#define CHART_TYPE_Radar 6
|
||||
#define CHART_TYPE_RadarArea 7
|
||||
#define CHART_TYPE_BopPop 8
|
||||
#define CHART_TYPE_Scatter 9
|
||||
#define CHART_TYPE_Bubble 10
|
||||
#define CHART_TYPE_Stock 11
|
||||
#define CHART_TYPE_Doughnut 12
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#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>
|
||||
@ -442,8 +443,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:plotArea")
|
||||
{
|
||||
BaseObjectPtr PlotAreaFrame;
|
||||
BaseObjectPtr PlotAreaPos;
|
||||
FRAME *PlotAreaFRAME = NULL;
|
||||
Pos *PlotAreaPos = NULL;
|
||||
|
||||
for (int i = 0; i < chart_formats->m_arAXISPARENT.size(); i++)
|
||||
{
|
||||
@ -453,13 +454,21 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
|
||||
if (((bool)ax_parent->iax == false) && axes) //primary axes
|
||||
{
|
||||
PlotAreaFrame = axes->m_PlotArea_FRAME;
|
||||
PlotAreaPos = parent->m_Pos;
|
||||
PlotAreaFRAME = dynamic_cast<FRAME*> (axes->m_PlotArea_FRAME.get());
|
||||
PlotAreaPos = dynamic_cast<Pos*> (parent->m_Pos.get());
|
||||
|
||||
if (PlotAreaFRAME && PlotAreaPos)
|
||||
{
|
||||
PlotAreaPos->m_Frame = PlotAreaFRAME->m_Frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (PlotAreaPos && (sht_props) && (sht_props->fAlwaysAutoPlotArea != false))
|
||||
{
|
||||
|
||||
PlotAreaPos->serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
for (std::map<int, std::vector<int>>::iterator it = m_mapTypeChart.begin(); it != m_mapTypeChart.end(); it++)
|
||||
{
|
||||
@ -471,7 +480,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
CP_XML_NODE(crt->getOoxChartType())
|
||||
{
|
||||
crt->m_ChartType->serialize_attribute( CP_GET_XML_NODE());
|
||||
if (crt->m_iChartType != 11)
|
||||
|
||||
if (crt->m_iChartType != CHART_TYPE_Stock)
|
||||
crt->m_ChartType->serialize(CP_XML_STREAM());
|
||||
|
||||
format->serialize(CP_XML_STREAM());
|
||||
@ -486,8 +496,11 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
series_ss->apply_crt_ss(crt->m_SS);
|
||||
series_ss->m_is3D = crt->m_bIs3D;
|
||||
|
||||
if (crt->m_iChartType == 3 || crt->m_iChartType == 8 || crt->m_iChartType == 12 || crt->m_iChartType == 5)
|
||||
series_ss->m_isVaried = format->fVaried;
|
||||
if (crt->m_iChartType == CHART_TYPE_Pie ||
|
||||
crt->m_iChartType == CHART_TYPE_BopPop ||
|
||||
crt->m_iChartType == CHART_TYPE_Doughnut ||
|
||||
crt->m_iChartType == CHART_TYPE_Surf )
|
||||
series_ss->m_isVaried = format->fVaried;
|
||||
|
||||
DataFormat * series_data_format = dynamic_cast<DataFormat *>(series_ss->m_DataFormat.get());
|
||||
int series_id = series_data_format->iss;
|
||||
@ -505,12 +518,13 @@ 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 (crt->m_iChartType == 9 || crt->m_iChartType == 10)//scatter & bubble
|
||||
if (crt->m_iChartType == CHART_TYPE_Scatter ||
|
||||
crt->m_iChartType == CHART_TYPE_Bubble)
|
||||
{
|
||||
serialize_ser(L"c:xVal", CP_XML_STREAM(), series_id, series->m_arAI[2], ser->sdtX, ser->cValx);
|
||||
serialize_ser(L"c:yVal", CP_XML_STREAM(), series_id, series->m_arAI[1], ser->sdtY, ser->cValy);
|
||||
|
||||
if (crt->m_iChartType == 10)
|
||||
if (crt->m_iChartType == CHART_TYPE_Bubble)
|
||||
serialize_ser(L"c:bubbleSize", CP_XML_STREAM(), series_id, series->m_arAI[3], ser->sdtBSize, ser->cValBSize);
|
||||
}
|
||||
else
|
||||
@ -588,8 +602,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
axes->serialize(CP_XML_STREAM(), secondary);
|
||||
}
|
||||
|
||||
if (PlotAreaFrame)
|
||||
PlotAreaFrame->serialize(CP_XML_STREAM());
|
||||
if (PlotAreaFRAME)
|
||||
PlotAreaFRAME->serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
serialize_legend (_stream, stream_legend_entries.str());
|
||||
@ -620,8 +634,11 @@ int ChartSheetSubstream::serialize_dPt(std::wostream & _stream, int id, CRT *crt
|
||||
|
||||
series_ss->m_is3D = crt->m_bIs3D;
|
||||
|
||||
if (crt->m_iChartType == 3 || crt->m_iChartType == 8 || crt->m_iChartType == 12 || crt->m_iChartType == 5)
|
||||
series_ss->m_isVaried = format->fVaried;
|
||||
if (crt->m_iChartType == CHART_TYPE_Pie ||
|
||||
crt->m_iChartType == CHART_TYPE_BopPop ||
|
||||
crt->m_iChartType == CHART_TYPE_Doughnut ||
|
||||
crt->m_iChartType == CHART_TYPE_Surf )
|
||||
series_ss->m_isVaried = format->fVaried;
|
||||
|
||||
CP_XML_NODE(L"c:idx")
|
||||
{
|
||||
@ -636,8 +653,11 @@ int ChartSheetSubstream::serialize_dPt(std::wostream & _stream, int id, CRT *crt
|
||||
}
|
||||
|
||||
bool varied = false;
|
||||
if (crt->m_iChartType == 3 || crt->m_iChartType == 8 || crt->m_iChartType == 12 || crt->m_iChartType == 5)
|
||||
varied = format->fVaried;
|
||||
if (crt->m_iChartType == CHART_TYPE_Pie ||
|
||||
crt->m_iChartType == CHART_TYPE_BopPop ||
|
||||
crt->m_iChartType == CHART_TYPE_Doughnut ||
|
||||
crt->m_iChartType == CHART_TYPE_Surf )
|
||||
varied = format->fVaried;
|
||||
|
||||
if (varied && present_idx.size() < count_point)
|
||||
{
|
||||
@ -673,7 +693,7 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT *
|
||||
SS *series_ss = dynamic_cast<SS *>(series->m_SS.get());
|
||||
DataFormat *series_df = dynamic_cast<DataFormat *>(series_ss->m_DataFormat.get());
|
||||
|
||||
bool is_area = (crt->m_iChartType == 4 || crt->m_iChartType == 7);
|
||||
bool is_area = (crt->m_iChartType == CHART_TYPE_Area || crt->m_iChartType == CHART_TYPE_RadarArea);
|
||||
int series_id = series_df->iss;
|
||||
|
||||
std::vector<std::pair<int, BaseObjectPtr>> labels = chart_formats->find_labels ( 4, id);
|
||||
@ -683,39 +703,30 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT *
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
Text * text = NULL;
|
||||
AttachedLabel * att_label = dynamic_cast<AttachedLabel*>(series_ss->m_AttachedLabel.get());
|
||||
ATTACHEDLABEL* AT_LABEL = dynamic_cast<ATTACHEDLABEL*>(chart_formats->find_label(4, id).get());
|
||||
if (AT_LABEL) text = dynamic_cast<Text*> (AT_LABEL->m_TextProperties.get());
|
||||
|
||||
if (att_label)
|
||||
{
|
||||
att_label->is_area = is_area;
|
||||
series_ss->m_AttachedLabel->serialize(_stream);
|
||||
add_labels = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Text * text = NULL;
|
||||
ATTACHEDLABEL* AT_LABEL = dynamic_cast<ATTACHEDLABEL*>(chart_formats->find_label(4, id).get());
|
||||
if (AT_LABEL)
|
||||
else
|
||||
{
|
||||
if ((AT_LABEL) && (AT_LABEL->m_FRAME))
|
||||
{
|
||||
text = dynamic_cast<Text*> (AT_LABEL->m_TextProperties.get());
|
||||
|
||||
if (AT_LABEL->m_FRAME)
|
||||
{
|
||||
AT_LABEL->m_FRAME->serialize(_stream);
|
||||
add_labels = true;
|
||||
}
|
||||
|
||||
if (text)
|
||||
{
|
||||
CP_XML_NODE(L"c:showLegendKey") {CP_XML_ATTR(L"val", text->fShowKey);}
|
||||
need_add_labels = true;
|
||||
}
|
||||
}
|
||||
AT_LABEL->m_FRAME->serialize(_stream);
|
||||
add_labels = true;
|
||||
}
|
||||
DataLabExtContents * data_ext_cont = NULL;
|
||||
|
||||
if (!data_ext_cont && AT_LABEL)
|
||||
data_ext_cont = dynamic_cast<DataLabExtContents *>(AT_LABEL->m_DataLabExtContents.get());
|
||||
|
||||
if (!data_ext_cont)
|
||||
if (!data_ext_cont && crt)
|
||||
data_ext_cont = dynamic_cast<DataLabExtContents *>(crt->m_DataLabExtContents.get());
|
||||
|
||||
if (data_ext_cont)
|
||||
@ -735,6 +746,13 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT *
|
||||
need_add_labels = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (text)
|
||||
{
|
||||
CP_XML_NODE(L"c:showLegendKey") {CP_XML_ATTR(L"val", text->fShowKey);}
|
||||
need_add_labels = true;
|
||||
}
|
||||
|
||||
Pie *pie = dynamic_cast<Pie *>(crt->m_ChartType.get());
|
||||
if ( (pie) && (pie->fShowLdrLines) )
|
||||
{
|
||||
@ -744,6 +762,7 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT *
|
||||
}
|
||||
if (!add_labels && need_add_labels)
|
||||
{
|
||||
CP_XML_NODE(L"c:showLegendKey") { CP_XML_ATTR (L"val" , 0); }
|
||||
CP_XML_NODE(L"c:showVal") { CP_XML_ATTR (L"val" , 0); }
|
||||
CP_XML_NODE(L"c:showPercent") { CP_XML_ATTR (L"val" , 0); }
|
||||
CP_XML_NODE(L"c:showBubbleSize"){ CP_XML_ATTR (L"val" , 0); }
|
||||
@ -771,6 +790,9 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT *
|
||||
{
|
||||
CP_XML_NODE(L"c:showLegendKey") {CP_XML_ATTR(L"val", text->fShowKey);}
|
||||
}
|
||||
else
|
||||
CP_XML_NODE(L"c:showLegendKey") {CP_XML_ATTR(L"val", 0);}
|
||||
|
||||
}
|
||||
DataLabExtContents * data_ext_cont = dynamic_cast<DataLabExtContents *>(crt->m_DataLabExtContents.get());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user