summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-02-07 12:22:52 +0100
committerAndras Timar <andras.timar@collabora.com>2018-02-12 19:59:47 +0100
commitd7763fb35f7556acffa5543f7b2a8eda47862fd1 (patch)
treea680e9f104ba09912c6a843c1726526f46306240 /sd/qa
parent6f05db5a19c0bd82b937e2c79f766bb35c60acc1 (diff)
tdf#115394 export correct slide transition time in PPT
Change-Id: Ie293dd4cc128c256e39d54fdcd83bb5e13484662 Reviewed-on: https://gerrit.libreoffice.org/49345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/49523 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/ppt/tdf115394.pptbin0 -> 90112 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx39
-rw-r--r--sd/qa/unit/import-tests.cxx25
3 files changed, 64 insertions, 0 deletions
diff --git a/sd/qa/unit/data/ppt/tdf115394.ppt b/sd/qa/unit/data/ppt/tdf115394.ppt
new file mode 100644
index 000000000000..1fd299a5e4be
--- /dev/null
+++ b/sd/qa/unit/data/ppt/tdf115394.ppt
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f42673006e82..a1f067287de5 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -95,6 +95,7 @@ public:
void testEmbeddedPdf();
void testTdf100926();
void testTextRotation();
+ void testTdf115394PPT();
CPPUNIT_TEST_SUITE(SdExportTest);
@@ -112,6 +113,7 @@ public:
CPPUNIT_TEST(testEmbeddedPdf);
CPPUNIT_TEST(testTdf100926);
CPPUNIT_TEST(testTextRotation);
+ CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST_SUITE_END();
@@ -708,6 +710,43 @@ void SdExportTest::testTextRotation()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf115394PPT()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf115394.ppt"), PPT);
+
+ // Export the document and import again for a check
+ uno::Reference< lang::XComponent > xComponent(xDocShRef->GetModel(), uno::UNO_QUERY);
+ uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OStringToOUString(OString(aFileFormats[PPT].pFilterName), RTL_TEXTENCODING_UTF8);
+
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+ xComponent.set(xStorable, uno::UNO_QUERY);
+ xComponent->dispose();
+ xDocShRef = loadURL(aTempFile.GetURL(), PPT);
+
+ double fTransitionDuration;
+
+ // Fast
+ SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+ fTransitionDuration = pPage1->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+ // Medium
+ SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+ fTransitionDuration = pPage2->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+ // Slow
+ SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+ fTransitionDuration = pPage3->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 187d678a2958..0796cebbaef0 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -151,6 +151,7 @@ public:
void testActiveXCheckbox();
void testTdf108926();
void testTdf115394();
+ void testTdf115394PPT();
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -221,6 +222,7 @@ public:
CPPUNIT_TEST(testActiveXCheckbox);
CPPUNIT_TEST(testTdf108926);
CPPUNIT_TEST(testTdf115394);
+ CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST_SUITE_END();
};
@@ -2293,6 +2295,29 @@ void SdImportTest::testTdf115394()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf115394PPT()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf115394.ppt"), PPT);
+ double fTransitionDuration;
+
+ // Fast
+ SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+ fTransitionDuration = pPage1->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+ // Medium
+ SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+ fTransitionDuration = pPage2->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+ // Slow
+ SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+ fTransitionDuration = pPage3->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();