diff --git a/ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp b/ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp index efb9e5eb28..ae466c0324 100644 --- a/ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp @@ -93,8 +93,10 @@ void FormFieldData::_FFData::read(VirtualStreamReader *reader) { xstzTextDef = readXstz(reader); } - - wDef = reader->ReadUInt16(); + else if (iType == 1 || iType == 2) + { + wDef = reader->ReadUInt16(); + } xstzTextFormat = readXstz(reader); xstzHelpText = readXstz(reader); diff --git a/ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h b/ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h index adbe6acaad..13abb9324a 100644 --- a/ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h +++ b/ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h @@ -60,7 +60,7 @@ namespace DocFileFormat m_pXmlWriter->WriteNodeBegin( L"w:ffData"); m_pXmlWriter->WriteNodeBegin( L"w:name", true); - m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzName); + m_pXmlWriter->WriteAttribute(L"w:val", XmlUtils::EncodeXmlString(ffData->FFData.xstzName)); m_pXmlWriter->WriteNodeEnd(L"w:name", true, true ); m_pXmlWriter->WriteNodeBegin(L"w:enabled", true); @@ -76,26 +76,26 @@ namespace DocFileFormat { m_pXmlWriter->WriteNodeBegin(L"w:helpText", true); m_pXmlWriter->WriteAttribute(L"w:type", ffData->FFData.fOwnHelp ? L"text" : L"autoText"); - m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzHelpText); + m_pXmlWriter->WriteAttribute(L"w:val", XmlUtils::EncodeXmlString(ffData->FFData.xstzHelpText)); m_pXmlWriter->WriteNodeEnd(L"w:helpText", true, true); } if (false == ffData->FFData.xstzStatText.empty()) { m_pXmlWriter->WriteNodeBegin(L"w:statusText", true); m_pXmlWriter->WriteAttribute(L"w:type", ffData->FFData.fOwnStat ? L"text" : L"autoText"); - m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzStatText); + m_pXmlWriter->WriteAttribute(L"w:val", XmlUtils::EncodeXmlString(ffData->FFData.xstzStatText)); m_pXmlWriter->WriteNodeEnd(L"w:statusText", true, true); } if (false == ffData->FFData.xstzEntryMcr.empty()) { m_pXmlWriter->WriteNodeBegin(L"w:entryMacro", true); - m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzEntryMcr); + m_pXmlWriter->WriteAttribute(L"w:val", XmlUtils::EncodeXmlString(ffData->FFData.xstzEntryMcr)); m_pXmlWriter->WriteNodeEnd(L"w:entryMacro", true, true); } if (false == ffData->FFData.xstzExitMcr.empty()) { m_pXmlWriter->WriteNodeBegin(L"w:exitMacro", true); - m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzExitMcr); + m_pXmlWriter->WriteAttribute(L"w:val", XmlUtils::EncodeXmlString(ffData->FFData.xstzExitMcr)); m_pXmlWriter->WriteNodeEnd(L"w:exitMacro", true, true); } if (ffData->FFData.iType == 1)