Commit 16c57b50 authored by ElenaSubbotina's avatar ElenaSubbotina

XlsFormat - table parts

parent 83c0ba9d
......@@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
......@@ -60,7 +61,7 @@ public:
_INT16 pcSplitPercent;
_INT16 pcPie2Size;
_INT16 pcGap;
BIFF_DOUBLE numSplitValue;
Xnum numSplitValue;
bool fHasShadow;
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of BottomMargin record in BIFF8
class BottomMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(BottomMargin)
......@@ -54,7 +53,7 @@ public:
static const ElementType type = typeBottomMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of CalcDelta record in BIFF8
class CalcDelta: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CalcDelta)
......@@ -54,7 +53,7 @@ public:
static const ElementType type = typeCalcDelta;
//-----------------------------
BIFF_DOUBLE numDelta;
Xnum numDelta;
};
......
......@@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
......@@ -44,7 +45,6 @@ public:
~CrtLayout12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
......@@ -59,10 +59,10 @@ public:
CrtLayout12Mode wWidthMode;
CrtLayout12Mode wHeightMode;
BIFF_DOUBLE x;
BIFF_DOUBLE y;
BIFF_DOUBLE dx;
BIFF_DOUBLE dy;
Xnum x;
Xnum y;
Xnum dx;
Xnum dy;
};
} // namespace XLS
......
......@@ -45,11 +45,14 @@ Feat::~Feat()
{
}
BaseObjectPtr Feat::clone()
{
return BaseObjectPtr(new Feat(*this));
}
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
// ISFLIST = 0x0005, // Specifies the list type.
void Feat::readFields(CFRecord& record)
{
......@@ -72,17 +75,18 @@ void Feat::readFields(CFRecord& record)
switch(isf)
{
case SharedFeatureType::ISFPROTECTION:
record >> protection;
case 0x0002://ISFPROTECTION:
is_object = BiffStructurePtr(new FeatProtection);
break;
case SharedFeatureType::ISFFEC2:
record >> formula_err;
case 0x0003://ISFFEC2:
is_object = BiffStructurePtr(new FeatFormulaErr2);
break;
case SharedFeatureType::ISFFACTOID:
record >> smart_tag;
case 0x0004://ISFFACTOID:
is_object = BiffStructurePtr(new FeatSmartTag);
break;
}
if (is_object)
is_object->load(record);
}
} // namespace XLS
......
......@@ -54,16 +54,13 @@ public:
static const ElementType type = typeFeat;
SharedFeatureType isf;
_UINT16 isf;
_UINT16 cref;
_UINT32 cbFeatData;
BiffStructurePtrVector refs;
std::wstring sqref;
FeatProtection protection;
FeatFormulaErr2 formula_err;
FeatSmartTag smart_tag;
BiffStructurePtr is_object;
};
} // namespace XLS
......
......@@ -63,10 +63,10 @@ void FeatHdr::readFields(CFRecord& record)
{
switch(isf)
{
case SharedFeatureType::ISFPROTECTION:
case 0x0002://ISFPROTECTION:
record >> protection;
break;
case SharedFeatureType::ISFFACTOID:
case 0x0004://ISFFACTOID:
if(is_contained_in_Globals)
{
record >> prop;
......
......@@ -55,12 +55,13 @@ public:
static const ElementType type = typeFeatHdr;
_UINT16 isf;
_UINT32 cbHdrData;
EnhancedProtection protection;
OSHARED::PropertyBagStore prop;
//-----------------------------
bool is_contained_in_Globals;
SharedFeatureType isf;
_UINT32 cbHdrData;
EnhancedProtection protection;
OSHARED::PropertyBagStore prop;
};
} // namespace XLS
......
......@@ -54,6 +54,12 @@ void FeatHdr11::readFields(CFRecord& record)
{
record >> frt;
record >> isf;
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
// ISFLIST = 0x0005, // Specifies the list type.
record.skipNunBytes(1); // reserved1
record.skipNunBytes(4); // reserved2
record.skipNunBytes(4); // reserved3
......
......@@ -32,13 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/FrtHeader.h>
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of FeatHdr11 record in BIFF8
class FeatHdr11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(FeatHdr11)
......@@ -48,18 +46,14 @@ public:
~FeatHdr11();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeFeatHdr11;
public:
FrtHeader frt;
SharedFeatureType isf;
_UINT32 idListNext;
FrtHeader frt;
_UINT16 isf;
_UINT32 idListNext;
};
......
......@@ -39,12 +39,10 @@ Feature11::Feature11()
{
}
Feature11::~Feature11()
{
}
BaseObjectPtr Feature11::clone()
{
return BaseObjectPtr(new Feature11(*this));
......@@ -54,25 +52,21 @@ void Feature11::readFields(CFRecord& record)
{
record >> frtRefHeaderU;
record >> isf;
record.skipNunBytes(1); // reserved1
record.skipNunBytes(4); // reserved2
record >> cref2;
record >> cbFeatData;
record.skipNunBytes(2); // reserved3
unsigned short _isf = isf;
unsigned short _cref2 = cref2;
unsigned int _cbFeatData = cbFeatData;
std::wstring sqref_str;
for (int i = 0; i < cref2 ; ++i)
{
Ref8U reff;
record >> reff;
refs2.push_back(BiffStructurePtr(new Ref8U(reff)));
sqref_str += std::wstring (reff.toString().c_str()) + ((i == cref2 - 1) ? L"" : L" ");
sqref += reff.toString() + ((i == cref2 - 1) ? L"" : L" ");
}
sqref = sqref_str;
record >> rgbFeat;
}
......
......@@ -32,15 +32,14 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/FrtRefHeaderU.h>
#include <Logic/Biff_structures/CellRangeRef.h>
#include <Logic/Biff_structures/TableFeatureType.h>
#include "../Biff_structures/FrtRefHeaderU.h"
#include "../Biff_structures/CellRangeRef.h"
#include "../Biff_structures/TableFeatureType.h"
namespace XLS
{
// Logical representation of Feature11 record in BIFF8
class Feature11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature11)
......@@ -53,7 +52,7 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeFeature11;
static const ElementType type = typeFeature11;
FrtRefHeaderU frtRefHeaderU;
_UINT16 isf;
......@@ -62,7 +61,7 @@ public:
BiffStructurePtrVector refs2;
std::wstring sqref;
TableFeatureType rgbFeat;
TableFeatureType rgbFeat;
};
} // namespace XLS
......
......@@ -39,12 +39,10 @@ Feature12::Feature12()
{
}
Feature12::~Feature12()
{
}
BaseObjectPtr Feature12::clone()
{
return BaseObjectPtr(new Feature12(*this));
......
......@@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of Feature12 record in BIFF8
class Feature12: public BiffRecordContinued
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature12)
......@@ -47,11 +45,10 @@ public:
~Feature12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeFeature12;
static const ElementType type = typeFeature12;
};
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of LeftMargin record in BIFF8
class LeftMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(LeftMargin)
......@@ -50,10 +49,9 @@ public:
static const ElementType type = typeLeftMargin;
void readFields(CFRecord& record);
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};
......
......@@ -43,12 +43,10 @@ List12::List12()
{
}
List12::~List12()
{
}
BaseObjectPtr List12::clone()
{
return BaseObjectPtr(new List12(*this));
......
......@@ -83,12 +83,9 @@ int Number::serialize(std::wostream & stream)
{
CP_XML_ATTR(L"s", cell.ixfe - global_info_->cellStyleXfs_count);
}
if (num.value())
CP_XML_NODE(L"v")
{
CP_XML_NODE(L"v")
{
CP_XML_STREAM() << STR::double2str(num);
}
CP_XML_STREAM() << std::to_wstring(num.data.value);
}
}
}
......
......@@ -32,14 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/CellOffsetResender.h>
#include <Logic/Biff_structures/Cell.h>
#include "../Biff_structures/CellOffsetResender.h"
#include "../Biff_structures/Cell.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of Number record in BIFF8
class Number: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Number)
......@@ -59,13 +58,11 @@ public:
const CellRef getLocation() const;
//-----------------------------
GlobalWorkbookInfoPtr global_info_;
CellOffsetResender resender;
Cell cell;
BIFF_DOUBLE num;
Xnum num;
//-----------------------------
GlobalWorkbookInfoPtr global_info_;
};
} // namespace XLS
......
......@@ -32,12 +32,10 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of RightMargin record in BIFF8
class RightMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(RightMargin)
......@@ -48,14 +46,12 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeRightMargin;
static const ElementType type = typeRightMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};
} // namespace XLS
......
......@@ -81,7 +81,7 @@ int SIIndex::serialize(std::wostream & _stream, int idx, const CellRef & in_ref)
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", idx++);
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num.data.value; }
}
res = 1;
}
......@@ -122,7 +122,7 @@ int SIIndex::serialize(std::wostream & _stream, ChartParsedFormula & in_ref)
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", idx++);
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << std::to_wstring(number->num.data.value); }
}
}
}
......
......@@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
......@@ -55,7 +56,7 @@ public:
unsigned char sertm;
unsigned char ebsrc;
unsigned char fTeeTop;
BIFF_DOUBLE numValue;
Xnum numValue;
_UINT16 cnum;
};
......
......@@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/ChartNumNillable.h>
#include "../Biff_structures/ChartNumNillable.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of SerAuxTrend record in BIFF8
class SerAuxTrend: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(SerAuxTrend)
......@@ -48,20 +47,19 @@ public:
~SerAuxTrend();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeSerAuxTrend;
//-----------------------------
unsigned char regt;
unsigned char ordUser;
ChartNumNillable numIntercept;
unsigned char fEquation;
unsigned char fRSquared;
BIFF_DOUBLE numForecast;
BIFF_DOUBLE numBackcast;
unsigned char regt;
unsigned char ordUser;
ChartNumNillable numIntercept;
unsigned char fEquation;
unsigned char fRSquared;
Xnum numForecast;
Xnum numBackcast;
};
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of Setup record in BIFF8
class Setup: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Setup)
......@@ -73,8 +72,8 @@ public:
_UINT16 iRes;
_UINT16 iVRes;
BIFF_DOUBLE numHdr;
BIFF_DOUBLE numFtr;
Xnum numHdr;
Xnum numFtr;
_UINT16 iCopies;
};
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of TopMargin record in BIFF8
class TopMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TopMargin)
......@@ -50,10 +49,10 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeTopMargin;
static const ElementType type = typeTopMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};
......
......@@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/PaneType.h>
#include "../Biff_structures/PaneType.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of UserSViewBegin record in BIFF8
class UserSViewBegin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(UserSViewBegin)
......@@ -88,8 +87,8 @@ public:
bool fRuler;
std::wstring ref8TopLeft;
BIFF_DOUBLE operNumX;
BIFF_DOUBLE operNumY;
Xnum operNumX;
Xnum operNumY;
ForwardOnlyParam<unsigned short> colRPane;
ForwardOnlyParam<unsigned short> rwBPane;
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of ValueRange record in BIFF8
class ValueRange: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ValueRange)
......@@ -53,11 +52,11 @@ public:
static const ElementType type = typeValueRange;
//-----------------------------
BIFF_DOUBLE numMin;
BIFF_DOUBLE numMax;
BIFF_DOUBLE numMajor;
BIFF_DOUBLE numMinor;
BIFF_DOUBLE numCross;
Xnum numMin;
Xnum numMax;
Xnum numMajor;
Xnum numMinor;
Xnum numCross;
bool fAutoMin;
bool fAutoMax;
......
......@@ -78,8 +78,6 @@ typedef unsigned char FillPattern;
typedef BiffAttributeSimple<unsigned char> BIFF_BYTE;
typedef BiffAttributeSimple<_UINT16> BIFF_WORD;
typedef BiffAttributeSimple<_UINT32> BIFF_DWORD;
typedef BiffAttributeSimple<double> BIFF_DOUBLE;
struct PtgAttrSpaceType : public BiffStructure_NoVtbl
{
......@@ -257,22 +255,6 @@ public:
unsigned char ifmt;
};
class SharedFeatureType : public BiffAttributeSimple<_UINT16>
{
public:
enum
{
ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
ISFFACTOID = 0x0004, // Specifies the smart tag type.
ISFLIST = 0x0005, // Specifies the list type.
};
};
struct FFErrorCheck : public BiffStructure_NoVtbl
{
unsigned int ffecCalcError : 1;
......
......@@ -44,6 +44,7 @@ BiffStructurePtr DXFN12List::clone()
DXFN12List::DXFN12List()
{
bExist = false;
size = -1;
}
......@@ -60,6 +61,7 @@ void DXFN12List::load(CFRecord& record)
if (size > 0)
{
bExist = true;
record >> dxfn;
size -= (record.getRdPtr() - pos_record);
}
......
......@@ -55,6 +55,8 @@ public:
int size;
DXFN dxfn;
XFExtNoFRT xfext;
//-----------------------------------------------------------------
bool bExist;
};
typedef boost::shared_ptr<DXFN12List> DXFN12ListPtr;
......
......@@ -43,7 +43,7 @@ class Xnum : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeXnum;
static const ElementType type = typeXnum;
virtual void load(CFRecord& record);
......
......@@ -162,8 +162,10 @@ int CUSTOMVIEW::serialize(std::wostream & stream)
CP_XML_NODE(L"pane")
{
if (userSView->operNumX != 0) CP_XML_ATTR(L"xSplit", userSView->operNumX);
if (userSView->operNumY != 0) CP_XML_ATTR(L"ySplit", userSView->operNumY);
if (userSView->operNumX.data.value != 0)
CP_XML_ATTR(L"xSplit", std::to_wstring(userSView->operNumX.data.value));
if (userSView->operNumY.data.value != 0)
CP_XML_ATTR(L"ySplit", std::to_wstring(userSView->operNumY.data.value));
if (userSView->pane_top_left_cell != L"A1")CP_XML_ATTR(L"topLeftCell", userSView->pane_top_left_cell);
......
......@@ -152,16 +152,16 @@ int DVAXIS::serialize(std::wostream & _stream)
{
CP_XML_NODE(L"c:max")
{
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMax));
else CP_XML_ATTR(L"val", value_range->numMax);
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMax.data.value));
else CP_XML_ATTR(L"val", value_range->numMax.data.value);
}
}
if (value_range->fAutoMin == false)
{
CP_XML_NODE(L"c:min")
{
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMin));
else CP_XML_ATTR(L"val", value_range->numMin);
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMin.data.value));
else CP_XML_ATTR(L"val", value_range->numMin.data.value);
}
}
}
......@@ -202,16 +202,16 @@ int DVAXIS::serialize(std::wostream & _stream)
{
CP_XML_NODE(L"c:majorUnit")
{
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMajor));
else CP_XML_ATTR(L"val", value_range->numMajor);
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMajor.data.value));
else CP_XML_ATTR(L"val", value_range->numMajor.data.value);
}
}
if (value_range->fAutoMinor == false)
{
CP_XML_NODE(L"c:minorUnit")
{
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMinor));
else CP_XML_ATTR(L"val", value_range->numMinor);
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMinor.data.value));
else CP_XML_ATTR(L"val", value_range->numMinor.data.value);
}
}
}
......
......@@ -31,6 +31,8 @@
*/
#include "FEAT11.h"
#include "SORTDATA12.h"
#include "../Biff_records/FeatHdr11.h"
#include "../Biff_records/Feature11.h"
#include "../Biff_records/Feature12.h"
......@@ -39,7 +41,11 @@
#include "../Biff_records/AutoFilter12.h"
#include "../Biff_records/ContinueFrt12.h"
#include "../Biff_records/List12.h"
#include "../Biff_unions/SORTDATA12.h"
#include "../Biff_structures/List12BlockLevel.h"
#include "../Biff_structures/List12TableStyleClientInfo.h"
#include "../Biff_structures/List12DisplayName.h"
#include "../Biff_structures/Feat11FieldDataItem.h"
namespace XLS
{
......@@ -54,8 +60,6 @@ FEAT11::~FEAT11()
{
}
class Parenthesis_FEAT11_1: public ABNFParenthesis
{
BASE_OBJECT_DEFINE_CLASS_NAME(Parenthesis_FEAT11_1)
......@@ -124,10 +128,7 @@ const bool FEAT11::loadContent(BinProcessor& proc)
}break;
case typeList12:
{
if (m_arFEAT.back().m_AutoFilter12)
m_arFEAT.back().m_arList12_second.push_back(elements_.front());
else
m_arFEAT.back().m_arList12.push_back(elements_.front());
m_arFEAT.back().m_arList12.push_back(elements_.front());
}break;
case typeAutoFilter12:
{
......@@ -143,13 +144,97 @@ const bool FEAT11::loadContent(BinProcessor& proc)
return true;
}
int FEAT11::serialize(std::wostream & strm)
int FEAT11::serialize(std::wostream & strm, size_t index)
{
FeatHdr11 * feature = dynamic_cast<FeatHdr11*>(m_FeatHdr11.get());
Feature11 * feature11 = dynamic_cast<Feature11*>(m_arFEAT[index].m_Feature.get());
Feature12 * feature12 = dynamic_cast<Feature12*>(m_arFEAT[index].m_Feature.get());
List12BlockLevel *block_level = NULL;
List12TableStyleClientInfo *table_style = NULL;
List12DisplayName *display_name = NULL;
for (size_t i = 0; i < m_arFEAT[index].m_arList12.size(); i++)
{
List12* list_prop = dynamic_cast<List12*>(m_arFEAT[index].m_arList12[i].get());
if (!list_prop) continue;
if (!block_level) block_level = dynamic_cast<List12BlockLevel*> (list_prop->rgbList12.get());
if (!table_style) table_style = dynamic_cast<List12TableStyleClientInfo*> (list_prop->rgbList12.get());
if (!display_name) display_name = dynamic_cast<List12DisplayName*> (list_prop->rgbList12.get());
}
//----------------------------------------------------------------------------------------------------------------------------------
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"table")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
if (display_name)
{
if (!display_name->stListName.value().empty())
CP_XML_ATTR(L"displayName", display_name->stListName.value());
if (!display_name->stListComment.value().empty())
CP_XML_ATTR(L"comment", display_name->stListComment.value());
}
if (block_level)
{
if (!block_level->stData.value().empty())
CP_XML_ATTR(L"dataCellStyle", block_level->stData.value());
}
if (feature11)
{
CP_XML_ATTR(L"id", feature11->rgbFeat.idList);
CP_XML_ATTR(L"name", feature11->rgbFeat.rgbName.value());
CP_XML_ATTR(L"ref", feature11->sqref);
if (feature11->rgbFeat.fAutoFilter)
{
CP_XML_NODE(L"autoFilter")
{
CP_XML_ATTR(L"ref", feature11->sqref);
}
}
CP_XML_NODE(L"tableColumns")
{
CP_XML_ATTR(L"count", feature11->rgbFeat.arFieldData.size());
for (size_t i = 0; i < feature11->rgbFeat.arFieldData.size(); i++)
{
Feat11FieldDataItem* field = dynamic_cast<Feat11FieldDataItem*>(feature11->rgbFeat.arFieldData[i].get());
if(!field) continue;
CP_XML_NODE(L"tableColumn")
{
CP_XML_ATTR(L"id", field->idField);
CP_XML_ATTR(L"name", field->strCaption.value());
if (field->dxfFmtAgg.bExist ||
field->dxfFmtInsertRow.bExist)
{
//if (!field->stData.value().empty())
// CP_XML_ATTR(L"dataCellStyle", field->stData.value());
//if (!field->stData.value().empty())
// CP_XML_ATTR(L"dataDxfId", field->stData.value());
}
}
}
}
}
else if (feature12)
{
}
if (table_style)
{
CP_XML_NODE(L"tableStyleInfo")
{
CP_XML_ATTR(L"name", table_style->stListStyleName.value());
CP_XML_ATTR(L"showFirstColumn", table_style->nFirstColumn);
CP_XML_ATTR(L"showLastColumn", table_style->nLastColumn);
CP_XML_ATTR(L"showRowStripes", table_style->nRowStripes);
CP_XML_ATTR(L"showColumnStripes", table_style->nColumnStripes);
}
}
}
}
return 0;
......
......@@ -47,7 +47,7 @@ public:
BaseObjectPtr clone();
virtual const bool loadContent(BinProcessor& proc);
int serialize(std::wostream & stream);
int serialize(std::wostream & stream, size_t index);
static const ElementType type = typeFEAT11;
......@@ -58,8 +58,6 @@ public:
BaseObjectPtr m_Feature; //11 or 12
BaseObjectPtr m_AutoFilter12;
std::vector<BaseObjectPtr> m_arList12;
std::vector<BaseObjectPtr> m_arList12_second;
std::vector<BaseObjectPtr> m_arAutoFilter12;
BaseObjectPtr m_SORTDATA12;
};
......
......@@ -167,15 +167,13 @@ int PAGESETUP::serialize(std::wostream & stream)
{
if (setup)
{
if (setup->numHdr.value())
{
CP_XML_ATTR(L"header", setup->numHdr);
CP_XML_ATTR(L"header", std::to_wstring(setup->numHdr.data.value));
header = true;
}
if (setup->numFtr.value())
{
CP_XML_ATTR(L"footer", setup->numFtr);
CP_XML_ATTR(L"footer", std::to_wstring(setup->numFtr.data.value));
footer = true;
}
}
......@@ -187,26 +185,26 @@ int PAGESETUP::serialize(std::wostream & stream)
if (!t)
{
TopMargin* top = dynamic_cast<TopMargin*>(it->get());
CP_XML_ATTR(L"top", top->num);
CP_XML_ATTR(L"top", std::to_wstring(top->num.data.value));
t = true;
}break;
case typeBottomMargin:
if (!b)
{
BottomMargin* bottom = dynamic_cast<BottomMargin*>(it->get());
CP_XML_ATTR(L"bottom", bottom->num);
CP_XML_ATTR(L"bottom", std::to_wstring(bottom->num.data.value));
b= true;
}break;
case typeLeftMargin:
{
LeftMargin* left = dynamic_cast<LeftMargin*>(it->get());
CP_XML_ATTR(L"left", left->num);
CP_XML_ATTR(L"left", std::to_wstring(left->num.data.value));
l= true;
}break;
case typeRightMargin:
{
RightMargin* right = dynamic_cast<RightMargin*>(it->get());
CP_XML_ATTR(L"right", right->num);
CP_XML_ATTR(L"right", std::to_wstring(right->num.data.value));
r= true;
}break;
}
......
......@@ -75,9 +75,6 @@
#include "../XlsFormat/Logic/Biff_records/IMDATA.h"
#include "../XlsFormat/Logic/Biff_records/Note.h"
#include "../XlsFormat/Logic/Biff_records/WsBool.h"
#include "../XlsFormat/Logic/Biff_records/FeatHdr11.h"
#include "../XlsFormat/Logic/Biff_records/Feature11.h"
#include "../XlsFormat/Logic/Biff_records/Feature12.h"
#include "../XlsFormat/Logic/Biff_structures/URLMoniker.h"
#include "../XlsFormat/Logic/Biff_structures/FileMoniker.h"
......@@ -994,30 +991,18 @@ void XlsConverter::convert(ODRAW::OfficeArtBStoreContainer* art_bstore, int star
void XlsConverter::convert(XLS::FEAT11 * shared_feature)
{
if (!shared_feature) return;
xlsx_context->start_table();
std::wstringstream strm;
shared_feature->serialize(strm);
for (size_t i = 0; i < shared_feature->m_arFEAT.size(); i++)
{
xlsx_context->start_table();
xlsx_context->get_tables_context().add_table(strm.str());
std::wstringstream strm;
shared_feature->serialize(strm, i);
xlsx_context->end_table();
//XLS::FeatHdr11 * feature = dynamic_cast<XLS::FeatHdr11*>(shared_feature->m_FeatHdr11.get());
xlsx_context->get_tables_context().add_table(strm.str());
//for (size_t i = 0; i < shared_feature->m_arFEAT.size(); i++)
//{
// XLS::Feature11 * feature11 = dynamic_cast<XLS::Feature11*>(shared_feature->m_arFEAT[i].m_Feature.get());
// XLS::Feature12 * feature12 = dynamic_cast<XLS::Feature12*>(shared_feature->m_arFEAT[i].m_Feature.get());
//
// if (feature11)
// {
// }
// else if (feature12)
// {
// }
//}
xlsx_context->end_table();
}
}
void XlsConverter::convert(XLS::HLINK * HLINK_)
......
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