summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-02-02 10:21:50 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2018-02-07 10:28:12 +0100
commita8a3e6a7fee5ac23bc2155b9391ead9402211147 (patch)
treec381a276f8e3b4e69e335a203fffeb6083ad4165 /sd
parente89964ebb3ba3bd7d694695c004c5f976d8d9616 (diff)
tdf#115394 import custom slide transition time in PPTX
* custom values are imported correctly * standard (fast, slow, medium) values are changed to match values in the MSO Change-Id: I004242afbbf641fe414abc8df248a2844c104502 Reviewed-on: https://gerrit.libreoffice.org/49139 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf115394.pptxbin0 -> 31282 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx34
-rw-r--r--sd/source/ui/inc/unoprnms.hxx1
-rw-r--r--sd/source/ui/unoidl/unopage.cxx2
4 files changed, 36 insertions, 1 deletions
diff --git a/sd/qa/unit/data/pptx/tdf115394.pptx b/sd/qa/unit/data/pptx/tdf115394.pptx
new file mode 100644
index 000000000000..d01c90270f34
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf115394.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c54989eff192..652b6ace8626 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -174,6 +174,7 @@ public:
void testTdf114488();
void testTdf114913();
void testTdf114821();
+ void testTdf115394();
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST(testTdf114488);
CPPUNIT_TEST(testTdf114913);
CPPUNIT_TEST(testTdf114821);
+ CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST_SUITE_END();
};
@@ -2380,6 +2382,38 @@ void SdImportTest::testTdf114821()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf115394()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394.pptx"), PPTX);
+ double fTransitionDuration;
+
+ // Slow in MS formats
+ SdPage* pPage1 = xDocShRef->GetDoc()->GetSdPage(0, PageKind::Standard);
+ fTransitionDuration = pPage1->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(1.0, fTransitionDuration);
+
+ // Medium in MS formats
+ SdPage* pPage2 = xDocShRef->GetDoc()->GetSdPage(1, PageKind::Standard);
+ fTransitionDuration = pPage2->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.75, fTransitionDuration);
+
+ // Fast in MS formats
+ SdPage* pPage3 = xDocShRef->GetDoc()->GetSdPage(2, PageKind::Standard);
+ fTransitionDuration = pPage3->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.5, fTransitionDuration);
+
+ // Custom values
+ SdPage* pPage4 = xDocShRef->GetDoc()->GetSdPage(3, PageKind::Standard);
+ fTransitionDuration = pPage4->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(0.25, fTransitionDuration);
+
+ SdPage* pPage5 = xDocShRef->GetDoc()->GetSdPage(4, PageKind::Standard);
+ fTransitionDuration = pPage5->getTransitionDuration();
+ CPPUNIT_ASSERT_EQUAL(4.25, fTransitionDuration);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/inc/unoprnms.hxx b/sd/source/ui/inc/unoprnms.hxx
index 3dd438f0ec28..1e5e3b910f3e 100644
--- a/sd/source/ui/inc/unoprnms.hxx
+++ b/sd/source/ui/inc/unoprnms.hxx
@@ -33,6 +33,7 @@
#define UNO_NAME_PAGE_NUMBER "Number"
#define UNO_NAME_PAGE_ORIENTATION "Orientation"
#define UNO_NAME_PAGE_SPEED "Speed"
+#define UNO_NAME_PAGE_TRANSITION_DURATION "TransitionDuration"
#define UNO_NAME_PAGE_WIDTH "Width"
#define UNO_NAME_PAGE_PREVIEW "Preview"
#define UNO_NAME_PAGE_PREVIEWBITMAP "PreviewBitmap"
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index fd1f877ec78b..2263860bfa02 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -142,7 +142,7 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind eP
{ OUString("TransitionSubtype"), WID_TRANSITION_SUBTYPE, ::cppu::UnoType<sal_Int16>::get(), 0, 0},
{ OUString("TransitionDirection"), WID_TRANSITION_DIRECTION, ::cppu::UnoType<sal_Bool>::get(), 0, 0},
{ OUString("TransitionFadeColor"), WID_TRANSITION_FADE_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0},
- { OUString("TransitionDuration"), WID_TRANSITION_DURATION, ::cppu::UnoType<double>::get(), 0, 0},
+ { OUString(UNO_NAME_PAGE_TRANSITION_DURATION), WID_TRANSITION_DURATION, ::cppu::UnoType<double>::get(), 0, 0},
{ OUString("LoopSound"), WID_LOOP_SOUND, cppu::UnoType<bool>::get(), 0, 0},
{ OUString("NavigationOrder"), WID_NAVORDER, cppu::UnoType<css::container::XIndexAccess>::get(),0, 0},
{ OUString(), 0, css::uno::Type(), 0, 0 }