[Libreoffice-commits] core.git: sd/qa sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 22 12:16:26 UTC 2019
sd/qa/unit/data/odp/loopNoPause.odp |binary
sd/qa/unit/data/odp/loopPause10.odp |binary
sd/qa/unit/data/ppt/loopNoPause.ppt |binary
sd/qa/unit/import-tests.cxx | 28 ++++++++++++++++++++++++++++
sd/source/core/drawdoc.cxx | 2 +-
5 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit bde5a8623262e50c12a073eb5a78c95211a650a3
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Feb 22 11:45:56 2019 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Feb 22 13:15:47 2019 +0100
tdf#61679 tdf#83247: default presentation pause should be 0 s
OpenDocument Version 1.2 [1] requires that missing presentation:pause
attribute be treated as if 0 s duration was set.
Changing the default here in PresentationSettings ctor will (1) allow LO
to conform to the standard reading ODF; (2) not introduce the 10-s pause
when importing external formats (such as PPT, which has no pause, and
should work as if the pause is 0 s); and (3) change the default pause
value for the newly created presentation (if no template is used).
[1] http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1417722_253892949
Change-Id: I6df2e83d07980b679574ec81fae001ca40f116fd
Reviewed-on: https://gerrit.libreoffice.org/68190
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sd/qa/unit/data/odp/loopNoPause.odp b/sd/qa/unit/data/odp/loopNoPause.odp
new file mode 100644
index 000000000000..d9be1c2dcac4
Binary files /dev/null and b/sd/qa/unit/data/odp/loopNoPause.odp differ
diff --git a/sd/qa/unit/data/odp/loopPause10.odp b/sd/qa/unit/data/odp/loopPause10.odp
new file mode 100644
index 000000000000..0e3e316db314
Binary files /dev/null and b/sd/qa/unit/data/odp/loopPause10.odp differ
diff --git a/sd/qa/unit/data/ppt/loopNoPause.ppt b/sd/qa/unit/data/ppt/loopNoPause.ppt
new file mode 100644
index 000000000000..d82879a5247e
Binary files /dev/null and b/sd/qa/unit/data/ppt/loopNoPause.ppt differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 56f7a11cc267..c47982d39066 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/presentation/ClickAction.hpp>
#include <com/sun/star/presentation/XPresentationPage.hpp>
+#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
@@ -195,6 +196,7 @@ public:
void testTdf120028b();
void testTdf44223();
void testDescriptionImport();
+ void testTdf83247();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -281,6 +283,7 @@ public:
CPPUNIT_TEST(testTdf120028b);
CPPUNIT_TEST(testTdf44223);
CPPUNIT_TEST(testDescriptionImport);
+ CPPUNIT_TEST(testTdf83247);
CPPUNIT_TEST_SUITE_END();
};
@@ -2666,6 +2669,31 @@ void SdImportTest::testDescriptionImport()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf83247()
+{
+ auto GetPause = [this](const OUString& sSrc, sal_Int32 nFormat) {
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(sSrc), nFormat);
+ uno::Reference<presentation::XPresentationSupplier> xPresentationSupplier(
+ xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPresentationProps(
+ xPresentationSupplier->getPresentation(), uno::UNO_QUERY_THROW);
+
+ auto retVal = xPresentationProps->getPropertyValue("Pause");
+ xDocShRef->DoClose();
+ return retVal.get<sal_Int32>();
+ };
+
+ // 1. Check that presentation:pause attribute is imported correctly
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10), GetPause("/sd/qa/unit/data/odp/loopPause10.odp", ODP));
+
+ // 2. ODF compliance: if presentation:pause attribute is absent, it must be treated as 0
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), GetPause("/sd/qa/unit/data/odp/loopNoPause.odp", ODP));
+
+ // 3. Import PPT: pause should be 0
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), GetPause("/sd/qa/unit/data/ppt/loopNoPause.ppt", PPT));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 58c8a404b144..1ff77f1283c3 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -105,7 +105,7 @@ PresentationSettings::PresentationSettings()
mbAlwaysOnTop( false ),
mbFullScreen( true ),
mbAnimationAllowed( true ),
- mnPauseTimeout( 10 ),
+ mnPauseTimeout( 0 ),
mbShowPauseLogo( false )
{
}
More information about the Libreoffice-commits
mailing list