Files
core/ASCOfficeDocFile/DocDocxConverter/ListData.cpp
Alexey.Musinov 9ea51f5678 выпиливание boost'a
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52920 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-20 22:33:45 +03:00

51 lines
1.2 KiB
C++

#include "stdafx.h"
#include "ListData.h"
namespace DocFileFormat
{
ListData::~ListData()
{
for_each(rglvl->begin(), rglvl->end(), DeleteDynamicObject());
RELEASEOBJECT(rglvl);
RELEASEARRAYOBJECTS(_rawBytes);
}
// Parses the StreamReader to retrieve a ListData
ListData::ListData(VirtualStreamReader* reader, int length) : rglvl(NULL), _rawBytes(NULL)
{
long startPos = reader->GetPosition();
this->lsid = reader->ReadInt32();
this->tplc = reader->ReadInt32();
for ( int i = 0; i < 9; i++ )
{
this->rgistd.push_back( reader->ReadInt16() );
}
//parse flagbyte
int flag = (int)reader->ReadByte();
this->fSimpleList = FormatUtils::BitmaskToBool( flag, 0x01 );
if ( this->fSimpleList )
{
this->rglvl = new vector<ListLevel*>( 1 );
}
else
{
this->rglvl = new vector<ListLevel*>( 9 );
}
this->fRestartHdn = FormatUtils::BitmaskToBool( flag, 0x02 );
this->fAutoNum = FormatUtils::BitmaskToBool( flag, 0x04 );
this->fPreRTF = FormatUtils::BitmaskToBool( flag, 0x08 );
this->fHybrid = FormatUtils::BitmaskToBool( flag, 0x10 );
this->grfhic = reader->ReadByte();
reader->Seek( startPos, STREAM_SEEK_SET );
_rawBytes = reader->ReadBytes( LSTF_LENGTH, true );
}
}