summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-08 18:00:34 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-08 18:14:55 +0200
commitab52bb712c335e88cf100b3b8336a46b7673eb98 (patch)
tree724b951cef11afe5c5059fba7fb0808069ebcf42 /sw/qa
parentd61f8185e660a6820351b8cea3ac51d344f0ab3e (diff)
DOCX export: fix handling of shapes containing and also anchored inside tables
Change-Id: I6f23bd0e0553b8f6435537b542fc82ee55a64c03
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/textbox-table.docxbin0 -> 16404 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/textbox-table.docx b/sw/qa/extras/ooxmlexport/data/textbox-table.docx
new file mode 100644
index 000000000000..8c06f5eeb088
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/textbox-table.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 9b493398767a..279be0030435 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -424,6 +424,17 @@ DECLARE_OOXMLEXPORT_TEST(testMultiPageToc, "multi-page-toc.docx")
CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty<OUString>(getRun(getParagraphOfText(1, xHeaderText), 1), "TextPortionType"));
}
+DECLARE_OOXMLEXPORT_TEST(testTextboxTable, "textbox-table.docx")
+{
+ // We wrote not-well-formed XML during export for this one:
+ // Shape with textbox, having a table and also anchored inside a table.
+
+ // Just make sure that we have both tables.
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */