summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorRajashri <rajashri.udhoji@synerzip.com>2014-04-24 14:44:33 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-28 07:47:33 +0000
commitd9de57dd2acc4719f846e908284ed81f09856098 (patch)
tree64c1bb5a2203f9331bd35a4f451c282d476840af /sw
parentc865de60a769cc99c25050652aaad751771b2249 (diff)
fdo#77713 : File Corruption - Header.xml
Document containing track changes within a SDT content is getting corrupted. Reason for corruption: In export side,parent tag [SDT] is getting closed before child tag ['del' tag]. The corruption is resolved now. Change-Id: I42451495f80e30ddfebab8b81bcf1e309b0c2ca2 Reviewed-on: https://gerrit.libreoffice.org/9146 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/SdtContent.docxbin0 -> 24609 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
3 files changed, 11 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/SdtContent.docx b/sw/qa/extras/ooxmlexport/data/SdtContent.docx
new file mode 100644
index 000000000000..91e0ef0e44cb
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/SdtContent.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index f33771f4d946..5dc3bcf2f348 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2947,6 +2947,14 @@ DECLARE_OOXMLEXPORT_TEST(testlvlPicBulletId, "lvlPicBulletId.docx")
assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0);
}
+DECLARE_OOXMLEXPORT_TEST(testSdtContent, "SdtContent.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/header1.xml");
+ if (!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:del[1]");
+}
+
DECLARE_OOXMLEXPORT_TEST(testCitation,"FDO74775.docx")
{
xmlDocPtr pXmlDoc = parseExport();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 27835b308780..33219995f8da 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -836,6 +836,9 @@ void DocxAttributeOutput::EndRun()
// append the actual run end
m_pSerializer->endElementNS( XML_w, XML_r );
+ // if there is some redlining in the document, output it
+ EndRedline( m_pRedlineData );
+
// enclose in a sdt block, if necessary
WriteSdtBlock( m_nRunSdtPrToken, m_pRunSdtPrTokenChildren, m_pRunSdtPrDataBindingAttrs );
m_pSerializer->mergeTopMarks();
@@ -848,9 +851,6 @@ void DocxAttributeOutput::EndRun()
WritePendingPlaceholder();
- // if there is some redlining in the document, output it
- EndRedline( m_pRedlineData );
-
m_pRedlineData = NULL;
if ( m_closeHyperlinkInThisRun )