20#include <com/sun/star/frame/XModel.hpp>
21#include <com/sun/star/util/Duration.hpp>
22#include <com/sun/star/xml/sax/XAttributeList.hpp>
23#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
24#include <com/sun/star/presentation/XPresentationSupplier.hpp>
25#include <com/sun/star/container/XIndexContainer.hpp>
26#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
35using namespace ::
cppu;
52 Reference< XCustomPresentationSupplier > xShowsSupplier( rImport.GetModel(), UNO_QUERY );
53 if( xShowsSupplier.is() )
55 mxShows = xShowsSupplier->getCustomPresentations();
59 Reference< XDrawPagesSupplier > xDrawPagesSupplier( rImport.GetModel(), UNO_QUERY );
60 if( xDrawPagesSupplier.is() )
61 mxPages.set( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
63 Reference< XPresentationSupplier > xPresentationSupplier( rImport.GetModel(), UNO_QUERY );
64 if( xPresentationSupplier.is() )
65 mxPresProps.set( xPresentationSupplier->getPresentation(), UNO_QUERY );
73 bool bIsMouseVisible =
true;
74 if (rImport.getGeneratorVersion() < SvXMLImport::LO_6x)
75 bIsMouseVisible =
false;
80 switch( aIter.getToken() )
84 mxPresProps->setPropertyValue(
"FirstPage",
Any(aIter.toString()) );
100 const sal_Int32 nMS = (aDuration.Hours * 60 +
101 aDuration.Minutes) * 60 + aDuration.Seconds;
108 mxPresProps->setPropertyValue(
"AllowAnimations", aAny );
114 mxPresProps->setPropertyValue(
"IsAlwaysOnTop", aAny );
120 mxPresProps->setPropertyValue(
"IsAutomatic", aAny );
132 mxPresProps->setPropertyValue(
"IsFullScreen", aAny );
143 mxPresProps->setPropertyValue(
"StartWithNavigator", aAny );
155 mxPresProps->setPropertyValue(
"IsTransitionOnClick", aAny );
161 mxPresProps->setPropertyValue(
"IsShowLogo", aAny );
167 mxPresProps->setPropertyValue(
"IsMouseVisible",
Any(bIsMouseVisible) );
176 mxPresProps->setPropertyValue(
"CustomShow", aAny );
182 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
192 OUString sValue = aIter.toString();
194 switch( aIter.getToken() )
205 if( !
aName.isEmpty() && !aPages.isEmpty() )
207 Reference< XIndexContainer > xShow(
mxShowFactory->createInstance(), UNO_QUERY );
211 std::u16string_view sPageNameView;
215 OUString sPageName(sPageNameView);
216 if( !
mxPages->hasByName( sPageName ) )
219 Reference< XDrawPage > xPage;
220 mxPages->getByName( sPageName ) >>= xPage;
223 xShow->insertByIndex( xShow->getCount(),
Any(xPage) );
css::uno::Reference< css::container::XNameAccess > mxPages
css::uno::Reference< css::lang::XSingleServiceFactory > mxShowFactory
css::uno::Reference< css::beans::XPropertySet > mxPresProps
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SdXMLShowsContext(SdXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
OUString maCustomShowName
css::uno::Reference< css::container::XNameContainer > mxShows
virtual ~SdXMLShowsContext() override
This class deliberately does not support XWeak, to improve performance when loading large documents.
bool getNextToken(std::u16string_view &rToken)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
@ XML_START_WITH_NAVIGATOR
@ XML_TRANSITION_ON_CLICK
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
#define XML_ELEMENT(prefix, name)