diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2021-06-23 13:15:57 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-06-29 09:50:25 +0200 |
commit | 3d55149dcf19cffefcc19c16a3abbe8851453c5e (patch) | |
tree | 61559ceb6cbe1261d6ebec6ddb77cd4ff33d5831 /oox | |
parent | a63679f30a2c455fe0a6471e76a0ec8e3aecd0ea (diff) |
tdf#142913 PPTX: slideshow setting “Start from” not imported
Note: see Slide Show->Slide Show Settings...->Range->From:
on the UI, or press Shift-F5 after loading the unit test
document sd/qa/unit/data/pptx/tdf142913.pptx.
Change-Id: I2e10a4353c26600bf405475cb89990413c81dc1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117705
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/ppt/presPropsfragmenthandler.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
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; } |