mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-15 23:58:12 +08:00
rtf formfield, fix odt fields
This commit is contained in:
@ -1752,9 +1752,7 @@ bool RtfFieldReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,
|
||||
m_oField.m_pInsert = oNewFieldInst;
|
||||
}
|
||||
}
|
||||
else if ( "datafield" == sCommand )
|
||||
Skip( oDocument, oReader );
|
||||
else if ( "fldrslt" == sCommand )
|
||||
else if ( "fldrslt" == sCommand )
|
||||
{
|
||||
RtfFieldInstPtr oNewFieldInst = RtfFieldInstPtr(new RtfFieldInst());
|
||||
oNewFieldInst->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
@ -1783,6 +1781,20 @@ bool RtfFieldInstReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
|
||||
return true;
|
||||
if( "fldrslt" == sCommand )
|
||||
return true;
|
||||
else if ("formfield" == sCommand)
|
||||
{
|
||||
RtfFormFieldPtr oNewFormField = RtfFormFieldPtr(new RtfFormField());
|
||||
|
||||
RtfFormFieldReader oFormFieldReader(*oNewFormField.get());
|
||||
StartSubReader(oFormFieldReader, oDocument, oReader);
|
||||
|
||||
if (oNewFormField->IsValid())
|
||||
{
|
||||
m_oFieldInst.m_pFormField = oNewFormField;
|
||||
}
|
||||
}
|
||||
else if ("ffdeftext" == sCommand)
|
||||
Skip(oDocument, oReader);
|
||||
else
|
||||
{
|
||||
RtfCharPropsCommand::ExecuteCommand( oDocument, oReader, sCommand, hasParameter, parameter, &m_oFieldInst.m_oCharProperty );
|
||||
@ -1790,6 +1802,48 @@ bool RtfFieldInstReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
|
||||
return RtfParagraphPropDestination::ExecuteCommand( oDocument, oReader, (*this), sCommand, hasParameter, parameter );
|
||||
}
|
||||
}
|
||||
void RtfFormFieldReader::ExecuteText(RtfDocument& oDocument, RtfReader& oReader, std::wstring sText)
|
||||
{
|
||||
if (is_name == m_eInternalState) m_oFormField.name += sText;
|
||||
else if (is_deftext == m_eInternalState) m_oFormField.deftext += sText;
|
||||
else if (is_datafield == m_eInternalState) m_oFormField.datafield += sText;
|
||||
else if (is_format == m_eInternalState) m_oFormField.format += sText;
|
||||
else if (is_helptext == m_eInternalState) m_oFormField.helptext += sText;
|
||||
else if (is_stattext == m_eInternalState) m_oFormField.stattext += sText;
|
||||
else if (is_entrymcr == m_eInternalState) m_oFormField.entrymcr += sText;
|
||||
else if (is_exitmcr == m_eInternalState) m_oFormField.exitmcr += sText;
|
||||
else if (is_list == m_eInternalState) m_oFormField.list.push_back(sText);
|
||||
}
|
||||
bool RtfFormFieldReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
|
||||
{
|
||||
if ("formfield" == sCommand)
|
||||
return true;
|
||||
|
||||
m_eInternalState = is_none;
|
||||
if ("datafield" == sCommand) m_eInternalState = is_datafield;
|
||||
else if ("ffname" == sCommand) m_eInternalState = is_name;
|
||||
else if ("ffdeftext" == sCommand) m_eInternalState = is_deftext;
|
||||
else if ("ffformat" == sCommand) m_eInternalState = is_format;
|
||||
else if ("ffhelptext" == sCommand) m_eInternalState = is_helptext;
|
||||
else if ("ffstattext" == sCommand) m_eInternalState = is_stattext;
|
||||
else if ("ffentrymcr" == sCommand) m_eInternalState = is_entrymcr;
|
||||
else if ("ffexitmcr" == sCommand) m_eInternalState = is_exitmcr;
|
||||
else if ("ffl" == sCommand) m_eInternalState = is_list;
|
||||
COMMAND_RTF_INT("fftype", m_oFormField.type, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffownhelp", m_oFormField.ownhelp, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffownstat", m_oFormField.ownstat, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffprot", m_oFormField.prot, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffsize", m_oFormField.sizeCheckBox, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("fftypetx", m_oFormField.typetx, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffrecalc", m_oFormField.recalc, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffhaslistbox", m_oFormField.haslistbox, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffmaxlen", m_oFormField.maxlen, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffhps", m_oFormField.hps, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffdefres", m_oFormField.defres, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT("ffres", m_oFormField.res, sCommand, hasParameter, parameter)
|
||||
|
||||
return true;
|
||||
}
|
||||
bool RtfOleBinReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
|
||||
{
|
||||
if ( "objdata" == sCommand )
|
||||
|
||||
Reference in New Issue
Block a user