[Libreoffice-commits] core.git: sw/qa sw/source

Dinesh Patil dinesh.patil at synerzip.com
Mon Apr 28 00:29:27 PDT 2014


 sw/qa/extras/ooxmlexport/data/FDO77715.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx    |    9 +++++++++
 sw/source/filter/ww8/ww8atr.cxx             |   12 ++++++++----
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit c865de60a769cc99c25050652aaad751771b2249
Author: Dinesh Patil <dinesh.patil at synerzip.com>
Date:   Wed Apr 23 13:29:29 2014 +0530

    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 at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/FDO77715.docx b/sw/qa/extras/ooxmlexport/data/FDO77715.docx
new file mode 100644
index 0000000..f93a46e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/FDO77715.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 18f91a8..f33771f 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 839d70c..b82ea5c 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)


More information about the Libreoffice-commits mailing list