fdo#79915:Text Data Lost after exporting through LO
In the OutputTextNode, the text data is postponed when the in case of
NOT_PROCESSED state of fly frame. This text data is never been processed
later.
When the text data is postponed we should write this before processing
the next text node.
Change-Id: Ib8d5fdcf8dcfb9ff394d32103502150e08bbd521
Reviewed-on: https://gerrit.libreoffice.org/9737
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79915.docx b/sw/qa/extras/ooxmlexport/data/fdo79915.docx
new file mode 100644
index 0000000..351674d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo79915.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 27752df..d97be6f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3617,6 +3617,15 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79822, "fdo79822.docx")
return;
}
DECLARE_OOXMLEXPORT_TEST(testFDO79915, "fdo79915.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[8]/w:t", "How much buoyancy does the water provide?");
}
DECLARE_OOXMLEXPORT_TEST(testfdo79817,"fdo79817.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 1bc795e..d885948 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2320,6 +2320,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
AttrOutput().RunText( aSavedSnippet, eChrSet );
AttrOutput().EndRun();
}
else if( bPostponeWritingText && FLY_NOT_PROCESSED == nStateOfFlyFrame )
{
//write the postponed text run
bPostponeWritingText = false ;
AttrOutput().RunText( aSavedSnippet, eChrSet );
AttrOutput().EndRun();
}
else
AttrOutput().EndRun();