tdf#106181: sc_subsequent_export_test: Add unittest

Change-Id: I0d6481466642173df16bba841ede95a9a018b0eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101928
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2020-09-02 13:34:45 +02:00
parent c1d234830a
commit 3696b51de1
2 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

@@ -225,6 +225,7 @@ public:
void testTdf133595();
void testTdf134769();
void testTdf106181();
void testTdf105272();
void testTdf118990();
void testTdf121612();
@@ -381,6 +382,7 @@ public:
CPPUNIT_TEST(testTdf133595);
CPPUNIT_TEST(testTdf134769);
CPPUNIT_TEST(testTdf106181);
CPPUNIT_TEST(testTdf105272);
CPPUNIT_TEST(testTdf118990);
CPPUNIT_TEST(testTdf121612);
@@ -4622,6 +4624,28 @@ void ScExportTest::testTdf134769()
xDocSh->DoClose();
}
void ScExportTest::testTdf106181()
{
ScDocShellRef xDocSh = loadDoc("tdf106181.", FORMAT_ODS);
CPPUNIT_ASSERT(xDocSh.is());
std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
CPPUNIT_ASSERT(pSheet);
assertXPath(pSheet, "/x:worksheet/mc:AlternateContent/mc:Choice/x:controls/mc:AlternateContent/mc:Choice/x:control", "name", "Check Box");
assertXPath(pSheet, "/x:worksheet/mc:AlternateContent/mc:Choice/x:controls/mc:AlternateContent/mc:Choice/x:control/x:controlPr", "altText", "Check Box 1");
xmlDocUniquePtr pDrawing = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
CPPUNIT_ASSERT(pDrawing);
assertXPath(pDrawing, "/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr", "name", "Check Box 1");
assertXPath(pDrawing, "/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr", "descr", "Check Box");
assertXPath(pDrawing, "/xdr:wsDr/mc:AlternateContent/mc:Choice/xdr:twoCellAnchor/xdr:sp/xdr:nvSpPr/xdr:cNvPr", "hidden", "0");
xDocSh->DoClose();
}
void ScExportTest::testTdf105272()
{
ScDocShellRef xDocSh = loadDoc("tdf105272.", FORMAT_XLSX);