summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/ppt/presPropsfragmenthandler.hxx1
-rw-r--r--oox/source/ppt/presPropsfragmenthandler.cxx18
-rw-r--r--sd/qa/unit/data/pptx/tdf142913.pptxbin0 -> 35076 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx19
4 files changed, 38 insertions, 0 deletions
diff --git a/include/oox/ppt/presPropsfragmenthandler.hxx b/include/oox/ppt/presPropsfragmenthandler.hxx
index 3edf60cf3273..5125ee3357c7 100644
--- a/include/oox/ppt/presPropsfragmenthandler.hxx
+++ b/include/oox/ppt/presPropsfragmenthandler.hxx
@@ -33,6 +33,7 @@ public:
private:
bool m_bLoop = false;
OUString m_sId;
+ OUString m_sSt;
};
} // namespace ppt
} // namespace oox
diff --git a/oox/source/ppt/presPropsfragmenthandler.cxx b/oox/source/ppt/presPropsfragmenthandler.cxx
index 47965050b164..ca466177e944 100644
--- a/oox/source/ppt/presPropsfragmenthandler.cxx
+++ b/oox/source/ppt/presPropsfragmenthandler.cxx
@@ -13,12 +13,17 @@
#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <oox/core/xmlfilterbase.hxx>
#include <oox/helper/attributelist.hxx>
#include <oox/ppt/presPropsfragmenthandler.hxx>
#include <oox/token/namespaces.hxx>
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
namespace oox::ppt
{
PresPropsFragmentHandler::PresPropsFragmentHandler(core::XmlFilterBase& rFilter,
@@ -47,6 +52,16 @@ void PresPropsFragmentHandler::finalizeImport()
xPresentationProps->setPropertyValue("CustomShow",
css::uno::Any(aNameSeq[m_sId.toInt32()]));
}
+
+ if (!m_sSt.isEmpty())
+ {
+ Reference<drawing::XDrawPagesSupplier> xDPS(getFilter().getModel(), uno::UNO_QUERY_THROW);
+ Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
+ Reference<drawing::XDrawPage> xDrawPage;
+ xDrawPages->getByIndex(m_sSt.toInt32() - 1) >>= xDrawPage;
+ Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW);
+ xPresentationProps->setPropertyValue("FirstPage", uno::Any(xNamed->getName()));
+ }
}
core::ContextHandlerRef PresPropsFragmentHandler::onCreateContext(sal_Int32 aElementToken,
@@ -62,6 +77,9 @@ core::ContextHandlerRef PresPropsFragmentHandler::onCreateContext(sal_Int32 aEle
case PPT_TOKEN(custShow):
m_sId = rAttribs.getString(XML_id).get();
return this;
+ case PPT_TOKEN(sldRg):
+ m_sSt = rAttribs.getString(XML_st).get();
+ return this;
}
return this;
}
diff --git a/sd/qa/unit/data/pptx/tdf142913.pptx b/sd/qa/unit/data/pptx/tdf142913.pptx
new file mode 100644
index 000000000000..4fd938de1e41
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf142913.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 8723c0ee53b8..708c8a375482 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -122,6 +122,7 @@ public:
virtual void setUp() override;
void testDocumentLayout();
+ void testTdf142913();
void testTdf142590();
void testCustomSlideShow();
void testInternalHyperlink();
@@ -242,6 +243,7 @@ public:
CPPUNIT_TEST_SUITE(SdImportTest);
CPPUNIT_TEST(testDocumentLayout);
+ CPPUNIT_TEST(testTdf142913);
CPPUNIT_TEST(testTdf142590);
CPPUNIT_TEST(testCustomSlideShow);
CPPUNIT_TEST(testInternalHyperlink);
@@ -438,6 +440,23 @@ void SdImportTest::testDocumentLayout()
}
}
+void SdImportTest::testTdf142913()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142913.pptx"), PPTX);
+
+ uno::Reference<presentation::XPresentationSupplier> xPresentationSupplier(
+ xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xPresentationProps(xPresentationSupplier->getPresentation(),
+ uno::UNO_QUERY_THROW);
+
+ OUString sFirstPage = xPresentationProps->getPropertyValue("FirstPage").get<OUString>();
+
+ CPPUNIT_ASSERT_EQUAL(OUString("Second"), sFirstPage);
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testTdf142590()
{
::sd::DrawDocShellRef xDocShRef