summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-04-09 14:32:54 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2020-04-09 16:50:41 +0200
commit569f88693e0a6a0eb8f04fa8f8ffccf1cbd112f1 (patch)
tree050efdd3360997c1a3d9e7a85aec721b97a63ad5 /sd
parent086142ba70c51be7487a40d433dc75656f637cdf (diff)
sd: move some import tests to export tests
Change-Id: I1003f153e7baf7568f44359784af7df3e9e33270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91971 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx76
-rw-r--r--sd/qa/unit/import-tests.cxx70
2 files changed, 76 insertions, 70 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index fa555e9c57b5..5c6167485c87 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -18,6 +18,7 @@
#include <svx/svdotext.hxx>
#include <svx/svdomedia.hxx>
+#include <svx/svdotable.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlndsit.hxx>
#include <rtl/ustring.hxx>
@@ -88,6 +89,9 @@ public:
void testBnc822341();
void testMathObject();
void testMathObjectPPT2010();
+ void testTdf119015();
+ void testTdf123090();
+ void testTdf126324();
void testTdf80224();
void testExportTransitionsPPTX();
void testPresetShapesExport();
@@ -192,6 +196,9 @@ public:
CPPUNIT_TEST(testBnc822341);
CPPUNIT_TEST(testMathObject);
CPPUNIT_TEST(testMathObjectPPT2010);
+ CPPUNIT_TEST(testTdf119015);
+ CPPUNIT_TEST(testTdf123090);
+ CPPUNIT_TEST(testTdf126324);
CPPUNIT_TEST(testTdf80224);
CPPUNIT_TEST(testExportTransitionsPPTX);
CPPUNIT_TEST(testPresetShapesExport);
@@ -476,6 +483,75 @@ void SdOOXMLExportTest2::testMathObjectPPT2010()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf119015()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf119015.pptx"), PPTX);
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
+ // The position was previously not properly initialized: (0, 0, 100, 100)
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(6991, 6902), Size(14099, 1999)),
+ pTableObj->GetLogicRect());
+ uno::Reference<table::XTable> xTable(pTableObj->getTable());
+
+ // Test that we actually have three cells: this threw css.lang.IndexOutOfBoundsException
+ uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("A3"), xTextRange->getString());
+
+ xDocShRef->DoClose();
+}
+
+void SdOOXMLExportTest2::testTdf123090()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf123090.pptx"), PPTX);
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
+
+ uno::Reference<table::XTable> xTable(pTableObj->getTable());
+
+ // Test that we actually have two cells: this threw css.lang.IndexOutOfBoundsException
+ uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("aaa"), xTextRange->getString());
+
+ sal_Int32 nWidth;
+ const OUString sWidth("Width");
+ uno::Reference< css::table::XTableColumns > xColumns( xTable->getColumns(), uno::UNO_SET_THROW);
+ uno::Reference< beans::XPropertySet > xRefColumn( xColumns->getByIndex(1), uno::UNO_QUERY_THROW );
+ xRefColumn->getPropertyValue( sWidth ) >>= nWidth;
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(9136), nWidth);
+
+ xDocShRef->DoClose();
+}
+
+void SdOOXMLExportTest2::testTdf126324()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126324.pptx"), PPTX);
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDoc.is());
+ uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPage.is());
+ uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
+ CPPUNIT_ASSERT(xShape.is());
+ uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY_THROW )->getText();
+ CPPUNIT_ASSERT_EQUAL(OUString("17"), xText->getString());
+
+ xDocShRef->DoClose();
+}
+
void SdOOXMLExportTest2::testTdf80224()
{
::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf80224.odp"), ODP);
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index d3670d167ff5..bccfc56dc392 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -207,15 +207,12 @@ public:
void testTdf116899();
void testTdf77747();
void testTdf116266();
- void testTdf126324();
void testTdf128684();
void testShapeGlowEffectPPTXImpoer();
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
void testPptCrop();
- void testTdf119015();
- void testTdf123090();
void testTdf120028();
void testTdf120028b();
void testDescriptionImport();
@@ -312,15 +309,12 @@ public:
CPPUNIT_TEST(testTdf114913);
CPPUNIT_TEST(testTdf114821);
CPPUNIT_TEST(testTdf115394);
- CPPUNIT_TEST(testTdf126324);
CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testTdf51340);
CPPUNIT_TEST(testTdf116899);
CPPUNIT_TEST(testTdf77747);
CPPUNIT_TEST(testTdf116266);
CPPUNIT_TEST(testPptCrop);
- CPPUNIT_TEST(testTdf119015);
- CPPUNIT_TEST(testTdf123090);
CPPUNIT_TEST(testTdf120028);
CPPUNIT_TEST(testTdf120028b);
CPPUNIT_TEST(testDescriptionImport);
@@ -2801,55 +2795,6 @@ void SdImportTest::testTdf116266()
xDocShRef->DoClose();
}
-void SdImportTest::testTdf119015()
-{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf119015.pptx"), PPTX);
-
- const SdrPage* pPage = GetPage(1, xDocShRef);
-
- sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT(pTableObj);
- // The position was previously not properly initialized: (0, 0, 100, 100)
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(6991, 6902), Size(14099, 1999)),
- pTableObj->GetLogicRect());
- uno::Reference<table::XTable> xTable(pTableObj->getTable());
-
- // Test that we actually have three cells: this threw css.lang.IndexOutOfBoundsException
- uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
- uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL(OUString("A3"), xTextRange->getString());
-
- xDocShRef->DoClose();
-}
-
-void SdImportTest::testTdf123090()
-{
- ::sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf123090.pptx"), PPTX);
-
- const SdrPage* pPage = GetPage(1, xDocShRef);
-
- sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
- CPPUNIT_ASSERT(pTableObj);
-
- uno::Reference<table::XTable> xTable(pTableObj->getTable());
-
- // Test that we actually have two cells: this threw css.lang.IndexOutOfBoundsException
- uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
- uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL(OUString("aaa"), xTextRange->getString());
-
- sal_Int32 nWidth;
- const OUString sWidth("Width");
- uno::Reference< css::table::XTableColumns > xColumns( xTable->getColumns(), uno::UNO_SET_THROW);
- uno::Reference< beans::XPropertySet > xRefColumn( xColumns->getByIndex(1), uno::UNO_QUERY_THROW );
- xRefColumn->getPropertyValue( sWidth ) >>= nWidth;
- CPPUNIT_ASSERT_EQUAL( sal_Int32(9136), nWidth);
-
- xDocShRef->DoClose();
-}
-
void SdImportTest::testTdf120028()
{
// Check that the table shape has 4 columns.
@@ -2923,21 +2868,6 @@ void SdImportTest::testTdf120028b()
xDocShRef->DoClose();
}
-void SdImportTest::testTdf126324()
-{
- sd::DrawDocShellRef xDocShRef
- = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126324.pptx"), PPTX);
- uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
- uno::UNO_QUERY);
- CPPUNIT_ASSERT(xDoc.is());
- uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xPage.is());
- uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
- CPPUNIT_ASSERT(xShape.is());
- uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY_THROW )->getText();
- CPPUNIT_ASSERT_EQUAL(OUString{"17"}, xText->getString());
-}
-
void SdImportTest::testDescriptionImport()
{
sd::DrawDocShellRef xDocShRef