summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavindra Vidhate <ravindra.vidhate@synerzip.com>2014-05-15 16:12:23 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-05-20 03:53:51 -0500
commit1870ed0e4f63e9c58476e7dcd160e04eb866e0f5 (patch)
treef10c6b02e4da3b6069a40f3f41440051d0a6c7e3
parent76531b80ea49e9665c628a2e5f8b82280ef80704 (diff)
fdo#78659:FIle geting corrupted after Roundtrip due to fieldchar.
In a hyperlink, the field with fieldchartype="end" is getting addeded eventhough there is no begin for that field. Change-Id: I50df6efc63fc9a66b146d4a861ae4bd654b4a3c6 Reviewed-on: https://gerrit.libreoffice.org/9368 Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo78659.docxbin0 -> 225907 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78659.docx b/sw/qa/extras/ooxmlexport/data/fdo78659.docx
new file mode 100644
index 000000000000..55d6d08eb5d4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo78659.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 7f3a5b71f98b..f70f58df5ead 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3362,6 +3362,15 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78284, "fdo78284.docx")
"image/png");
}
+DECLARE_OOXMLEXPORT_TEST(testFDO78659, "fdo78659.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[8]/w:tr[6]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0);
+}
+
DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 19807f40565c..6608149709b9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1866,7 +1866,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
bool DocxAttributeOutput::EndURL()
{
m_closeHyperlinkInThisRun = true;
- if(m_hyperLinkAnchor != "" && m_hyperLinkAnchor.startsWith("_Toc"))
+ if(m_startedHyperlink && m_hyperLinkAnchor != "" && m_hyperLinkAnchor.startsWith("_Toc"))
{
m_endPageRef = true;
}