Files
core/ASCOfficeRtfFile/RtfFormatLib/source/RtfDocument.h
Elen.Subbotina 5d14eb881e RtfFormatWriter - fix конвертации с секциями(колонками) и разрывами.
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67800 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-21 00:53:53 +03:00

78 lines
1.8 KiB
C++

#pragma once
#include "Basic.h"
#include "RtfGlobalTables.h"
#include "RtfSection.h"
class RtfDocument :public ItemContainer<RtfSectionPtr>
{
public:
RtfDocumentProperty m_oProperty;
RtfFontTable m_oFontTable;
RtfColorTable m_oColorTable;
RtfStyleTable m_oStyleTable;
RtfInformation m_oInformation;
RtfListTable m_oListTabel;
RtfListOverrideTable m_oListOverrideTabel;
RtfParagraphProperty m_oDefaultParagraphProp;
RtfCharProperty m_oDefaultCharProp;
RtfMathProperty m_oMathProp;
TextItemContainerPtr m_oFootnoteSep;
TextItemContainerPtr m_oFootnoteCon;
TextItemContainerPtr m_oEndnoteSep;
TextItemContainerPtr m_oEndnoteCon;
//для того чтобы конвертировать старый формат List в Numbering
std::vector<RtfOldListPtr> m_aOldLists;
struct _status_section
{
bool start_new;
int number;
}m_oStatusSection;
private:
std::vector<int> m_aShapeId;
public:
IdGenerator m_oIdGenerator;
void SetShapeId( int nShapeId )
{
for( int i = 0; i < (int)m_aShapeId.size(); i++ )
if( nShapeId == m_aShapeId[i] )
return;
m_aShapeId.push_back( nShapeId );
}
int GetShapeId( int& nShapeId )
{
if( PROP_DEF != nShapeId )
return nShapeId;
int nNewShapeId;
while( true )
{
bool bUnique = true;
nNewShapeId = m_oIdGenerator.Generate_ShapeId();
for( int i = 0; i < (int)m_aShapeId.size(); i++ )
if( nNewShapeId == m_aShapeId[i] )
{
bUnique = false;
break;
}
if( true == bUnique )
{
nShapeId = nNewShapeId;
m_aShapeId.push_back( nNewShapeId );
break;
}
}
return nShapeId;
}
RtfDocument();
int GetType();
CString RenderToRtf(RenderParameter oRenderParameter);
CString RenderToOOX(RenderParameter oRenderParameter);
};
typedef boost::shared_ptr<RtfDocument> RtfDocumentPtr;