summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-23 17:48:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-23 17:56:07 +0200
commiteae5d8de6dde0ea4dd1494b0e1f036789b7c6220 (patch)
tree8e6a0266540cb526bba376ec168ea73ff9e6193f /sw
parent23e1fc277d5651babce17bb74408ef6505f101d2 (diff)
DOCX export: fix duplicated OLE objects
Change-Id: I5b73fcbdbad26505e3ddd66d246354110c0f2e88
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/chart-dupe.docxbin0 -> 25367 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx3
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/chart-dupe.docx b/sw/qa/extras/ooxmlexport/data/chart-dupe.docx
new file mode 100644
index 000000000000..545f9665f728
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/chart-dupe.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index dd458e942777..d45db672738e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -263,6 +263,15 @@ DECLARE_OOXMLEXPORT_TEST(testSdtRunPicture, "sdt-run-picture.docx")
}
}
+DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx")
+{
+ // Single chart was exported back as two charts.
+ uno::Reference<text::XTextEmbeddedObjectsSupplier> xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY);
+ // This was 2, on second import we got a duplicated chart copy.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xEmbeddedObjects->getCount());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index c17e3af5c573..540ed1997239 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2236,7 +2236,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if ( aAttrIter.IsDropCap( nNextAttr ) )
AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFmtDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner );
- if (0 != nEnd)
+ // Only output character attributes if this is not a postponed text run.
+ if (0 != nEnd && !(bPostponeWritingText && FLY_PROCESSED == nStateOfFlyFrame))
{
// Output the character attributes
// #i51277# do this before writing flys at end of paragraph