summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorRajashri <rajashri.udhoji@synerzip.com>2014-02-03 19:29:16 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-14 10:25:03 +0100
commitd738b063134e97c780205f8baf138f291016ded4 (patch)
tree5a733d9053db4b5d1fac7f87cbec6d51b818b851 /sw
parent64fe9c6fd5888a7eeed34a20787d2d61da02378f (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docxbin0 -> 16850 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docxbin0 -> 15211 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docxbin0 -> 109122 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docxbin0 -> 14761 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx56
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx12
7 files changed, 63 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx
new file mode 100644
index 000000000000..e6d6bdf4484a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/EquationAsScientificNumbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx
new file mode 100644
index 000000000000..7657d050786b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/EquationWithAboveAndBelowCaption.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx
new file mode 100644
index 000000000000..50415bc1c9dd
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/FigureAsLabelPicture.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx
new file mode 100644
index 000000000000..f445ab6b153d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/TableWithAboveCaptions.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 79e0bacc8bb7..5a0b8171d043 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 5f6fed317953..6e306e79b11c 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 d326cef4125b..79d9f6aeb406 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);
}