summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-20 17:45:14 +0200
committerMichael Stahl <mstahl@redhat.com>2017-09-20 23:11:21 +0200
commit86f256596c8566e80993e1cf6035bc3534b6f816 (patch)
tree2ca662d955cc8d7844be770f2f4abf03df6aff98 /sc/qa
parent6c6e0149e0bc9607f4d3e601915e77d6646bc809 (diff)
tdf#112005 xmloff: ODF export: export embedded object text *first*
... before adding any attributes, so that the attributes don't erroneously get added to the paragraph element. Also fix the problem that if you set "ODF format version" to 1.1 or 1.2, export asserts in SvXMLNamespaceMap::GetQNameByKey() because the "loext" namespace isn't registered, and creates an invalid <p> element. Change-Id: I637f9d3ff746d877ced480e35ef53f4545a06a4b
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 0cccc54f026d..4ceb568bc26a 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -136,6 +136,7 @@ public:
void testLandscapeOrientationXLSX();
void testInlineArrayXLS();
+ void testEmbeddedChartODS();
void testEmbeddedChartXLS();
void testCellAnchoredGroupXLS();
@@ -258,6 +259,7 @@ public:
CPPUNIT_TEST(testAllRowsHiddenXLSX);
CPPUNIT_TEST(testLandscapeOrientationXLSX);
CPPUNIT_TEST(testInlineArrayXLS);
+ CPPUNIT_TEST(testEmbeddedChartODS);
CPPUNIT_TEST(testEmbeddedChartXLS);
CPPUNIT_TEST(testCellAnchoredGroupXLS);
@@ -356,6 +358,8 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{ BAD_CAST("office"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:office:1.0") },
{ BAD_CAST("table"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0") },
{ BAD_CAST("text"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0") },
+ { BAD_CAST("style"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:style:1.0") },
+ { BAD_CAST("draw"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0") },
{ BAD_CAST("xlink"), BAD_CAST("http://www.w3c.org/1999/xlink") },
{ BAD_CAST("xdr"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing") },
{ BAD_CAST("x"), BAD_CAST("http://schemas.openxmlformats.org/spreadsheetml/2006/main") },
@@ -2110,6 +2114,24 @@ void ScExportTest::testInlineArrayXLS()
xDocSh->DoClose();
}
+void ScExportTest::testEmbeddedChartODS()
+{
+ ScDocShellRef xShell = loadDoc("embedded-chart.", FORMAT_XLS);
+ CPPUNIT_ASSERT(xShell.is());
+
+ std::shared_ptr<utl::TempFile> pTempFile(
+ ScBootstrapFixture::exportTo(xShell.get(), FORMAT_ODS));
+
+ xmlDocPtr pDoc = XPathHelper::parseExport(pTempFile, m_xSFactory, "content.xml");
+ CPPUNIT_ASSERT(pDoc);
+ assertXPath(pDoc,
+ "/office:document-content/office:body/office:spreadsheet/table:table[2]/table:table-row[7]/table:table-cell[2]/draw:frame/draw:object",
+ "notify-on-update-of-ranges",
+ "Chart1.B3:Chart1.B5 Chart1.C2:Chart1.C2 Chart1.C3:Chart1.C5");
+
+ xShell->DoClose();
+}
+
void ScExportTest::testEmbeddedChartXLS()
{
ScDocShellRef xShell = loadDoc("embedded-chart.", FORMAT_XLS);