Commit 3f8c2c29 authored by ElenaSubbotina's avatar ElenaSubbotina

XlsFormatReader - fix users file

parent 2c97e743
......@@ -32,7 +32,6 @@
#include "FixedPoint.h"
#include <Binary/CFRecord.h>
//#include <Exception/AttributeDataWrong.h>
namespace OSHARED
{
......@@ -40,8 +39,14 @@ namespace OSHARED
FixedPoint::FixedPoint()
{
Integral = 0;
Fractional = 0;
}
FixedPoint::FixedPoint(unsigned short cbElement_)
{
Integral = 0;
Fractional = 0;
}
FixedPoint::FixedPoint(const int raw_data)
{
......@@ -49,7 +54,6 @@ FixedPoint::FixedPoint(const int raw_data)
Integral = static_cast<unsigned char>(raw_data >> 16);
}
XLS::BiffStructurePtr FixedPoint::clone()
{
return XLS::BiffStructurePtr(new FixedPoint(*this));
......
......@@ -41,6 +41,7 @@ class CFRecord;
class FixedPoint : public XLS::BiffAttribute
{
public:
FixedPoint(unsigned short cbElement_); //fixed always!!
FixedPoint();
FixedPoint(const int raw_data);
XLS::BiffStructurePtr clone();
......
......@@ -56,8 +56,11 @@ public:
unsigned short nElems, nElemsAlloc;
unsigned short cbElem;
int pos1 = record.getRdPtr();
record >> nElems >> nElemsAlloc >> cbElem;
while(nElems--)
for (unsigned short i = 0; i < nElems; i++)
{
Type element(cbElem);
record >> element;
......
......@@ -223,18 +223,26 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
fopte = OfficeArtFOPTEPtr(new AdjustValue);
break;
case 0x0151:
fopte = OfficeArtFOPTEPtr(new pAdjustHandles);
break;
case 0x0156:
fopte = OfficeArtFOPTEPtr(new pGuides);
fopte = OfficeArtFOPTEPtr(new pConnectionSites);
break;
case 0x0152:
fopte = OfficeArtFOPTEPtr(new pConnectionSitesDir);
break;
case 0x0153:
case 0x0154:
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);
break;
case 0x0155:
fopte = OfficeArtFOPTEPtr(new pAdjustHandles);
break;
case 0x0156:
fopte = OfficeArtFOPTEPtr(new pGuides);
break;
case 0x0157:
fopte = OfficeArtFOPTEPtr(new pInscribe);
break;
case 0x0158:
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);//cxk
break;
case 0x017f:
fopte = OfficeArtFOPTEPtr(new GeometryBooleanProperties);
......@@ -427,6 +435,14 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
return fopte;
}
FixedPoint::FixedPoint()
{
dVal = 0;
}
FixedPoint::FixedPoint(unsigned short cbElement_)
{
dVal = 0;
}
void FixedPoint::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
......@@ -642,17 +658,6 @@ void pihlShape::ReadComplexData(XLS::CFRecord& record)
int pos = record.getRdPtr();
record >> complex;
int pos2 = record.getRdPtr() - pos;
if (pos2 > 0 && pos2 < op)
{
record.skipNunBytes(op - pos2);
}
if (pos2 > 0 && pos2 > op)
{
record.RollRdPtrBack( pos2 - op);
}
}
//---------------------------------------------------------------------------------------------
MSOPOINT::MSOPOINT()
......@@ -691,6 +696,44 @@ void MSOPOINT::load(XLS::CFRecord& record)
}
}
//---------------------------------------------------------------------------------------------
MSORECT::MSORECT()
{
cbElement = 8;
}
MSORECT::MSORECT(unsigned short cbElement_)
{
cbElement = 8;
if (cbElement_ == 0xfff0)
{
cbElement = 4;
}
}
XLS::BiffStructurePtr MSORECT::clone()
{
return XLS::BiffStructurePtr(new MSORECT(*this));
}
void MSORECT::load(XLS::CFRecord& record)
{
if (cbElement == 8)
{
record >> l >> t >> r >> b;
}
else
{
unsigned short l_, t_, r_, b_;
record >> l_ >> t_ >> r_ >> b_;
l = l_;
t = t_;
r = r_;
b = b_;
}
}
//---------------------------------------------------------------------------------------------
MSOPATHINFO::MSOPATHINFO()
{
cbElement = 4;
......@@ -926,17 +969,6 @@ void PVertices::ReadComplexData(XLS::CFRecord& record)
int pos = record.getRdPtr();
record >> complex;
int pos2 = record.getRdPtr() - pos;
if (pos2 > 0 && pos2 < op)
{
record.skipNunBytes(op - pos2);
}
if (pos2 > 0 && pos2 > op)
{
record.RollRdPtrBack( pos2 - op);
}
}
void PSegmentInfo::ReadComplexData(XLS::CFRecord& record)
......@@ -945,17 +977,6 @@ void PSegmentInfo::ReadComplexData(XLS::CFRecord& record)
int pos = record.getRdPtr();
record >> complex;
int pos2 = record.getRdPtr() - pos;
if (pos2 > 0 && pos2 < op)
{
record.skipNunBytes(op - pos2);
}
if (pos2 > 0 && pos2 > op)
{
record.RollRdPtrBack( pos2 - op);
}
}
void pGuides::ReadComplexData(XLS::CFRecord& record)
......@@ -964,17 +985,6 @@ void pGuides::ReadComplexData(XLS::CFRecord& record)
int pos = record.getRdPtr();
record >> complex;
int pos2 = record.getRdPtr() - pos;
if (pos2 > 0 && pos2 < op)
{
record.skipNunBytes(op - pos2);
}
if (pos2 > 0 && pos2 > op)
{
record.RollRdPtrBack( pos2 - op);
}
}
void pAdjustHandles::ReadComplexData(XLS::CFRecord& record)
{
......@@ -983,16 +993,26 @@ void pAdjustHandles::ReadComplexData(XLS::CFRecord& record)
int pos = record.getRdPtr();
record >> complex;
}
void pConnectionSites::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
int pos = record.getRdPtr();
int pos2 = record.getRdPtr() - pos;
record >> complex;
}
void pConnectionSitesDir::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
int pos = record.getRdPtr();
if (pos2 > 0 && pos2 < op)
{
record.skipNunBytes(op - pos2);
}
if (pos2 > 0 && pos2 > op)
{
record.RollRdPtrBack( pos2 - op);
}
record >> complex;
}
void pInscribe::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
int pos = record.getRdPtr();
record >> complex;
}
}
......@@ -88,7 +88,10 @@ class fillColor : public OfficeArtFOPTE
class FixedPoint : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(fillColor)
BASE_STRUCTURE_DEFINE_CLASS_NAME(FixedPoint)
FixedPoint();
FixedPoint(unsigned short cbElement_); //fixed always!!
virtual void load(XLS::CFRecord& record);
double dVal;
......@@ -574,6 +577,28 @@ class MSOPOINT : public XLS::BiffStructure
int cbElement;
};
class MSORECT : public XLS::BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(MSORECT)
MSORECT(unsigned short cbElement_);
MSORECT();
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
_INT32 l;
_INT32 t;
_INT32 r;
_INT32 b;
int cbElement;
};
class MSOPATHINFO : public XLS::BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(MSOPATHINFO)
......@@ -710,6 +735,40 @@ class pAdjustHandles : public OfficeArtFOPTE
IMsoArray<ADJH> complex;
};
class pConnectionSites : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(pConnectionSites)
virtual void ReadComplexData(XLS::CFRecord& record);
IMsoArray<MSOPOINT> complex;
};
class pConnectionSitesDir : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(pConnectionSitesDir)
virtual void ReadComplexData(XLS::CFRecord& record);
IMsoArray<ODRAW::FixedPoint> complex;
};
class pInscribe : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(pInscribe)
virtual void ReadComplexData(XLS::CFRecord& record);
IMsoArray<MSORECT> complex;
};
//class cxk : public OfficeArtFOPTE
//{
// BASE_STRUCTURE_DEFINE_CLASS_NAME(cxk)
//
// virtual void ReadComplexData(XLS::CFRecord& record);
//
// IMsoArray<MSOCXK> complex;
//};
class lineOpacity : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(lineOpacity)
......
......@@ -115,30 +115,30 @@ public:
m_strRect = Shape->m_strRect;
m_arAdjustments.clear();
for(int i = 0; i < Shape->m_arAdjustments.size(); i++)
for(size_t i = 0; i < Shape->m_arAdjustments.size(); i++)
m_arAdjustments.push_back(Shape->m_arAdjustments[i]);
m_arGuides.clear();
for(int i = 0; i < Shape->m_arGuides.size(); i++)
for(size_t i = 0; i < Shape->m_arGuides.size(); i++)
m_arGuides.push_back(Shape->m_arGuides[i]);
m_eJoin = Shape->m_eJoin;
m_bConcentricFill = Shape->m_bConcentricFill;
m_arConnectors.clear();
for(int i = 0; i < Shape->m_arConnectors.size(); i++)
for(size_t i = 0; i < Shape->m_arConnectors.size(); i++)
m_arConnectors.push_back(Shape->m_arConnectors[i]);
m_arConnectorAngles.clear();
for(int i = 0; i < Shape->m_arConnectorAngles.size(); i++)
for(size_t i = 0; i < Shape->m_arConnectorAngles.size(); i++)
m_arConnectorAngles.push_back(Shape->m_arConnectorAngles[i]);
m_arTextRects.clear();
for(int i = 0; i < Shape->m_arTextRects.size(); i++)
for(size_t i = 0; i < Shape->m_arTextRects.size(); i++)
m_arTextRects.push_back(Shape->m_arTextRects[i]);
m_arHandles.clear();
for(int i = 0; i < Shape->m_arHandles.size(); i++)
for(size_t i = 0; i < Shape->m_arHandles.size(); i++)
m_arHandles.push_back(Shape->m_arHandles[i]);
......@@ -157,26 +157,26 @@ public:
// Shape->m_strRect = m_strRect;
//
// Shape->m_arAdjustments.clear();
// for(int i = 0; i < m_arAdjustments.size(); i++)
// for(size_t i = 0; i < m_arAdjustments.size(); i++)
// Shape->m_arAdjustments.push_back(m_arAdjustments[i]);
// Shape->Guides.clear();
// for(int i = 0; i < Guides.size(); i++)
// for(size_t i = 0; i < Guides.size(); i++)
// Shape->Guides.push_back(Guides[i]);
// Shape->m_eJoin = m_eJoin;
// Shape->m_bConcentricFill = m_bConcentricFill;
// Shape->m_arConnectors.clear();
// for(int i = 0; i < m_arConnectors.size(); i++)
// for(size_t i = 0; i < m_arConnectors.size(); i++)
// Shape->m_arConnectors.push_back(m_arConnectors[i]);
// Shape->m_arConnectorAngles.clear();
// for(int i = 0; i < m_arConnectorAngles.size(); i++)
// for(size_t i = 0; i < m_arConnectorAngles.size(); i++)
// Shape->m_arConnectorAngles.push_back(m_arConnectorAngles[i]);
// Shape->m_arTextRects.clear();
// for(int i = 0; i < m_arTextRects.size(); i++)
// for(size_t i = 0; i < m_arTextRects.size(); i++)
// Shape->m_arTextRects.push_back(m_arTextRects[i]);
// Shape->m_strRect = m_strRect;
......
......@@ -351,12 +351,12 @@ private:
m_lShapeHeight = oSrc.m_lShapeHeight;
m_arResults.clear();
for (int nIndex = 0; nIndex < oSrc.m_arResults.size(); ++nIndex)
for (size_t nIndex = 0; nIndex < oSrc.m_arResults.size(); ++nIndex)
{
m_arResults.push_back(oSrc.m_arResults[nIndex]);
}
m_arFormulas.clear();
for (int nIndex = 0; nIndex < oSrc.m_arFormulas.size(); ++nIndex)
for (size_t nIndex = 0; nIndex < oSrc.m_arFormulas.size(); ++nIndex)
{
m_arFormulas.push_back(oSrc.m_arFormulas[nIndex]);
}
......@@ -379,7 +379,7 @@ private:
//m_arFormulas.clear();
//m_arResults.clear();
for (int nIndex = 0; nIndex < m_arResults.size(); ++nIndex)
for (size_t nIndex = 0; nIndex < m_arResults.size(); ++nIndex)
{
m_arResults[nIndex] = 0xFFFFFFFF;
}
......@@ -399,7 +399,7 @@ private:
}
void CalculateResults()
{
for (int index = 0; index < m_arFormulas.size(); ++index)
for (size_t index = 0; index < m_arFormulas.size(); ++index)
{
LONG lResult = m_arFormulas[index].CalculateFormula(this);
}
......
......@@ -426,7 +426,7 @@ namespace NSCustomShapesConvert
{
m_eType = oSrc.m_eType;
this->m_arPoints.clear();
for (int nIndex = 0; nIndex < oSrc.m_arPoints.size(); ++nIndex)
for (size_t nIndex = 0; nIndex < oSrc.m_arPoints.size(); ++nIndex)
{
this->m_arPoints.push_back(oSrc.m_arPoints[nIndex]);
}
......@@ -771,7 +771,7 @@ namespace NSCustomShapesConvert
case rtAngleEllipseTo:
{
int nFigure = 0;
while ((nFigure + 3) <= this->m_arPoints.size())
while ((nFigure + 3) <= (int)this->m_arPoints.size())
{
double nLeft = this->m_arPoints[nFigure].dX - this->m_arPoints[nFigure + 1].dX / 2;
double nTop = this->m_arPoints[nFigure].dY - this->m_arPoints[nFigure + 1].dY / 2;
......@@ -790,7 +790,7 @@ namespace NSCustomShapesConvert
{
pRenderer->PathCommandStart();
int nFigure = 0;
while ((nFigure + 3) <= this->m_arPoints.size())
while ((nFigure + 3) <= (int)this->m_arPoints.size())
{
double nLeft = this->m_arPoints[nFigure].dX - this->m_arPoints[nFigure + 1].dX / 2;
double nTop = this->m_arPoints[nFigure].dY - this->m_arPoints[nFigure + 1].dY / 2;
......@@ -809,7 +809,7 @@ namespace NSCustomShapesConvert
{
pRenderer->PathCommandStart();
int nFigure = 0;
while ((nFigure + 4) <= this->m_arPoints.size())
while ((nFigure + 4) <= (int)this->m_arPoints.size())
{
double nCentreX = (this->m_arPoints[nFigure].dX + this->m_arPoints[nFigure + 1].dX) / 2;
double nCentreY = (this->m_arPoints[nFigure].dY + this->m_arPoints[nFigure + 1].dY) / 2;
......@@ -834,7 +834,7 @@ namespace NSCustomShapesConvert
case rtArcTo:
{
int nFigure = 0;
while ((nFigure + 4) <= this->m_arPoints.size())
while ((nFigure + 4) <= (int)this->m_arPoints.size())
{
double nCentreX = (this->m_arPoints[nFigure].dX + this->m_arPoints[nFigure + 1].dX) / 2;
double nCentreY = (this->m_arPoints[nFigure].dY + this->m_arPoints[nFigure + 1].dY) / 2;
......@@ -859,7 +859,7 @@ namespace NSCustomShapesConvert
case rtClockwiseArcTo:
{
int nFigure = 0;
while ((nFigure + 4) <= this->m_arPoints.size())
while ((nFigure + 4) <= (int)this->m_arPoints.size())
{
double nCentreX = (this->m_arPoints[nFigure].dX + this->m_arPoints[nFigure + 1].dX) / 2;
double nCentreY = (this->m_arPoints[nFigure].dY + this->m_arPoints[nFigure + 1].dY) / 2;
......@@ -885,7 +885,7 @@ namespace NSCustomShapesConvert
{
pRenderer->PathCommandStart();
int nFigure = 0;
while ((nFigure + 4) <= this->m_arPoints.size())
while ((nFigure + 4) <= (int)this->m_arPoints.size())
{
double nCentreX = (this->m_arPoints[nFigure].dX + this->m_arPoints[nFigure + 1].dX) / 2;
double nCentreY = (this->m_arPoints[nFigure].dY + this->m_arPoints[nFigure + 1].dY) / 2;
......
......@@ -622,7 +622,7 @@ void xlsx_drawing_context::serialize_group()
//serialize_line(CP_XML_STREAM(), drawing_state);
}
for (int i = 1; i < current_drawing_states->size(); i++)
for (size_t i = 1; i < current_drawing_states->size(); i++)
{
CP_XML_STREAM() << current_drawing_states->at(i)->shape;
//todooo current_drawing_states->at(i).shape.erase(); // память поэкономить
......@@ -1033,7 +1033,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.m_bIsVerticesPresent = drawing_state->custom_verticles.empty() ? false : true;
for (int i = 0 ; i < drawing_state->custom_verticles.size(); i++)
for (size_t i = 0 ; i < drawing_state->custom_verticles.size(); i++)
{
Aggplus::POINT p;
......@@ -1043,7 +1043,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.m_arVertices.push_back(p);
}
for (int i = 0 ; i < drawing_state->custom_guides.size(); i++)
for (size_t i = 0 ; i < drawing_state->custom_guides.size(); i++)
{//todooo объеденить/срастить !!
NSCustomShapesConvert::CGuide guid;
......@@ -1058,7 +1058,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.addGuide(guid);
}
for (int i = 0 ; i < drawing_state->custom_segments.size(); i++)
for (size_t i = 0 ; i < drawing_state->custom_segments.size(); i++)
{
if (0 == drawing_state->custom_segments[i].m_nCount)
{
......@@ -1076,7 +1076,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
//{//todooo - ранее этого не было ?????
// shape->m_oCustomVML.addHandle(i, *drawing_state->custom_adjustHandles[i]);
//}
for (int i = 0; i < drawing_state->custom_adjustValues.size(); i++)
for (size_t i = 0; i < drawing_state->custom_adjustValues.size(); i++)
{
if (drawing_state->custom_adjustValues[i])
{
......@@ -1301,7 +1301,7 @@ void xlsx_drawing_context::serialize_gradient_fill(std::wostream & stream, _draw
if ( !fill.colorsPosition.empty() )
{
for (int i = 0; i < fill.colorsPosition.size(); i++)
for (size_t i = 0; i < fill.colorsPosition.size(); i++)
{
CP_XML_NODE(L"a:gs")
{
......@@ -1600,6 +1600,13 @@ void xlsx_drawing_context::serialize_line(std::wostream & stream, _drawing_state
else
CP_XML_ATTR(L"w", 9525); //default
switch(line.endcap)
{
case 0: CP_XML_ATTR(L"cap", L"rnd"); break;
case 1: CP_XML_ATTR(L"cap", L"sq"); break;
case 2: CP_XML_ATTR(L"cap", L"flat"); break;
}
serialize_fill(CP_XML_STREAM(), line.fill);
CP_XML_NODE(L"a:prstDash")
......@@ -1613,6 +1620,18 @@ void xlsx_drawing_context::serialize_line(std::wostream & stream, _drawing_state
case lineDashDotDot:CP_XML_ATTR(L"val", L"lgDashDotDot"); break;
}
}
switch(line.join)
{
case 0: CP_XML_NODE(L"a:bevel"); break;
case 1:
CP_XML_NODE(L"a:miter")
{
if (line.miter > 0)
CP_XML_ATTR(L"lim", line.miter * 1000);
}break;
case 2: CP_XML_NODE(L"a:round"); break;
}
if (line.arrow.enabled)
{
serialize_arrow(CP_XML_STREAM(), L"a:headEnd", line.arrow.start, line.arrow.start_width, line.arrow.start_length);
......@@ -2019,7 +2038,27 @@ void xlsx_drawing_context::set_line_width (int val)
current_drawing_states->back()->line.width = val;
}
void xlsx_drawing_context::set_line_miter(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->line.miter = val;
}
void xlsx_drawing_context::set_line_join(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->line.join = val;
}
void xlsx_drawing_context::set_line_endcap(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->line.endcap = val;
}
void xlsx_drawing_context::set_line_arrow(bool val)
{
if (current_drawing_states == NULL) return;
......@@ -2032,7 +2071,8 @@ void xlsx_drawing_context::set_arrow_start (int val)
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->line.arrow.start = val;
current_drawing_states->back()->line.arrow.start = val;
current_drawing_states->back()->line.arrow.enabled = true;
}
void xlsx_drawing_context::set_arrow_end (int val)
{
......@@ -2040,6 +2080,7 @@ void xlsx_drawing_context::set_arrow_end (int val)
if (current_drawing_states->empty()) return;
current_drawing_states->back()->line.arrow.end = val;
current_drawing_states->back()->line.arrow.enabled = true;
}
void xlsx_drawing_context::set_arrow_start_width (int val)
{
......@@ -2375,6 +2416,41 @@ void xlsx_drawing_context::set_custom_path (int type_path)
current_drawing_states->back()->custom_path = type_path;
}
void xlsx_drawing_context::set_custom_connection(std::vector<ODRAW::MSOPOINT>& points)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->custom_connection = points;
}
void xlsx_drawing_context::set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->custom_connectionDir = points;
}
void xlsx_drawing_context::set_custom_inscribe(std::vector<ODRAW::MSORECT>& rects)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->custom_inscribe = rects;
}
void xlsx_drawing_context::set_custom_x_limo(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->custom_x_limo = val;
}
void xlsx_drawing_context::set_custom_y_limo(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->custom_y_limo = val;
}
//----------------------------------------------------------------------------------------------------------
bool xlsx_drawing_context::get_mode_vmlwrite ()
{//comment, shapes in header/footer, ....
......@@ -2435,7 +2511,7 @@ void xlsx_drawing_context::serialize_vml_HF(std::wostream & strm)
CP_XML_ATTR(L"xmlns:o" , L"urn:schemas-microsoft-com:office:office");
CP_XML_ATTR(L"xmlns:x" , L"urn:schemas-microsoft-com:office:excel");
for (int i = 0 ; i < drawing_states_vml_HF.size(); i++)
for (size_t i = 0 ; i < drawing_states_vml_HF.size(); i++)
{
serialize_vml(CP_XML_STREAM(), drawing_states_vml_HF[i]);
}
......@@ -2471,7 +2547,7 @@ void xlsx_drawing_context::serialize_vml_comments(std::wostream & strm)
}
}
for (int i = 0 ; i < drawing_states_vml_comments.size(); i++)
for (size_t i = 0 ; i < drawing_states_vml_comments.size(); i++)
{
serialize_vml(CP_XML_STREAM(), drawing_states_vml_comments[i]);
}
......@@ -2490,7 +2566,7 @@ void xlsx_drawing_context::serialize(std::wostream & strm)
CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"xmlns:mc" , L"http://schemas.openxmlformats.org/markup-compatibility/2006");
for (int i = 0 ; i < drawing_states.size(); i++)
for (size_t i = 0 ; i < drawing_states.size(); i++)
{
serialize(CP_XML_STREAM(), drawing_states[i]);
}
......
......@@ -137,10 +137,12 @@ public:
type_anchor(0),
vmlwrite_mode_(false)
{
id = -1;
rotation = 0;
parent_drawing_states = NULL;
custom_path = -1;
id = -1;
rotation = 0;
parent_drawing_states = NULL;
custom_path = -1;
custom_x_limo = 0x80000000;
custom_y_limo = 0x80000000;
}
external_items::Type type;
......@@ -179,10 +181,15 @@ public:
std::vector<ODRAW::MSOSG> custom_guides;
std::vector<ODRAW::MSOPOINT> custom_verticles;
std::vector<ODRAW::ADJH> custom_adjustHandles;
std::vector<ODRAW::MSOPOINT> custom_connection;
std::vector<ODRAW::FixedPoint> custom_connectionDir;
std::vector<ODRAW::MSORECT> custom_inscribe;
_rect custom_rect;
std::vector<_CP_OPT(int)> custom_adjustValues;
int custom_path;
int custom_x_limo;
int custom_y_limo;
//-----------------------------------------------
std::wstring hyperlink;
struct _text
......@@ -265,12 +272,15 @@ public:
};
struct _line
{
_line() { fill.color.SetRGB(0, 0, 0); width = 0; }
_line() : join(-1), endcap(-1), miter(0), width(0) { fill.color.SetRGB(0, 0, 0); }
std::wstring style;
int width;
_line_typeDash typeDash;
_fill fill;
_arrow arrow;
int miter;
int join;
int endcap;
}line;
struct _object
{
......@@ -357,6 +367,9 @@ public:
void set_arrow_end_width (int val);
void set_arrow_start_length (int val);
void set_arrow_end_length (int val);
void set_line_miter (int val);
void set_line_join (int val);
void set_line_endcap (int val);
void set_fill_old_version (_UINT32 val);
void set_line_old_version (_UINT32 val);
......@@ -399,6 +412,11 @@ public:
void set_custom_adjustHandles(std::vector<ODRAW::ADJH> & handles);
void set_custom_adjustValues(std::vector<_CP_OPT(int)> & values);
void set_custom_path (int type_path);
void set_custom_connection (std::vector<ODRAW::MSOPOINT> & points);
void set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points);
void set_custom_inscribe (std::vector<ODRAW::MSORECT> & rects);
void set_custom_x_limo (int val);
void set_custom_y_limo (int val);
//------------------------------------------------------------------------------
void serialize_group ();
void serialize_shape (_drawing_state_ptr & drawing_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment