summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinesh Patil <dinesh.patil@synerzip.com>2014-04-23 13:29:29 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-28 07:28:57 +0000
commitc865de60a769cc99c25050652aaad751771b2249 (patch)
tree763bfd5b224917347d1d7faa2ba94308e421ca58
parenta3c00ee3c7b3b0fbcde32baeb7023c7e8526b908 (diff)
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/9145 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/FDO77715.docxbin0 -> 120055 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx12
3 files changed, 17 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/FDO77715.docx b/sw/qa/extras/ooxmlexport/data/FDO77715.docx
new file mode 100644
index 000000000000..f93a46e0f3d3
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/FDO77715.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 18f91a8ce92a..f33771f4d946 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -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");
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 839d70cb0565..b82ea5c7285d 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -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)