Commit 8f45da5a authored by ElenaSubbotina's avatar ElenaSubbotina

RtfWriter - fix read section with fields

parent 84fb75ab
......@@ -246,7 +246,7 @@ public:
CString RenderToRtf(RenderParameter oRenderParameter)
{
CString sResult;
for( int i = 0; i < (int)m_aArray.size(); i++ )
for( int i = 0; i < (int)m_aArray.size(); i++ )//идем с конца - из за св-в секций
{
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
......@@ -260,8 +260,10 @@ public:
CString RenderToOOX(RenderParameter oRenderParameter)
{
CString sResult;
for( int i = 0; i < (int)m_aArray.size(); i++ )
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
for( int i = (int)m_aArray.size() - 1; i >= 0; i-- )
{
sResult = m_aArray[i]->RenderToOOX(oRenderParameter) + sResult;
}
return sResult;
}
bool IsValid()
......
......@@ -67,31 +67,31 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
{
oDocument.m_oProperty.m_eCodePage = RtfDocumentProperty::cp_ansi;
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nAnsiCodePage = parameter;
}
}
else if( _T("deff") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nDeffFont = parameter;
oReader.m_nDefFont = parameter;
}
}
COMMAND_RTF_INT( _T("themelang"), oDocument.m_oProperty.m_nThemelang, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("themelangfe"), oDocument.m_oProperty.m_nThemelangfe, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("themelangcs"), oDocument.m_oProperty.m_nThemelangcs, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("themelang"), oDocument.m_oProperty.m_nThemelang, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("themelangfe"), oDocument.m_oProperty.m_nThemelangfe, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("themelangcs"), oDocument.m_oProperty.m_nThemelangcs, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("rtlgutter"), oDocument.m_oProperty.m_bRtlGutter, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("rtldoc"), oDocument.m_oProperty.m_bRtl, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("rtlgutter"), oDocument.m_oProperty.m_bRtlGutter, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("rtldoc"), oDocument.m_oProperty.m_bRtl, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("hyphcaps"), oDocument.m_oProperty.m_bHypCaps, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("hyphauto"), oDocument.m_oProperty.m_bAutoHyp, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("hyphconsec"), oDocument.m_oProperty.m_nMaxHypen, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("hyphhotz"), oDocument.m_oProperty.m_nHyphenationRight, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("deftab"), oDocument.m_oProperty.m_nTabWidth, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("hyphcaps"), oDocument.m_oProperty.m_bHypCaps, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("hyphauto"), oDocument.m_oProperty.m_bAutoHyp, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("hyphconsec"), oDocument.m_oProperty.m_nMaxHypen, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("hyphhotz"), oDocument.m_oProperty.m_nHyphenationRight, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( _T("deftab"), oDocument.m_oProperty.m_nTabWidth, sCommand, hasParameter, parameter )
//Page Borders
COMMAND_RTF_BOOL( _T("pgbrdrhead"), oDocument.m_oProperty.m_bDorderSurroundHeader, sCommand, hasParameter, parameter )
......@@ -101,68 +101,68 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
//Page Information
else if( _T("paperw") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nPaperWidth = parameter;
oReader.m_oCurSectionProp.m_nPageWidth = parameter;
oDocument.m_oProperty.m_nPaperWidth = parameter;
oReader.m_oCurSectionProp.m_nPageWidth = parameter;
}
}
else if( _T("paperh") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nPaperHeight = parameter;
oDocument.m_oProperty.m_nPaperHeight = parameter;
oReader.m_oCurSectionProp.m_nPageHeight = parameter;
}
}
else if( _T("margl") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nMarginLeft = parameter;
oDocument.m_oProperty.m_nMarginLeft = parameter;
oReader.m_oCurSectionProp.m_nMarginLeft = parameter;
}
}
else if( _T("margr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nMarginRight = parameter;
oReader.m_oCurSectionProp.m_nMarginRight = parameter;
oDocument.m_oProperty.m_nMarginRight = parameter;
oReader.m_oCurSectionProp.m_nMarginRight = parameter;
}
}
else if( _T("margt") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nMarginTop = parameter;
oReader.m_oCurSectionProp.m_nMarginTop = parameter;
oDocument.m_oProperty.m_nMarginTop = parameter;
oReader.m_oCurSectionProp.m_nMarginTop = parameter;
}
}
else if( _T("margb") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nMarginBottom = parameter;
oReader.m_oCurSectionProp.m_nMarginBottom = parameter;
oDocument.m_oProperty.m_nMarginBottom = parameter;
oReader.m_oCurSectionProp.m_nMarginBottom = parameter;
}
}
else if( _T("facingp") == sCommand )
{
if( true == hasParameter && 0 == parameter )
if( hasParameter && 0 == parameter )
{
oDocument.m_oProperty.m_bFacingPage = 0;
oReader.m_oCurSectionProp.m_bSwitchMargin = 0;
oDocument.m_oProperty.m_bFacingPage = 0;
oReader.m_oCurSectionProp.m_bSwitchMargin = 0;
}
else
{
oDocument.m_oProperty.m_bFacingPage = 1;
oReader.m_oCurSectionProp.m_bSwitchMargin = 1;
oDocument.m_oProperty.m_bFacingPage = 1;
oReader.m_oCurSectionProp.m_bSwitchMargin = 1;
}
}
else if( _T("gutter") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oDocument.m_oProperty.m_nGutterWidth = parameter;
oReader.m_oCurSectionProp.m_nGutterMarginWidth = parameter;
......@@ -170,90 +170,90 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
}
else if( _T("ogutter") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oDocument.m_oProperty.m_nGutterWidthOutside = parameter;
}
else if( _T("margmirror") == sCommand )
{
if( true == hasParameter && 0 == parameter )
if( hasParameter && 0 == parameter )
{
oDocument.m_oProperty.m_bSwitchMargins = 0;
oReader.m_oCurSectionProp.m_bLandscapeFormat = 0;
oDocument.m_oProperty.m_bSwitchMargins = 0;
oReader.m_oCurSectionProp.m_bLandscapeFormat = 0;
}
else
{
oDocument.m_oProperty.m_bSwitchMargins = 1;
oReader.m_oCurSectionProp.m_bLandscapeFormat = 1;
oDocument.m_oProperty.m_bSwitchMargins = 1;
oReader.m_oCurSectionProp.m_bLandscapeFormat = 1;
}
}
else if( _T("landscape") == sCommand )
{
if( true == hasParameter && 0 == parameter )
if( hasParameter && 0 == parameter )
oDocument.m_oProperty.m_bLandScape = 0;
else
oDocument.m_oProperty.m_bLandScape = 1;
}
COMMAND_RTF_BOOL( _T("gutterprl"), oDocument.m_oProperty.m_bGutterAtTop, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("viewbksp"), oDocument.m_oProperty.m_nDisplayBackground, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("htmautsp"), oDocument.m_oProperty.m_bHtmlAutoSpace, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("useltbaln"), oDocument.m_oProperty.m_bUseTabAlignment, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("gutterprl"), oDocument.m_oProperty.m_bGutterAtTop, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("viewbksp"), oDocument.m_oProperty.m_nDisplayBackground, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("htmautsp"), oDocument.m_oProperty.m_bHtmlAutoSpace, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( _T("useltbaln"), oDocument.m_oProperty.m_bUseTabAlignment, sCommand, hasParameter, parameter )
//Footnotes and Endnotes
COMMAND_RTF_INT( _T("endnotes"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndSection )
COMMAND_RTF_INT( _T("enddoc"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
COMMAND_RTF_INT( _T("ftntj"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BeneathText )
COMMAND_RTF_INT( _T("ftnbj"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BottomPage )
COMMAND_RTF_INT( _T("aendnotes"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_EndSection )
COMMAND_RTF_INT( _T("aenddoc"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_EndDocument )
COMMAND_RTF_INT( _T("aftnbj"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_BeneathText )
COMMAND_RTF_INT( _T("aftntj"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_BottomPage )
COMMAND_RTF_INT( _T("ftnstart"), oDocument.m_oProperty.m_nFootnoteStart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("aftnstart"), oDocument.m_oProperty.m_nEndnoteStart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("ftnrstpg"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_EachPage )
COMMAND_RTF_INT( _T("ftnrestart"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_EachSection )
COMMAND_RTF_INT( _T("ftnrstcont"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_Continuous )
COMMAND_RTF_INT( _T("aftnrestart"), oDocument.m_oProperty.m_eEndnoteRestart, sCommand, true, RtfDocumentProperty::er_EachSection )
COMMAND_RTF_INT( _T("aftnrstcont"), oDocument.m_oProperty.m_eEndnoteRestart, sCommand, true, RtfDocumentProperty::er_Continuous )
COMMAND_RTF_INT( _T("ftnnar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 0 )
COMMAND_RTF_INT( _T("ftnnalc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 4 )
COMMAND_RTF_INT( _T("ftnnauc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 3 )
COMMAND_RTF_INT( _T("ftnnrlc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 2 )
COMMAND_RTF_INT( _T("ftnnruc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 1 )
COMMAND_RTF_INT( _T("ftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 70 )
COMMAND_RTF_INT( _T("ftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 25 )
COMMAND_RTF_INT( _T("ftnncnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 18 )
COMMAND_RTF_INT( _T("ftnndbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 10 )
COMMAND_RTF_INT( _T("ftnndbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 11 )
COMMAND_RTF_INT( _T("ftnndbnumt"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 16 )
COMMAND_RTF_INT( _T("ftnndbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 17 )
COMMAND_RTF_INT( _T("ftnndbar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 20 )
COMMAND_RTF_INT( _T("ftnnganada"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 24 )
COMMAND_RTF_INT( _T("ftnngbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 26 )
COMMAND_RTF_INT( _T("ftnngbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 27 )
COMMAND_RTF_INT( _T("ftnngbnuml"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 28 )
COMMAND_RTF_INT( _T("ftnngbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 29 )
COMMAND_RTF_INT( _T("ftnnzodiac"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 30 )
COMMAND_RTF_INT ( _T("endnotes"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndSection )
COMMAND_RTF_INT ( _T("enddoc"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
COMMAND_RTF_INT ( _T("ftntj"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BeneathText )
COMMAND_RTF_INT ( _T("ftnbj"), oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BottomPage )
COMMAND_RTF_INT( _T("aendnotes"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_EndSection )
COMMAND_RTF_INT( _T("aenddoc"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_EndDocument )
COMMAND_RTF_INT( _T("aftnbj"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_BeneathText )
COMMAND_RTF_INT( _T("aftntj"), oDocument.m_oProperty.m_eEndnotePlacement, sCommand, true, RtfDocumentProperty::ep_BottomPage )
COMMAND_RTF_INT( _T("ftnstart"), oDocument.m_oProperty.m_nFootnoteStart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("aftnstart"), oDocument.m_oProperty.m_nEndnoteStart, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("ftnrstpg"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_EachPage )
COMMAND_RTF_INT( _T("ftnrestart"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_EachSection )
COMMAND_RTF_INT( _T("ftnrstcont"), oDocument.m_oProperty.m_eFootnoteRestart, sCommand, true, RtfDocumentProperty::fr_Continuous )
COMMAND_RTF_INT( _T("aftnrestart"), oDocument.m_oProperty.m_eEndnoteRestart, sCommand, true, RtfDocumentProperty::er_EachSection )
COMMAND_RTF_INT( _T("aftnrstcont"), oDocument.m_oProperty.m_eEndnoteRestart, sCommand, true, RtfDocumentProperty::er_Continuous )
COMMAND_RTF_INT( _T("ftnnar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 0 )
COMMAND_RTF_INT( _T("ftnnalc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 4 )
COMMAND_RTF_INT( _T("ftnnauc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 3 )
COMMAND_RTF_INT( _T("ftnnrlc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 2 )
COMMAND_RTF_INT( _T("ftnnruc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 1 )
COMMAND_RTF_INT( _T("ftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 70 )
COMMAND_RTF_INT( _T("ftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 25 )
COMMAND_RTF_INT( _T("ftnncnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 18 )
COMMAND_RTF_INT( _T("ftnndbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 10 )
COMMAND_RTF_INT( _T("ftnndbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 11 )
COMMAND_RTF_INT( _T("ftnndbnumt"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 16 )
COMMAND_RTF_INT( _T("ftnndbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 17 )
COMMAND_RTF_INT( _T("ftnndbar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 20 )
COMMAND_RTF_INT( _T("ftnnganada"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 24 )
COMMAND_RTF_INT( _T("ftnngbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 26 )
COMMAND_RTF_INT( _T("ftnngbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 27 )
COMMAND_RTF_INT( _T("ftnngbnuml"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 28 )
COMMAND_RTF_INT( _T("ftnngbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 29 )
COMMAND_RTF_INT( _T("ftnnzodiac"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 30 )
COMMAND_RTF_INT( _T("ftnnzodiacd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 31 )
COMMAND_RTF_INT( _T("ftnnzodiacl"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 32 )
COMMAND_RTF_INT( _T("aftnnar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 0 )
COMMAND_RTF_INT( _T("aftnnalc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 4 )
COMMAND_RTF_INT( _T("aftnnauc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 3 )
COMMAND_RTF_INT( _T("aftnnrlc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 2 )
COMMAND_RTF_INT( _T("aftnnruc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 1 )
COMMAND_RTF_INT( _T("aftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 70 )
COMMAND_RTF_INT( _T("aftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 25 )
COMMAND_RTF_INT( _T("aftnncnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 18 )
COMMAND_RTF_INT( _T("aftnndbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 10 )
COMMAND_RTF_INT( _T("aftnnar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 0 )
COMMAND_RTF_INT( _T("aftnnalc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 4 )
COMMAND_RTF_INT( _T("aftnnauc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 3 )
COMMAND_RTF_INT( _T("aftnnrlc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 2 )
COMMAND_RTF_INT( _T("aftnnruc"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 1 )
COMMAND_RTF_INT( _T("aftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 70 )
COMMAND_RTF_INT( _T("aftnnchi"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 25 )
COMMAND_RTF_INT( _T("aftnncnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 18 )
COMMAND_RTF_INT( _T("aftnndbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 10 )
COMMAND_RTF_INT( _T("aftnndbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 11 )
COMMAND_RTF_INT( _T("aftnndbnumt"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 16 )
COMMAND_RTF_INT( _T("aftnndbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 17 )
COMMAND_RTF_INT( _T("aftnndbar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 20 )
COMMAND_RTF_INT( _T("aftnndbar"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 20 )
COMMAND_RTF_INT( _T("aftnnganada"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 24 )
COMMAND_RTF_INT( _T("aftnngbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 26 )
COMMAND_RTF_INT( _T("aftnngbnum"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 26 )
COMMAND_RTF_INT( _T("aftnngbnumd"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 27 )
COMMAND_RTF_INT( _T("aftnngbnuml"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 28 )
COMMAND_RTF_INT( _T("aftnngbnumk"), oDocument.m_oProperty.m_nFootnoteNumberingFormat, sCommand, true, 29 )
......@@ -356,26 +356,21 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
}
else if( _T("sect") == sCommand )
{
oParagraphReaderDestination.Finalize( oReader );
_section section;
if(true == oDocument.GetItem( section ) )
if(oDocument.GetItem( section ) )
{
section.props->m_bFinalize = true;
section.props->m_oProperty = oReader.m_oCurSectionProp;
if (oParagraphReaderDestination.nCurItap > 0)
{
}
else
{
section.props->m_bFinalize = true;
}
}
oParagraphReaderDestination.Finalize( oReader/* , oCurSection*/);
RtfSectionPtr oNewSection = RtfSectionPtr( new RtfSection() );
oParagraphReaderDestination.m_oTextItems = oNewSection;
_section new_section(oNewSection);
oDocument.AddItem( new_section );
oParagraphReaderDestination.m_oTextItems = oNewSection;
//вручную обнуляем footer, т.к. sectd может встретиться и после field
///?????
......@@ -388,22 +383,23 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
}
else if( _T("sectd") == sCommand )
{
//default set to curent section
SectDef( oDocument, oReader );
}
else
{
bool bResult = false;
bResult = oParagraphReaderDestination.ExecuteCommand( oDocument, oReader, (*this), sCommand, hasParameter, parameter );
if( true == bResult )
if( bResult )
return true;
bResult = RtfDocumentCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter );
if( true == bResult )
if( bResult )
return true;
bResult = oRtfSectionCommand.ExecuteCommand( oDocument, oReader, (*this),sCommand, hasParameter, parameter );
if( true == bResult )
if( bResult )
return true;
bResult = RtfDocumentCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter );
if( true == bResult )
if( bResult )
return true;
return false;
}
......@@ -413,20 +409,20 @@ bool RtfSectionCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade
{
if( _T("11111111") == sCommand )
;
COMMAND_RTF_BOOL( _T("rtlsect"), oReader.m_oCurSectionProp.m_bBidi, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("binfsxn"), oReader.m_oCurSectionProp.m_nPaperSourceFirst, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("binsxn"), oReader.m_oCurSectionProp.m_nPaperSourceOther, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("rtlgutter"), oReader.m_oCurSectionProp.m_bRtlGutter, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("endnhere"), oReader.m_oCurSectionProp.m_bEndnotes, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("ds"), oReader.m_oCurSectionProp.m_nStyle, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("sbknone"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbknone)
COMMAND_RTF_INT( _T("sbkcol"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkcol)
COMMAND_RTF_INT( _T("sbkpage"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkpage)
COMMAND_RTF_INT( _T("sbkeven"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkeven)
COMMAND_RTF_INT( _T("sbkodd"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkodd)
COMMAND_RTF_BOOL( _T("rtlsect"), oReader.m_oCurSectionProp.m_bBidi, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("binfsxn"), oReader.m_oCurSectionProp.m_nPaperSourceFirst, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("binsxn"), oReader.m_oCurSectionProp.m_nPaperSourceOther, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("rtlgutter"), oReader.m_oCurSectionProp.m_bRtlGutter, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("endnhere"), oReader.m_oCurSectionProp.m_bEndnotes, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("ds"), oReader.m_oCurSectionProp.m_nStyle, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("sbknone"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbknone)
COMMAND_RTF_INT ( _T("sbkcol"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkcol)
COMMAND_RTF_INT ( _T("sbkpage"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkpage)
COMMAND_RTF_INT ( _T("sbkeven"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkeven)
COMMAND_RTF_INT ( _T("sbkodd"), oReader.m_oCurSectionProp.m_eSectionBreak, sCommand, true, RtfSectionProperty::sb_sbkodd)
else if( _T("cols") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oReader.m_oCurSectionProp.m_nColumnNumber = parameter;
oReader.m_oCurSectionProp.m_oCollumnProperty.m_aCollumnProperty.resize( parameter );
......@@ -435,116 +431,116 @@ bool RtfSectionCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade
COMMAND_RTF_INT( _T("colsx"), oReader.m_oCurSectionProp.m_nColumnSpace, sCommand, hasParameter, parameter)
else if( _T("colno") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
nCurCollumnNumber = parameter - 1;
}
else if( _T("colsr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
if( nCurCollumnNumber >= 0 && nCurCollumnNumber < (int)oReader.m_oCurSectionProp.m_oCollumnProperty.m_aCollumnProperty.size() )
oReader.m_oCurSectionProp.m_oCollumnProperty.m_aCollumnProperty[ nCurCollumnNumber ].m_nColumnSpaceToRightOfCol = parameter;
}
else if( _T("colw") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
if( nCurCollumnNumber >= 0 && nCurCollumnNumber < (int)oReader.m_oCurSectionProp.m_oCollumnProperty.m_aCollumnProperty.size() )
oReader.m_oCurSectionProp.m_oCollumnProperty.m_aCollumnProperty[ nCurCollumnNumber ].m_nColumnWidth = parameter;
}
COMMAND_RTF_BOOL( _T("linebetcol"), oReader.m_oCurSectionProp.m_bColumnLineBetween, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("sftntj"), oReader.m_oCurSectionProp.m_eFootnotesJust, sCommand, true, RtfSectionProperty::fj_sftntj)
COMMAND_RTF_INT( _T("sftnbj"), oReader.m_oCurSectionProp.m_eFootnotesJust, sCommand, true, RtfSectionProperty::fj_sftnbj)
COMMAND_RTF_BOOL( _T("linebetcol"), oReader.m_oCurSectionProp.m_bColumnLineBetween, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("sftntj"), oReader.m_oCurSectionProp.m_eFootnotesJust, sCommand, true, RtfSectionProperty::fj_sftntj)
COMMAND_RTF_INT ( _T("sftnbj"), oReader.m_oCurSectionProp.m_eFootnotesJust, sCommand, true, RtfSectionProperty::fj_sftnbj)
//Footnotes and Endnotes
COMMAND_RTF_INT( _T("sftnstart"), oReader.m_oCurSectionProp.m_nFootnotesStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("sftnrstpg"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrstpg)
COMMAND_RTF_INT( _T("sftnrestart"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrestart)
COMMAND_RTF_INT( _T("sftnrstcont"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrstcont)
COMMAND_RTF_INT( _T("sftnnar"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnar)
COMMAND_RTF_INT( _T("sftnnalc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnalc)
COMMAND_RTF_INT( _T("sftnnauc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnauc)
COMMAND_RTF_INT( _T("sftnnrlc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnrlc)
COMMAND_RTF_INT( _T("sftnnruc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnruc)
COMMAND_RTF_INT( _T("sftnnchi"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnchi)
COMMAND_RTF_INT( _T("sftnnchosung"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnchosung)
COMMAND_RTF_INT( _T("sftnncnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnncnum)
COMMAND_RTF_INT( _T("sftnndbnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnum)
COMMAND_RTF_INT( _T("sftnndbnumd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumd)
COMMAND_RTF_INT( _T("sftnndbnumt"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumt)
COMMAND_RTF_INT( _T("sftnndbnumk"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumk)
COMMAND_RTF_INT( _T("sftnndbar"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbar)
COMMAND_RTF_INT( _T("sftnnganada"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnganada)
COMMAND_RTF_INT( _T("sftnngbnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnum)
COMMAND_RTF_INT( _T("sftnngbnumd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnumd)
COMMAND_RTF_INT( _T("sftnngbnuml"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnuml)
COMMAND_RTF_INT( _T("sftnngbnumk"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnumk)
COMMAND_RTF_INT( _T("sftnnzodiac"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiac)
COMMAND_RTF_INT( _T("sftnnzodiacd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiacd)
COMMAND_RTF_INT( _T("sftnnzodiacl"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiacl)
COMMAND_RTF_INT ( _T("sftnstart"), oReader.m_oCurSectionProp.m_nFootnotesStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("sftnrstpg"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrstpg)
COMMAND_RTF_INT ( _T("sftnrestart"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrestart)
COMMAND_RTF_INT ( _T("sftnrstcont"), oReader.m_oCurSectionProp.m_eFootnotesRestart, sCommand, true, RtfSectionProperty::fr_sftnrstcont)
COMMAND_RTF_INT ( _T("sftnnar"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnar)
COMMAND_RTF_INT ( _T("sftnnalc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnalc)
COMMAND_RTF_INT ( _T("sftnnauc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnauc)
COMMAND_RTF_INT ( _T("sftnnrlc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnrlc)
COMMAND_RTF_INT ( _T("sftnnruc"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnruc)
COMMAND_RTF_INT ( _T("sftnnchi"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnchi)
COMMAND_RTF_INT ( _T("sftnnchosung"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnchosung)
COMMAND_RTF_INT ( _T("sftnncnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnncnum)
COMMAND_RTF_INT ( _T("sftnndbnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnum)
COMMAND_RTF_INT ( _T("sftnndbnumd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumd)
COMMAND_RTF_INT ( _T("sftnndbnumt"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumt)
COMMAND_RTF_INT ( _T("sftnndbnumk"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbnumk)
COMMAND_RTF_INT ( _T("sftnndbar"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnndbar)
COMMAND_RTF_INT ( _T("sftnnganada"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnganada)
COMMAND_RTF_INT ( _T("sftnngbnum"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnum)
COMMAND_RTF_INT ( _T("sftnngbnumd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnumd)
COMMAND_RTF_INT ( _T("sftnngbnuml"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnuml)
COMMAND_RTF_INT ( _T("sftnngbnumk"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnngbnumk)
COMMAND_RTF_INT ( _T("sftnnzodiac"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiac)
COMMAND_RTF_INT ( _T("sftnnzodiacd"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiacd)
COMMAND_RTF_INT ( _T("sftnnzodiacl"), oReader.m_oCurSectionProp.m_eFootnotesFormat, sCommand, true, RtfSectionProperty::ff_sftnnzodiacl)
COMMAND_RTF_INT( _T("saftnstart"), oReader.m_oCurSectionProp.m_nEndnotesStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("saftnrestart"), oReader.m_oCurSectionProp.m_eEndnotesRestart, sCommand, true, RtfSectionProperty::er_saftnrestart)
COMMAND_RTF_INT( _T("saftnrstcont"), oReader.m_oCurSectionProp.m_eEndnotesRestart, sCommand, true, RtfSectionProperty::er_saftnrstcont)
COMMAND_RTF_INT( _T("saftnnar"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnar)
COMMAND_RTF_INT( _T("saftnnalc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnalc)
COMMAND_RTF_INT( _T("saftnnauc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnauc)
COMMAND_RTF_INT( _T("saftnnrlc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnrlc)
COMMAND_RTF_INT( _T("saftnnruc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnruc)
COMMAND_RTF_INT( _T("saftnnchi"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnchi)
COMMAND_RTF_INT( _T("saftnnchosung"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnchosung)
COMMAND_RTF_INT( _T("saftnncnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnncnum)
COMMAND_RTF_INT( _T("saftnndbnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnum)
COMMAND_RTF_INT( _T("saftnndbnumd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumd)
COMMAND_RTF_INT( _T("saftnndbnumt"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumt)
COMMAND_RTF_INT( _T("saftnndbnumk"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumk)
COMMAND_RTF_INT( _T("saftnndbar"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbar)
COMMAND_RTF_INT( _T("saftnnganada"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnganada)
COMMAND_RTF_INT( _T("saftnngbnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnum)
COMMAND_RTF_INT( _T("saftnngbnumd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnumd)
COMMAND_RTF_INT( _T("saftnngbnuml"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnuml)
COMMAND_RTF_INT( _T("saftnngbnumk"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnumk)
COMMAND_RTF_INT( _T("saftnnzodiac"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiac)
COMMAND_RTF_INT( _T("saftnnzodiacd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiacd)
COMMAND_RTF_INT( _T("saftnnzodiacl"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiacl)
COMMAND_RTF_INT ( _T("saftnstart"), oReader.m_oCurSectionProp.m_nEndnotesStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("saftnrestart"), oReader.m_oCurSectionProp.m_eEndnotesRestart, sCommand, true, RtfSectionProperty::er_saftnrestart)
COMMAND_RTF_INT ( _T("saftnrstcont"), oReader.m_oCurSectionProp.m_eEndnotesRestart, sCommand, true, RtfSectionProperty::er_saftnrstcont)
COMMAND_RTF_INT ( _T("saftnnar"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnar)
COMMAND_RTF_INT ( _T("saftnnalc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnalc)
COMMAND_RTF_INT ( _T("saftnnauc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnauc)
COMMAND_RTF_INT ( _T("saftnnrlc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnrlc)
COMMAND_RTF_INT ( _T("saftnnruc"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnruc)
COMMAND_RTF_INT ( _T("saftnnchi"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnchi)
COMMAND_RTF_INT ( _T("saftnnchosung"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnchosung)
COMMAND_RTF_INT ( _T("saftnncnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnncnum)
COMMAND_RTF_INT ( _T("saftnndbnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnum)
COMMAND_RTF_INT ( _T("saftnndbnumd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumd)
COMMAND_RTF_INT ( _T("saftnndbnumt"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumt)
COMMAND_RTF_INT ( _T("saftnndbnumk"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbnumk)
COMMAND_RTF_INT ( _T("saftnndbar"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnndbar)
COMMAND_RTF_INT ( _T("saftnnganada"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnganada)
COMMAND_RTF_INT ( _T("saftnngbnum"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnum)
COMMAND_RTF_INT ( _T("saftnngbnumd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnumd)
COMMAND_RTF_INT ( _T("saftnngbnuml"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnuml)
COMMAND_RTF_INT ( _T("saftnngbnumk"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnngbnumk)
COMMAND_RTF_INT ( _T("saftnnzodiac"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiac)
COMMAND_RTF_INT ( _T("saftnnzodiacd"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiacd)
COMMAND_RTF_INT ( _T("saftnnzodiacl"), oReader.m_oCurSectionProp.m_eEndnotesFormat, sCommand, true, RtfSectionProperty::ef_saftnnzodiacl)
//Line Numbering
COMMAND_RTF_INT( _T("linemod"), oReader.m_oCurSectionProp.m_nLineModulus, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("linex"), oReader.m_oCurSectionProp.m_nLineX, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("linestarts"), oReader.m_oCurSectionProp.m_nLineStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("linerestart"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_linerestart)
COMMAND_RTF_INT( _T("lineppage"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_lineppage)
COMMAND_RTF_INT( _T("linecont"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_linecont)
COMMAND_RTF_INT ( _T("linemod"), oReader.m_oCurSectionProp.m_nLineModulus, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("linex"), oReader.m_oCurSectionProp.m_nLineX, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("linestarts"), oReader.m_oCurSectionProp.m_nLineStart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("linerestart"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_linerestart)
COMMAND_RTF_INT ( _T("lineppage"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_lineppage)
COMMAND_RTF_INT ( _T("linecont"), oReader.m_oCurSectionProp.m_eLineNumberRestart, sCommand, true, RtfSectionProperty::lnr_linecont)
//Page Information
COMMAND_RTF_INT( _T("pgwsxn"), oReader.m_oCurSectionProp.m_nPageWidth, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("pghsxn"), oReader.m_oCurSectionProp.m_nPageHeight, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("marglsxn"), oReader.m_oCurSectionProp.m_nMarginLeft, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("margrsxn"), oReader.m_oCurSectionProp.m_nMarginRight, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("margtsxn"), oReader.m_oCurSectionProp.m_nMarginTop, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("margbsxn"), oReader.m_oCurSectionProp.m_nMarginBottom, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("guttersxn"), oReader.m_oCurSectionProp.m_nGutterMarginWidth, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("margmirsxn"), oReader.m_oCurSectionProp.m_bSwitchMargin, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("lndscpsxn"), oReader.m_oCurSectionProp.m_bLandscapeFormat, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("titlepg"), oReader.m_oCurSectionProp.m_bTitlePage, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pgwsxn"), oReader.m_oCurSectionProp.m_nPageWidth, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pghsxn"), oReader.m_oCurSectionProp.m_nPageHeight, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("marglsxn"), oReader.m_oCurSectionProp.m_nMarginLeft, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("margrsxn"), oReader.m_oCurSectionProp.m_nMarginRight, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("margtsxn"), oReader.m_oCurSectionProp.m_nMarginTop, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("margbsxn"), oReader.m_oCurSectionProp.m_nMarginBottom, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("guttersxn"), oReader.m_oCurSectionProp.m_nGutterMarginWidth, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("margmirsxn"), oReader.m_oCurSectionProp.m_bSwitchMargin, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("lndscpsxn"), oReader.m_oCurSectionProp.m_bLandscapeFormat, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("titlepg"), oReader.m_oCurSectionProp.m_bTitlePage, sCommand, hasParameter, parameter)
//else if( _T("headery") == sCommand )
//{
// static int nCount = 0;
// nCount++;
// ATLTRACE( "count %d\n", nCount );
//}
COMMAND_RTF_INT( _T("headery"), oReader.m_oCurSectionProp.m_nHeaderTop, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("footery"), oReader.m_oCurSectionProp.m_nFooterBottom, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("headery"), oReader.m_oCurSectionProp.m_nHeaderTop, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("footery"), oReader.m_oCurSectionProp.m_nFooterBottom, sCommand, hasParameter, parameter)
//Page Numbers
COMMAND_RTF_INT( _T("pgnstarts"), oReader.m_oCurSectionProp.m_nPageNumberStart, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("pgncont"), oReader.m_oCurSectionProp.m_bPageNumberContinuos, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pgnstarts"), oReader.m_oCurSectionProp.m_nPageNumberStart, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("pgncont"), oReader.m_oCurSectionProp.m_bPageNumberContinuos, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("pgnrestart"), oReader.m_oCurSectionProp.m_bPageNumberRestart, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("pgnx"), oReader.m_oCurSectionProp.m_nPageNumberX, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("pgny"), oReader.m_oCurSectionProp.m_nPageNumberY, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("pgndec"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgndec)
COMMAND_RTF_INT( _T("pgnucrm"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgnucrm)
COMMAND_RTF_INT( _T("pgnlcrm"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgnlcrm)
COMMAND_RTF_INT( _T("vertalt"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalt)
COMMAND_RTF_INT( _T("vertalb"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalb)
COMMAND_RTF_INT( _T("vertalc"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalc)
COMMAND_RTF_INT( _T("vertalj"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalj)
COMMAND_RTF_INT ( _T("pgnx"), oReader.m_oCurSectionProp.m_nPageNumberX, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pgny"), oReader.m_oCurSectionProp.m_nPageNumberY, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pgndec"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgndec)
COMMAND_RTF_INT ( _T("pgnucrm"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgnucrm)
COMMAND_RTF_INT ( _T("pgnlcrm"), oReader.m_oCurSectionProp.m_ePageNumberFormat, sCommand, true, RtfSectionProperty::pnf_pgnlcrm)
COMMAND_RTF_INT ( _T("vertalt"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalt)
COMMAND_RTF_INT ( _T("vertalb"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalb)
COMMAND_RTF_INT ( _T("vertalc"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalc)
COMMAND_RTF_INT ( _T("vertalj"), oReader.m_oCurSectionProp.m_eVerticalAlignment, sCommand, true, RtfSectionProperty::va_vertalj)
//Text Flow
COMMAND_RTF_INT( _T("stextflow"), oReader.m_oCurSectionProp.m_nTextFollow, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("stextflow"), oReader.m_oCurSectionProp.m_nTextFollow, sCommand, hasParameter, parameter)
//Page Borders
else if( _T("pgbrdrl") == sCommand )
......@@ -555,9 +551,9 @@ bool RtfSectionCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade
m_eInternalState = is_border_right;
else if( _T("pgbrdrb") == sCommand )
m_eInternalState = is_border_bottom;
COMMAND_RTF_INT( _T("brdrart"), oReader.m_oCurSectionProp.m_nBorderArt, sCommand, hasParameter, parameter)
COMMAND_RTF_INT( _T("pgbrdropt"), oReader.m_oCurSectionProp.m_nBorderMeasure, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("pgbrdrsna"), oReader.m_oCurSectionProp.m_nBorderAlign, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("brdrart"), oReader.m_oCurSectionProp.m_nBorderArt, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( _T("pgbrdropt"), oReader.m_oCurSectionProp.m_nBorderMeasure, sCommand, hasParameter, parameter)
COMMAND_RTF_BOOL( _T("pgbrdrsna"), oReader.m_oCurSectionProp.m_nBorderAlign, sCommand, hasParameter, parameter)
else if( _T("header") == sCommand || _T("footer") == sCommand || _T("headerl") == sCommand ||
_T("headerr") == sCommand || _T("headerf") == sCommand || _T("footerl") == sCommand ||
_T("footerr") == sCommand || _T("footerf") == sCommand )
......@@ -598,7 +594,7 @@ bool RtfSectionCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade
else if( is_border_bottom == m_eInternalState )
bRes = RtfBorderCommand::ExecuteCommand( oDocument, oReader, sCommand, hasParameter, parameter, oReader.m_oCurSectionProp.m_oBorderBottom );
if( true == bRes )
if( bRes )
return true;
return false;
}
......@@ -635,17 +631,17 @@ bool RtfShadingCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade
oOutput.m_eType = RtfShading::st_chbgdkdcross;
else if( _T("cfpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nForeColor = parameter;
}
else if( _T("cbpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nBackColor = parameter;
}
else if( _T("shading") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nValue = parameter;
}
else
......@@ -712,7 +708,7 @@ bool OldShapeReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,C
else if ( L"dplinehollow" == sCommand )
m_oShape.m_bLine = false;
else if ( true == hasParameter)
else if ( hasParameter)
{
if( L"dpx" == sCommand )
m_oShape.m_nLeft = parameter;
......@@ -776,27 +772,27 @@ bool ShapeReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStr
}
else if( _T("shpleft") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nLeft = parameter;
}
else if( _T("shptop") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nTop = parameter;
}
else if( _T("shpbottom") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nBottom = parameter;
}
else if( _T("shpright") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nRight = parameter;
}
else if( _T("shplid") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
m_oShape.m_nID = parameter;
oDocument.SetShapeId( parameter );
......@@ -804,12 +800,12 @@ bool ShapeReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStr
}
else if( _T("shpz") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nZOrder = parameter;
}
else if( _T("shpfhdr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nHeader = parameter;
}
//else if( _T("shpbxignore") == sCommand )
......@@ -830,17 +826,17 @@ bool ShapeReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStr
m_oShape.m_eYAnchor = RtfShape::ay_Para;
else if( _T("shpwr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nWrapType = parameter;
}
else if( _T("shpwrk") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nWrapSideType = parameter;
}
else if( _T("shpfblwtxt") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_nZOrderRelative = parameter;
}
else if( _T("shplockanchor") == sCommand )
......@@ -922,17 +918,17 @@ bool RtfShadingCharCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oR
oOutput.m_eType = RtfShading::st_chbgdkdcross;
else if( _T("chcfpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nForeColor = parameter;
}
else if( _T("chcbpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nBackColor = parameter;
}
else if( _T("chshdng") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nValue = parameter;
}
else
......@@ -968,17 +964,17 @@ bool RtfShadingRowCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRe
oOutput.m_eType = RtfShading::st_chbgdkdcross;
else if( _T("trcfpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nForeColor = parameter;
}
else if( _T("trcbpat") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nBackColor = parameter;
}
else if( _T("trshdng") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
oOutput.m_nValue = parameter;
}
else
......@@ -1002,7 +998,7 @@ bool RtfCharPropCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
COMMAND_RTF_INT( _T("expndtw") , ChartProperty.m_nCharacterSpacing, sCommand, hasParameter, parameter)
else if( _T("expnd") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
ChartProperty.m_nCharacterSpacing = 5 * parameter; //quater -points
}
COMMAND_RTF_INT( _T("fittext") , ChartProperty.m_nFitText, sCommand, hasParameter, parameter)
......@@ -1033,14 +1029,14 @@ bool RtfCharPropCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
COMMAND_RTF_INT( _T("highlight"), ChartProperty.m_nHightlited , sCommand, hasParameter, parameter)
else if( _T("cf") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
ChartProperty.m_nForeColor = parameter;
else
ChartProperty.m_nForeColor= PROP_DEF;
}
else if( _T("ul") == sCommand )
{
if( true == hasParameter && 0 == parameter)
if( hasParameter && 0 == parameter)
ChartProperty.m_eUnderStyle = RtfCharProperty::uls_none;
else
ChartProperty.m_eUnderStyle = RtfCharProperty::uls_Single;
......@@ -1080,12 +1076,12 @@ bool RtfCharPropCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
{
bool bResult ;
bResult = RtfShadingCharCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, ChartProperty.m_poShading);
if( true == bResult )
if( bResult )
return true;
if( true == bLookOnBorder )
if( bLookOnBorder )
{
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, ChartProperty.m_poBorder);
if( true == bResult )
if( bResult )
return true;
}
return false;
......@@ -1112,68 +1108,68 @@ bool PictureReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CS
else if( _T("wmetafile") == sCommand )
{
if( true == hasParameter && 8 == parameter )
if( hasParameter && 8 == parameter )
m_oShape.m_oPicture->eDataType = RtfPicture::dt_wmf;
}
else if( _T("picw") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
m_oShape.m_oPicture->m_nWidth = parameter;
}
}
else if( _T("pich") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
m_oShape.m_oPicture->m_nHeight = parameter;
}
}
else if( _T("picwgoal") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nWidthGoal = parameter;
}
else if( _T("pichgoal") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nHeightGoal = parameter;
}
else if( _T("picscalex") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_dScaleX = parameter;
}
else if( _T("picscaley") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_dScaleY = parameter;
}
else if( _T("picscaled") == sCommand )
m_oShape.m_oPicture->m_bScaled = 1;
else if( _T("piccropl") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nCropL = parameter;
}
else if( _T("piccropt") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nCropT = parameter;
}
else if( _T("piccropr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nCropR = parameter;
}
else if( _T("piccropb") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
m_oShape.m_oPicture->m_nCropB = parameter;
}
else if( _T("bin") == sCommand)
{
if( true == hasParameter )
if( hasParameter )
{
//читаем картинку как бинарник длиной parameter
m_bBin = true;
......@@ -1456,7 +1452,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_BOOL( _T("hyphpar"), oReader.m_oState->m_oParagraphProp.m_bAutoHyphenation, sCommand, hasParameter, parameter )
else if( _T("intbl") == sCommand )
{
if( true == hasParameter && 0 == parameter )
if( hasParameter && 0 == parameter )
{
oReader.m_oState->m_oParagraphProp.m_bInTable = 0;
if( PROP_DEF == oReader.m_oState->m_oParagraphProp.m_nItap )
......@@ -1512,7 +1508,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("lisa"), oReader.m_oState->m_oParagraphProp.m_nSpaceAfterLine, sCommand, hasParameter, parameter )
else if( _T("sl") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oReader.m_oState->m_oParagraphProp.m_nSpaceBetween = parameter;
if( PROP_DEF == oReader.m_oState->m_oParagraphProp.m_nSpaceMultiLine )
......@@ -1528,14 +1524,14 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_BOOL( _T("nowwrap"), oReader.m_oState->m_oParagraphProp.m_bNoWordWrap, sCommand, hasParameter, parameter )
else if( _T("nowwrap") == sCommand )
{
if( true == hasParameter && 0 == parameter)
if( hasParameter && 0 == parameter)
oReader.m_oState->m_oParagraphProp.m_bSnapToGrid = 1;
else
oReader.m_oState->m_oParagraphProp.m_bSnapToGrid = 0;
}
else if( _T("ls") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oReader.m_oState->m_oParagraphProp.m_nListId = parameter;
if( PROP_DEF == oReader.m_oState->m_oParagraphProp.m_nListLevel )
......@@ -1613,7 +1609,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("tqdec"), m_oCurTab.m_eKind , sCommand, true, RtfTab::tk_tqdec )
else if( _T("tb") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
m_oCurTab.m_eKind = RtfTab::tk_tqbar;
m_oCurTab.m_nTab = parameter;
......@@ -1623,7 +1619,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
}
else if( _T("tx") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
m_oCurTab.m_nTab = parameter;
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.push_back( m_oCurTab );
......@@ -1722,7 +1718,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("clspb"), oReader.m_oState->m_oCellProperty.m_nSpacingBottom, sCommand, hasParameter, parameter )
else if( _T("clftsWidth") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
switch( parameter )
{
......@@ -1764,7 +1760,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("cltxtbrlv"), oReader.m_oState->m_oCellProperty.m_oCellFlow, sCommand, true, RtfCellProperty::cf_tbrlv )
else if( _T("cellx") == sCommand )
{
if( true == hasParameter)
if( hasParameter)
{
oReader.m_oState->m_oCellProperty.m_nCellx = parameter;
oReader.m_oState->m_oRowProperty.AddItem( oReader.m_oState->m_oCellProperty );
......@@ -1809,7 +1805,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
else if( _T("trftsWidth") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
switch( parameter )
{
......@@ -1823,7 +1819,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("trwWidth"), oReader.m_oState->m_oRowProperty.m_nWidth, sCommand, hasParameter, parameter )
else if( _T("trftsWidthB") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
switch( parameter )
{
......@@ -1837,7 +1833,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("trwWidthB"), oReader.m_oState->m_oRowProperty.m_nWidthStartInvCell, sCommand, hasParameter, parameter )
else if( _T("trftsWidthA") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
switch( parameter )
{
......@@ -1895,7 +1891,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
else if( _T("trleft") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
oReader.m_oState->m_oRowProperty.m_nLeft = parameter;
if( PROP_DEF == oReader.m_oState->m_oRowProperty.nTableIndent )
......@@ -1908,7 +1904,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_INT( _T("trwWidth"), oReader.m_oState->m_oRowProperty.m_nWidth, sCommand, hasParameter, parameter )
else if( _T("trleft") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
switch( parameter )
{
......@@ -1987,7 +1983,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfShapePtr oNewShape( new RtfShape() );
ShapeReader oShapeReader( *oNewShape );
oAbstrReader.StartSubReader( oShapeReader, oDocument, oReader );
if( true == oNewShape->IsValid() )
if( oNewShape->IsValid() )
m_oCurParagraph->AddItem( oNewShape );
}
else if( _T("do") == sCommand )
......@@ -1995,7 +1991,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfShapePtr oNewShape( new RtfShape() );
OldShapeReader oShapeReader( *oNewShape );
oAbstrReader.StartSubReader( oShapeReader, oDocument, oReader );
if( true == oNewShape->IsValid() )
if( oNewShape->IsValid() )
m_oCurParagraph->AddItem( oNewShape );
}
else if( _T("shppict") == sCommand )
......@@ -2003,7 +1999,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfShapePtr oNewShape( new RtfShape() );
ShppictReader oShppictReader( *oNewShape );
oAbstrReader.StartSubReader( oShppictReader, oDocument, oReader );
if( true == oNewShape->IsValid() )
if( oNewShape->IsValid() )
m_oCurParagraph->AddItem( oNewShape );
}
else if( _T("pict") == sCommand )
......@@ -2020,7 +2016,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
PictureReader oPictureReader( oReader, *oNewShape);
oAbstrReader.StartSubReader( oPictureReader, oDocument, oReader );
if( true == oNewShape->IsValid() )
if( oNewShape->IsValid() )
m_oCurParagraph->AddItem( oNewShape );
}
else if( _T("shpgrp") == sCommand )
......@@ -2028,7 +2024,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfShapeGroupPtr oNewShape( new RtfShapeGroup() );
ShapeGroupReader oShapeGroupReader( *oNewShape );
oAbstrReader.StartSubReader( oShapeGroupReader, oDocument, oReader );
if( true == oNewShape->IsValid() )
if( oNewShape->IsValid() )
m_oCurParagraph->AddItem( oNewShape );
}
else if( _T("nonshppict") == sCommand )
......@@ -2038,7 +2034,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfFieldPtr oNewField = RtfFieldPtr(new RtfField());
FieldReader oFieldReader( *oNewField );
oAbstrReader.StartSubReader( oFieldReader, oDocument, oReader );
if( true == oNewField->IsValid() )
if( oNewField->IsValid() )
m_oCurParagraph->AddItem( oNewField );
}
else if( _T("bkmkstart") == sCommand )
......@@ -2046,7 +2042,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfBookmarkStartPtr oNewBookmarkStart = RtfBookmarkStartPtr( new RtfBookmarkStart() );
BookmarkStartReader oBookmarkStartReader( *oNewBookmarkStart );
oAbstrReader.StartSubReader( oBookmarkStartReader, oDocument, oReader );
if( true == oNewBookmarkStart->IsValid() )
if( oNewBookmarkStart->IsValid() )
m_oCurParagraph->AddItem( oNewBookmarkStart );
}
else if( _T("bkmkend") == sCommand )
......@@ -2054,7 +2050,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfBookmarkEndPtr oNewBookmarkEnd = RtfBookmarkEndPtr( new RtfBookmarkEnd() );
BookmarkEndReader oBookmarkEndReader( *oNewBookmarkEnd );
oAbstrReader.StartSubReader( oBookmarkEndReader, oDocument, oReader );
if( true == oNewBookmarkEnd->IsValid() )
if( oNewBookmarkEnd->IsValid() )
m_oCurParagraph->AddItem( oNewBookmarkEnd );
}
else if( _T("footnote") == sCommand )
......@@ -2063,7 +2059,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
oNewFootnote->m_oCharProp = oReader.m_oState->m_oCharProp;
FootnoteReader oFootnoteReader( *oNewFootnote );
oAbstrReader.StartSubReader( oFootnoteReader, oDocument, oReader );
if( true == oNewFootnote->IsValid() )
if( oNewFootnote->IsValid() )
m_oCurParagraph->AddItem( oNewFootnote );
}
else if( _T("chftn") == sCommand )
......@@ -2114,7 +2110,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_SPECIAL_CHAR( _T("line"), m_oCurParagraph, sCommand, hasParameter, RtfCharSpecial::rsc_line )
else if( _T("lbr") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_nTextWrapBreak = parameter;
......@@ -2127,7 +2123,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
COMMAND_RTF_SPECIAL_CHAR( _T("softline"), m_oCurParagraph, sCommand, hasParameter, RtfCharSpecial::rsc_softline )
else if( _T("softlheight") == sCommand )
{
if( true == hasParameter )
if( hasParameter )
{
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_nSoftHeight = parameter;
......@@ -2167,7 +2163,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
RtfOlePtr oNewOleObject = RtfOlePtr( new RtfOle() );
OleReader oOleReader( *oNewOleObject );
oAbstrReader.StartSubReader( oOleReader, oDocument, oReader );
if( true == oNewOleObject->IsValid() )
if( oNewOleObject->IsValid() )
m_oCurParagraph->AddItem( oNewOleObject );
}
else
......@@ -2176,8 +2172,8 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
bResult = RtfShadingCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oParagraphProp.m_oShading );
if( true == bResult )
return true;
if( bResult ) return true;
if( is_borderBar == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oParagraphProp.m_oBorderBar );
......@@ -2192,8 +2188,7 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
else if( is_borderTop == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oParagraphProp.m_oBorderTop );
if( true == bResult )
return true;
if( bResult ) return true;
if( is_borderCellBottom == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oCellProperty.m_oBorderBottom );
......@@ -2208,12 +2203,11 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
else if( is_borderCellRL == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oCellProperty.m_oBorderDiagonalRL );
if( true == bResult )
return true;
if( bResult ) return true;
bResult = RtfShadingCellCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oCellProperty.m_oShading );
if( true == bResult )
return true;
if( bResult ) return true;
if( is_borderRowBottom == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oRowProperty.m_oBorderBottom );
......@@ -2228,22 +2222,20 @@ bool ParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfReader&
else if( is_borderRowVer == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oRowProperty.m_oBorderVert );
if( true == bResult )
return true;
if( bResult ) return true;
bResult = RtfShadingRowCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oRowProperty.m_oShading );
if( true == bResult )
return true;
if( bResult ) return true;
if( is_charBorder == m_eInternalState )
bResult = RtfBorderCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oCharProp.m_poBorder);
if( true == bResult )
return true;
if( bResult ) return true;
bResult = RtfCharPropCommand::ExecuteCommand( oDocument, oReader,sCommand, hasParameter, parameter, oReader.m_oState->m_oCharProp );
if( true == bResult )
return true;
if( bResult ) return true;
return false;
}
......@@ -2328,7 +2320,7 @@ void ParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oReade
}
nCurItap = oItem->m_oProperty.m_nItap;
//закончилась строка
if( true == bEndRow )
if( bEndRow )
{
RtfTableRowPtr oNewTableRow( new RtfTableRow() );
oNewTableRow->m_oProperty = oReader.m_oState->m_oRowProperty;
......@@ -2358,7 +2350,7 @@ void ParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oReade
aCellRenderables.push_back( oItem ); //содержит все параграфы, не разложенные по cell
aItaps.push_back( nCurItap ); //содержит все номера вложенности параграфов
if( true == bEndCell )
if( bEndCell )
{
RtfTableCellPtr oNewTableCell( new RtfTableCell() );
for( int k = (int)aCellRenderables.size() - 1; k >= 0 ; k-- )
......
......@@ -1705,9 +1705,10 @@ public:
}
void ExitReader( RtfDocument& oDocument, RtfReader& oReader )
{
m_oParPropDest.Finalize( oReader/*, RtfSectionPtr()*/);
m_oRtfFootnote.m_oContent = m_oParPropDest.m_oTextItems;
oReader.m_nFootnote = PROP_DEF;
m_oParPropDest.Finalize( oReader );
m_oRtfFootnote.m_oContent = m_oParPropDest.m_oTextItems;
oReader.m_nFootnote = PROP_DEF;
}
};
class RtfDefParPropReader: public RtfAbstractReader
......@@ -2409,7 +2410,7 @@ public:
}
void ExitReader( RtfDocument& oDocument, RtfReader& oReader )
{
m_oParPropDest.Finalize( oReader /*, RtfSectionPtr()*/ );
m_oParPropDest.Finalize( oReader );
}
};
......@@ -2422,21 +2423,22 @@ class RtfSectionCommand
{
private:
typedef enum{ is_none, is_border_left, is_border_top, is_border_right, is_border_bottom }InternalState;
InternalState m_eInternalState;
int nCurCollumnNumber;
public:
RtfSectionCommand()
{
m_eInternalState = is_none;
nCurCollumnNumber = PROP_DEF;
m_eInternalState = is_none;
nCurCollumnNumber = PROP_DEF;
}
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, RtfAbstractReader& oAbstrReader, CString sCommand, bool hasParameter, int parameter);
};
class RtfNormalReader : public RtfAbstractReader
{
public:
ParagraphPropDestination oParagraphReaderDestination;
RtfSectionCommand oRtfSectionCommand;
ParagraphPropDestination oParagraphReaderDestination;
RtfSectionCommand oRtfSectionCommand;
RtfNormalReader( RtfDocument& oDocument, RtfReader& oReader )
{
......@@ -2457,7 +2459,7 @@ public:
}
void ExitReader(RtfDocument& oDocument, RtfReader& oReader)
{
oParagraphReaderDestination.Finalize(oReader/*, RtfSectionPtr()*/);
oParagraphReaderDestination.Finalize( oReader );
_section section;
if(true == oDocument.GetItem( section) )
......@@ -2467,10 +2469,10 @@ public:
if( NULL == oDocument.m_oFootnoteCon )
{
oDocument.m_oFootnoteCon = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
oDocument.m_oFootnoteCon = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
oNewPar->AddItem( oNewChar );
oDocument.m_oFootnoteCon->AddItem( oNewPar );
......@@ -2478,10 +2480,10 @@ public:
}
if( NULL == oDocument.m_oFootnoteSep )
{
oDocument.m_oFootnoteSep = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
oDocument.m_oFootnoteSep = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
oNewPar->AddItem( oNewChar );
oDocument.m_oFootnoteSep->AddItem( oNewPar );
......@@ -2489,10 +2491,10 @@ public:
}
if( NULL == oDocument.m_oEndnoteCon )
{
oDocument.m_oEndnoteCon = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
oDocument.m_oEndnoteCon = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
oNewPar->AddItem( oNewChar );
oDocument.m_oEndnoteCon->AddItem( oNewPar );
......@@ -2500,10 +2502,10 @@ public:
}
if( NULL == oDocument.m_oEndnoteSep )
{
oDocument.m_oEndnoteSep = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
oDocument.m_oEndnoteSep = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
oNewPar->AddItem( oNewChar );
oDocument.m_oEndnoteSep->AddItem( oNewPar );
......@@ -2514,15 +2516,16 @@ private:
void SectDef( RtfDocument& oDocument, RtfReader& oReader )
{
oReader.m_oCurSectionProp.SetDefaultRtf();
//в соответствии с документацией ставим Page Information свойства как у документа
oReader.m_oCurSectionProp.m_nPageWidth = oDocument.m_oProperty.m_nPaperWidth;
oReader.m_oCurSectionProp.m_nPageHeight = oDocument.m_oProperty.m_nPaperHeight;
oReader.m_oCurSectionProp.m_nMarginLeft = oDocument.m_oProperty.m_nMarginLeft;
oReader.m_oCurSectionProp.m_nMarginRight = oDocument.m_oProperty.m_nMarginRight;
oReader.m_oCurSectionProp.m_nMarginTop = oDocument.m_oProperty.m_nMarginTop;
oReader.m_oCurSectionProp.m_nMarginBottom = oDocument.m_oProperty.m_nMarginBottom;
oReader.m_oCurSectionProp.m_nGutterMarginWidth = oDocument.m_oProperty.m_nGutterWidth;
oReader.m_oCurSectionProp.m_bSwitchMargin = oDocument.m_oProperty.m_bFacingPage;
oReader.m_oCurSectionProp.m_bLandscapeFormat = oDocument.m_oProperty.m_bLandScape;
oReader.m_oCurSectionProp.m_nPageWidth = oDocument.m_oProperty.m_nPaperWidth;
oReader.m_oCurSectionProp.m_nPageHeight = oDocument.m_oProperty.m_nPaperHeight;
oReader.m_oCurSectionProp.m_nMarginLeft = oDocument.m_oProperty.m_nMarginLeft;
oReader.m_oCurSectionProp.m_nMarginRight = oDocument.m_oProperty.m_nMarginRight;
oReader.m_oCurSectionProp.m_nMarginTop = oDocument.m_oProperty.m_nMarginTop;
oReader.m_oCurSectionProp.m_nMarginBottom = oDocument.m_oProperty.m_nMarginBottom;
oReader.m_oCurSectionProp.m_nGutterMarginWidth = oDocument.m_oProperty.m_nGutterWidth;
oReader.m_oCurSectionProp.m_bSwitchMargin = oDocument.m_oProperty.m_bFacingPage;
oReader.m_oCurSectionProp.m_bLandscapeFormat = oDocument.m_oProperty.m_bLandScape;
}
};
......@@ -90,7 +90,6 @@ public:
}
}
}
m_poDocument->RemoveItem(0);
_section last_section;
m_poDocument->GetItem(last_section);
......@@ -112,6 +111,8 @@ public:
m_poDocument->AddItem( section );
}
m_poDocument->RemoveItem(0);
for (int sect = 0 ; sect < m_poDocument->GetCount(); sect++)
{
m_oTextItemReader.m_oTextItems = m_poDocument->m_aArray[sect].props;
......
......@@ -163,9 +163,11 @@ CString RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
{
int nID = poDocument->m_oIdGenerator.Generate_FootnoteNumber();
OOXFootnoteWriter* poFootnoteWriter = static_cast<OOXFootnoteWriter*>( poOOXWriter->m_poFootnoteWriter );
RenderParameter oNewParameter = oRenderParameter;
oNewParameter.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
oNewParameter.poRels = poFootnoteWriter->m_oRelsWriter.get();
oNewParameter.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
oNewParameter.poRels = poFootnoteWriter->m_oRelsWriter.get();
poFootnoteWriter->AddFootnote( _T(""), nID, m_oContent->RenderToOOX(oNewParameter) );
sResult += _T("<w:r>");
......
......@@ -45,80 +45,79 @@ const long g_cdMaxPercent = 1000000;
//#define RTF_MATH_OOX
#define ELEMENT_UNDEFINED 0x001;
#define ELEMENT_OOXFIELD 0x010;
#define TYPE_UNKNOWN 0
#define TYPE_RTF_DOCUMENT 1
#define TYPE_RTF_PARAGRAPH 2
#define TYPE_RTF_BOOKMARKSTART 3
#define TYPE_RTF_BOOKMARKEND 4
#define TYPE_RTF_CHAR 5
#define TYPE_RTF_FIELD 6
#define TYPE_RTF_MATH 7
#define TYPE_RTF_PICTURE 8
#define TYPE_RTF_PROPERTY_DOCUMENT 9
#define TYPE_RTF_PROPERTY_SECTION 10
#define TYPE_RTF_FONT 11
#define TYPE_RTF_PROPERTY_SHADING 13
#define ELEMENT_UNDEFINED 0x001;
#define ELEMENT_OOXFIELD 0x010;
#define TYPE_UNKNOWN 0
#define TYPE_RTF_DOCUMENT 1
#define TYPE_RTF_PARAGRAPH 2
#define TYPE_RTF_BOOKMARKSTART 3
#define TYPE_RTF_BOOKMARKEND 4
#define TYPE_RTF_CHAR 5
#define TYPE_RTF_FIELD 6
#define TYPE_RTF_MATH 7
#define TYPE_RTF_PICTURE 8
#define TYPE_RTF_PROPERTY_DOCUMENT 9
#define TYPE_RTF_PROPERTY_SECTION 10
#define TYPE_RTF_FONT 11
#define TYPE_RTF_PROPERTY_SHADING 13
#define TYPE_RTF_PROPERTY_SHADING_PARAGRAPH 14
#define TYPE_RTF_PROPERTY_SHADING_CHAR 15
#define TYPE_RTF_PROPERTY_SHADING_CELL 16
#define TYPE_RTF_PROPERTY_SHADING_ROW 17
#define TYPE_RTF_PROPERTY_SHADING_TABLESTYLE 18
#define TYPE_RTF_PROPERTY_BORDER 19
#define TYPE_RTF_PROPERTY_STYLE_CHAR 21
#define TYPE_RTF_PROPERTY_SHADING_CHAR 15
#define TYPE_RTF_PROPERTY_SHADING_CELL 16
#define TYPE_RTF_PROPERTY_SHADING_ROW 17
#define TYPE_RTF_PROPERTY_SHADING_TABLESTYLE 18
#define TYPE_RTF_PROPERTY_BORDER 19
#define TYPE_RTF_PROPERTY_STYLE_CHAR 21
#define TYPE_RTF_PROPERTY_STYLE_PARAGRAPH 22
#define TYPE_RTF_PROPERTY_STYLE_TABLE 22
#define TYPE_RTF_SECTION 23
#define TYPE_RTF_TABLE 24
#define TYPE_RTF_TABLE_CELL 25
#define TYPE_RTF_PROPERTY_CHAR 26
#define TYPE_RTF_PROPERTY_STYLE 27
#define TYPE_RTF_TABLE_ROW 28
#define TYPE_RTF_OLE 29
#define TYPE_OOX_FIELD 29
#define TYPE_RTF_FOOTNOTE 30
#define RENDER_TO_OOX_PARAM_UNKNOWN 0
#define RENDER_TO_OOX_PARAM_LAST 1
#define RENDER_TO_OOX_PARAM_RUN 2
#define RENDER_TO_OOX_PARAM_PLAIN 3
#define RENDER_TO_OOX_PARAM_TEXT 4
#define RENDER_TO_OOX_PARAM_MATH 5
#define RENDER_TO_OOX_PARAM_NESTED 6
#define RENDER_TO_OOX_PARAM_FONTTABLE 7
#define RENDER_TO_OOX_PARAM_MAJOR_FONT 10
#define RENDER_TO_OOX_PARAM_MINOR_FONT 11
#define RENDER_TO_OOX_PARAM_CORE 12
#define RENDER_TO_OOX_PARAM_APP 13
#define RENDER_TO_OOX_PARAM_COLOR_VALUE 14
#define RENDER_TO_OOX_PARAM_COLOR_ATTRIBUTE 15
#define RENDER_TO_OOX_PARAM_COLOR_TAG 16
#define RENDER_TO_OOX_PARAM_NUMBERING 17
#define RENDER_TO_OOX_PARAM_STYLES 18
#define RENDER_TO_OOX_PARAM_BORDER_ATTRIBUTE 19
#define RENDER_TO_OOX_PARAM_BORDER_TAG 20
#define RENDER_TO_OOX_PARAM_SHAPE_WSHAPE 22
#define RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2 23
#define RENDER_TO_OOX_PARAM_FIRST_SECTION 24
#define RENDER_TO_OOX_PARAM_OLE_ONLY 25
#define RENDER_TO_OOX_PARAM_OLDLIST_ABS 26
#define RENDER_TO_OOX_PARAM_OLDLIST_OVR 27
#define RENDER_TO_RTF_PARAM_UNKNOWN 0
#define RENDER_TO_RTF_PARAM_CHAR 1
#define RENDER_TO_RTF_PARAM_NO_PAR 2
#define RENDER_TO_RTF_PARAM_PAR 3
#define RENDER_TO_RTF_PARAM_NESTED 4
#define RENDER_TO_RTF_PARAM_PLAIN 5
#define RENDER_TO_RTF_PARAM_NO_SECT 6
#define RENDER_TO_RTF_PARAM_FONT_TBL 7
#define RENDER_TO_RTF_PARAM_COLOR_TBL 8
#define RENDER_TO_RTF_PARAM_NO_WROWD 9
#define TYPE_RTF_PROPERTY_STYLE_TABLE 22
#define TYPE_RTF_SECTION 23
#define TYPE_RTF_TABLE 24
#define TYPE_RTF_TABLE_CELL 25
#define TYPE_RTF_PROPERTY_CHAR 26
#define TYPE_RTF_PROPERTY_STYLE 27
#define TYPE_RTF_TABLE_ROW 28
#define TYPE_RTF_OLE 29
#define TYPE_OOX_FIELD 29
#define TYPE_RTF_FOOTNOTE 30
#define RENDER_TO_OOX_PARAM_UNKNOWN 0
#define RENDER_TO_OOX_PARAM_LAST 1
#define RENDER_TO_OOX_PARAM_RUN 2
#define RENDER_TO_OOX_PARAM_PLAIN 3
#define RENDER_TO_OOX_PARAM_TEXT 4
#define RENDER_TO_OOX_PARAM_MATH 5
#define RENDER_TO_OOX_PARAM_NESTED 6
#define RENDER_TO_OOX_PARAM_FONTTABLE 7
#define RENDER_TO_OOX_PARAM_MAJOR_FONT 10
#define RENDER_TO_OOX_PARAM_MINOR_FONT 11
#define RENDER_TO_OOX_PARAM_CORE 12
#define RENDER_TO_OOX_PARAM_APP 13
#define RENDER_TO_OOX_PARAM_COLOR_VALUE 14
#define RENDER_TO_OOX_PARAM_COLOR_ATTRIBUTE 15
#define RENDER_TO_OOX_PARAM_COLOR_TAG 16
#define RENDER_TO_OOX_PARAM_NUMBERING 17
#define RENDER_TO_OOX_PARAM_STYLES 18
#define RENDER_TO_OOX_PARAM_BORDER_ATTRIBUTE 19
#define RENDER_TO_OOX_PARAM_BORDER_TAG 20
#define RENDER_TO_OOX_PARAM_SHAPE_WSHAPE 22
#define RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2 23
#define RENDER_TO_OOX_PARAM_FIRST_SECTION 24
#define RENDER_TO_OOX_PARAM_OLE_ONLY 25
#define RENDER_TO_OOX_PARAM_OLDLIST_ABS 26
#define RENDER_TO_OOX_PARAM_OLDLIST_OVR 27
#define RENDER_TO_RTF_PARAM_UNKNOWN 0
#define RENDER_TO_RTF_PARAM_CHAR 1
#define RENDER_TO_RTF_PARAM_NO_PAR 2
#define RENDER_TO_RTF_PARAM_PAR 3
#define RENDER_TO_RTF_PARAM_NESTED 4
#define RENDER_TO_RTF_PARAM_PLAIN 5
#define RENDER_TO_RTF_PARAM_NO_SECT 6
#define RENDER_TO_RTF_PARAM_FONT_TBL 7
#define RENDER_TO_RTF_PARAM_COLOR_TBL 8
#define RENDER_TO_RTF_PARAM_NO_WROWD 9
......
......@@ -43,6 +43,7 @@ RtfDocument::RtfDocument()
{
RtfSectionPtr s(new RtfSection());
_section section(s, 0, 0);
m_aArray.push_back( section );
m_oProperty.SetDefaultOOX();
......
......@@ -68,8 +68,8 @@ typedef boost::shared_ptr<RtfOldList> RtfOldListPtr;
class RtfParagraph : public ITextItem, public ItemContainer< IDocumentElementPtr >
{
public:
RtfParagraphProperty m_oProperty;
RtfOldListPtr m_oOldList;
RtfParagraphProperty m_oProperty;
RtfOldListPtr m_oOldList;
int GetType( )
{
......@@ -163,6 +163,17 @@ public:
}
else
{
CString ParagraphContent;// todooo проследить за вложенными объектами (inset fields) - св-ва секций
// нужно чтобы были в последнем параграфе!!! - так что и начнем с него - Australia Electronic Transactions Act 1999.rtf
RenderParameter oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_RUN;
for( int i = m_aArray.size() - 1; i >= 0; i-- )
{
ParagraphContent = m_aArray[i]->RenderToOOX(oNewParam) + ParagraphContent;
}
bool bCanConvertToNumbering = false;
if( NULL != m_oOldList )
bCanConvertToNumbering = m_oOldList->CanConvertToNumbering();
......@@ -190,7 +201,7 @@ public:
if( NULL != m_oOldList->m_oText )
oCharProp.m_nFont = m_oOldList->m_oText->m_oProperty.m_oCharProperty.m_nFont;
RenderParameter oNewParam = oRenderParameter;
oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_TEXT;
for( int i = 0; i < m_oOldList->m_oText->GetCount(); i++ )
......@@ -206,13 +217,8 @@ public:
}
}
RenderParameter oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_RUN;
for( int i = 0; i < (int)m_aArray.size(); i++ )
{
sResult += m_aArray[i]->RenderToOOX(oNewParam);
}
sResult += ParagraphContent;
sResult += _T("</w:p>");
}
return sResult;
......
......@@ -1202,14 +1202,14 @@ CString RtfParagraphStyle::RenderToOOX(RenderParameter oRenderParameter)
if( false == sParProp.IsEmpty() )
{
sResult += _T("<w:pPr>");
sResult += sParProp;
sResult += sParProp;
sResult += _T("</w:pPr>");
}
CString sCharProp = m_oCharProp.RenderToOOX(oRenderParameter);
if( false == sCharProp.IsEmpty() )
{
sResult += _T("<w:rPr>");
sResult += sCharProp;
sResult += sCharProp;
sResult += _T("</w:rPr>");
}
sResult += RenderToOOXEnd( oRenderParameter ) ;
......@@ -1321,35 +1321,35 @@ CString RtfTableStyle::RenderToOOX(RenderParameter oRenderParameter)
if( false == sTablProp.IsEmpty() )
{
sResult += _T("<w:tblPr>");
sResult += sTablProp;
sResult += sTablProp;
sResult += _T("</w:tblPr>");
}
CString sRowProp = m_oRowProp.RenderToOOX(oRenderParameter);
if( false == sRowProp.IsEmpty() )
{
sResult += _T("<w:trPr>");
sResult += sRowProp;
sResult += sRowProp;
sResult += _T("</w:trPr>");
}
CString sCellProp = m_oCellProp.RenderToOOX(oRenderParameter);
if( false == sCellProp.IsEmpty() )
{
sResult += _T("<w:tcPr>");
sResult += sCellProp;
sResult += sCellProp;
sResult += _T("</w:tcPr>");
}
CString sParProp = m_oParProp.RenderToOOX(oRenderParameter);
if( false == sParProp.IsEmpty() )
{
sResult += _T("<w:pPr>");
sResult += sParProp;
sResult += sParProp;
sResult += _T("</w:pPr>");
}
CString sCharProp = m_oCharProp.RenderToOOX(oRenderParameter);
if( false == sCharProp.IsEmpty() )
{
sResult += _T("<w:rPr>");
sResult += sCharProp;
sResult += sCharProp;
sResult += _T("</w:rPr>");
}
......@@ -1447,14 +1447,14 @@ CString RtfTableStyle::RenderToOOX(RenderParameter oRenderParameter)
if( false == sParProp.IsEmpty() )
{
sResult += _T("<w:pPr>");
sResult += sParProp;
sResult += sParProp;
sResult += _T("</w:pPr>");
}
CString sCharProp = m_oCharProp.RenderToOOX(oRenderParameter);
if( false == sCharProp.IsEmpty() )
{
sResult += _T("<w:rPr>");
sResult += sCharProp;
sResult += sCharProp;
sResult += _T("</w:rPr>");
}
sResult += _T("</w:tblStylePr>") ;
......@@ -1868,8 +1868,8 @@ CString RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter)
}
CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
{
RtfDocument* poRtfDocument = static_cast<RtfDocument*>(oRenderParameter.poDocument);
OOXWriter* poOOXWriter = static_cast<OOXWriter*>(oRenderParameter.poWriter);
RtfDocument* poRtfDocument = static_cast<RtfDocument*> (oRenderParameter.poDocument);
OOXWriter* poOOXWriter = static_cast<OOXWriter*> (oRenderParameter.poWriter);
CString sResult;
if( PROP_DEF != m_nStyle )
......@@ -1882,21 +1882,13 @@ CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
sResult += _T("\"/>") ;
}
}
if ( 0 == m_bAutoHyphenation ) sResult += _T("<w:suppressAutoHyphens/>");
else if ( 1 == m_bAutoHyphenation ) sResult += _T("<w:suppressAutoHyphens w:val=\"false\"/>");
_section section;
if(true == poRtfDocument->GetItem( section ) )
{
sResult += section.props->RenderToOOX(oRenderParameter);
section.props->m_bFinalize = false;
}
if( 0 == m_bAutoHyphenation ) sResult += _T("<w:suppressAutoHyphens/>");
else if( 1 == m_bAutoHyphenation ) sResult += _T("<w:suppressAutoHyphens w:val=\"false\"/>");
RENDER_OOX_BOOL( m_bKeep, sResult, _T("w:keepLines") );
RENDER_OOX_BOOL( m_bKeepNext, sResult, _T("w:keepNext") );
RENDER_OOX_INT( m_nOutlinelevel, sResult, _T("w:outlineLvl") );
RENDER_OOX_BOOL( m_bPageBB, sResult, _T("w:pageBreakBefore") );
RENDER_OOX_BOOL ( m_bKeep , sResult, _T("w:keepLines") );
RENDER_OOX_BOOL ( m_bKeepNext , sResult, _T("w:keepNext") );
RENDER_OOX_INT ( m_nOutlinelevel , sResult, _T("w:outlineLvl") );
RENDER_OOX_BOOL ( m_bPageBB , sResult, _T("w:pageBreakBefore") );
switch(m_eAlign)
......@@ -1947,12 +1939,12 @@ CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
if( PROP_DEF == m_nSpaceAfter ) m_nSpaceAfter = 0;
//if( PROP_DEF == m_nSpaceBefore ) m_nSpaceBefore = 0;
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBefore, sSpacing, _T("w:before") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfter, sSpacing, _T("w:after") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBeforeAuto, sSpacing, _T("w:beforeAutospacing") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfterAuto, sSpacing, _T("w:afterAutospacing") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBeforeLine, sSpacing, _T("w:beforeLines") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfterLine, sSpacing, _T("w:afterLines") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBefore, sSpacing, _T("w:before") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfter, sSpacing, _T("w:after") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBeforeAuto, sSpacing, _T("w:beforeAutospacing") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfterAuto, sSpacing, _T("w:afterAutospacing") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceBeforeLine, sSpacing, _T("w:beforeLines") );
RENDER_OOX_INT_ATTRIBUTE( m_nSpaceAfterLine, sSpacing, _T("w:afterLines") );
if( PROP_DEF != m_nSpaceBetween && 0 != m_nSpaceBetween )
{
......@@ -2024,7 +2016,7 @@ CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
}
if( true == m_oBorderRight.IsValid() )
{
sBorder += _T("<w:right "); sBorder += m_oBorderRight.RenderToOOX(oNewParam); sBorder += _T(" />");
sBorder += _T("<w:right "); sBorder += m_oBorderRight.RenderToOOX(oNewParam); sBorder += _T(" />");
}
}
......
......@@ -33,7 +33,6 @@
#include "Basic.h"
#include "Utils.h"
#include "RtfDefine.h"
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Drawing.h"
......@@ -1823,61 +1822,63 @@ public:
typedef enum{hr_none,
hr_phmrg, //\tphmrg Use margin as horizontal reference frame.
hr_phpg, //tphpg Use page as horizontal reference frame.
hr_phcol//tphcol Use column as horizontal reference frame. This is the default if no horizontal table positioning information is given.
hr_phcol //tphcol Use column as horizontal reference frame. This is the default if no horizontal table positioning information is given.
} HRef;
typedef enum{vr_none,
vr_pvmrg, //tpvmrg Position table vertically relative to the top margin. This is the default if no vertical table positioning information is given.
vr_pvpg, //tpvpg Position table vertically relative to the top of the page.
vr_pvpara//tpvpara Position table vertically relative to the upper left corner of the next unframed paragraph in the stream.
vr_pvpg, //tpvpg Position table vertically relative to the top of the page.
vr_pvpara //tpvpara Position table vertically relative to the upper left corner of the next unframed paragraph in the stream.
} VRef;
typedef enum{hp_none,
hp_posxc, //tposxc Center table within the horizontal reference frame.
hp_posxi, //tposxi Position table inside the horizontal reference frame.
hp_posxo, //tposxo Position table outside the horizontal reference frame.
hp_posxl, //tposxl Position table at the left of the horizontal reference frame.
hp_posxr //tposxr Position table at the right of the horizontal reference frame.
hp_posxr //tposxr Position table at the right of the horizontal reference frame.
} HPos;
typedef enum{vp_none,
vp_posyt, //tposyt Position table at the top of the vertical reference frame.
vp_posyt, //tposyt Position table at the top of the vertical reference frame.
vp_posyil, //tposyil Position table to be inline.
vp_posyb, //tposyb Position table at the bottom of the vertical reference frame.
vp_posyc, //tposyc Center table within the vertical reference frame
vp_posyb, //tposyb Position table at the bottom of the vertical reference frame.
vp_posyc, //tposyc Center table within the vertical reference frame
vp_posyin, //tposyin Position table inside within the vertical reference frame.
vp_posyout//tposyout Position table outside within the vertical reference frame.
vp_posyout //tposyout Position table outside within the vertical reference frame.
} VPos;
int m_bBidi; //taprtl Table direction is right to left.
int m_nAutoFit; //trautofitN AutoFit:0 No AutoFit (default).1 AutoFit is on for the row. Overridden by \clwWidthN and \trwWidthN in any table row
int m_nGraph; //trgaphN Half the space between the cells of a table row in twips.
int m_bBidi; //taprtl Table direction is right to left.
int m_nAutoFit; //trautofitN AutoFit:0 No AutoFit (default).1 AutoFit is on for the row. Overridden by \clwWidthN and \trwWidthN in any table row
int m_nGraph; //trgaphN Half the space between the cells of a table row in twips.
int nTableIndent; //tblindN
int nTableIndentUnits; //\tblindtypeN
int nTableIndentUnits; //\tblindtypeN
typedef enum{rj_none,
rj_trql, //trql Left-justifies a table row with respect to its containing column.
rj_trqr, //trqr Right-justifies a table row with respect to its containing column.
rj_trqc //trqc Centers a table row with respect to its containing column.
} RowJust;
RowJust m_eJust; //
typedef enum
{
rj_none,
rj_trql, //trql Left-justifies a table row with respect to its containing column.
rj_trqr, //trqr Right-justifies a table row with respect to its containing column.
rj_trqc //trqc Centers a table row with respect to its containing column.
} RowJust;
RowJust m_eJust;
int m_nWrapLeft; //tdfrmtxtLeftN Distance in twips, between the left of the table and surrounding text (default is 0).
int m_nWrapRight; //tdfrmtxtRightN Distance in twips, between the right of the table and surrounding text (default is 0).
int m_nWrapTop; //tdfrmtxtTopN Distance in twips, between the top of the table and surrounding text (default is 0).
int m_nWrapTop; //tdfrmtxtTopN Distance in twips, between the top of the table and surrounding text (default is 0).
int m_nWrapBottom; //tdfrmtxtBottomN Distance in twips, between the bottom of the table and surrounding text (default is 0).
int m_bOverlap; //tabsnoovrlp Do not allow table to overlap with other tables or shapes with similar wrapping not contained within it.
int m_bOverlap; //tabsnoovrlp Do not allow table to overlap with other tables or shapes with similar wrapping not contained within it.
HRef m_eHRef;
VRef m_eVRef;
HPos m_eHPos;
int m_nHPos; //tposxN Position table N twips from the left edge of the horizontal reference frame.
int m_nHPos; //tposxN Position table N twips from the left edge of the horizontal reference frame.
VPos m_eVPos;
int m_nVPos; //tposyN Position table N twips from the top edge of the vertical reference frame.
int m_nVPos; //tposyN Position table N twips from the top edge of the vertical reference frame.
int m_nLeft;
int m_nWidth; //trwWidthN Preferred row width. Overrides \trautofitN.
int m_nWidth; //trwWidthN Preferred row width. Overrides \trautofitN.
MetricUnits m_eMUWidth; //trftsWidthN Units for \trwWidthN:
int m_nDefCellMarBottom; //trpaddbN Default bottom cell margin or padding for the row.
int m_nDefCellMarBottom; //trpaddbN Default bottom cell margin or padding for the row.
int m_nDefCellMarLeft; //trpaddlN Default left cell margin or padding for the row.
int m_nDefCellMarRight; //trpaddrN Default right cell margin or padding for the row.
int m_nDefCellMarTop; //trpaddtN Default top cell margin or padding for the row.
......@@ -2586,6 +2587,7 @@ class RtfParagraphProperty: public IRenderableProperty
{
public:
bool m_bOldList;
//-------------------------------------------------------------------
int m_bAutoHyphenation; //hyphpar Switches automatic hyphenation for the paragraph. Append 1 or nothing to toggle property on; append 0 to turn it off.
int m_bInTable; //intbl Paragraph is part of a table.
......@@ -2599,14 +2601,14 @@ public:
typedef enum
{
pa_none,
pa_qc, //qc Centered.
pa_qj, //qj Justified.
pa_ql, //ql Left-aligned (the default).
pa_qr, //qr Right-aligned.
pa_qd, //qd Distributed.
pa_qk0, //qkN Percentage of line occupied by Kashida justification (0 – low, 10 – medium, 20 – high).
pa_qk10, //
pa_qk20, //
pa_qc, //qc Centered.
pa_qj, //qj Justified.
pa_ql, //ql Left-aligned (the default).
pa_qr, //qr Right-aligned.
pa_qd, //qd Distributed.
pa_qk0, //qkN Percentage of line occupied by Kashida justification (0 – low, 10 – medium, 20 – high).
pa_qk10,
pa_qk20,
} ParagraphAlign;
ParagraphAlign m_eAlign;
......@@ -2614,88 +2616,90 @@ public:
typedef enum
{
fa_none,
fa_faauto, //faauto Font alignment. The default setting for this is "Auto."
fa_fahang, //fahang Font alignment: Hanging.
fa_facenter, //facenter Font alignment: Center.
fa_faroman, //faroman Font alignment: Roman (default).
fa_favar, //favar Font alignment: Upholding variable.
fa_fafixed, //fafixed Font alignment: Upholding fixed.
fa_faauto, //faauto Font alignment. The default setting for this is "Auto."
fa_fahang, //fahang Font alignment: Hanging.
fa_facenter, //facenter Font alignment: Center.
fa_faroman, //faroman Font alignment: Roman (default).
fa_favar, //favar Font alignment: Upholding variable.
fa_fafixed, //fafixed Font alignment: Upholding fixed.
} FontAlign;
FontAlign m_eFontAlign;
int m_nIndFirstLine; //fiN First-line indent in twips (default is 0).
int m_nIndLeft; //liN Left indent in twips (default is 0).
int m_nIndRight; //riN Right indent in twips (default is 0).
int m_nIndStart; //linN Left indent for left-to-right paragraphs; right indent for right-to-left paragraphs (default is 0). \linN defines space before the paragraph.
int m_nIndEnd; //rinN Right indent for left-to-right paragraphs; left indent for right-to-left paragraphs (default is 0). \rinN defines space after the paragraph.
int m_nIndLeft; //liN Left indent in twips (default is 0).
int m_nIndRight; //riN Right indent in twips (default is 0).
int m_nIndStart; //linN Left indent for left-to-right paragraphs; right indent for right-to-left paragraphs (default is 0). \linN defines space before the paragraph.
int m_nIndEnd; //rinN Right indent for left-to-right paragraphs; left indent for right-to-left paragraphs (default is 0). \rinN defines space after the paragraph.
int m_bIndRightAuto; //adjustright Automatically adjust right indent when document grid is defined.
int m_bIndMirror; //indmirror...
int m_bIndMirror; //indmirror...
int m_nSpaceBefore; //sbN Space before in twips (default is 0).
int m_nSpaceAfter; //saN Space after in twips (default is 0).
int m_nSpaceBefore; //sbN Space before in twips (default is 0).
int m_nSpaceAfter; //saN Space after in twips (default is 0).
int m_nSpaceBeforeAuto; //sbautoN Auto spacing before:
int m_nSpaceAfterAuto; //saautoN Auto spacing after:
int m_nSpaceBeforeLine; //lisbN Space before in hundredths of a character unit. Overrides \sbN, although they should both be emitted with equivalent values.
int m_nSpaceAfterLine; //lisaN Space after in hundredths of a character unit. Overrides \saN, although they should both be emitted with equivalent values.
int m_nSpaceBetween; //slN Space between lines. If this control word is missing or if \sl0 is used, the line spacing is automatically determined by the tallest character in the line. If N is a positive value, this size is used only if it is taller than the tallest character (otherwise, the tallest character is used); if N is a negative value, the absolute value of N is used, even if it is shorter than the tallest character.
int m_nSpaceMultiLine; //slmultN
int m_bContextualSpacing; //contextualspace
int m_bContextualSpacing; //contextualspace
int m_bRtl; //rtlpar Text in this paragraph will display with right-to-left precedence.
int m_bNoWordWrap; //nowwrap
int m_bSnapToGrid; //nosnaplinegrid Disable snap line to grid.
int m_bRtl; //rtlpar Text in this paragraph will display with right-to-left precedence.
int m_bNoWordWrap; //nowwrap
int m_bSnapToGrid; //nosnaplinegrid Disable snap line to grid.
typedef enum {tbw_none,
tbw_txbxtwno, //txbxtwno
tbw_txbxtwalways, //txbxtwalways
tbw_txbxtwno, //txbxtwno
tbw_txbxtwalways, //txbxtwalways
tbw_txbxtwfirstlast, //txbxtwfirstlast
tbw_txbxtwfirst, //txbxtwfirst
tbw_txbxtwlast, //txbxtwlast
tbw_txbxtwfirst, //txbxtwfirst
tbw_txbxtwlast, //txbxtwlast
} TextBoxWrap;
TextBoxWrap m_eTextBoxWrap; //1
int m_nListId; //lsN Should exactly match the \lsN for one of the list overrides in the List Override table.
int m_nListLevel; //ilvlN The 0-based level of the list to which the paragraph belongs. For all simple lists, N should always be 0. For multilevel lists, it can be 0 through 8. The value 9 is never used. The values 10 through 12 have the special meanings for documents generated by Word 6: 10 = ilvlBullet (a bulleted paragraph in Word 6), 11 = ilvlList (a numbered paragraph in Word 6), 12 = ilvlContinue (a paragraph that was not itself numbered, but took its indenting scheme from its numbering properties and did not “break” numbering (that in Word 6 required otherwise contiguous paragraphs).
RtfShadingPar m_oShading; //
RtfBorder m_oBorderTop; //
RtfBorder m_oBorderLeft; //
RtfBorder m_oBorderBottom; //
RtfBorder m_oBorderRight; //
RtfBorder m_oBorderBox; //
RtfBorder m_oBorderBar; //
RtfFrame m_oFrame; //
int m_bOverlap; //1\absnoovrlpN Allow overlap with other frames or objects with similar wrapping:
typedef enum{tf_none,
tf_frmtxlrtb, //frmtxlrtb Frame box flows from left to right and top to bottom (default).
tf_frmtxtbrl, //frmtxtbrl Frame box flows right to left and top to bottom.
tf_frmtxbtlr, //frmtxbtlr Frame box flows left to right and bottom to top.
tf_frmtxlrtbv, //frmtxlrtbv Frame box flows left to right and top to bottom, vertical.
tf_frmtxtbrlv //frmtxtbrlv Frame box flows top to bottom and right to left, vertical.
} TextFollow;
TextFollow m_eTextFollow;
RtfTabs m_oTabs;
TextBoxWrap m_eTextBoxWrap; //1
int m_nListId; //lsN Should exactly match the \lsN for one of the list overrides in the List Override table.
int m_nListLevel; //ilvlN The 0-based level of the list to which the paragraph belongs. For all simple lists, N should always be 0. For multilevel lists, it can be 0 through 8. The value 9 is never used. The values 10 through 12 have the special meanings for documents generated by Word 6: 10 = ilvlBullet (a bulleted paragraph in Word 6), 11 = ilvlList (a numbered paragraph in Word 6), 12 = ilvlContinue (a paragraph that was not itself numbered, but took its indenting scheme from its numbering properties and did not “break” numbering (that in Word 6 required otherwise contiguous paragraphs).
RtfShadingPar m_oShading;
RtfBorder m_oBorderTop;
RtfBorder m_oBorderLeft;
RtfBorder m_oBorderBottom;
RtfBorder m_oBorderRight;
RtfBorder m_oBorderBox;
RtfBorder m_oBorderBar;
RtfFrame m_oFrame;
int m_bOverlap; //1\absnoovrlpN Allow overlap with other frames or objects with similar wrapping:
typedef enum
{
tf_none,
tf_frmtxlrtb, //frmtxlrtb Frame box flows from left to right and top to bottom (default).
tf_frmtxtbrl, //frmtxtbrl Frame box flows right to left and top to bottom.
tf_frmtxbtlr, //frmtxbtlr Frame box flows left to right and bottom to top.
tf_frmtxlrtbv, //frmtxlrtbv Frame box flows left to right and top to bottom, vertical.
tf_frmtxtbrlv //frmtxtbrlv Frame box flows top to bottom and right to left, vertical.
} TextFollow;
TextFollow m_eTextFollow;
RtfTabs m_oTabs;
//Table Style Specific
int m_nTableStyle; //\ytsN Designates the table style handle that was applied to the row/cell.
int m_nTableStyle; //\ytsN Designates the table style handle that was applied to the row/cell.
int m_bStyleFirstRow; //\tscfirstrow This cell is in the first row.
int m_bStyleLastRow; //\tsclastrow This cell is in the last row.
int m_bStyleFirstCollumn; //\tscfirstcol This cell is in the first column.
int m_bStyleLastCollumn; //\tsclastcol This cell is in the last column.
int m_bStyleFirstCollumn; //\tscfirstcol This cell is in the first column.
int m_bStyleLastCollumn; //\tsclastcol This cell is in the last column.
int m_bStyleOddRowBand; //\tscbandhorzodd This cell is in the odd row band.
int m_bStyleEvenRowBand; //\tscbandhorzeven This cell is in the even row band.
int m_bStyleEvenRowBand; //\tscbandhorzeven This cell is in the even row band.
int m_bStyleOddColBand; //\tscbandvertodd This cell is in the odd column band.
int m_bStyleEvenColBand; //\tscbandverteven This cell is in the even column band.
int m_bStyleNWCell; //\tscnwcell This is the NW (north west) cell in the table (upper left).
int m_bStyleNECell; //\tscnecell NE cell.
int m_bStyleSWCell; //\tscswcell SW cell.
int m_bStyleSECell; //\tscsecell SE cell.
int m_bStyleEvenColBand; //\tscbandverteven This cell is in the even column band.
int m_bStyleNWCell; //\tscnwcell This is the NW (north west) cell in the table (upper left).
int m_bStyleNECell; //\tscnecell NE cell.
int m_bStyleSWCell; //\tscswcell SW cell.
int m_bStyleSECell; //\tscsecell SE cell.
RtfCharProperty m_oCharProperty;
//--------------------------------------------------------------------------------------------------------------
RtfParagraphProperty()
{
SetDefault();
......
......@@ -508,108 +508,114 @@ public:
SetDefault();
//footer - header
m_oHeaderLeft = TextItemContainerPtr();
m_oHeaderFirst = TextItemContainerPtr();
m_oHeaderRight = TextItemContainerPtr();
m_oFooterLeft = TextItemContainerPtr();
m_oFooterFirst = TextItemContainerPtr();
m_oFooterRight = TextItemContainerPtr();
m_oHeaderLeft = TextItemContainerPtr();
m_oHeaderFirst = TextItemContainerPtr();
m_oHeaderRight = TextItemContainerPtr();
m_oFooterLeft = TextItemContainerPtr();
m_oFooterFirst = TextItemContainerPtr();
m_oFooterRight = TextItemContainerPtr();
}
int GetType()
{
return TYPE_RTF_PROPERTY_SECTION;
}
void SetDefaultRtf()
{
SetDefault();
m_nColumnSpace = 720;
DEFAULT_PROPERTY_DEF( m_eSectionBreak, sb_sbkpage )
DEFAULT_PROPERTY_DEF( m_nColumnSpace, 720);
}
void SetDefaultOOX()
{
SetDefault();
m_nPageWidth = 11906;
m_nPageHeight = 16838;
m_nMarginLeft = 210;
m_nMarginRight = 215;
m_nMarginTop = 204;
m_nMarginBottom = 204;
m_nPageWidth = 11906;
m_nPageHeight = 16838;
m_nHeaderTop = 709;
m_nFooterBottom = 709;
m_nGutterMarginWidth = 0;
m_nMarginLeft = 210;
m_nMarginRight = 215;
m_nMarginTop = 204;
m_nMarginBottom = 204;
m_nColumnSpace = 708;
m_nHeaderTop = 709;
m_nFooterBottom = 709;
m_nGutterMarginWidth = 0;
m_nColumnSpace = 708;
}
void SetDefault()
{
DEFAULT_PROPERTY( m_bBidi )
DEFAULT_PROPERTY( m_nPaperSourceFirst )
DEFAULT_PROPERTY( m_nPaperSourceOther )
DEFAULT_PROPERTY( m_bRtlGutter )
DEFAULT_PROPERTY( m_bEndnotes )
DEFAULT_PROPERTY( m_nStyle )
DEFAULT_PROPERTY ( m_bBidi )
DEFAULT_PROPERTY ( m_nPaperSourceFirst )
DEFAULT_PROPERTY ( m_nPaperSourceOther )
DEFAULT_PROPERTY ( m_bRtlGutter )
DEFAULT_PROPERTY ( m_bEndnotes )
DEFAULT_PROPERTY ( m_nStyle )
DEFAULT_PROPERTY_DEF( m_eSectionBreak, sb_none )
//Columns
m_nColumnNumber = 1;
DEFAULT_PROPERTY( m_nColumnSpace )
DEFAULT_PROPERTY( m_bColumnLineBetween )
DEFAULT_PROPERTY ( m_nColumnSpace )
DEFAULT_PROPERTY ( m_bColumnLineBetween )
m_oCollumnProperty.m_aCollumnProperty.resize( m_nColumnNumber );
//Footnotes and Endnotes
DEFAULT_PROPERTY_DEF( m_eFootnotesJust, fj_none )
DEFAULT_PROPERTY( m_nFootnotesStart )
DEFAULT_PROPERTY_DEF( m_eFootnotesRestart, fr_none )
DEFAULT_PROPERTY_DEF( m_eFootnotesFormat, ff_none )
DEFAULT_PROPERTY( m_nEndnotesStart )
DEFAULT_PROPERTY_DEF( m_eEndnotesRestart, er_none )
DEFAULT_PROPERTY_DEF( m_eEndnotesFormat, ef_none )
DEFAULT_PROPERTY_DEF( m_eFootnotesJust, fj_none )
DEFAULT_PROPERTY ( m_nFootnotesStart )
DEFAULT_PROPERTY_DEF( m_eFootnotesRestart, fr_none )
DEFAULT_PROPERTY_DEF( m_eFootnotesFormat, ff_none )
DEFAULT_PROPERTY ( m_nEndnotesStart )
DEFAULT_PROPERTY_DEF( m_eEndnotesRestart, er_none )
DEFAULT_PROPERTY_DEF( m_eEndnotesFormat, ef_none )
//Line Numbering
DEFAULT_PROPERTY( m_nLineModulus )
DEFAULT_PROPERTY( m_nLineX )
DEFAULT_PROPERTY( m_nLineStart )
DEFAULT_PROPERTY ( m_nLineModulus )
DEFAULT_PROPERTY ( m_nLineX )
DEFAULT_PROPERTY ( m_nLineStart )
DEFAULT_PROPERTY_DEF( m_eLineNumberRestart, lnr_none )
//Page Information
DEFAULT_PROPERTY( m_nPageWidth )
DEFAULT_PROPERTY( m_nPageHeight )
DEFAULT_PROPERTY( m_nMarginLeft )
DEFAULT_PROPERTY( m_nMarginRight )
DEFAULT_PROPERTY( m_nMarginTop )
DEFAULT_PROPERTY( m_nMarginBottom )
DEFAULT_PROPERTY( m_nGutterMarginWidth )
DEFAULT_PROPERTY( m_bSwitchMargin )
DEFAULT_PROPERTY( m_bLandscapeFormat )
DEFAULT_PROPERTY( m_bTitlePage )
DEFAULT_PROPERTY ( m_nPageWidth )
DEFAULT_PROPERTY ( m_nPageHeight )
DEFAULT_PROPERTY ( m_nMarginLeft )
DEFAULT_PROPERTY ( m_nMarginRight )
DEFAULT_PROPERTY ( m_nMarginTop )
DEFAULT_PROPERTY ( m_nMarginBottom )
DEFAULT_PROPERTY ( m_nGutterMarginWidth )
DEFAULT_PROPERTY ( m_bSwitchMargin )
DEFAULT_PROPERTY ( m_bLandscapeFormat )
DEFAULT_PROPERTY ( m_bTitlePage )
DEFAULT_PROPERTY_DEF( m_nHeaderTop, 720 )
DEFAULT_PROPERTY_DEF( m_nFooterBottom, 720 )
//Page Numbers
DEFAULT_PROPERTY( m_nPageNumberStart )
DEFAULT_PROPERTY( m_bPageNumberContinuos )
DEFAULT_PROPERTY( m_bPageNumberRestart )
DEFAULT_PROPERTY( m_nPageNumberX )
DEFAULT_PROPERTY( m_nPageNumberY )
DEFAULT_PROPERTY ( m_nPageNumberStart )
DEFAULT_PROPERTY ( m_bPageNumberContinuos )
DEFAULT_PROPERTY ( m_bPageNumberRestart )
DEFAULT_PROPERTY ( m_nPageNumberX )
DEFAULT_PROPERTY ( m_nPageNumberY )
DEFAULT_PROPERTY_DEF( m_ePageNumberFormat, pnf_none )
//Vertical Alignment
DEFAULT_PROPERTY_DEF( m_eVerticalAlignment, va_none )
//Text Flow
DEFAULT_PROPERTY( m_nTextFollow )
DEFAULT_PROPERTY ( m_nTextFollow )
//Page Borders
m_oBorderLeft.SetDefault();
m_oBorderTop.SetDefault();
m_oBorderRight.SetDefault();
m_oBorderBottom.SetDefault();
DEFAULT_PROPERTY( m_nBorderArt )
DEFAULT_PROPERTY( m_nBorderMeasure )
DEFAULT_PROPERTY( m_nBorderAlign )
DEFAULT_PROPERTY ( m_nBorderArt )
DEFAULT_PROPERTY ( m_nBorderMeasure )
DEFAULT_PROPERTY ( m_nBorderAlign )
//footer - header надо обнулять вручную
//m_oHeaderLeft = TextItemContainerPtr();
......@@ -660,6 +666,7 @@ public:
CString RenderToOOX(RenderParameter oRenderParameter)
{
if (!m_bFinalize) return L"";
m_bFinalize = false; // тут .. чтобы не повторилось при конвертации колонтитулов
RenderParameter oNewParam = oRenderParameter;
......
......@@ -225,40 +225,42 @@ bool OOXDocumentWriter::SaveByItem()
if( m_oDocument.GetCount() > 1)//если что-то есть в следующей секции значит предыдущая закончилась
{
if( m_oDocument[1].props->GetCount() > 0 )
std::wstring sXml, sectPr;
_section section;
if (m_oDocument.GetItem(section, 0))
{
CString sSectPr = m_oDocument[0].props->m_oProperty.RenderToOOX(oNewParam);
CString sXml = m_oDocument[1].props->operator[](0)->RenderToOOX(oNewParam);
int nIndexP = sXml.Find( _T("<w:p>") );
sectPr = section.props->RenderToOOX(oNewParam).GetBuffer();
}
if (nIndexP == 0) //элемент параграф
if( m_oDocument[0].props->GetCount() > 0 )
{
sXml = m_oDocument[0].props->operator[](0)->RenderToOOX(oNewParam).GetBuffer();
int nFind = sXml.rfind(L"</w:pPr>");
if( -1 != nFind )
{
int nIndexpPr = sXml.Find( _T("</w:pPr>") );
if( -1 != nIndexpPr )
{
sXml.Insert( nIndexpPr, sSectPr );
}
else
{
sSectPr = _T("<w:pPr>") + sSectPr + _T("</w:pPr>");
sXml.Insert( 5, sSectPr );
}
sXml.insert( nFind, sectPr );
}
else
{
sXml = _T("<w:p><w:pPr>") + sSectPr + _T("</w:pPr></w:p>") + sXml;
int Find = sXml.rfind( L"<w:p>" );
if( -1 != nFind )
sXml.insert( nFind + 5, L"<w:pPr>" + sectPr + L"</w:pPr>" );
}
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml.GetBuffer());
m_oFileWriter->Write((BYTE*)sXmlUTF.c_str(), sXmlUTF.length());
m_oDocument[1].props->RemoveItem( 0 ); //удаляем первый параграф
m_oDocument.RemoveItem( 0 ); //удаляем секцию
}
}
else
{
//генерация ???
sXml = _T("<w:p><w:pPr>") + sectPr + _T("</w:pPr></w:p>");
}
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml);
m_oFileWriter->Write((BYTE*)sXmlUTF.c_str(), sXmlUTF.length());
m_oDocument.RemoveItem( 0 ); //удаляем секцию
}
else if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 0 )//пишем параграф
else if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 1 )//пишем параграф - один всегда "прозапас для секций"
{
CString sXml = m_oDocument[0].props->operator[](0)->RenderToOOX(oNewParam);
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml.GetBuffer());
......
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