Commit 152b2d8f authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

XlsFile2 - картинки

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63801 954022d7-b5bf-4e40-9824-e11837661b57
parent 089d4c7f
......@@ -11,11 +11,10 @@ class BopPopCustomPiesIndices : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(MSXML2::IXMLDOMElementPtr xml_tag);
//virtual const bool fromXML(MSXML2::IXMLDOMElementPtr xml_tag){return false;}
virtual void load(CFRecord& record);
virtual void store(CFRecord& record){}
static const ElementType type = typeBopPopCustomPiesIndices;
//-----------------------------
std::vector<unsigned short> pie_indices;
};
......
......@@ -17,6 +17,7 @@ public:
virtual void load(CFRecord& record) {};
virtual void store(CFRecord& record){};
static const ElementType type = typeIXFCellMulBlankSpecial;
//-----------------------------
unsigned short common_ixfe;
std::vector<unsigned short> rgixfe;
......
......@@ -11,14 +11,12 @@ class RGISeriesListSpecial : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(MSXML2::IXMLDOMElementPtr xml_tag);
//virtual const bool fromXML(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeRGISeriesListSpecial;
//-----------------------------
//-----------------------------
std::vector<unsigned short> series;
};
......
......@@ -17,11 +17,11 @@ public:
~AF12Criteria();
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
static const ElementType type = typeAF12Criteria;
AFDOper doper;
XLUnicodeStringNoCch str;
BIFF_BSTR _str;
......
......@@ -17,16 +17,15 @@ public:
AFDOper(bool bAutoFilter);
~AFDOper();
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeAFDOper;
BIFF_BYTE vt;
BIFF_BYTE grbitSign;
AFDOperStr vtValue;
public:
bool m_bAutoFilter;
};
......
......@@ -17,7 +17,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
static const ElementType type = typeAFDOperRk;
BIFF_DWORD rk;
};
......
......@@ -17,6 +17,7 @@ public:
AFDOperStr(bool bAutoFilter);
~AFDOperStr();
static const ElementType type = typeAFDOperStr;
virtual void load(CFRecord& record);
......@@ -25,7 +26,6 @@ public:
BIFF_BYTE cch;
BIFF_BYTE fCompare;
public:
bool m_bAutoFilter;
};
......
......@@ -14,12 +14,11 @@ class AddinUdf : public BiffStructure
public:
BiffStructurePtr clone();
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeAddinUdf;
ShortXLUnicodeString udfName;
};
......
......@@ -13,7 +13,7 @@ class AntiMoniker : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeAntiMoniker;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
......
......@@ -14,6 +14,7 @@ class Bes : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeBes;
virtual void load(CFRecord& record);
......
......@@ -17,6 +17,7 @@ public:
{
attrib_name = name_init;
}
static const ElementType type = typeBiffAttribute;
_CP_OPT(std::wstring) attrib_name;
};
......
......@@ -37,8 +37,7 @@ public:
virtual void load(CFRecord& record) = 0;
virtual void store(CFRecord& record) = 0;
static const ElementType type = typeBiffStructure;
virtual ElementType get_type() const { return type; }
virtual ElementType get_type() = 0;
virtual int serialize(std::wostream & _stream)
{
......@@ -54,7 +53,8 @@ public:
#define BASE_STRUCTURE_DEFINE_CLASS_NAME(class_name)\
public: \
const std::wstring & getClassName() const { static std::wstring str(L# class_name); return str; };
const std::wstring & getClassName() const { static std::wstring str(L# class_name); return str; };\
virtual XLS::ElementType get_type() { return type; }
......
......@@ -13,12 +13,12 @@ class BookExt_Conditional11 : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeBookExt_Conditional11;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool fBuggedUserAboutSolution;
bool fShowInkAnnotation;
};
......
......@@ -13,12 +13,11 @@ class BookExt_Conditional12 : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeBookExt_Conditional12;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool fPublishedBookItems;
bool fShowPivotChartFilter;
};
......
......@@ -13,7 +13,7 @@ class BuiltInStyle : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeBuiltInStyle;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -17,12 +17,11 @@ public:
CFColor(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeCFColor;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
XColorType xclrType;
ColorICV icv;
LongRGBA rgb;
......
......@@ -15,12 +15,11 @@ class CFExNonCF12 : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeCFExNonCF12;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short icf;
unsigned char cp;
unsigned char icfTemplate;
......
......@@ -100,7 +100,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeCFExTemplateParams;
union
{
CFExFilterParams filter;
......
......@@ -15,12 +15,12 @@ class CFMStateItem : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeCFMStateItem;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
CFVO cfvo;
Boolean<unsigned char> fEqual;
};
......
......@@ -14,7 +14,7 @@ class CFMultistate : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeCFMultistate;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -14,7 +14,7 @@ class CFVO : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeCFVO;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -23,6 +23,8 @@ public:
const CellRef getLocation() const;
static const ElementType type = typeCell;
Rw rw;
Col col;
IXFCell ixfe;
......
......@@ -23,10 +23,9 @@ public:
static void resend(CFStream& stream, const unsigned int data_place, const unsigned int data);
private:
static const ElementType type = typeCellOffsetResender;
// Stubbed to make class non-abstract
private:
bool row_starts;
};
......
......@@ -25,8 +25,7 @@ public:
BiffStructurePtr clone();
static const ElementType type = typeCellRangeRef;
const std::wstring toString(const bool useShortForm = true) const;
void fromString(const std::wstring& str);
......
......@@ -16,7 +16,7 @@ public:
BiffStructurePtr clone();
static const ElementType type = typeCellRef;
const std::wstring toString() const;
......
......@@ -21,6 +21,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeCellXF;
GlobalWorkbookInfoPtr m_GlobalWorkbookInfo;
int serialize(std::wostream & stream);
......
......@@ -16,12 +16,11 @@ public:
CompositeMoniker(XLS::CFRecord& record);
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeCompositeMoniker;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
std::vector<HyperlinkMoniker> monikerArray;
};
......
......@@ -14,7 +14,7 @@ class CondFmtStructure : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeCondFmtStructure;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -14,7 +14,7 @@ class ControlInfo : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeControlInfo;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -13,12 +13,11 @@ class DXFALC : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFALC;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned char alc;
bool fWrap;
unsigned char alcv;
......
......@@ -13,12 +13,11 @@ class DXFBdr : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFBdr;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned char dgLeft;
unsigned char dgRight;
unsigned char dgTop;
......
......@@ -16,12 +16,11 @@ class DXFFntD : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFFntD;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
XLUnicodeStringNoCch stFontName;
Stxp stxp;
long icvFore;
......
......@@ -17,12 +17,11 @@ public:
DXFId(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeDXFId;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int index;
};
......
......@@ -19,12 +19,11 @@ class DXFN : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFN;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool alchNinch;
bool alcvNinch;
bool wrapNinch;
......
......@@ -15,12 +15,11 @@ class DXFN12 : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFN12;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int cbDxf;
DXFNPtr dxfn;
XFExtNoFRTPtr xfext;
......
......@@ -17,12 +17,11 @@ public:
DXFN12List();
~DXFN12List();
static const ElementType type = typeDXFN12List;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
DXFN dxfn;
XFExtNoFRT xfext;
};
......
......@@ -15,7 +15,7 @@ class DXFNum : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFNum;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......@@ -23,7 +23,6 @@ public:
void setIsUserDefined(const bool is_user_defined);
const bool getIsUserDefined() const;
private:
_CP_OPT(bool) is_user_defined_;
DXFNumIFmt fmt_id;
DXFNumUsr user_defined;
......
......@@ -15,12 +15,11 @@ public:
DXFNumUsr();
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeDXFNumUsr;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short cb;
XLUnicodeString fmt;
};
......
......@@ -14,12 +14,11 @@ class DXFPat : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFPat;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
FillPattern fls;
unsigned char icvForeground;
unsigned char icvBackground;
......
#pragma once
#include "BiffStructure.h"
//#include <Logic/Biff_structures/Phs.h>
//#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{;
......@@ -15,12 +13,11 @@ class DXFProt : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeDXFProt;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool fLocked;
bool fHidden;
};
......
......@@ -14,12 +14,11 @@ class DropDownObjId : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeDropDownObjId;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
ObjId id;
};
......
......@@ -14,12 +14,11 @@ class EncryptionHeader : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeEncryptionHeader;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
EncryptionHeaderFlags Flags;
long AlgID;
long AlgIDHash;
......
......@@ -15,12 +15,11 @@ class EncryptionHeaderFlags : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeEncryptionHeaderFlags;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
bool fCryptoAPI;
bool fDocProps;
bool fExternal;
......
......@@ -13,12 +13,11 @@ class EncryptionVerifier : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeEncryptionVerifier;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
unsigned int SaltSize;
struct SALT_TAG {
unsigned int b1;
......
......@@ -15,12 +15,11 @@ public:
EnhancedProtection(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeEnhancedProtection;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool iprotObjects;
bool iprotScenarios;
bool iprotFormatCells;
......
......@@ -18,6 +18,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeExtProp;
unsigned short extType;
unsigned short cb;
......
......@@ -16,14 +16,13 @@ class ExtRst : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeExtRst;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
const size_t getSize() const;
private:
unsigned short cb;
Phs phs;
RPHSSub rphssub;
......
......@@ -14,12 +14,11 @@ class ExternDdeLinkNoOper : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeExternDdeLinkNoOper;
ShortXLUnicodeString linkName;
};
......
......@@ -15,12 +15,11 @@ class ExternDocName : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeExternDocName;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short ixals;
ShortXLUnicodeString extName;
ExtNameParsedFormula nameDefinition;
......
......@@ -15,12 +15,11 @@ class ExternOleDdeLink : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeExternOleDdeLink;
unsigned int lStgName;
ShortXLUnicodeString linkName;
MOper moper;
......
......@@ -17,12 +17,11 @@ public:
FactoidData(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeFactoidData;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool fDelete;
bool fXMLBased;
OSHARED::PropertyBag propertyBag;
......
......@@ -15,12 +15,11 @@ class FactoidType : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeFactoidType;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
unsigned int id;
PBString rgbUri;
PBString rgbTag;
......
......@@ -16,12 +16,11 @@ class Feat11FdaAutoFilter : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFeat11FdaAutoFilter;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
BIFF_DWORD cbAutoFilter;
AutoFilter recAutoFilter;
};
......
......@@ -16,12 +16,11 @@ class Feat11FieldDataItem : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFeat11FieldDataItem;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
BIFF_DWORD idField;
BIFF_DWORD lfdt;
BIFF_DWORD lfxidt;
......
......@@ -16,12 +16,11 @@ public:
FeatFormulaErr2(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeFeatFormulaErr2;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
FFErrorCheck grffecIgnore;
};
......
......@@ -17,12 +17,11 @@ public:
FeatProtection(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeFeatProtection;
bool fSD;
unsigned int wPassword;
XLUnicodeString stTitle;
......
......@@ -17,12 +17,11 @@ public:
FeatSmartTag(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeFeatSmartTag;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int hashValue;
std::vector<FactoidData> rgFactoid;
};
......
......@@ -15,6 +15,8 @@ public:
FileMoniker(XLS::CFRecord& record);
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeFileMoniker;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
......
......@@ -13,12 +13,11 @@ class FileOffset : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFileOffset;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short offset;
};
......
......@@ -16,12 +16,11 @@ public:
BiffStructurePtr clone();
static const ElementType type = typeFilePointer;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int offset;
};
......
......@@ -14,12 +14,11 @@ class FormatRun : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFormatRun;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short ich;
FontIndex ifnt;
};
......
......@@ -22,8 +22,8 @@ public:
virtual void store(CFRecord& record);
static const ElementType type = typeFrtHeader;
private:
CFRecordType::TypeId rt;
FrtFlags grbitFrt;
};
......
......@@ -18,12 +18,11 @@ public:
BiffStructurePtr clone();
static const ElementType type = typeFrtHeaderOld;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
CFRecordType::TypeId rt;
FrtFlags grbitFrt;
};
......
......@@ -16,7 +16,7 @@ class FrtRefHeader : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFrtRefHeader;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -19,12 +19,11 @@ public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeFrtRefHeaderNoGrbit;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
CFRecordType::TypeId rt;
Ref8U ref8;
};
......
......@@ -16,12 +16,11 @@ class FrtRefHeaderU : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeFrtRefHeaderU;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
CFRecordType::TypeId rt;
FrtFlags grbitFrt;
Ref8U ref8;
......
......@@ -13,12 +13,11 @@ class FtCblsData : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtCblsData;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short fChecked;
unsigned short accel;
bool fNo3d;
......
......@@ -17,12 +17,11 @@ public:
}
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtCf;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short cf;
};
......
......@@ -16,7 +16,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
static const ElementType type = typeFtCmo;
unsigned short ot;
unsigned short id;
......
......@@ -14,12 +14,11 @@ class FtEdoData : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtEdoData;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short ivtEdit;
Boolean<unsigned short> fMultiLine;
unsigned short fVScroll;
......
......@@ -14,12 +14,11 @@ class FtGboData : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
static const ElementType type = typeFtGboData;
unsigned short accel;
bool fNo3d;
};
......
......@@ -18,16 +18,14 @@ public:
FtLbsData();
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtLbsData;
virtual void load(CFRecord& record, const unsigned short ot);
virtual void store(CFRecord& record, const unsigned short ot);
private:
virtual void load(CFRecord& record){}
virtual void store(CFRecord& record){}
private:
ObjFmla fmla;
unsigned short cLines;
unsigned short iSel;
......
......@@ -15,12 +15,11 @@ public:
FtMacro();
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtMacro;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
ObjFmla fmla;
};
......
......@@ -14,12 +14,11 @@ class FtNts : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtNts;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
std::wstring guid;
Boolean<unsigned short> fSharedNote;
};
......
......@@ -17,15 +17,14 @@ public:
FtPictFmla();
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
virtual void load(CFRecord& record, FtPioGrbit& pictFlags);
virtual void store(CFRecord& record, FtPioGrbit& pictFlags);
private:
static const ElementType type = typeFtPictFmla;
virtual void load(CFRecord& record){}
virtual void store(CFRecord& record){}
private:
ObjFmla fmla;
unsigned int lPosInCtlStm;
unsigned int cbBufInCtlStm;
......
......@@ -13,12 +13,11 @@ class FtPioGrbit : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtPioGrbit;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
bool fAutoPict;
bool fDde;
bool fPrintCalc;
......
......@@ -14,12 +14,11 @@ class FtRboData : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtRboData;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short idRadNext;
Boolean<unsigned short> fFirstBtn;
};
......
......@@ -14,16 +14,14 @@ class FtSbs : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeFtSbs;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
unsigned short ft;
unsigned short cb;
private:
short iVal;
short iMin;
short iMax;
......
......@@ -21,12 +21,8 @@ public:
const unsigned short getIndex() const;
const bool isMacro() const;
//void toXML(BiffStructurePtr & parent);
public:
static const unsigned short recognizeFunction(const std::wstring& word);
private:
class ValuesDetermination
{
public:
......@@ -35,7 +31,6 @@ private:
static const unsigned short getIndex(const std::wstring& func_name);
static const long getParamsNum(const std::wstring& func_name);
private:
ValuesDetermination();
static ValuesDetermination& getInst()
{
......@@ -58,11 +53,9 @@ private:
> ParamsFixedSet;
private:
ParamsFixedSet params_fixed;
};
private:
unsigned short func_index;
};
#pragma pack() // restore
......
......@@ -16,6 +16,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeFullColorExt;
unsigned char icv;
unsigned char xclrType;
short nTintShade;
......
......@@ -17,6 +17,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeGradStop;
unsigned short xclrType;
unsigned int xclrValue;
LongRGBA xclrValue_rgb;
......
......@@ -14,12 +14,11 @@ class HorzBrk : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeHorzBrk;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
RwU row;
unsigned short colStart;
unsigned short colEnd;
......
......@@ -16,6 +16,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeHyperlinkMoniker;
std::wstring monikerClsid;
boost::shared_ptr<BiffStructure> data;
};
......
......@@ -20,6 +20,8 @@ public:
unsigned int streamVersion;
static const XLS::ElementType type = XLS::typeHyperlinkObject;
bool hlstmfHasMoniker;
bool hlstmfIsAbsolute;
bool hlstmfSiteGaveDisplayName;
......
......@@ -13,12 +13,11 @@ class ISSTInf : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeISSTInf;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int ib;
unsigned short cbOffset;
};
......
......@@ -15,12 +15,11 @@ public:
ItemMoniker(XLS::CFRecord& record);
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeItemMoniker;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
std::string delimiterAnsi;
std::wstring delimiterUnicode;
std::string itemAnsi;
......
......@@ -14,12 +14,11 @@ class LbsDropData : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeLbsDropData;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned char wStyle;
bool fFiltered;
......
......@@ -16,12 +16,11 @@ public:
List12BlockLevel();
~List12BlockLevel();
static const ElementType type = typeList12BlockLevel;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
BIFF_DWORD cbdxfHeader;
BIFF_DWORD istnHeader;
BIFF_DWORD cbdxfData;
......
......@@ -16,12 +16,11 @@ public:
List12DisplayName();
~List12DisplayName();
static const ElementType type = typeList12DisplayName;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
XLNameUnicodeString stListName;
XLUnicodeString stListComment;
};
......
......@@ -16,12 +16,11 @@ public:
List12TableStyleClientInfo();
~List12TableStyleClientInfo();
static const ElementType type = typeList12TableStyleClientInfo;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
BIFF_BYTE fFirstColumn;
BIFF_BYTE fLastColumn;
BIFF_BYTE fRowStripes;
......
......@@ -15,19 +15,17 @@ public:
LongRGBA(const bool alpha_present);
BiffStructurePtr clone();
static const ElementType type = typeLongRGBA;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
protected:
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
std::wstring argb;
private:
bool is_alpha;
};
......
......@@ -13,12 +13,11 @@ class MDXStrIndex : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeMDXStrIndex;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int index;
};
......
......@@ -13,12 +13,11 @@ class MDir : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeMDir;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
long imdt;
unsigned short mdd;
};
......
......@@ -15,12 +15,11 @@ class MOper : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeMOper;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
ColunByteU colLast;
RwU rowLast;
std::vector<SerArPtr> extOper;
......
......@@ -18,12 +18,11 @@ public:
NoteRR(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeNoteRR;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
RRD rrd;
bool bitfDelNote;
bool bitfAddNote;
......
......@@ -17,12 +17,11 @@ public:
NoteSh(CFRecord& record);
BiffStructurePtr clone();
////virtual void toXML(BiffStructurePtr & parent);
////virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeNoteSh;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
Rw row;
Col col;
bool fShow;
......
......@@ -18,6 +18,8 @@ class IMsoArray : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone(){return XLS::BiffStructurePtr(new IMsoArray(*this));}
static const XLS::ElementType type = XLS::typeIMsoArray;
virtual void load(XLS::CFRecord& record)
{
unsigned short nElems, nElemsAlloc;
......
......@@ -19,6 +19,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeMSOCR;
unsigned char red;
unsigned char green;
unsigned char blue;
......
......@@ -20,12 +20,11 @@ public:
MSOSHADECOLOR();
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeMSOSHADECOLOR;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
public:
OfficeArtCOLORREF color;
OSHARED::FixedPoint position;
};
......
......@@ -42,6 +42,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeOfficeArtBStoreContainerFileBlock;
void readCompressedData(XLS::CFRecord& record, OfficeArtMetafileHeader metafileHeader);
int bin_data_id;
......@@ -54,7 +56,7 @@ public:
std::wstring rgbUid1;
std::wstring rgbUid2;
bool result;
private:
const std::wstring ReadMD4Digest(XLS::CFRecord& record)
{
std::wstring result;
......
......@@ -18,6 +18,8 @@ public:
OfficeArtCOLORREF(const long raw_data);
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtCOLORREF;
virtual void load(XLS::CFRecord& record) {};
virtual void store(XLS::CFRecord& record) {};
......
......@@ -2,6 +2,9 @@
#include "OfficeArtClientAnchorSheet.h"
#include <Binary/CFRecord.h>
#include <boost/lexical_cast.hpp>
#include <simple_xml_writer.h>
namespace ODRAW
{;
......@@ -9,6 +12,7 @@ namespace ODRAW
OfficeArtClientAnchorSheet::OfficeArtClientAnchorSheet()
: OfficeArtRecord(0x00, ClientAnchor)
{
}
......@@ -17,38 +21,51 @@ XLS::BiffStructurePtr OfficeArtClientAnchorSheet::clone()
return XLS::BiffStructurePtr(new OfficeArtClientAnchorSheet(*this));
}
//void OfficeArtClientAnchorSheet::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// xml_tag->setAttribute(L"fMove", fMove);
// xml_tag->setAttribute(L"fSize", fSize);
//
// xml_tag->setAttribute(L"colL", colL);
// xml_tag->setAttribute(L"dxL", _dxL);
// xml_tag->setAttribute(L"rwT", rwT);
// xml_tag->setAttribute(L"dyT", _dyT);
// xml_tag->setAttribute(L"colR", colR);
// xml_tag->setAttribute(L"dxR", _dxR);
// xml_tag->setAttribute(L"rwB", rwB);
// xml_tag->setAttribute(L"dyB", _dyB);
//}
//void OfficeArtClientAnchorSheet::getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// fMove = getStructAttribute(xml_tag, L"fMove");
// fSize = getStructAttribute(xml_tag, L"fSize");
//
// colL = getStructAttribute(xml_tag, L"colL");
// dxL = getStructAttribute(xml_tag, L"dxL");
// rwT = getStructAttribute(xml_tag, L"rwT");
// dyT = getStructAttribute(xml_tag, L"dyT");
// colR = getStructAttribute(xml_tag, L"colR");
// dxR = getStructAttribute(xml_tag, L"dxR");
// rwB = getStructAttribute(xml_tag, L"rwB");
// dyB = getStructAttribute(xml_tag, L"dyB");
//}
int OfficeArtClientAnchorSheet::serialize(std::wostream &stream)
{
CP_XML_WRITER(stream)
{
CP_XML_NODE(L"xdr:from")
{
CP_XML_NODE(L"xdr:col")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(colL);
}
CP_XML_NODE(L"xdr:colOff")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(dxL * 256);
}
CP_XML_NODE(L"xdr:row")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(rwT);
}
CP_XML_NODE(L"xdr:rowOff")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(dyT * 256);
}
}
CP_XML_NODE(L"xdr:to")
{
CP_XML_NODE(L"xdr:col")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(colR);
}
CP_XML_NODE(L"xdr:colOff")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(dxR * 256);
}
CP_XML_NODE(L"xdr:row")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(rwB);
}
CP_XML_NODE(L"xdr:rowOff")
{
CP_XML_STREAM() << boost::lexical_cast<std::wstring>(dyB * 256);
}
}
}
return 0;
}
void OfficeArtClientAnchorSheet::storeFields(XLS::CFRecord& record)
{
......
......@@ -24,6 +24,8 @@ public:
virtual void loadFields(XLS::CFRecord& record);
virtual void storeFields(XLS::CFRecord& record);
int serialize(std::wostream & stream);
bool fMove;
bool fSize;
......
......@@ -24,7 +24,7 @@ class OfficeArtFOPTE : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtFOPTE;
virtual void store(XLS::CFRecord& record);
......
......@@ -16,7 +16,7 @@ class OfficeArtFRIT : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtFRIT;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
......
......@@ -27,7 +27,6 @@ public:
const unsigned short GetInstanceToStore();
unsigned short shape_id;
unsigned int spid;
bool fGroup;
......
......@@ -16,7 +16,7 @@ class OfficeArtIDCL : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtIDCL;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
......
......@@ -18,12 +18,11 @@ class OfficeArtMetafileHeader : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtMetafileHeader;
virtual void store(XLS::CFRecord& record);
virtual void load(XLS::CFRecord& record);
public:
unsigned int cbSize;
RECT rcBounds;
POINT ptSize;
......
......@@ -20,6 +20,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeOfficeArtRGFOPTE;
void SetOptionsNumber(const unsigned short number);
const unsigned short GetOptionsNumber();
......
......@@ -20,6 +20,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeOfficeArtRecordHeader;
const size_t size() const;
unsigned char recVer;
......
......@@ -16,13 +16,13 @@ public:
ObjFmla(const bool is_part_of_FtPictFmla);
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeObjFmla;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
ObjectParsedFormula fmla;
private:
bool is_part_of_FtPictFmla_;
bool fmla_found;
PictFmlaEmbedInfo embedInfo;
......
......@@ -15,15 +15,13 @@ public:
ObjLinkFmla();
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typeObjLinkFmla;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record, const unsigned short ot);
private:
virtual void store(CFRecord& record){}
private:
ObjFmla fmla;
};
......
......@@ -20,7 +20,7 @@ public:
const std::wstring getAssembledFormula() const;
//const bool parseStringFormula(const std::wstring formula, const std::wstring & tag_name);
static const ElementType type = typeParsedFormula;
Rgce rgce;
RgbExtra rgcb;
......
......@@ -13,12 +13,11 @@ class PhRuns : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typePhRuns;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
short ichFirst;
short ichMom;
short cchMom;
......
......@@ -14,12 +14,11 @@ class Phs : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typePhs;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short ifnt;
struct Phs_Data
{
......
......@@ -14,12 +14,11 @@ class PictFmlaEmbedInfo : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typePictFmlaEmbedInfo;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
XLUnicodeStringNoCch strClass;
};
......
......@@ -16,12 +16,11 @@ public:
PictFmlaKey();
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr own_tag);
static const ElementType type = typePictFmlaKey;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
ObjFmla fmlaLinkedCell;
ObjFmla fmlaListFillRange;
};
......
......@@ -13,12 +13,11 @@ class Property : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeProperty;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
unsigned int keyIndex;
unsigned int valueIndex;
};
......
......@@ -14,12 +14,11 @@ class PropertyBag : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typePropertyBag;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
unsigned short id;
std::vector<Property> properties;
};
......
......@@ -15,12 +15,11 @@ class PropertyBagStore : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typePropertyBagStore;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
std::vector<FactoidType> factoidTypes;
unsigned short cbHdr;
unsigned short sVer;
......
......@@ -33,6 +33,7 @@ public:
virtual void loadFields(CFRecord& record) {};
virtual void storeFields(CFRecord& record) {};
static const ElementType type = typePtg;
virtual const unsigned short getPtgId() const;// = 0;
const size_t getOffsetInRecord() const;
......
......@@ -11,21 +11,6 @@ BiffStructurePtr PtgMemNoMemN::clone()
return BiffStructurePtr(new PtgMemNoMemN(*this));
}
//
//void PtgMemNoMemN::toXML(BiffStructurePtr & parent)
//{
// MSXML2::IXMLDOMElementPtr own_tag = XMLSTUFF::createElement(getClassName(), parent);
//
// own_tag->setAttribute(L"type", type);
//}
//
//
//const bool PtgMemNoMemN::fromXML(BiffStructurePtr & parent)
//{
//#pragma message("####################### PtgMemNoMemN record has no BiffStructure::fromXML() implemented")
// Log::error(" Error!!! PtgMemNoMemN record has no BiffStructure::fromXML() implemented.");
// return false;
//}
void PtgMemNoMemN::store(CFRecord& record)
......@@ -40,7 +25,7 @@ void PtgMemNoMemN::load(CFRecord& record)
{
unsigned char rec_type;
record >> rec_type;
type = GETBITS(rec_type, 5, 6);
type1 = GETBITS(rec_type, 5, 6);
record >> cce;
}
......
......@@ -13,15 +13,13 @@ class PtgMemNoMemN : public Ptg
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned char type;
unsigned char type1;
unsigned short cce;
};
......
......@@ -17,12 +17,11 @@ class RC4CryptoAPIEncryptionHeader : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeRC4CryptoAPIEncryptionHeader;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
Version EncryptionVersionInfo;
EncryptionHeaderFlags Flags;
unsigned int EncryptionHeaderSize;
......
......@@ -13,12 +13,11 @@ class RC4EncryptionHeader : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
public:
static const XLS::ElementType type = XLS::typeRC4EncryptionHeader;
Version EncryptionVersionInfo;
struct SALT_TAG {
unsigned int b1;
......
......@@ -14,7 +14,7 @@ class RPHSSub : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeRPHSSub;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......@@ -22,7 +22,6 @@ public:
const size_t getSize() const;
const unsigned short getRunsNumber() const;
private:
unsigned short crun;
LPWideString st;
};
......
......@@ -16,12 +16,11 @@ public:
RRD(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeRRD;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned int cbMemory;
long revid;
RevisionType revt;
......
......@@ -33,7 +33,7 @@ void RevItab::store(CFRecord& record)
void RevItab::load(CFRecord& record)
{
record >> type;
record >> type1;
switch(type)
{
case 0x00:
......
......@@ -16,13 +16,12 @@ public:
RevItab(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeRevItab;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned char type;
unsigned char type1;
unsigned short tabid;
XLUnicodeString sheet;
};
......
......@@ -16,14 +16,13 @@ public:
RevLblName(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(MSXML2::IXMLDOMElementPtr parent);
//virtual const bool fromXML(MSXML2::IXMLDOMElementPtr parent);
static const ElementType type = typeRevLblName;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
const std::wstring toString() const;
private:
std::wstring st;
};
......
......@@ -17,12 +17,11 @@ public:
RevNamePly(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeRevNamePly;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
RevSheetName sheet;
RevLblName name;
};
......
......@@ -14,7 +14,7 @@ class RgbExtra : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeRgbExtra;
void load(CFRecord& record, const PtgVector& records_from_rgce, bool is_part_of_a_revision);
void load(CFRecord& record, unsigned short rgce_record_type, bool is_part_of_a_revision);
......@@ -24,7 +24,6 @@ public:
const bool isEmpty() const;
void addPtg(const PtgPtr ptg);
private:
// Shall not be used. This is just a stub for the virtual 'load' realization
virtual void load(CFRecord& record);
......
......@@ -15,8 +15,7 @@ public:
Rgce(const CellRef& cell_base_ref_init);
BiffStructurePtr clone();
// The following non-standard overriding is intended not to let empty <Rgce/> to be generated
//virtual void toXML(BiffStructurePtr & parent);
static const ElementType type = typeRgce;
void load(CFRecord& record, const size_t cce_val);
......
......@@ -17,6 +17,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeRkRec;
const unsigned short get_ixfe() const;
unsigned short ixfe;
......
......@@ -16,12 +16,11 @@ public:
Run();
~Run();
static const ElementType type = typeRun;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
FormatRun formatRun;
};
......
......@@ -16,12 +16,11 @@ public:
SDContainer(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeSDContainer;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
SecurityDescriptor sd;
};
......
......@@ -15,12 +15,11 @@ public:
SecurityDescriptor(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeSecurityDescriptor;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
SECURITY_DESCRIPTOR sd;
};
......
......@@ -11,12 +11,12 @@ typedef boost::shared_ptr<SerAr> SerArPtr;
class SerAr : public BiffStructure
{
public:
//void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
static SerArPtr createSerAr(const unsigned char type);
virtual const std::wstring toString() const = 0;
static const ElementType type = typeSerAr;
};
typedef boost::shared_ptr<SerAr> SerArPtr;
......
......@@ -17,12 +17,11 @@ public:
SheetExtOptional(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeSheetExtOptional;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned char icvPlain12;
bool fCondFmtCalc;
bool fNotPublished;
......
......@@ -13,12 +13,11 @@ class SheetId : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeSheetId;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short id;
};
......
......@@ -16,12 +16,11 @@ class SortCond12 : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeSortCond12;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
bool fSortDes;
unsigned short sortOn;
RFX rfx;
......
......@@ -14,12 +14,11 @@ class SqRef : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeSqRef;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
std::vector<Ref8U> rgrefs;
};
......
......@@ -14,14 +14,13 @@ class SqRefU : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeSqRefU;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
const CellRef getLocationFirstCell() const;
private:
std::wstring sqref;
};
......
......@@ -14,12 +14,11 @@ class Stxp : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeStxp;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
long twpHeight;
Ts ts;
short bls;
......
......@@ -22,6 +22,8 @@ public:
GlobalWorkbookInfoPtr m_GlobalWorkbookInfo;
static const ElementType type = typeStyleXF;
int serialize(std::wostream & stream);
void RegisterFillBorder();
......
......@@ -17,12 +17,11 @@ public:
TableFeatureType();
~TableFeatureType();
static const ElementType type = typeTableFeatureType;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
BIFF_DWORD lt; // SourceType
BIFF_DWORD idList;
BIFF_DWORD crwHeader;
......
......@@ -15,7 +15,7 @@ public:
TxOLastRun();
~TxOLastRun();
static const ElementType type = typeTxOLastRun;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -17,12 +17,11 @@ public:
TxORuns();
~TxORuns();
static const ElementType type = typeTxORuns;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
public:
int m_runCount;
std::vector<RunPtr> rgTxoRuns;
TxOLastRun lastRun;
......
......@@ -17,12 +17,11 @@ public:
URICreateFlags(XLS::CFRecord& record);
XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const XLS::ElementType type = XLS::typeURICreateFlags;
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
private:
bool createAllowRelative;
bool createAllowImplicitWildcardScheme;
bool createAllowImplicitFileScheme;
......
......@@ -19,6 +19,8 @@ public:
virtual void load(XLS::CFRecord& record);
virtual void store(XLS::CFRecord& record);
static const XLS::ElementType type = XLS::typeURLMoniker;
std::wstring url;
std::wstring serialGUID;
......
......@@ -14,12 +14,11 @@ class VertBrk : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeVertBrk;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
ColU col;
RwU rowStart;
RwU rowEnd;
......
......@@ -18,6 +18,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeXFExtGradient;
XFPropGradient gradient;
unsigned int cGradStops;
std::vector<GradStop> rgGradStops;
......
......@@ -16,8 +16,8 @@ public:
XFExtNoFRT(CFRecord& record);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeXFExtNoFRT;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -15,12 +15,11 @@ class XFProp : public BiffStructure
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeXFProp;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short xfPropType;
unsigned short cb;
BiffStructurePtr xfPropDataBlob;
......
......@@ -8,15 +8,14 @@ namespace XLS
class CFRecord;
//#pragma pack(1)
class XFPropBorder : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(XFPropBorder)
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
static const ElementType type = typeXFPropBorder;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -8,7 +8,6 @@ namespace XLS
class CFRecord;
//#pragma pack(1)
class XFPropColor : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(XFPropColor)
......@@ -18,12 +17,13 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeXFPropColor;
bool fValidRGBA;
unsigned char xclrType;
unsigned char icv;
short nTintShade;
LongRGBA dwRgba;
};
//#pragma pack() // restore
} // namespace XLS
......@@ -21,7 +21,7 @@ void XFPropGradient::store(CFRecord& record)
void XFPropGradient::load(CFRecord& record)
{
record >> type >> numDegree >> numFillToLeft >> numFillToRight >>
record >> type1 >> numDegree >> numFillToLeft >> numFillToRight >>
numFillToTop >> numFillToBottom;
}
......
......@@ -16,7 +16,9 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
Boolean<unsigned int> type;
static const ElementType type = typeXFPropGradient;
Boolean<unsigned int> type1;
double numDegree;
double numFillToLeft;
double numFillToRight;
......
......@@ -14,6 +14,8 @@ class XFPropGradientStop : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeXFPropGradientStop;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
......
......@@ -17,6 +17,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeXFProps;
unsigned short cprops;
std::vector<XFProp> xfPropArray;
};
......
......@@ -16,6 +16,7 @@ public:
~XLUnicodeRichExtendedString();
XLUnicodeRichExtendedString operator=(const XLUnicodeRichExtendedString& other);
static const ElementType type = typeXLUnicodeRichExtendedString;
BiffStructurePtr clone();
......
......@@ -18,6 +18,8 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
static const ElementType type = typeXORObfuscation;
unsigned short key;
unsigned short verificationBytes;
};
......
......@@ -13,12 +13,11 @@ class XTI : public BiffStructure
public:
BiffStructurePtr clone();
static const ElementType type = typeXTI;
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
private:
unsigned short iSupBook;
short itabFirst;
short itabLast;
......
......@@ -463,8 +463,163 @@ enum ElementType
typeWorksheetSubstream,
typeBiffStructure = 2000,
typeBopPopCustomPiesIndices,
typeIXFCellMulBlankSpecial,
typeAddinUdf,
typeAF12Criteria,
typeAFDOper,
typeAFDOperRk,
typeAFDOperStr,
typeBes,
typeBiffAttribute,
typeBookExt_Conditional11,
typeBookExt_Conditional12,
typeBuiltInStyle,
typeCell,
typeCellOffsetResender,
typeCellRangeRef,
typeCellRef,
typeCellXF,
typeCFColor,
typeCFExNonCF12,
typeCFExTemplateParams,
typeCFMStateItem,
typeCFMultistate,
typeCFVO,
typeCondFmtStructure,
typeControlInfo,
typeDropDownObjId,
typeDXFALC,
typeDXFBdr,
typeDXFFntD,
typeDXFId,
typeDXFN,
typeDXFN12,
typeDXFN12List,
typeDXFNum,
typeDXFNumUsr,
typeDXFPat,
typeDXFProt,
typeEnhancedProtection,
typeExternDdeLinkNoOper,
typeExternDocName,
typeExternOleDdeLink,
typeExtProp,
typeExtRst,
typeFactoidData,
typeFeat11FdaAutoFilter,
typeFeat11FieldDataItem,
typeFeatFormulaErr2,
typeFeatProtection,
typeFeatSmartTag,
typeFileOffset,
typeFilePointer,
typeFormatRun,
typeFrtHeader,
typeFrtHeaderOld,
typeFrtRefHeader,
typeFrtRefHeaderNoGrbit,
typeFrtRefHeaderU,
typeFtCblsData,
typeFtCf,
typeFtCmo,
typeFtEdoData,
typeFtGboData,
typeFtLbsData,
typeFtMacro,
typeFtNts,
typeFtPictFmla,
typeFtPioGrbit,
typeFtRboData,
typeFtSbs,
typeFullColorExt,
typeGradStop,
typeHorzBrk,
typeISSTInf,
typeLbsDropData,
typeList12BlockLevel,
typeList12DisplayName,
typeList12TableStyleClientInfo,
typeLongRGBA,
typeMDir,
typeMDXStrIndex,
typeMOper,
typeNoteRR,
typeNoteSh,
typeObjFmla,
typeObjLinkFmla,
typeParsedFormula,
typePhRuns,
typePhs,
typePictFmlaEmbedInfo,
typePictFmlaKey,
typePtg,
typeRevItab,
typeRevLblName,
typeRevNamePly,
typeRgbExtra,
typeRgce,
typeRkRec,
typeRPHSSub,
typeRRD,
typeRun,
typeSDContainer,
typeSecurityDescriptor,
typeSerAr,
typeSheetExtOptional,
typeSheetId,
typeSortCond12,
typeSqRef,
typeSqRefU,
typeStxp,
typeStyleXF,
typeTableFeatureType,
typeTxOLastRun,
typeTxORuns,
typeVertBrk,
typeXFExtGradient,
typeXFExtNoFRT,
typeXFProp,
typeXFPropBorder,
typeXFPropColor,
typeXFPropGradient,
typeXFPropGradientStop,
typeXFProps,
typeXLUnicodeRichExtendedString,
typeXORObfuscation,
typeXTI,
typeIMsoArray,
typeMSOCR,
typeMSOSHADECOLOR,
typeAntiMoniker,
typeVersion,
typeCompositeMoniker,
typeEncryptionHeader,
typeEncryptionHeaderFlags,
typeEncryptionVerifier,
typeFactoidType,
typeFileMoniker,
typeHyperlinkMoniker,
typeHyperlinkObject,
typeItemMoniker,
typeProperty,
typePropertyBag,
typePropertyBagStore,
typeRC4CryptoAPIEncryptionHeader,
typeRC4EncryptionHeader,
typeURICreateFlags,
typeURLMoniker,
typeOfficeArtRecord = 3000,
typeOfficeArtBStoreContainerFileBlock,
typeOfficeArtCOLORREF,
typeOfficeArtFOPTE,
typeOfficeArtFRIT,
typeOfficeArtIDCL,
typeOfficeArtMetafileHeader,
typeOfficeArtRecordHeader,
typeOfficeArtRGFOPTE,
typeOfficeArtBlip,
typeOfficeArtBStoreContainer,
typeOfficeArtClientAnchorChart,
......
......@@ -32,6 +32,7 @@
#include <Logic/Biff_structures/ODRAW/OfficeArtBStoreContainer.h>
#include <Logic/Biff_structures/ODRAW/SimpleOfficeArtContainers.h>
#include <Logic/Biff_structures/ODRAW/OfficeArtFOPT.h>
#include <Logic/Biff_structures/ODRAW/OfficeArtFSP.h>
#include <Logic/Biff_structures/ODRAW/OfficeArtBlip.h>
#include "xlsx_conversion_context.h"
......@@ -379,18 +380,22 @@ void XlsConverter::convert(XLS::MSODRAWINGGROUP * mso_drawing)
void XlsConverter::convert(ODRAW::OfficeArtBStoreContainer* art_bstore)
{
if (art_bstore == NULL) return;
if (art_bstore->rgfb.size() < 1) return;
std::wstring xl_path = xlsx_path + FILE_SEPARATOR_STR + L"xl";
FileSystem::Directory::CreateDirectory(xl_path.c_str());
FileSystem::Directory::CreateDirectory((xl_path + FILE_SEPARATOR_STR + L"media").c_str());
for (long i =0 ; i < art_bstore->rgfb.size(); i++)
{
int bin_id = i + 1;
if (art_bstore->rgfb[i]->data_size > 0)
{
FileSystem::Directory::CreateDirectory((xlsx_path + FILE_SEPARATOR_STR + L"media").c_str());
std::wstring file_name = L"image" + boost::lexical_cast<std::wstring>(bin_id) + art_bstore->rgfb[i]->pict_type;
NSFile::CFileBinary file;
if (file.CreateFileW(xlsx_path + FILE_SEPARATOR_STR + L"media" + FILE_SEPARATOR_STR + file_name))
if (file.CreateFileW(xl_path + FILE_SEPARATOR_STR + L"media" + FILE_SEPARATOR_STR + file_name))
{
file.WriteFile((BYTE*)art_bstore->rgfb[i]->pict_data, art_bstore->rgfb[i]->data_size);
file.CloseFile();
......@@ -492,8 +497,7 @@ void XlsConverter::convert(ODRAW::OfficeArtRecord * art)
}break;
case XLS::typeOfficeArtFSP:
{
art->serialize(strm);
xlsx_context->get_drawing_context().set_properties(strm.str());
convert(dynamic_cast<ODRAW::OfficeArtFSP *>(art));
}break;
case XLS::typeOfficeArtClientAnchorSheet:
{
......@@ -503,7 +507,16 @@ void XlsConverter::convert(ODRAW::OfficeArtRecord * art)
}
}
void XlsConverter::convert(ODRAW::OfficeArtFSP * fsp)
{
if (fsp == NULL) return;
if (fsp->fFlipH) xlsx_context->get_drawing_context().set_FlipH();
if (fsp->fFlipV) xlsx_context->get_drawing_context().set_FlipV();
xlsx_context->get_drawing_context().set_id(fsp->spid);
xlsx_context->get_drawing_context().set_shape_id(fsp->shape_id);
}
void XlsConverter::convert(ODRAW::OfficeArtFOPT * fort)
{
if (fort == NULL) return;
......@@ -514,10 +527,10 @@ void XlsConverter::convert(ODRAW::OfficeArtFOPT * fort)
{
case 0x104:
{
ODRAW::pib * pib = dynamic_cast<ODRAW::pib*>(fort->fopt.rgfopte[i].get());
if (pib)
{
}
bool isIternal = false;
std::wstring target;
std::wstring rId = xlsx_context->get_mediaitems().find_image(fort->fopt.rgfopte[i]->op , target, isIternal);
xlsx_context->get_drawing_context().set_image(target);
}break;
}
......
......@@ -43,6 +43,7 @@ namespace ODRAW
class OfficeArtBStoreContainer;
class OfficeArtSpContainer;
class OfficeArtFOPT;
class OfficeArtFSP;
}
class XlsConverter
......@@ -83,6 +84,7 @@ private:
void convert(ODRAW::OfficeArtBStoreContainer* art_bstore);
void convert(ODRAW::OfficeArtSpContainer * sp);
void convert(ODRAW::OfficeArtFOPT * fort);
void convert(ODRAW::OfficeArtFSP * fsp);
std::wstring GetTargetMoniker(XLS::BiffStructure *moniker);
......
......@@ -86,7 +86,18 @@ std::wstring external_items::find_image(int _id, std::wstring & target, bool & i
}
return L"";
}
std::wstring external_items::find_image(const std::wstring & target, bool & isInternal)
{
for (long i=0 ; i <items_.size(); i ++)
{
if (items_[i].type == typeImage && items_[i].uri == target)
{
isInternal = items_[i].mediaInternal;
return items_[i].rId;
}
}
return L"";
}
void external_items::dump_rels(rels & Rels)
{
size_t i = 0;
......
......@@ -49,6 +49,7 @@ public:
//std::wstring add_or_find(const std::wstring & href, Type type, bool & isInternal);//
std::wstring add_image(const std::wstring & file_name, int bin_id);
std::wstring find_image(int id, std::wstring & target, bool & isExternal);
std::wstring find_image(const std::wstring & target, bool & isExternal);
void dump_rels(rels & Rels);
items_array & items() { return items_; }
......
......@@ -2,13 +2,9 @@
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
//#include <cpdoccore/xml/utils.h>
//
//#include "mediaitems_utils.h"
//
//#include "xlsx_utils.h"
#include "xlsx_drawing_context.h"
#include <simple_xml_writer.h>
namespace oox {
......@@ -111,17 +107,7 @@ bool xlsx_drawing_context::start_drawing(int type)
break;
}
return false;
//count_object++;
//bool isIternal = false;
//std::wstring target;
//std::wstring rId = handle_.impl_->get_mediaitems().find_image(type, target, isIternal);
//if (!rId.empty())
//{
// xlsx_drawings_->add(stream_.str(), isIternal, rId , target, external_items::typeImage);
//}
}
void xlsx_drawing_context::start_image()
......@@ -130,6 +116,8 @@ void xlsx_drawing_context::start_image()
drawing_state.push_back(st);
drawing_state.back().type = external_items::typeImage;
count_object++;
}
void xlsx_drawing_context::start_shape(int type)
......@@ -138,6 +126,29 @@ void xlsx_drawing_context::start_shape(int type)
drawing_state.push_back(st);
drawing_state.back().type = external_items::typeShape;
count_object++;
}
void xlsx_drawing_context::set_id(int id)
{
if (drawing_state.size() < 1 )return;
drawing_state.back().id = id;
}
void xlsx_drawing_context::set_FlipH()
{
if (drawing_state.size() < 1 )return;
drawing_state.back().flipH = true;
}
void xlsx_drawing_context::set_FlipV()
{
if (drawing_state.size() < 1 )return;
drawing_state.back().flipV = true;
}
void xlsx_drawing_context::set_shape_id(int id)
{
if (drawing_state.size() < 1 )return;
drawing_state.back().shape_id = id;
}
void xlsx_drawing_context::end_drawing()
{
......@@ -145,11 +156,104 @@ void xlsx_drawing_context::end_drawing()
std::wstringstream strm;
//serialize
switch(drawing_state.back().type)
{
case external_items::typeImage:
if (!drawing_state.back().image_target.empty())
{
bool isIternal = false;
std::wstring rId = handle_.impl_->get_mediaitems().find_image( drawing_state.back().image_target, isIternal);
serialize_pic(rId);
serialize(strm);
xlsx_drawings_->add(strm.str(), isIternal, rId , drawing_state.back().image_target, drawing_state.back().type);
}
break;
}
drawing_state.pop_back();
}
void xlsx_drawing_context::serialize_pic(std::wstring rId)
{
std::wstringstream strm;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"xdr:pic")
{
CP_XML_NODE(L"xdr:nvPicPr")
{
CP_XML_NODE(L"xdr:cNvPr")
{
if (drawing_state.back().id >= 0) CP_XML_ATTR(L"id", drawing_state.back().id);
CP_XML_ATTR(L"name", L"Picture_" + rId.substr(5));
}
CP_XML_NODE(L"xdr:cNvPicPr")
{
CP_XML_NODE(L"a:picLocks")
{
CP_XML_ATTR(L"noChangeArrowheads", 1);
CP_XML_ATTR(L"noChangeAspect", 1);
}
}
}
CP_XML_NODE(L"xdr:blipFill")
{
CP_XML_NODE(L"a:blip")
{
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:embed", rId);
}
CP_XML_NODE(L"a:srcRect");
CP_XML_NODE(L"a:stretch")
{
CP_XML_NODE(L"a:fillRect");
}
}
CP_XML_NODE(L"xdr:spPr")
{
CP_XML_NODE(L"a:xfrm")
{
CP_XML_NODE(L"a:off")
{
CP_XML_ATTR(L"y", 0);
CP_XML_ATTR(L"x", 0);
}
CP_XML_NODE(L"a:ext")
{
CP_XML_ATTR(L"cy", 0);
CP_XML_ATTR(L"cx", 0);
}
}
CP_XML_NODE(L"a:prstGeom")
{
CP_XML_ATTR(L"prst", "rect");
CP_XML_NODE(L"a:avLst");
}
xlsx_drawings_->add(strm.str(), drawing_state.back().isMediaInternal,
drawing_state.back().rId , drawing_state.back().target, drawing_state.back().type);
CP_XML_NODE(L"a:noFill");
}
}
}
drawing_state.back().shape = strm.str();
}
void xlsx_drawing_context::serialize(std::wostream & stream)
{
CP_XML_WRITER(stream)
{
CP_XML_NODE(L"xdr:twoCellAnchor")
{
CP_XML_ATTR(L"editAs", L"oneCell");
CP_XML_STREAM() << drawing_state.back().anchor;
CP_XML_STREAM() << drawing_state.back().shape;
CP_XML_NODE(L"xdr:clientData");
}
}
}
void xlsx_drawing_context::set_anchor(std::wstring & str)
......@@ -157,7 +261,11 @@ void xlsx_drawing_context::set_anchor(std::wstring & str)
if (drawing_state.size() < 1 )return;
drawing_state.back().anchor = str;
}
void xlsx_drawing_context::set_image(std::wstring & str)
{
if (drawing_state.size() < 1 )return;
drawing_state.back().image_target = str;
}
void xlsx_drawing_context::set_properties(std::wstring & str)
{
if (drawing_state.size() < 1 )return;
......
......@@ -27,15 +27,20 @@ private:
class _drawing_state
{
public:
_drawing_state() {isMediaInternal = false;}
_drawing_state() {isInternal = false; id = shape_id = -1; flipV = flipH = false;}
external_items::Type type;
std::wstring rId;
std::wstring target;
std::wstring anchor;
std::wstring shape;
bool isMediaInternal;
std::wstring image_target;
int id;
int shape_id;
bool flipV;
bool flipH;
bool isInternal;
};
class xlsx_drawing_context
......@@ -46,20 +51,27 @@ public:
xlsx_drawing_context(xlsx_drawing_context_handle & h);
~xlsx_drawing_context(){}
bool start_drawing(int type);
void end_drawing();
xlsx_drawings_ptr get_drawings();
bool empty();
bool start_drawing(int type);
void start_image();
void start_shape(int type);
void set_id ( int id);
void set_FlipH();
void set_FlipV();
void set_shape_id(int id);
void set_image(std::wstring & str);
void set_anchor(std::wstring & str);
void set_properties(std::wstring & str);
void serialize(std::wostream & stream);
void serialize_pic(std::wstring rId);
void end_drawing();
private:
std::vector<_drawing_state> drawing_state;
......
......@@ -130,6 +130,8 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_STREAM() << impl_->mergeCells_.str();
CP_XML_STREAM() << impl_->hyperlinks_.str();
CP_XML_STREAM() << impl_->pageProperties_.str();
CP_XML_STREAM() << impl_->drawing_.str();
if (impl_->commentsId_.length()>0)
......@@ -140,8 +142,6 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
}
}
CP_XML_STREAM() << impl_->pageProperties_.str();
//CP_XML_NODE(L"rowBreaks){}
//CP_XML_NODE(L"colBreaks){}
......
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