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

PriyankaGaikwad priyanka.gaikwad at synerzip.com
Fri Jan 10 08:01:51 PST 2014


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

New commits:
commit b4e9e7726f0c67938e8b80e6b7c2883459d0b533
Author: PriyankaGaikwad <priyanka.gaikwad at synerzip.com>
Date:   Fri Dec 27 10:26:51 2013 +0530

    fdo#69613 DOCX export: Fix for '\o' flag field should export once.
    
    (This is partial fix for this bug)
    Description:
    TOC flag field '\o' exported twice after roundtrip because the export logic for '\o' is repeated in ww8atr.cxx.
    
    XML file difference
    In document.xml
    Before :
        <w:instrText>
         TOC \o "1-3" \o "1-3" \h
        </w:instrText>
    
    After :
        <w:instrText>
         TOC \o "1-3" \h
        </w:instrText>
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
    	https://gerrit.libreoffice.org/7206
    
    Change-Id: I136744927b8d5a48869a2bfc87278bede697c655

diff --git a/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx b/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx
new file mode 100644
index 0000000..ea0958a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/TOC_field_f.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 26dc77a..4f189e1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2304,6 +2304,20 @@ DECLARE_OOXMLEXPORT_TEST(testFDO71834, "fdo71834.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[4]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFieldFlagO,"TOC_field_f.docx")
+{
+   // This test case is to verify \o flag should come once.
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed
+    // not to insert an empty paragraph before TOC.
+    xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText");
+    xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
+    OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content));
+    CPPUNIT_ASSERT(contents.match(" TOC \\f \\o \"1-3\" \\h"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 4a800b1..e9d1069 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2120,23 +2120,6 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
                             sStr += OUString((sal_Char)( 'A' + GetExport( ).GetId( *pTOX->GetTOXType() ) ));
                             sStr += sEntryEnd;
                         }
-
-                        if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
-                        {
-                            const int nMinLvl = nTOXLvl;
-                            if ( nMinLvl > 0 )
-                            {
-                                int nTmpLvl = nMinLvl;
-                                if (nTmpLvl > WW8ListManager::nMaxLevel)
-                                    nTmpLvl = WW8ListManager::nMaxLevel;
-
-                                sStr += "\\o \"1-";
-                                sStr += OUString::number(nTmpLvl);
-                                sStr += sEntryEnd;
-
-                            }
-                        }
-
                         if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
                         {
                             // Take the TOC value of the max level to evaluate to as


More information about the Libreoffice-commits mailing list