Kaydet (Commit) c865de60 authored tarafından Dinesh Patil's avatar Dinesh Patil Kaydeden (comit) Miklos Vajna

fdo#77715: Fix for TOC flag field \c

Description:
If SEQIdentifier for TOC field \c is not there then blank "" are getting added
due to which opening of RT file in LO was causing system hang.

Implementation:
1) Check added for SEQIdentifier, if found then add SEQIdentifier with ""
e.g. {TOC \c "SEQ"}
2) If SEQIdentifier not found then don't add ""
e.g. {TOC \c}

Change-Id: I9dbfa1db51358908b246456201428de8b4104e10
Reviewed-on: https://gerrit.libreoffice.org/9145Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst a3c00ee3
......@@ -2248,6 +2248,15 @@ DECLARE_OOXMLEXPORT_TEST(testPreserveXfieldTOC, "PreserveXfieldTOC.docx")
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h");
}
DECLARE_OOXMLEXPORT_TEST(testFDO77715,"FDO77715.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText[1]", " TOC \\c ");
}
DECLARE_OOXMLEXPORT_TEST(testTrackChangesParagraphProperties, "testTrackChangesParagraphProperties.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
......
......@@ -2172,10 +2172,14 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
{
sStr = FieldString(eCode);
sStr += "\\c \"";
sStr += pTOX->GetSequenceName();
sStr += sEntryEnd;
sStr += "\\c ";
OUString seqName = pTOX->GetSequenceName();
if(!seqName.isEmpty())
{
sStr += "\"";
sStr += seqName;
sStr += sEntryEnd;
}
OUString aTxt;
int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(), 1, aTxt );
if (1 == nRet)
......
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