10#include <com/sun/star/beans/XPropertySet.hpp>
11#include <com/sun/star/frame/XModel.hpp>
12#include <com/sun/star/presentation/XPresentationSupplier.hpp>
13#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
14#include <com/sun/star/container/XNamed.hpp>
15#include <com/sun/star/drawing/XDrawPages.hpp>
16#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
21#include <oox/token/namespaces.hxx>
29 const OUString& rFragmentPath)
30 : FragmentHandler2(rFilter, rFragmentPath)
38 css::uno::Reference<css::presentation::XPresentationSupplier> xPresentationSupplier(
39 getFilter().getModel(), css::uno::UNO_QUERY_THROW);
40 css::uno::Reference<css::beans::XPropertySet> xPresentationProps(
41 xPresentationSupplier->getPresentation(), css::uno::UNO_QUERY_THROW);
42 xPresentationProps->setPropertyValue(
"IsEndless", css::uno::Any(
m_bLoop));
43 xPresentationProps->setPropertyValue(
"IsAutomatic", css::uno::Any(!
m_bTiming));
47 css::uno::Reference<css::presentation::XCustomPresentationSupplier>
48 XCustPresentationSupplier(getFilter().getModel(), css::uno::UNO_QUERY_THROW);
49 css::uno::Reference<css::container::XNameContainer> mxCustShows;
50 mxCustShows = XCustPresentationSupplier->getCustomPresentations();
51 const css::uno::Sequence<OUString> aNameSeq(mxCustShows->getElementNames());
52 xPresentationProps->setPropertyValue(
"CustomShow",
53 css::uno::Any(aNameSeq[
m_sId.toInt32()]));
58 Reference<drawing::XDrawPagesSupplier> xDPS(getFilter().getModel(), uno::UNO_QUERY_THROW);
59 Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
60 Reference<drawing::XDrawPage> xDrawPage;
61 xDrawPages->getByIndex(
m_sSt.toInt32() - 1) >>= xDrawPage;
62 Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW);
63 xPresentationProps->setPropertyValue(
"FirstPage",
uno::Any(xNamed->getName()));
70 switch (aElementToken)
72 case PPT_TOKEN(presentationPr):
74 case PPT_TOKEN(showPr):
78 case PPT_TOKEN(custShow):
81 case PPT_TOKEN(sldRg):
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
std::optional< bool > getBool(sal_Int32 nAttrToken) const
Returns the boolean value of the specified attribute.
PresPropsFragmentHandler(core::XmlFilterBase &rFilter, const OUString &rFragmentPath)
virtual void finalizeImport() override
virtual ~PresPropsFragmentHandler() override
virtual core::ContextHandlerRef onCreateContext(sal_Int32 aElementToken, const AttributeList &rAttribs) override