Commit e6ee6861 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

RtfFormatReader - Formula 01.rtf - конвертация формул в docx

parent 46fa2b43
...@@ -1762,6 +1762,11 @@ public: ...@@ -1762,6 +1762,11 @@ public:
if( true == hasParameter ) if( true == hasParameter )
oDocument.m_oMathProp.mwrapRight = parameter; oDocument.m_oMathProp.mwrapRight = parameter;
} }
else if( _T("mintLim") == sCommand )
{
if( true == hasParameter )
oDocument.m_oMathProp.mintLim = parameter;
}
else else
{ {
return false; return false;
...@@ -1823,20 +1828,48 @@ public: ...@@ -1823,20 +1828,48 @@ public:
Skip( oDocument, oReader ); Skip( oDocument, oReader );
else else
{ {
if( RtfMath::IsRtfControlWord( sCommand ) == true ) bool isBoolMath = RtfMath::IsRtfControlPropertyBool(sCommand);
bool isValMath = isBoolMath ? false : RtfMath::IsRtfControlProperty(sCommand);
bool isMath = (isValMath || isBoolMath) ? false : RtfMath::IsRtfControlWord(sCommand);
if( isMath || isValMath || isBoolMath)
{ {
if( m_oMath.IsEmpty() ) if( true == m_oMath.m_bHeader )
m_oMath.SetRtfName( sCommand ); {
m_oMath.m_bHeader = false;
if (m_oMath.IsEmpty())
m_oMath.SetRtfName( sCommand );
}
else else
{ {
RtfMathPtr oNewMath( new RtfMath() ); RtfMathPtr oNewMath( new RtfMath() );
oNewMath->SetRtfName( sCommand ); oNewMath->SetRtfName( sCommand );
oNewMath->m_bIsVal = isValMath;
oNewMath->m_bIsBool = isBoolMath;
RtfMathReader oSubMathReader( *oNewMath ); RtfMathReader oSubMathReader( *oNewMath );
StartSubReader( oSubMathReader, oDocument, oReader ); StartSubReader( oSubMathReader, oDocument, oReader );
if( RtfParagraphProperty::pa_none != oSubMathReader.m_eParAlign ) if( RtfParagraphProperty::pa_none != oSubMathReader.m_eParAlign )
m_eParAlign = oSubMathReader.m_eParAlign; m_eParAlign = oSubMathReader.m_eParAlign;
if( oNewMath->IsValid() == true ) if( oNewMath->IsValid() == true )
m_oMath.AddItem( oNewMath ); {
if (m_oMath.m_bIsVal || m_oMath.m_bIsBool)
{
IDocumentElementPtr item;
oNewMath->GetItem( item, 0);
if ((item) && (TYPE_RTF_PARAGRAPH == item->GetType()))
{
m_oMath.m_oVal = *((RtfParagraph*)(item.get()));
}
}
else
{
m_oMath.AddItem( oNewMath );
}
}
} }
} }
else if( RtfCharPropCommand::ExecuteCommand(oDocument, oReader, sCommand, hasParameter, parameter ) == true ) else if( RtfCharPropCommand::ExecuteCommand(oDocument, oReader, sCommand, hasParameter, parameter ) == true )
......
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
{ {
OOX::Logic::CRunProperty *ooxRPr = dynamic_cast<OOX::Logic::CRunProperty *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CRunProperty *ooxRPr = dynamic_cast<OOX::Logic::CRunProperty *>(m_ooxElem->m_arrItems[i]);
OOXrPrReader orPrReader(ooxRPr); OOXrPrReader orPrReader(ooxRPr);
orPrReader.Parse( oParam, oOutput.oProperty.m_oCharProp ); orPrReader.Parse( oParam, oOutput.m_oProperty.m_oCharProp );
/// ///
oCurrentProp = RtfCharProperty(); oCurrentProp = RtfCharProperty();
oCurrentProp.SetDefaultOOX(); oCurrentProp.SetDefaultOOX();
...@@ -38,20 +38,20 @@ public: ...@@ -38,20 +38,20 @@ public:
{ {
OOX::Logic::CAlnScr *ooxAlnScr = dynamic_cast<OOX::Logic::CAlnScr *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CAlnScr *ooxAlnScr = dynamic_cast<OOX::Logic::CAlnScr *>(m_ooxElem->m_arrItems[i]);
if( ooxAlnScr->m_val.IsInit()) if( ooxAlnScr->m_val.IsInit())
oNewMath->oProperty.malnScr = ooxAlnScr->m_val->ToBool(); oNewMath->m_oProperty.malnScr = ooxAlnScr->m_val->ToBool();
}break; }break;
case OOX::et_m_oMathParaPr: case OOX::et_m_oMathParaPr:
{ {
OOX::Logic::COMathParaPr *ooxMathParaPr = dynamic_cast<OOX::Logic::COMathParaPr *>(m_ooxElem->m_arrItems[i]); OOX::Logic::COMathParaPr *ooxMathParaPr = dynamic_cast<OOX::Logic::COMathParaPr *>(m_ooxElem->m_arrItems[i]);
if( ooxMathParaPr->m_oMJc.IsInit() && ooxMathParaPr->m_oMJc->m_val.IsInit()) if( ooxMathParaPr->m_oMJc.IsInit() && ooxMathParaPr->m_oMJc->m_val.IsInit())
{ {
oNewMath->oProperty.moMathParaPr = 1; oNewMath->m_oProperty.moMathParaPr = 1;
switch(ooxMathParaPr->m_oMJc->m_val->GetValue()) switch(ooxMathParaPr->m_oMJc->m_val->GetValue())
{ {
case SimpleTypes::mjcCenter : oNewMath->oProperty.moMathParaPr = 1; break; case SimpleTypes::mjcCenter : oNewMath->m_oProperty.moMathParaPr = 1; break;
case SimpleTypes::mjcCenterGroup : oNewMath->oProperty.moMathParaPr = 2; break; case SimpleTypes::mjcCenterGroup : oNewMath->m_oProperty.moMathParaPr = 2; break;
case SimpleTypes::mjcLeft : oNewMath->oProperty.moMathParaPr = 3; break; case SimpleTypes::mjcLeft : oNewMath->m_oProperty.moMathParaPr = 3; break;
case SimpleTypes::mjcRight : oNewMath->oProperty.moMathParaPr = 4; break; case SimpleTypes::mjcRight : oNewMath->m_oProperty.moMathParaPr = 4; break;
} }
} }
}break; }break;
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
{ {
OOX::Logic::CBrk *ooxMath = dynamic_cast<OOX::Logic::CBrk *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CBrk *ooxMath = dynamic_cast<OOX::Logic::CBrk *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_alnAt.IsInit() ) if( ooxMath->m_alnAt.IsInit() )
oNewMath->oProperty.Break = ooxMath->m_alnAt->GetValue(); oNewMath->m_oProperty.Break = ooxMath->m_alnAt->GetValue();
}break; }break;
case OOX::et_m_chr: case OOX::et_m_chr:
{ {
...@@ -80,20 +80,20 @@ public: ...@@ -80,20 +80,20 @@ public:
nValue = sValue[0]; nValue = sValue[0];
} }
if( PROP_DEF != nValue ) if( PROP_DEF != nValue )
oNewMath->oProperty.mchr = nValue; oNewMath->m_oProperty.mchr = nValue;
} }
}break; }break;
case OOX::et_m_lit: case OOX::et_m_lit:
{ {
OOX::Logic::CLit *ooxMath = dynamic_cast<OOX::Logic::CLit *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CLit *ooxMath = dynamic_cast<OOX::Logic::CLit *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mlit = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mlit = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_nor: case OOX::et_m_nor:
{ {
OOX::Logic::CNor *ooxMath = dynamic_cast<OOX::Logic::CNor *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CNor *ooxMath = dynamic_cast<OOX::Logic::CNor *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.NormalText = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.NormalText = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_scr: case OOX::et_m_scr:
{ {
...@@ -102,12 +102,12 @@ public: ...@@ -102,12 +102,12 @@ public:
{ {
switch(ooxMath->m_val->GetValue()) switch(ooxMath->m_val->GetValue())
{ {
case SimpleTypes::scriptDoubleStruck: oNewMath->oProperty.mscr = 3; break; case SimpleTypes::scriptDoubleStruck: oNewMath->m_oProperty.mscr = 3; break;
case SimpleTypes::scriptFraktur : oNewMath->oProperty.mscr = 2; break; case SimpleTypes::scriptFraktur : oNewMath->m_oProperty.mscr = 2; break;
case SimpleTypes::scriptMonospace : oNewMath->oProperty.mscr = 5; break; case SimpleTypes::scriptMonospace : oNewMath->m_oProperty.mscr = 5; break;
case SimpleTypes::scriptRoman : oNewMath->oProperty.mscr = 0; break; case SimpleTypes::scriptRoman : oNewMath->m_oProperty.mscr = 0; break;
case SimpleTypes::scriptSansSerif : oNewMath->oProperty.mscr = 4; break; case SimpleTypes::scriptSansSerif : oNewMath->m_oProperty.mscr = 4; break;
case SimpleTypes::scriptScript : oNewMath->oProperty.mscr = 1; break; case SimpleTypes::scriptScript : oNewMath->m_oProperty.mscr = 1; break;
} }
} }
}break; }break;
...@@ -118,10 +118,10 @@ public: ...@@ -118,10 +118,10 @@ public:
{ {
switch(ooxMath->m_val->GetValue()) switch(ooxMath->m_val->GetValue())
{ {
case SimpleTypes::styleBold : oNewMath->oProperty.msty = 1; break; case SimpleTypes::styleBold : oNewMath->m_oProperty.msty = 1; break;
case SimpleTypes::styleBoldItalic : oNewMath->oProperty.msty = 3; break; case SimpleTypes::styleBoldItalic : oNewMath->m_oProperty.msty = 3; break;
case SimpleTypes::styleItalic : oNewMath->oProperty.msty = 2; break; case SimpleTypes::styleItalic : oNewMath->m_oProperty.msty = 2; break;
case SimpleTypes::stylePlain : oNewMath->oProperty.msty = 0; break; case SimpleTypes::stylePlain : oNewMath->m_oProperty.msty = 0; break;
} }
} }
}break; }break;
...@@ -132,10 +132,10 @@ public: ...@@ -132,10 +132,10 @@ public:
{ {
switch(ooxMath->m_val->GetValue()) switch(ooxMath->m_val->GetValue())
{ {
case SimpleTypes::mjcCenter : oNewMath->oProperty.moMathParaPr = 1; break; case SimpleTypes::mjcCenter : oNewMath->m_oProperty.moMathParaPr = 1; break;
case SimpleTypes::mjcCenterGroup : oNewMath->oProperty.moMathParaPr = 2; break; case SimpleTypes::mjcCenterGroup : oNewMath->m_oProperty.moMathParaPr = 2; break;
case SimpleTypes::mjcLeft : oNewMath->oProperty.moMathParaPr = 3; break; case SimpleTypes::mjcLeft : oNewMath->m_oProperty.moMathParaPr = 3; break;
case SimpleTypes::mjcRight : oNewMath->oProperty.moMathParaPr = 4; break; case SimpleTypes::mjcRight : oNewMath->m_oProperty.moMathParaPr = 4; break;
} }
} }
}break; }break;
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
{ {
OOX::Logic::CRSp *ooxMath = dynamic_cast<OOX::Logic::CRSp *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CRSp *ooxMath = dynamic_cast<OOX::Logic::CRSp *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.RowSpacing = ooxMath->m_val->GetValue(); oNewMath->m_oProperty.RowSpacing = ooxMath->m_val->GetValue();
}break; }break;
case OOX::et_m_t: case OOX::et_m_t:
{ {
...@@ -159,127 +159,127 @@ public: ...@@ -159,127 +159,127 @@ public:
{ {
OOX::Logic::CRSpRule *ooxMath = dynamic_cast<OOX::Logic::CRSpRule *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CRSpRule *ooxMath = dynamic_cast<OOX::Logic::CRSpRule *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.RowSpacingRule = ooxMath->m_val->GetValue(); oNewMath->m_oProperty.RowSpacingRule = ooxMath->m_val->GetValue();
}break; }break;
case OOX::et_m_cGp: case OOX::et_m_cGp:
{ {
OOX::Logic::CCGp *ooxMath = dynamic_cast<OOX::Logic::CCGp *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CCGp *ooxMath = dynamic_cast<OOX::Logic::CCGp *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit()) if( ooxMath->m_val.IsInit())
oNewMath->oProperty.CellGap = ooxMath->m_val->GetValue(); oNewMath->m_oProperty.CellGap = ooxMath->m_val->GetValue();
}break; }break;
case OOX::et_m_cGpRule: case OOX::et_m_cGpRule:
{ {
OOX::Logic::CCGpRule *ooxMath = dynamic_cast<OOX::Logic::CCGpRule *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CCGpRule *ooxMath = dynamic_cast<OOX::Logic::CCGpRule *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.CellGapRule = ooxMath->m_val->GetValue(); oNewMath->m_oProperty.CellGapRule = ooxMath->m_val->GetValue();
}break; }break;
case OOX::et_m_cSp: case OOX::et_m_cSp:
{ {
OOX::Logic::CCSp *ooxMath = dynamic_cast<OOX::Logic::CCSp *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CCSp *ooxMath = dynamic_cast<OOX::Logic::CCSp *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.CellSpacing = ooxMath->m_val->GetValue(); oNewMath->m_oProperty.CellSpacing = ooxMath->m_val->GetValue();
}break; }break;
case OOX::et_m_hideLeft: case OOX::et_m_hideLeft:
{ {
OOX::Logic::CHideLeft *ooxMath = dynamic_cast<OOX::Logic::CHideLeft *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CHideLeft *ooxMath = dynamic_cast<OOX::Logic::CHideLeft *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.HideLeft = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.HideLeft = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_hideTop: case OOX::et_m_hideTop:
{ {
OOX::Logic::CHideTop *ooxMath = dynamic_cast<OOX::Logic::CHideTop *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CHideTop *ooxMath = dynamic_cast<OOX::Logic::CHideTop *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.HideTop = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.HideTop = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_hideRight: case OOX::et_m_hideRight:
{ {
OOX::Logic::CHideRight *ooxMath = dynamic_cast<OOX::Logic::CHideRight *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CHideRight *ooxMath = dynamic_cast<OOX::Logic::CHideRight *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.HideRight = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.HideRight = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_hideBot: case OOX::et_m_hideBot:
{ {
OOX::Logic::CHideBot *ooxMath = dynamic_cast<OOX::Logic::CHideBot *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CHideBot *ooxMath = dynamic_cast<OOX::Logic::CHideBot *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.HideBottom = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.HideBottom = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_strikeH: case OOX::et_m_strikeH:
{ {
OOX::Logic::CStrikeH *ooxMath = dynamic_cast<OOX::Logic::CStrikeH *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CStrikeH *ooxMath = dynamic_cast<OOX::Logic::CStrikeH *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.StrikeHor = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.StrikeHor = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_strikeV: case OOX::et_m_strikeV:
{ {
OOX::Logic::CStrikeV *ooxMath = dynamic_cast<OOX::Logic::CStrikeV *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CStrikeV *ooxMath = dynamic_cast<OOX::Logic::CStrikeV *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.StrikeVer = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.StrikeVer = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_strikeTLBR: case OOX::et_m_strikeTLBR:
{ {
OOX::Logic::CStrikeTLBR *ooxMath = dynamic_cast<OOX::Logic::CStrikeTLBR *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CStrikeTLBR *ooxMath = dynamic_cast<OOX::Logic::CStrikeTLBR *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.StrikeLR = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.StrikeLR = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_strikeBLTR: case OOX::et_m_strikeBLTR:
{ {
OOX::Logic::CStrikeBLTR *ooxMath = dynamic_cast<OOX::Logic::CStrikeBLTR *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CStrikeBLTR *ooxMath = dynamic_cast<OOX::Logic::CStrikeBLTR *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.StrikeRL = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.StrikeRL = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_aln: case OOX::et_m_aln:
{ {
OOX::Logic::CAln *ooxMath = dynamic_cast<OOX::Logic::CAln *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CAln *ooxMath = dynamic_cast<OOX::Logic::CAln *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.Alignment = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.Alignment = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_diff: case OOX::et_m_diff:
{ {
OOX::Logic::CDiff *ooxMath = dynamic_cast<OOX::Logic::CDiff *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CDiff *ooxMath = dynamic_cast<OOX::Logic::CDiff *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.Differential = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.Differential = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_noBreak: case OOX::et_m_noBreak:
{ {
OOX::Logic::CNoBreak *ooxMath = dynamic_cast<OOX::Logic::CNoBreak *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CNoBreak *ooxMath = dynamic_cast<OOX::Logic::CNoBreak *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.NoBreak = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.NoBreak = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_opEmu: case OOX::et_m_opEmu:
{ {
OOX::Logic::COpEmu *ooxMath = dynamic_cast<OOX::Logic::COpEmu *>(m_ooxElem->m_arrItems[i]); OOX::Logic::COpEmu *ooxMath = dynamic_cast<OOX::Logic::COpEmu *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.Emulator = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.Emulator = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_show: case OOX::et_m_show:
{ {
OOX::Logic::CShow *ooxMath = dynamic_cast<OOX::Logic::CShow *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CShow *ooxMath = dynamic_cast<OOX::Logic::CShow *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mshow = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mshow = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_transp: case OOX::et_m_transp:
{ {
OOX::Logic::CTransp *ooxMath = dynamic_cast<OOX::Logic::CTransp *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CTransp *ooxMath = dynamic_cast<OOX::Logic::CTransp *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mtransp = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mtransp = ooxMath->m_val->ToBool();
} }
case OOX::et_m_zeroAsc: case OOX::et_m_zeroAsc:
{ {
OOX::Logic::CZeroAsc *ooxMath = dynamic_cast<OOX::Logic::CZeroAsc *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CZeroAsc *ooxMath = dynamic_cast<OOX::Logic::CZeroAsc *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mzeroAsc = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mzeroAsc = ooxMath->m_val->ToBool();
}break; }break;
case OOX::et_m_zeroDesc: case OOX::et_m_zeroDesc:
{ {
OOX::Logic::CZeroDesc *ooxMath = dynamic_cast<OOX::Logic::CZeroDesc *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CZeroDesc *ooxMath = dynamic_cast<OOX::Logic::CZeroDesc *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mzeroDesc = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mzeroDesc = ooxMath->m_val->ToBool();
} }
case OOX::et_m_zeroWid: case OOX::et_m_zeroWid:
{ {
OOX::Logic::CZeroWid *ooxMath = dynamic_cast<OOX::Logic::CZeroWid *>(m_ooxElem->m_arrItems[i]); OOX::Logic::CZeroWid *ooxMath = dynamic_cast<OOX::Logic::CZeroWid *>(m_ooxElem->m_arrItems[i]);
if( ooxMath->m_val.IsInit() ) if( ooxMath->m_val.IsInit() )
oNewMath->oProperty.mzeroWid = ooxMath->m_val->ToBool(); oNewMath->m_oProperty.mzeroWid = ooxMath->m_val->ToBool();
}break; }break;
default: default:
{ {
......
...@@ -6,89 +6,97 @@ ...@@ -6,89 +6,97 @@
class RtfAbsPosTab : public IDocumentElement class RtfAbsPosTab : public IDocumentElement
{ {
public: typedef enum {l_none, public:
l_ptablnone, //\ptablnone Absolute position tab with a blank leading (default). enum Leader
l_ptabldot, //\ptabldot Absolute position tab with a leading that uses period symbols (.....). { l_none,
l_ptablminus, //\ptablminus Absolute position tab with a leading that uses minus symbols (-----). l_ptablnone, //\ptablnone Absolute position tab with a blank leading (default).
l_ptabluscore, //\ptabluscore Absolute position tab with a leading that uses underscore symbols (_____). l_ptabldot, //\ptabldot Absolute position tab with a leading that uses period symbols (.....).
l_ptablmdot, //\ptablmdot Absolute position tab with a leading that uses middle dot symbols (•••••). l_ptablminus, //\ptablminus Absolute position tab with a leading that uses minus symbols (-----).
} Leader; l_ptabluscore, //\ptabluscore Absolute position tab with a leading that uses underscore symbols (_____).
public: Leader m_eLeader; l_ptablmdot, //\ptablmdot Absolute position tab with a leading that uses middle dot symbols (•••••).
public: typedef enum { a_none, } ;
a_left, enum Alignment
a_center, { a_none,
a_right, a_left,
} Alignment; a_center,
public: Alignment m_eAlignment; a_right,
public: typedef enum {r_none, };
r_margin,
r_indent, enum Relative
} Relative; { r_none,
public: Relative m_eRelative; r_margin,
r_indent,
} ;
public: RtfAbsPosTab() Leader m_eLeader;
Alignment m_eAlignment;
Relative m_eRelative;
RtfAbsPosTab()
{
}
bool IsValid()
{
return a_none != m_eAlignment && r_none != m_eRelative;
}
CString RenderToRtf(RenderParameter oRenderParameter)
{
CString sResult;
switch( m_eLeader )
{ {
case l_ptablnone: sResult.Append(_T("\\ptablnone"));break;
case l_ptabldot: sResult.Append(_T("\\ptabldot"));break;
case l_ptablminus: sResult.Append(_T("\\ptablminus"));break;
case l_ptabluscore: sResult.Append(_T("\\ptabluscore"));break;
case l_ptablmdot: sResult.Append(_T("\\ptablmdo"));break;
} }
public: bool IsValid() switch( m_eRelative )
{ {
return a_none != m_eAlignment && r_none != m_eRelative; case r_margin: sResult.Append(_T("\\pmartabq"));break;
case r_indent: sResult.Append(_T("\\pindtabq"));break;
} }
public: CString RenderToRtf(RenderParameter oRenderParameter) switch( m_eAlignment )
{ {
CString sResult; case a_left: sResult.Append(_T("l"));break;
switch( m_eLeader ) case a_center: sResult.Append(_T("c"));break;
{ case a_right: sResult.Append(_T("r"));break;
case l_ptablnone: sResult.Append(_T("\\ptablnone"));break;
case l_ptabldot: sResult.Append(_T("\\ptabldot"));break;
case l_ptablminus: sResult.Append(_T("\\ptablminus"));break;
case l_ptabluscore: sResult.Append(_T("\\ptabluscore"));break;
case l_ptablmdot: sResult.Append(_T("\\ptablmdo"));break;
}
switch( m_eRelative )
{
case r_margin: sResult.Append(_T("\\pmartabq"));break;
case r_indent: sResult.Append(_T("\\pindtabq"));break;
}
switch( m_eAlignment )
{
case a_left: sResult.Append(_T("l"));break;
case a_center: sResult.Append(_T("c"));break;
case a_right: sResult.Append(_T("r"));break;
}
if( false == sResult.IsEmpty() )
sResult = _T("{") + sResult + _T("}");
return sResult;
} }
public: CString RenderToOOX(RenderParameter oRenderParameter) if( false == sResult.IsEmpty() )
sResult = _T("{") + sResult + _T("}");
return sResult;
}
CString RenderToOOX(RenderParameter oRenderParameter)
{
CString sResult;
switch( m_eLeader )
{ {
CString sResult; case l_ptablnone: sResult.Append(_T(" w:leader=\"none\""));break;
switch( m_eLeader ) case l_ptabldot: sResult.Append(_T(" w:leader=\"dot\""));break;
{ case l_ptablminus: sResult.Append(_T(" w:leader=\"hyphen\""));break;
case l_ptablnone: sResult.Append(_T(" w:leader=\"none\""));break; case l_ptabluscore: sResult.Append(_T(" w:leader=\"underscore\""));break;
case l_ptabldot: sResult.Append(_T(" w:leader=\"dot\""));break; case l_ptablmdot: sResult.Append(_T(" w:leader=\"middleDot\""));break;
case l_ptablminus: sResult.Append(_T(" w:leader=\"hyphen\""));break; }
case l_ptabluscore: sResult.Append(_T(" w:leader=\"underscore\""));break; switch( m_eRelative )
case l_ptablmdot: sResult.Append(_T(" w:leader=\"middleDot\""));break; {
} case r_margin: sResult.Append(_T(" w:relativeTo=\"margin\""));break;
switch( m_eRelative ) case r_indent: sResult.Append(_T(" w:relativeTo=\"indent\""));break;
{
case r_margin: sResult.Append(_T(" w:relativeTo=\"margin\""));break;
case r_indent: sResult.Append(_T(" w:relativeTo=\"indent\""));break;
}
switch( m_eAlignment )
{
case a_left: sResult.Append(_T(" w:alignment=\"left\""));break;
case a_center: sResult.Append(_T(" w:alignment=\"center\""));break;
case a_right: sResult.Append(_T(" w:alignment=\"right\""));break;
}
if( false == sResult.IsEmpty() )
sResult = _T("<w:ptab") + sResult + _T("/>");
return sResult;
} }
switch( m_eAlignment )
{
case a_left: sResult.Append(_T(" w:alignment=\"left\""));break;
case a_center: sResult.Append(_T(" w:alignment=\"center\""));break;
case a_right: sResult.Append(_T(" w:alignment=\"right\""));break;
}
if( false == sResult.IsEmpty() )
sResult = _T("<w:ptab") + sResult + _T("/>");
return sResult;
}
}; };
class RtfCharSpecial : public IDocumentElement class RtfCharSpecial : public IDocumentElement
{ {
public: typedef enum { public:
typedef enum {
rsc_none, rsc_none,
rsc_chdate,//\chdate Current date (as in headers). rsc_chdate,//\chdate Current date (as in headers).
rsc_chdpl,//\chdpl Current date in long format (for example, Wednesday, February 20, 2008). rsc_chdpl,//\chdpl Current date in long format (for example, Wednesday, February 20, 2008).
...@@ -120,182 +128,171 @@ public: typedef enum { ...@@ -120,182 +128,171 @@ public: typedef enum {
rsc_zwnbo,//\zwnbo Zero-width non-break opportunity. Used to remove break opportunity between two characters. rsc_zwnbo,//\zwnbo Zero-width non-break opportunity. Used to remove break opportunity between two characters.
rsc_zwj,//\zwj Zero-width joiner. This is used for ligating (joining) characters. rsc_zwj,//\zwj Zero-width joiner. This is used for ligating (joining) characters.
rsc_zwnj,//\zwnj Zero-width nonjoiner. This is used for unligating a character. rsc_zwnj,//\zwnj Zero-width nonjoiner. This is used for unligating a character.
} RtfSpecChar; } RtfSpecChar;
public: int m_nTextWrapBreak;//\lbrN Text wrapping break of type int m_nTextWrapBreak;//\lbrN Text wrapping break of type
public: int m_nSoftHeight;//\softlheightN Nonrequired line height. This is emitted as a prefix to each line. int m_nSoftHeight;//\softlheightN Nonrequired line height. This is emitted as a prefix to each line.
public: RtfSpecChar m_eType; RtfSpecChar m_eType;
public: RtfCharProperty m_oProperty; RtfCharProperty m_oProperty;
public: RtfCharSpecial()
RtfCharSpecial()
{
m_eType = rsc_none;
m_nTextWrapBreak = PROP_DEF;
m_nSoftHeight = PROP_DEF;
}
CString RenderToRtf(RenderParameter oRenderParameter)
{
CString sResult;
sResult.Append( _T("{") );
sResult.Append( m_oProperty.RenderToRtf( oRenderParameter ) );
switch( m_eType )
{ {
m_eType = rsc_none; case rsc_chdate: sResult.Append( _T("\\chdate") ); break;
m_nTextWrapBreak = PROP_DEF; case rsc_chdpl: sResult.Append( _T("\\chdpl") ); break;
m_nSoftHeight = PROP_DEF; case rsc_chdpa: sResult.Append( _T("\\chdpa") ); break;
case rsc_chtime: sResult.Append( _T("\\chtime") ); break;
case rsc_chpgn: sResult.Append( _T("\\chpgn") ); break;
case rsc_sectnum: sResult.Append( _T("\\sectnum") ); break;
case rsc_chftn: sResult.Append( _T("\\chftn") ); break;
case rsc_chftnEnd: sResult.Append( _T("\\chftn") ); break;
case rsc_chatn: sResult.Append( _T("\\chatn") ); break;
case rsc_chftnsep: sResult.Append( _T("\\chftnsep") ); break;
case rsc_chftnsepc: sResult.Append( _T("\\chftnsepc") ); break;
case rsc_page: sResult.Append( _T("\\page") ); break;
case rsc_column: sResult.Append( _T("\\column") ); break;
case rsc_line: sResult.Append( _T("\\line") ); break;
case rsc_softpage: sResult.Append( _T("\\softpage") ); break;
case rsc_softcol: sResult.Append( _T("\\softcol") ); break;
case rsc_softline: sResult.Append( _T("\\softline") ); break;
case rsc_tab: sResult.Append( _T("\\tab") ); break;
case rsc_Formula: sResult.Append( _T("\\|") ); break;
case rsc_OptHyphen: sResult.Append( _T("\\-") ); break;
case rsc_NonBrHyphen: sResult.Append( _T("\\_") ); break;
case rsc_NonBrSpace: sResult.Append( _T("\\~") ); break;
case rsc_zwbo: sResult.Append( _T("\\zwbo") ); break;
case rsc_zwnbo: sResult.Append( _T("\\zwnbo") ); break;
case rsc_zwj: sResult.Append( _T("\\zwj") ); break;
case rsc_zwnj: sResult.Append( _T("\\zwnj") ); break;
} }
public: CString RenderToRtf(RenderParameter oRenderParameter) if( PROP_DEF != m_nTextWrapBreak )
sResult.Append( _T("\\par") );
//switch ( m_nTextWrapBreak ) //не воспринимается word
//{
// case 0: sResult.Append( _T("\\lbr0") );break;
// case 1: sResult.Append( _T("\\lbr1") );break;
// case 2: sResult.Append( _T("\\lbr2") );break;
// case 3: sResult.Append( _T("\\lbr3") );break;
//}
if( PROP_DEF != m_nSoftHeight )
{ {
CString sResult; sResult.AppendFormat( _T("\\softlheight%d"), m_nSoftHeight );
sResult.Append( _T("{") );
sResult.Append( m_oProperty.RenderToRtf( oRenderParameter ) );
switch( m_eType )
{
case rsc_chdate: sResult.Append( _T("\\chdate") ); break;
case rsc_chdpl: sResult.Append( _T("\\chdpl") ); break;
case rsc_chdpa: sResult.Append( _T("\\chdpa") ); break;
case rsc_chtime: sResult.Append( _T("\\chtime") ); break;
case rsc_chpgn: sResult.Append( _T("\\chpgn") ); break;
case rsc_sectnum: sResult.Append( _T("\\sectnum") ); break;
case rsc_chftn: sResult.Append( _T("\\chftn") ); break;
case rsc_chftnEnd: sResult.Append( _T("\\chftn") ); break;
case rsc_chatn: sResult.Append( _T("\\chatn") ); break;
case rsc_chftnsep: sResult.Append( _T("\\chftnsep") ); break;
case rsc_chftnsepc: sResult.Append( _T("\\chftnsepc") ); break;
case rsc_page: sResult.Append( _T("\\page") ); break;
case rsc_column: sResult.Append( _T("\\column") ); break;
case rsc_line: sResult.Append( _T("\\line") ); break;
case rsc_softpage: sResult.Append( _T("\\softpage") ); break;
case rsc_softcol: sResult.Append( _T("\\softcol") ); break;
case rsc_softline: sResult.Append( _T("\\softline") ); break;
case rsc_tab: sResult.Append( _T("\\tab") ); break;
case rsc_Formula: sResult.Append( _T("\\|") ); break;
case rsc_OptHyphen: sResult.Append( _T("\\-") ); break;
case rsc_NonBrHyphen: sResult.Append( _T("\\_") ); break;
case rsc_NonBrSpace: sResult.Append( _T("\\~") ); break;
case rsc_zwbo: sResult.Append( _T("\\zwbo") ); break;
case rsc_zwnbo: sResult.Append( _T("\\zwnbo") ); break;
case rsc_zwj: sResult.Append( _T("\\zwj") ); break;
case rsc_zwnj: sResult.Append( _T("\\zwnj") ); break;
}
if( PROP_DEF != m_nTextWrapBreak )
sResult.Append( _T("\\par") );
//switch ( m_nTextWrapBreak ) //не воспринимается word
//{
// case 0: sResult.Append( _T("\\lbr0") );break;
// case 1: sResult.Append( _T("\\lbr1") );break;
// case 2: sResult.Append( _T("\\lbr2") );break;
// case 3: sResult.Append( _T("\\lbr3") );break;
//}
if( PROP_DEF != m_nSoftHeight )
{
sResult.AppendFormat( _T("\\softlheight%d"), m_nSoftHeight );
}
sResult.Append( _T("}") );
return sResult;
} }
public: CString _RenderToOOX(RenderParameter oRenderParameter) sResult.Append( _T("}") );
return sResult;
}
CString _RenderToOOX(RenderParameter oRenderParameter)
{
CString sResult;
switch( m_eType )
{ {
CString sResult; case rsc_chdate: sResult.Append( _T("") );break;
switch( m_eType ) case rsc_chdpl: sResult.Append( _T("") );break;
{ case rsc_chdpa: sResult.Append( _T("") );break;
case rsc_chdate: sResult.Append( _T("") );break; case rsc_chtime: sResult.Append( _T("") );break;
case rsc_chdpl: sResult.Append( _T("") );break; case rsc_chpgn: sResult.Append( _T("<w:pgNum />") );break;
case rsc_chdpa: sResult.Append( _T("") );break; case rsc_sectnum: sResult.Append( _T("") );break;
case rsc_chtime: sResult.Append( _T("") );break; case rsc_chftn: sResult.Append( _T("<w:footnoteRef/>") );break;
case rsc_chpgn: sResult.Append( _T("<w:pgNum />") );break; case rsc_chftnEnd: sResult.Append( _T("<w:endnoteRef/>") );break;
case rsc_sectnum: sResult.Append( _T("") );break; case rsc_chatn: sResult.Append( _T("<w:annotationRef />") );break;
case rsc_chftn: sResult.Append( _T("<w:footnoteRef/>") );break; case rsc_chftnsep: sResult.Append( _T("<w:separator />") );break;
case rsc_chftnEnd: sResult.Append( _T("<w:endnoteRef/>") );break; case rsc_chftnsepc: sResult.Append( _T("<w:continuationSeparator/>") );break;
case rsc_chatn: sResult.Append( _T("<w:annotationRef />") );break; case rsc_page: sResult.Append( _T("<w:br w:type=\"page\"/>") );break;
case rsc_chftnsep: sResult.Append( _T("<w:separator />") );break; case rsc_column: sResult.Append( _T("<w:br w:type=\"column\"/>") );break;
case rsc_chftnsepc: sResult.Append( _T("<w:continuationSeparator/>") );break; case rsc_line: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"none\"/>") );break;
case rsc_page: sResult.Append( _T("<w:br w:type=\"page\"/>") );break; case rsc_softpage: sResult.Append( _T("") );break;
case rsc_column: sResult.Append( _T("<w:br w:type=\"column\"/>") );break; case rsc_softcol: sResult.Append( _T("") );break;
case rsc_line: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"none\"/>") );break; case rsc_softline: sResult.Append( _T("") );break;
case rsc_softpage: sResult.Append( _T("") );break; case rsc_tab: sResult.Append( _T("<w:tab/>") );break;
case rsc_softcol: sResult.Append( _T("") );break; case rsc_emspace: sResult.Append( _T("") );break;
case rsc_softline: sResult.Append( _T("") );break; case rsc_qmspace: sResult.Append( _T("") );break;
case rsc_tab: sResult.Append( _T("<w:tab/>") );break; case rsc_Formula: sResult.Append( _T("") );break;
case rsc_emspace: sResult.Append( _T("") );break; case rsc_OptHyphen: sResult.Append( _T("<w:t xml:space=\"preserve\">-</w:t>") );break;//<w:softHyphen/>
case rsc_qmspace: sResult.Append( _T("") );break; case rsc_NonBrHyphen: sResult.Append( _T("<w:t xml:space=\"preserve\">-</w:t>") );break;//<w:nonBreakHyphen/>
case rsc_Formula: sResult.Append( _T("") );break; case rsc_NonBrSpace: sResult.Append( _T("<w:t xml:space=\"preserve\"> </w:t>") );break;
case rsc_OptHyphen: sResult.Append( _T("<w:t xml:space=\"preserve\">-</w:t>") );break;//<w:softHyphen/> case rsc_zwbo: sResult.Append( _T("") );break;
case rsc_NonBrHyphen: sResult.Append( _T("<w:t xml:space=\"preserve\">-</w:t>") );break;//<w:nonBreakHyphen/> case rsc_zwnbo: sResult.Append( _T("") );break;
case rsc_NonBrSpace: sResult.Append( _T("<w:t xml:space=\"preserve\"> </w:t>") );break; case rsc_zwj: sResult.Append( _T("") );break;
case rsc_zwbo: sResult.Append( _T("") );break; case rsc_zwnj: sResult.Append( _T("") );break;
case rsc_zwnbo: sResult.Append( _T("") );break;
case rsc_zwj: sResult.Append( _T("") );break;
case rsc_zwnj: sResult.Append( _T("") );break;
}
switch ( m_nTextWrapBreak )
{
case 0: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"none\"/>") );break;
case 1: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"left\"/>") );break;
case 2: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"right\"/>") );break;
case 3: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"all\"/>") );break;
}
return sResult;
} }
public: CString RenderToOOX(RenderParameter oRenderParameter) switch ( m_nTextWrapBreak )
{ {
CString sResult; case 0: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"none\"/>") );break;
if(RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType) case 1: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"left\"/>") );break;
{ case 2: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"right\"/>") );break;
sResult.Append(_T("<w:r>")); case 3: sResult.Append( _T("<w:br w:type=\"textWrapping\" w:clear=\"all\"/>") );break;
sResult.Append(_T("<w:rPr>"));
sResult.Append( m_oProperty.RenderToOOX(oRenderParameter) );
sResult.Append(_T("</w:rPr>"));
sResult.Append( _RenderToOOX(oRenderParameter) );
sResult.Append(_T("</w:r>"));
}
else if(RENDER_TO_OOX_PARAM_TEXT == oRenderParameter.nType ||
RENDER_TO_OOX_PARAM_MATH == oRenderParameter.nType ||
RENDER_TO_OOX_PARAM_PLAIN == oRenderParameter.nType)
sResult.Append( _RenderToOOX(oRenderParameter) );
return sResult;
} }
return sResult;
}
CString RenderToOOX(RenderParameter oRenderParameter)
{
CString sResult;
if(RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType)
{
sResult.Append(_T("<w:r>"));
sResult.Append(_T("<w:rPr>"));
sResult.Append( m_oProperty.RenderToOOX(oRenderParameter) );
sResult.Append(_T("</w:rPr>"));
sResult.Append( _RenderToOOX(oRenderParameter) );
sResult.Append(_T("</w:r>"));
}
else if(RENDER_TO_OOX_PARAM_TEXT == oRenderParameter.nType ||
RENDER_TO_OOX_PARAM_MATH == oRenderParameter.nType ||
RENDER_TO_OOX_PARAM_PLAIN == oRenderParameter.nType)
sResult.Append( _RenderToOOX(oRenderParameter) );
return sResult;
}
}; };
typedef boost::shared_ptr<RtfCharSpecial> RtfCharSpecialPtr; typedef boost::shared_ptr<RtfCharSpecial> RtfCharSpecialPtr;
class RtfChar : public IDocumentElement class RtfChar : public IDocumentElement
{ {
public: RtfChar()
{
m_bRtfEncode = true;
}
protected: CString m_sChars; protected: CString m_sChars;
public: RtfCharProperty m_oProperty; public:
public: bool m_bRtfEncode; RtfChar()
{
m_bRtfEncode = true;
}
RtfCharProperty m_oProperty;
bool m_bRtfEncode;
public: int GetType() int GetType()
{ {
return TYPE_RTF_CHAR; return TYPE_RTF_CHAR;
} }
public: void AddText(CString text) void AddText(CString text)
{ {
m_sChars.Append( text ); m_sChars.Append( text );
} }
public: void setText(CString text) void setText(CString text)
{ {
m_sChars = text; m_sChars = text;
} }
public: CString GetText()
{ CString GetText()
return m_sChars; {
} return m_sChars;
private: CString renderTextToXML( CString sParam ) }
{
CString sResult;
if( _T("Text") == sParam )
{
sResult.AppendFormat( _T("<w:t xml:space= \"preserve\">%ls</w:t>"), Utils::PrepareToXML( m_sChars ).GetBuffer() );
}
else if( _T("Math") == sParam )
{
sResult.AppendFormat( _T("<m:t xml:space= \"preserve\">%ls</m:t>"), Utils::PrepareToXML( m_sChars ).GetBuffer());
}
return sResult;
}
public:
CString RenderToOOX(RenderParameter oRenderParameter) CString RenderToOOX(RenderParameter oRenderParameter)
{ {
CString sResult; CString sResult;
if(RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType) if(RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType)
{ {
sResult.Append(_T("<w:r>")); sResult.Append(_T("<w:r>"));
sResult.Append(_T("<w:rPr>")); sResult.Append(_T("<w:rPr>"));
sResult.Append( m_oProperty.RenderToOOX(oRenderParameter) ); sResult.Append( m_oProperty.RenderToOOX(oRenderParameter) );
sResult.Append(_T("</w:rPr>")); sResult.Append(_T("</w:rPr>"));
sResult.Append( renderTextToXML(_T("Text")) ); sResult.Append( renderTextToXML(_T("Text")) );
sResult.Append(_T("</w:r>")); sResult.Append(_T("</w:r>"));
} }
else if(RENDER_TO_OOX_PARAM_TEXT == oRenderParameter.nType) else if(RENDER_TO_OOX_PARAM_TEXT == oRenderParameter.nType)
...@@ -336,29 +333,50 @@ public: ...@@ -336,29 +333,50 @@ public:
} }
return result; return result;
} }
private:
CString renderTextToXML( CString sParam )
{
CString sResult;
if( _T("Text") == sParam )
{
sResult.Append( _T("<w:t xml:space= \"preserve\">"));
sResult += Utils::PrepareToXML( m_sChars );
sResult.Append( _T("</w:t>"));
}
else if( _T("Math") == sParam && !m_sChars.IsEmpty())
{
sResult.Append( _T("<m:r>"));
sResult.Append( _T("<m:t>"));
sResult += Utils::PrepareToXML( m_sChars );
sResult.Append( _T("</m:t>"));
sResult.Append( _T("</m:r>"));
}
return sResult;
}
}; };
class RtfCharNative : public RtfChar class RtfCharNative : public RtfChar
{ {
public: CString RenderToRtf(RenderParameter oRenderParameter) public:
CString RenderToRtf(RenderParameter oRenderParameter)
{
CString result;
if( RENDER_TO_RTF_PARAM_CHAR == oRenderParameter.nType )
{ {
CString result; result = m_sChars;
if( RENDER_TO_RTF_PARAM_CHAR == oRenderParameter.nType ) }
{ else
result = m_sChars; {
} CString sText = m_sChars;
else if( _T("") != sText )
{ {
CString sText = m_sChars; result.Append(_T("{"));
if( _T("") != sText ) result.Append( m_oProperty.RenderToRtf( oRenderParameter ) );
{ result.Append( _T(" ") + sText );
result.Append(_T("{")); result.Append(_T("}"));
result.Append( m_oProperty.RenderToRtf( oRenderParameter ) );
result.Append( _T(" ") + sText );
result.Append(_T("}"));
}
} }
return result;
} }
return result;
}
}; };
typedef boost::shared_ptr<RtfCharNative> RtfCharNativePtr; typedef boost::shared_ptr<RtfCharNative> RtfCharNativePtr;
typedef boost::shared_ptr<RtfChar> RtfCharPtr; typedef boost::shared_ptr<RtfChar> RtfCharPtr;
...@@ -16,15 +16,15 @@ RtfDocument::RtfDocument() ...@@ -16,15 +16,15 @@ RtfDocument::RtfDocument()
m_oDefaultParagraphProp.SetDefaultRtf(); m_oDefaultParagraphProp.SetDefaultRtf();
} }
int RtfDocument::GetType() int RtfDocument::GetType()
{ {
return TYPE_RTF_DOCUMENT; return TYPE_RTF_DOCUMENT;
} }
CString RtfDocument::RenderToRtf(RenderParameter oRenderParameter) CString RtfDocument::RenderToRtf(RenderParameter oRenderParameter)
{ {
return _T(""); return _T("");
} }
CString RtfDocument::RenderToOOX(RenderParameter oRenderParameter) CString RtfDocument::RenderToOOX(RenderParameter oRenderParameter)
{ {
return _T(""); return _T("");
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,15 +6,22 @@ ...@@ -6,15 +6,22 @@
class RtfMath : public IDocumentElement, public ItemContainer<IDocumentElementPtr> class RtfMath : public IDocumentElement, public ItemContainer<IDocumentElementPtr>
{ {
private: private:
CString m_sRtfName; CString m_sRtfName;
CString m_sOOXName; CString m_sOOXName;
public: public:
RtfMathSpecProp oProperty; bool m_bHeader; //чтобы отличать заголовок от вложенных групп
RtfParagraph m_oVal;
RtfShapePtr m_oPicture; bool m_bIsVal;
bool m_bIsBool;
RtfMathSpecProp m_oProperty;
RtfParagraph m_oVal;
RtfShapePtr m_oPicture;
RtfMath( ) RtfMath( )
{ {
m_bHeader = true;
m_bIsVal = m_bIsBool = false;
} }
RtfMath(const RtfMath& oMath ) RtfMath(const RtfMath& oMath )
{ {
...@@ -22,16 +29,16 @@ public: ...@@ -22,16 +29,16 @@ public:
} }
RtfMath& operator=(const RtfMath& oMath ) RtfMath& operator=(const RtfMath& oMath )
{ {
m_sRtfName = oMath.m_sRtfName; m_bHeader = oMath.m_bHeader;
m_sOOXName = oMath.m_sOOXName; m_bIsVal = oMath.m_bIsVal;
m_bIsBool = oMath.m_bIsBool;
m_sRtfName = oMath.m_sRtfName;
m_sOOXName = oMath.m_sOOXName;
m_aArray.clear(); m_aArray.clear();
m_aArray = oMath.m_aArray; m_aArray = oMath.m_aArray;
//for( int i = 0; i < oMath.m_aArray.size(); i++ )
//{
// RtfMath* oCopyMath = new RtfMath();
// (*oCopyMath) = (*oMath.m_aArray[i]);
// m_aArray.push_back( oCopyMath );
//}
return (*this); return (*this);
} }
bool IsEmpty() bool IsEmpty()
...@@ -42,9 +49,46 @@ public: ...@@ -42,9 +49,46 @@ public:
{ {
return (false == m_sRtfName.IsEmpty()); return (false == m_sRtfName.IsEmpty());
} }
static bool IsRtfControlPropertyBool( CString sControlW )
{
const TCHAR* mc_aRtfControlWords[] = { L"maln", L"malnScr", L"mdegHide", L"mdiff", L"mdispDef",
L"mgrow", L"mhideBot", L"mhideLeft", L"mhideRight", L"mhideTop", L"mlit", L"mmaxDist", L"mnoBreak", L"mnor",
L"mobjDist", L"mopEmu", L"mplcHide", L"mshow", L"msmallFracN", L"mstrikeBLTR", L"mstrikeH", L"mstrikeTLBR",
L"mstrikeV", L"msubHide", L"msupHide", L"mtransp", L"mwrapRight", L"mzeroAsc", L"mzeroDesc", L"mzeroWid"};
int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( TCHAR* );
//можно бинарный поиск вставить
for( int i = 0; i < mc_nRtfControlWordsSize; i++ )
if( mc_aRtfControlWords[ i ] == sControlW )
return true;
return false;
}
static bool IsRtfControlProperty( CString sControlW )
{
const TCHAR* mc_aRtfControlWords[] = {L"margSz", L"mbaseJc", L"mbegChr", L"mbrkBin", L"mbrkBinSub", L"mcGp",
L"mcGpRule", L"mchr", L"mcount", L"mcSp", L"mdefJc", L"mendChr", L"minterSp", L"mintLim", L"mintraSp", L"mmJc",
L"mlimLoc", L"mlMargin", L"mmcJc", L"mnaryLim", L"mpos", L"mpostSp", L"mpreSp", L"mrMargin", L"mrSp", L"mrSpRule",
L"msepChr", L"mshp", L"mtype", L"mvertJc", L"mwrapIndent", L"mmathFont"};
int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( TCHAR* );
//можно бинарный поиск вставить
for( int i = 0; i < mc_nRtfControlWordsSize; i++ )
if( mc_aRtfControlWords[ i ] == sControlW )
return true;
return false;
}
static bool IsRtfControlWord( CString sControlW ) static bool IsRtfControlWord( CString sControlW )
{ {
const TCHAR* mc_aRtfControlWords[] = {_T("macc"),_T("maccPr"),_T("maln"),_T("malnScr"),_T("margPr"),_T("margSz"),_T("mbar"),_T("mbarPr"),_T("mbaseJc"),_T("mbegChr"),_T("mborderBox"),_T("mborderBoxPr"),_T("mbox"),_T("mboxPr"),_T("mbrkN"),_T("mbrkBinN"),_T("mbrkBinSubN"),_T("mcGpN"),_T("mcGpRuleN"),_T("mchr"),_T("mcount"),_T("mcSpN"),_T("mctrlPr"),_T("md"),_T("mdefJcN"),_T("mdeg"),_T("mdegHide"),_T("mden"),_T("mdiff"),_T("mdiffStyN"),_T("mdispDefN"),_T("mdPr"),_T("me"),_T("mendChr"),_T("meqArr"),_T("meqArrPr"),_T("mf"),_T("mfName"),_T("mfPr"),_T("mfunc"),_T("mfuncPr"),_T("mgroupChr"),_T("mgroupChrPr"),_T("mgrow"),_T("mhideBot"),_T("mhideLeft"),_T("mhideRight"),_T("mhideTop"),_T("minterSpN"),_T("mintLimN"),_T("mintraSpN"),_T("mjcN"),_T("mlim"),_T("mlimLoc"),_T("mlimLow"),_T("mlimLowPr"),_T("mlimUpp"),_T("mlimUppPr"),_T("mlit"),_T("mlMarginN"),_T("mm"),_T("mmath"),_T("mmathFontN"),_T("mmathPict"),_T("mmathPr"),_T("mmaxDist"),_T("mmc"),_T("mmcJc"),_T("mmcPr"),_T("mmcs"),_T("mmPr"),_T("mmr"),_T("mnary"),_T("mnaryLimN"),_T("mnaryPr"),_T("mnoBreak"),_T("mnor"),_T("mnum"),_T("mobjDist"),_T("moMath"),_T("moMathPara"),_T("moMathParaPr"),_T("mopEmu"),_T("mphant"),_T("mphantPr"),_T("mplcHide"),_T("mpos"),_T("mpostSpN"),_T("mpreSpN"),_T("mr"),_T("mrad"),_T("mradPr"),_T("mrMarginN"),_T("mrPr"),_T("mrSpN"),_T("mrSpRuleN"),_T("mscrN"),_T("msepChr"),_T("mshow"),_T("mshp"),_T("msmallFracN"),_T("msPre"),_T("msPrePr"),_T("msSub"),_T("msSubPr"),_T("msSubSup"),_T("msSubSupPr"),_T("msSup"),_T("msSupPr"),_T("mstrikeBLTR"),_T("mstrikeH"),_T("mstrikeTLBR"),_T("mstrikeV"),_T("mstyN"),_T("msub"),_T("msubHide"),_T("msup"),_T("msupHide"),_T("mtransp"),_T("mtype"),_T("mvertJc"),_T("mwrapIndentN"),_T("mwrapRightN"),_T("mzeroAsc"),_T("mzeroDesc"),_T("mzeroWid")}; const TCHAR* mc_aRtfControlWords[] = { L"moMath", L"moMathPara", L"moMathParaPr", L"maccPr", L"macc",
L"me", L"mctrlPr", L"margPr", L"mbarPr", L"mbar", L"mborderBoxPr", L"mborderBox", L"mboxPr", L"mbox"/*, L"mbrk"*/,
L"mdPr", L"md", L"meqArrPr", L"meqArr", L"mfPr", L"mf", L"mfuncPr", L"mfunc",
L"mgroupChrPr", L"mgroupChr", L"mlimLowPr", L"mlimLow",L"mlimUppPr", L"mlimUpp", L"mmathPr", L"mmcPr", L"mmc",
L"mmcs", L"mmPr", L"mmr", L"mm", L"mnaryPr", L"mnary", L"mphantPr", L"mphant", L"mmRun", L"mmDel",
L"mmIns", L"mradPr", L"mrad", /*MRPr",*/ L"msPrePr", L"msPre", L"msSubPr", L"msSub", L"msSubSupPr",
L"msSubSup", L"msSupPr", L"msSup", L"msub", L"msup", L"mden", L"mlim", L"mnum", L"mdeg"/*mmText",*/, L"mfName" };
int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( TCHAR* ); int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( TCHAR* );
//можно бинарный поиск вставить //можно бинарный поиск вставить
...@@ -86,7 +130,7 @@ public: ...@@ -86,7 +130,7 @@ public:
RenderParameter oNewParameter = oRenderParameter; RenderParameter oNewParameter = oRenderParameter;
oNewParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN; oNewParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN;
sResult.Append( oProperty.RenderToRtf( oNewParameter ) ); sResult.Append( m_oProperty.RenderToRtf( oNewParameter ) );
//if( _T("mr") == m_sRtfName ) //if( _T("mr") == m_sRtfName )
//{ //{
...@@ -113,47 +157,63 @@ public: ...@@ -113,47 +157,63 @@ public:
CString RenderToOOX(RenderParameter oRenderParameter) CString RenderToOOX(RenderParameter oRenderParameter)
{ {
CString sResult; CString sResult;
//#ifdef RTF_MATH_OOX CString sContent;
RenderParameter oNewParam = oRenderParameter; CString sProp;
sResult.Append( _T("<") ); CString sVal;
sResult += m_sOOXName;
RenderParameter oNewParam = oRenderParameter;
oNewParam.nType = RENDER_TO_OOX_PARAM_TEXT; oNewParam.nType = RENDER_TO_OOX_PARAM_TEXT;
CString sProp = oProperty.RenderToOOX( oNewParam ); sProp = m_oProperty.RenderToOOX( oNewParam );
oNewParam.nType = RENDER_TO_OOX_PARAM_MATH; //oNewParam.nType = RENDER_TO_OOX_PARAM_PLAIN;
//CString sVal = m_oVal.RenderToOOX( oNewParam ); //sVal = m_oVal.RenderToOOX( oNewParam );
//if( false == sVal.IsEmpty() )
//{
// sResult.Append( _T(" w:val=\"") );
// sResult += sVal;
// sResult.Append( _T("\"") );
//}
sResult.Append( _T(">") );
sResult.Append( sProp); if (m_bIsVal || m_bIsBool)
{
if (m_aArray.size() == 1) oNewParam.nType = RENDER_TO_OOX_PARAM_PLAIN;
sResult.Append(m_aArray[0]->RenderToOOX(oNewParam)); for( int i = 0; i < (int)m_aArray.size(); i++ )
{
sVal += m_aArray[i]->RenderToOOX(oNewParam);
}
}
else else
{ {
for( int i = 1; i < (int)m_aArray.size(); i++ ) oNewParam.nType = RENDER_TO_OOX_PARAM_MATH;
for( int i = 0; i < (int)m_aArray.size(); i++ )
{ {
sResult.Append(m_aArray[i]->RenderToOOX(oNewParam)); sContent += m_aArray[i]->RenderToOOX(oNewParam);
} }
} }
sResult.Append( _T("<") );
sResult += m_sOOXName;
if( false == sVal.IsEmpty() )
{
if (m_bIsBool)
{
if (sVal == L"on") sVal = L"1";
else sVal = L"0";
}
sResult.Append( _T(" m:val=\"") );
sResult += sVal;
sResult.Append( _T("\"") );
}
sResult.Append( _T(">") );
sResult += sProp;
sResult += sContent;
sResult.Append(_T("</") ); sResult.Append(_T("</") );
sResult += m_sOOXName; sResult += m_sOOXName;
sResult.Append(_T(">")); sResult.Append(_T(">"));
//#else //альтернативная картинка
// if( NULL != m_oPicture ) // if( NULL != m_oPicture )
// sResult.Append( m_oPicture->RenderToOOX(oRenderParameter) ); // sResult.Append( m_oPicture->RenderToOOX(oRenderParameter) );
//#endif
return sResult; return sResult;
} }
}; };
......
...@@ -3040,81 +3040,85 @@ public: ...@@ -3040,81 +3040,85 @@ public:
class RtfMathProperty: public IRenderableProperty class RtfMathProperty: public IRenderableProperty
{ {
public: int mbrkBin; public:
int mbrkBinSub; int mbrkBin;
int mdefJc; int mbrkBinSub;
int mdispDef; int mdefJc;
int minterSp; int mdispDef;
int mintraSp; int minterSp;
int mlMargin; int mintraSp;
int mmathFont; int mlMargin;
int mnaryLim; int mmathFont;
int mpostSp; int mnaryLim;
int mpreSp; int mpostSp;
int mrMargin; int mpreSp;
int msmallFrac; int mrMargin;
int mwrapIndent; int msmallFrac;
int mwrapRight; int mwrapIndent;
RtfMathProperty() int mwrapRight;
{ int mintLim;
SetDefault();
} RtfMathProperty()
{
SetDefault();
}
// bool IsValid() //bool IsValid()
// { //{
// return PROP_DEF != mbrkBin || PROP_DEF != mbrkBinSub || PROP_DEF != mdispDef || PROP_DEF != minterSp || // return PROP_DEF != mbrkBin || PROP_DEF != mbrkBinSub || PROP_DEF != mdispDef || PROP_DEF != minterSp ||
// PROP_DEF != mintraSp || PROP_DEF != mlMargin || PROP_DEF != mmathFont || PROP_DEF != mnaryLim || // PROP_DEF != mintraSp || PROP_DEF != mlMargin || PROP_DEF != mmathFont || PROP_DEF != mnaryLim ||
// PROP_DEF != mpostSp || PROP_DEF != mpreSp || PROP_DEF != mrMargin || PROP_DEF != msmallFrac || // PROP_DEF != mpostSp || PROP_DEF != mpreSp || PROP_DEF != mrMargin || PROP_DEF != msmallFrac ||
// PROP_DEF != mwrapIndent || PROP_DEF != mwrapRight ; // PROP_DEF != mwrapIndent || PROP_DEF != mwrapRight ;
// } //}
void SetDefaultRtf() void SetDefaultRtf()
{ {
SetDefault(); SetDefault();
} }
void SetDefaultOOX() void SetDefaultOOX()
{ {
SetDefault(); SetDefault();
} }
void SetDefault() void SetDefault()
{ {
DEFAULT_PROPERTY( mbrkBin ) DEFAULT_PROPERTY( mintLim )
DEFAULT_PROPERTY( mbrkBinSub ) DEFAULT_PROPERTY( mbrkBin )
mdefJc = 1; //centered as a group DEFAULT_PROPERTY( mbrkBinSub )
DEFAULT_PROPERTY( mdispDef ) mdefJc = 1; //centered as a group
DEFAULT_PROPERTY( minterSp ) DEFAULT_PROPERTY( mdispDef )
DEFAULT_PROPERTY( mintraSp ) DEFAULT_PROPERTY( minterSp )
DEFAULT_PROPERTY( mlMargin ) DEFAULT_PROPERTY( mintraSp )
DEFAULT_PROPERTY( mmathFont ) DEFAULT_PROPERTY( mlMargin )
DEFAULT_PROPERTY( mnaryLim ) DEFAULT_PROPERTY( mmathFont )
DEFAULT_PROPERTY( mpostSp ) DEFAULT_PROPERTY( mnaryLim )
DEFAULT_PROPERTY( mpreSp ) DEFAULT_PROPERTY( mpostSp )
DEFAULT_PROPERTY( mrMargin ) DEFAULT_PROPERTY( mpreSp )
DEFAULT_PROPERTY( msmallFrac ) DEFAULT_PROPERTY( mrMargin )
DEFAULT_PROPERTY( mwrapIndent ) DEFAULT_PROPERTY( msmallFrac )
DEFAULT_PROPERTY( mwrapRight ) DEFAULT_PROPERTY( mwrapIndent )
} DEFAULT_PROPERTY( mwrapRight )
CString RenderToRtf(RenderParameter oRenderParameter); }
CString RenderToOOX(RenderParameter oRenderParameter); CString RenderToRtf(RenderParameter oRenderParameter);
CString RenderToOOX(RenderParameter oRenderParameter);
}; };
class RtfMathSpecProp: public IRenderableProperty class RtfMathSpecProp: public IRenderableProperty
{ {
//moMathParaPr
public: int moMathParaPr; public:
//moMath int moMathParaPr;//moMathParaPr
int Font;
//mboxPr int Font; //moMath
int Break; int Break; //mboxPr
//meqArrPr
int RowSpacing; int RowSpacing; //meqArrPr
int RowSpacingRule; int RowSpacingRule; //mmPr
//mmPr
int CellGap; int CellGap;
int CellGapRule; int CellGapRule;
int CellSpacing; int CellSpacing;
//msSubSupPr
int malnScr; int malnScr; //msSubSupPr
//borderBoxPrp
int HideLeft; int HideLeft; //borderBoxPrp
int HideTop; int HideTop;
int HideRight; int HideRight;
int HideBottom; int HideBottom;
...@@ -3122,26 +3126,26 @@ public: int moMathParaPr; ...@@ -3122,26 +3126,26 @@ public: int moMathParaPr;
int StrikeVer; int StrikeVer;
int StrikeLR; int StrikeLR;
int StrikeRL; int StrikeRL;
//boxPrp
int Alignment; int Alignment; //boxPrp
int Differential; int Differential;
int NoBreak; int NoBreak;
int Emulator; int Emulator;
//mrPr
int NormalText; int NormalText; //mrPr
int mscr; int mscr;
int msty; int msty;
int mlit; int mlit;
//phantPrp
int mshow; int mshow; //phantPrp
int mtransp; int mtransp;
int mzeroAsc; int mzeroAsc;
int mzeroDesc; int mzeroDesc;
int mzeroWid; int mzeroWid;
//mchr
int mchr; int mchr; //mchr
//charProp
RtfCharProperty m_oCharProp; RtfCharProperty m_oCharProp; //charProp
RtfMathSpecProp() RtfMathSpecProp()
{ {
......
...@@ -765,10 +765,10 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame ...@@ -765,10 +765,10 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame
sContent.AppendFormat( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n") ); sContent.AppendFormat( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n") );
sContent.AppendFormat( _T("<%ls xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">"), sRootName.GetBuffer() ); sContent.AppendFormat( _T("<%ls xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">"), sRootName.GetBuffer() );
RenderParameter oNewParameter = oRenderParameter; RenderParameter oNewParameter = oRenderParameter;
OOXRelsWriterPtr oNewRelsWr = OOXRelsWriterPtr( new OOXRelsWriter( sFilename, *poRtfDocument ) ); OOXRelsWriterPtr oNewRelsWr = OOXRelsWriterPtr( new OOXRelsWriter( sFilename, *poRtfDocument ) );
poOOXWriter->m_oCustomRelsWriter.push_back( oNewRelsWr ); poOOXWriter->m_oCustomRelsWriter.push_back( oNewRelsWr );
oNewParameter.poRels = oNewRelsWr.get(); oNewParameter.poRels = oNewRelsWr.get();
sContent.Append( oTarget->RenderToOOX(oNewParameter) ); sContent.Append( oTarget->RenderToOOX(oNewParameter) );
sContent.AppendFormat( _T("</%ls>"), sRootName.GetBuffer() ); sContent.AppendFormat( _T("</%ls>"), sRootName.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