mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 09:24:40 +08:00
add OfficeArtFOPT writing
This commit is contained in:
@ -36,6 +36,7 @@
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFSP.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFSPGR.h"
|
||||
#include "../Biff_structures/ODRAW/SimpleOfficeArtContainers.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFOPT.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -170,6 +171,12 @@ void MsoDrawing::prepareComment(const unsigned int CommentId)
|
||||
fsprPtr->spid = CommentId+1;
|
||||
fsprPtr->fHaveAnchor = true;
|
||||
fsprPtr->fHaveSpt = true;
|
||||
|
||||
|
||||
{
|
||||
//todo add mandatory optrions writing
|
||||
//auto textboxOpt = new ODRAW::OfficeArtFOPT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -53,6 +53,24 @@ void OfficeArtFOPT::loadFields(XLS::CFRecord& record)
|
||||
record >> fopt;
|
||||
}
|
||||
|
||||
void OfficeArtFOPT::save(XLS::CFRecord& record)
|
||||
{
|
||||
rh_own.recVer = 3;
|
||||
rh_own.recType = 0xF00B;
|
||||
rh_own.recInstance = fopt.options_count;
|
||||
record << rh_own;
|
||||
|
||||
auto sizePos = record.getRdPtr();
|
||||
|
||||
record << fopt;
|
||||
//calculating size
|
||||
rh_own.recLen = record.getRdPtr() - sizePos;
|
||||
record.RollRdPtrBack(rh_own.recLen + 4);
|
||||
auto recLen = rh_own.recLen;
|
||||
record << recLen;
|
||||
record.skipNunBytes(rh_own.recLen);
|
||||
}
|
||||
|
||||
|
||||
const unsigned short OfficeArtFOPT::GetInstanceToStore()
|
||||
{
|
||||
|
||||
@ -53,6 +53,7 @@ public:
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtFOPT;
|
||||
|
||||
virtual void loadFields(XLS::CFRecord& record);
|
||||
virtual void save(XLS::CFRecord& record);
|
||||
|
||||
const unsigned short GetInstanceToStore();
|
||||
|
||||
|
||||
@ -124,6 +124,14 @@ void OfficeArtFOPTE::load(IBinaryReader* _reader)
|
||||
fBid = GETBIT(flags, 14);
|
||||
fComplex = GETBIT(flags, 15);
|
||||
}
|
||||
void OfficeArtFOPTE::save(XLS::CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBITS(flags, 0, 13, opid)
|
||||
SETBIT(flags, 14, fBid)
|
||||
SETBIT(flags, 15, fComplex)
|
||||
record << flags << op;
|
||||
}
|
||||
void OfficeArtFOPTE::load(XLS::CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
@ -63,6 +63,7 @@ protected:
|
||||
virtual void load(XLS::CFRecord& record);
|
||||
void load(IBinaryReader* reader);
|
||||
public:
|
||||
void save(XLS::CFRecord& record);
|
||||
XLS::BiffStructurePtr clone();
|
||||
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtFOPTE;
|
||||
|
||||
@ -141,6 +141,44 @@ void OfficeArtRGFOPTE::load(XLS::CFRecord& record)
|
||||
rgfopte.clear();
|
||||
}
|
||||
|
||||
|
||||
void OfficeArtRGFOPTE::save(XLS::CFRecord& record)
|
||||
{
|
||||
for(auto i : GroupShape_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Shape_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Blip_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Text_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Geometry_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : GeometryText_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : FillStyle_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : LineStyle_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Shadow_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Transform_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
for(auto i : Other_props)
|
||||
if(i != nullptr)
|
||||
i->save(record);
|
||||
}
|
||||
|
||||
void OfficeArtRGFOPTE::SetOptionsCount(const unsigned short count)
|
||||
{
|
||||
options_count = count;
|
||||
|
||||
@ -49,6 +49,7 @@ public:
|
||||
XLS::BiffStructurePtr clone();
|
||||
|
||||
virtual void load(XLS::CFRecord& record);
|
||||
virtual void save(XLS::CFRecord& record);
|
||||
|
||||
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtRGFOPTE;
|
||||
|
||||
@ -188,9 +188,12 @@ void OfficeArtSpContainer::save(XLS::CFRecord& record)
|
||||
m_OfficeArtFSPGR->save(record);
|
||||
if(m_OfficeArtFSP != nullptr)
|
||||
m_OfficeArtFSP->save(record);
|
||||
if(m_oOfficeArtFOPT != nullptr)
|
||||
m_oOfficeArtFOPT->save(record);
|
||||
if(m_OfficeArtAnchor != nullptr)
|
||||
m_OfficeArtAnchor->save(record);
|
||||
|
||||
|
||||
//calculating size
|
||||
rh_own.recLen = record.getRdPtr() - sizePos;
|
||||
record.RollRdPtrBack(rh_own.recLen + 4);
|
||||
|
||||
@ -96,6 +96,7 @@ public:
|
||||
OfficeArtRecordPtr m_OfficeArtFSPGR;
|
||||
OfficeArtRecordPtr m_OfficeArtFSP;
|
||||
OfficeArtRecordPtr m_OfficeArtAnchor;
|
||||
OfficeArtRecordPtr m_oOfficeArtFOPT;
|
||||
};
|
||||
|
||||
class OfficeArtClientData : public OfficeArtRecord
|
||||
|
||||
Reference in New Issue
Block a user