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>
34using namespace ::
cppu;
51 Reference< XCustomPresentationSupplier > xShowsSupplier( rImport.GetModel(), UNO_QUERY );
52 if( xShowsSupplier.is() )
54 mxShows = xShowsSupplier->getCustomPresentations();
58 Reference< XDrawPagesSupplier > xDrawPagesSupplier( rImport.GetModel(), UNO_QUERY );
59 if( xDrawPagesSupplier.is() )
60 mxPages.set( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
62 Reference< XPresentationSupplier > xPresentationSupplier( rImport.GetModel(), UNO_QUERY );
63 if( xPresentationSupplier.is() )
64 mxPresProps.set( xPresentationSupplier->getPresentation(), UNO_QUERY );
72 bool bIsMouseVisible =
true;
73 if (rImport.getGeneratorVersion() < SvXMLImport::LO_6x)
74 bIsMouseVisible =
false;
79 switch( aIter.getToken() )
83 mxPresProps->setPropertyValue(
"FirstPage",
Any(aIter.toString()) );
99 const sal_Int32 nMS = (aDuration.Hours * 60 +
100 aDuration.Minutes) * 60 + aDuration.Seconds;
107 mxPresProps->setPropertyValue(
"AllowAnimations", aAny );
113 mxPresProps->setPropertyValue(
"IsAlwaysOnTop", aAny );
119 mxPresProps->setPropertyValue(
"IsAutomatic", aAny );
131 mxPresProps->setPropertyValue(
"IsFullScreen", aAny );
142 mxPresProps->setPropertyValue(
"StartWithNavigator", aAny );
154 mxPresProps->setPropertyValue(
"IsTransitionOnClick", aAny );
160 mxPresProps->setPropertyValue(
"IsShowLogo", aAny );
166 mxPresProps->setPropertyValue(
"IsMouseVisible",
Any(bIsMouseVisible) );
175 mxPresProps->setPropertyValue(
"CustomShow", aAny );
181 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
191 OUString sValue = aIter.toString();
193 switch( aIter.getToken() )
204 if( !
aName.isEmpty() && !aPages.isEmpty() )
206 Reference< XIndexContainer > xShow(
mxShowFactory->createInstance(), UNO_QUERY );
210 std::u16string_view sPageNameView;
214 OUString sPageName(sPageNameView);
215 if( !
mxPages->hasByName( sPageName ) )
218 Reference< XDrawPage > xPage;
219 mxPages->getByName( sPageName ) >>= xPage;
222 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)