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

Rajashri rajashri.udhoji at synerzip.com
Fri Feb 14 10:25:32 CET 2014


 sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx    |binary
 sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx |binary
 sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx             |binary
 sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx           |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                            |   56 ++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx                        |    2 
 sw/source/filter/ww8/ww8atr.cxx                                     |   12 +-
 7 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit d738b063134e97c780205f8baf138f291016ded4
Author: Rajashri <rajashri.udhoji at synerzip.com>
Date:   Mon Feb 3 19:29:16 2014 +0530

    fdo#74431 : Captions' are preserved but remove a space
    
    For the below captions :
    ALPHABETIC
    alphabetic
    ROMAN
    roman
    ARABIC
    in document.xml, captions were added as
    <w:instrText xml:space="preserve"> SEQ "scientific" *ROMAN </w:instrText>
    -no space after *
    -Double quotes added for scientific
    -For Caption ARABIC, it was comming as
    <w:instrText xml:space="preserve"> SEQ scientific *Arabic </w:instrText>
    it should be
    <w:instrText xml:space="preserve"> SEQ scientific * ARABIC </w:instrText>
    - After adding the above code, anchor value for a hyperlink tag was getting
    corrupted. So aaded a fix for that.
    UT which was failing due to above code changes :testBnc834035
    "equality assertion failed
    - Expected: _Toc363553908
    - Actual  : Figure!1|sequence"
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Reviewed on:
    	https://gerrit.libreoffice.org/7839
    
    Change-Id: I9124eefa0ae63baf7ee3eaa2148f3c739d6fa699

diff --git a/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx
new file mode 100644
index 0000000..e6d6bdf
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx
new file mode 100644
index 0000000..7657d05
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx
new file mode 100644
index 0000000..50415bc
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx
new file mode 100644
index 0000000..f445ab6
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 79e0bac..5a0b817 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3126,6 +3126,62 @@ DECLARE_OOXMLEXPORT_TEST(testIndentation, "test_indentation.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind", "end", "");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testCaption1, "EquationAsScientificNumbering.docx")
+{
+    // fdo#74431 : This test case is to verify the Captions are comming properly
+    //earlier it was comming as "SEQ "scientific"\*ROMAN now it is SEQ scientific\* ROMAN"
+
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p/w:r[3]/w:instrText");
+    xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
+    OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content));
+    CPPUNIT_ASSERT(contents.match(" SEQ scientific \\* ROMAN"));
+}
+
+
+
+DECLARE_OOXMLEXPORT_TEST(testCaption2, "EquationWithAboveAndBelowCaption.docx")
+{
+    // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip
+    // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[5]/w:r[3]/w:instrText");
+    xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
+    OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content));
+    CPPUNIT_ASSERT(contents.match(" SEQ Equation \\* ARABIC"));
+}
+
+
+DECLARE_OOXMLEXPORT_TEST(testCaption3, "FigureAsLabelPicture.docx")
+{
+    // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip
+    // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[3]/w:instrText");
+    xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
+    OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content));
+    CPPUNIT_ASSERT(contents.match(" SEQ picture \\* ARABIC"));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testCaption4, "TableWithAboveCaptions.docx")
+{
+    // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip
+    // This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[3]/w:instrText");
+    xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
+    OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content));
+    CPPUNIT_ASSERT(contents.match(" SEQ Table \\* ARABIC"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5f6fed3..6e306e7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1431,7 +1431,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
                 if (nPos != -1)
                 {
                     // Extract <seqname>, the field instruction text has the name quoted.
-                    OUString aSequenceName = OUString('"') + sMark.copy(0, nPos) + OUString('"');
+                    OUString aSequenceName = sMark.copy(0, nPos);
                     // Extract <index>.
                     sal_uInt32 nIndex = sMark.copy(nPos + 1, sMark.getLength() - nPos - sizeof("|sequence")).toInt32();
                     std::map<OUString, std::vector<OString> >::iterator it = m_aSeqBookmarksNames.find(aSequenceName);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d326cef..79d9f6a 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2384,24 +2384,24 @@ void AttributeOutputBase::GetNumberPara( OUString& rStr, const SwField& rFld )
     {
         case SVX_NUM_CHARS_UPPER_LETTER:
         case SVX_NUM_CHARS_UPPER_LETTER_N:
-            rStr += "\\*ALPHABETIC ";
+            rStr += "\\* ALPHABETIC ";
             break;
         case SVX_NUM_CHARS_LOWER_LETTER:
         case SVX_NUM_CHARS_LOWER_LETTER_N:
-            rStr += "\\*alphabetic ";
+            rStr += "\\* alphabetic ";
             break;
         case SVX_NUM_ROMAN_UPPER:
-            rStr += "\\*ROMAN ";
+            rStr += "\\* ROMAN ";
             break;
         case SVX_NUM_ROMAN_LOWER:
-            rStr += "\\*roman ";
+            rStr += "\\* roman ";
             break;
         default:
             OSL_ENSURE(rFld.GetFormat() == SVX_NUM_ARABIC,
                 "Unknown numbering type exported as default of Arabic\n");
             //fallthrough
         case SVX_NUM_ARABIC:
-            rStr += "\\*Arabic ";
+            rStr += "\\* ARABIC ";
             break;
         case SVX_NUM_PAGEDESC:
             //Nothing, use word's default
@@ -2579,7 +2579,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
     case RES_SETEXPFLD:
         if (nsSwGetSetExpType::GSE_SEQ == nSubType)
         {
-            OUString sStr = FieldString(ww::eSEQ) + "\"" + pFld->GetTyp()->GetName() +"\" ";
+            OUString sStr = FieldString(ww::eSEQ) +  pFld->GetTyp()->GetName() + " ";
             GetNumberPara( sStr, *pFld );
             GetExport().OutputField(pFld, ww::eSEQ, sStr);
         }


More information about the Libreoffice-commits mailing list