Commit 16c57b50 authored by ElenaSubbotina's avatar ElenaSubbotina

XlsFormat - table parts

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