23#include <com/sun/star/drawing/XDrawPage.hpp>
24#include <com/sun/star/drawing/XDrawPages.hpp>
25#include <com/sun/star/container/XNamed.hpp>
26#include <com/sun/star/presentation/XPresentationPage.hpp>
28#include <com/sun/star/drawing/XMasterPageTarget.hpp>
29#include <com/sun/star/beans/XPropertySet.hpp>
30#include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
43 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
44 uno::Reference< drawing::XShapes >
const & rShapes)
46, mbHadSMILNodes( false )
48 bool bHaveXmlId(
false );
49 OUString sXmlId, sStyleName, sContextName, sMasterPageName, sHREF;
53 OUString sValue = aIter.toString();
54 switch(aIter.getToken())
58 sContextName = sValue;
68 sMasterPageName = sValue;
101 if (!bHaveXmlId) { sXmlId = sValue; }
118 if (!sXmlId.isEmpty())
120 uno::Reference< uno::XInterface >
const xRef( rShapes );
121 GetImport().getInterfaceToIdentifierMapper().registerReference(
124 GetImport().GetShapeImport()->startPage( rShapes );
126 uno::Reference< drawing::XDrawPage > xShapeDrawPage(rShapes, uno::UNO_QUERY);
129 if(!sContextName.isEmpty())
131 if(xShapeDrawPage.is())
133 uno::Reference < container::XNamed > xNamed(xShapeDrawPage, uno::UNO_QUERY);
135 xNamed->setName(sContextName);
140 if(!sMasterPageName.isEmpty())
147 uno::Reference< drawing::XDrawPages > xMasterPages(
GetSdImport().GetLocalMasterPages(), uno::UNO_QUERY);
148 uno::Reference < drawing::XMasterPageTarget > xDrawPage(rShapes, uno::UNO_QUERY);
149 uno::Reference< drawing::XDrawPage > xMasterPage;
151 if(xDrawPage.is() && xMasterPages.is())
157 for(sal_Int32
a = 0; !bDone &&
a < xMasterPages->getCount();
a++)
159 uno::Any aAny(xMasterPages->getByIndex(
a));
160 aAny >>= xMasterPage;
164 uno::Reference < container::XNamed > xMasterNamed(xMasterPage, uno::UNO_QUERY);
165 if(xMasterNamed.is())
167 OUString sLoopMasterPageName = xMasterNamed->getName();
169 if(!sLoopMasterPageName.isEmpty() && sLoopMasterPageName ==
sDisplayName)
171 xDrawPage->setMasterPage(xMasterPage);
178 SAL_WARN_IF( !bDone,
"xmloff",
"xmloff::SdXMLDrawPageContext::SdXMLDrawPageContext(), could not find a master slide!" );
184 if( !sHREF.isEmpty() )
186 uno::Reference< beans::XPropertySet > xProps( xShapeDrawPage, uno::UNO_QUERY );
189 sal_Int32
nIndex = sHREF.lastIndexOf(
'#' );
192 OUString aFileName( sHREF.copy( 0,
nIndex ) );
193 std::u16string_view aBookmarkName( sHREF.subView(
nIndex+1 ) );
195 sHREF =
GetImport().GetAbsoluteReference( aFileName ) +
"#"
199 xProps->setPropertyValue(
"BookmarkURL",
uno::Any( sHREF ) );
213 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList)
225 uno::Reference< presentation::XPresentationPage > xPresPage(
GetLocalShapesContext(), uno::UNO_QUERY);
228 uno::Reference< drawing::XDrawPage > xNotesDrawPage = xPresPage->getNotesPage();
229 if(xNotesDrawPage.is())
245 uno::Reference< animations::XAnimationNodeSupplier > xNodeSupplier(
GetLocalShapesContext(), uno::UNO_QUERY);
246 if(xNodeSupplier.is())
271 uno::Reference< animations::XAnimationNodeSupplier > xNodeSupplier(
GetLocalShapesContext(), uno::UNO_QUERY);
273 if(xNodeSupplier.is())
289 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
305 uno::Reference< drawing::XDrawPage > xNewDrawPage;
306 uno::Reference< drawing::XDrawPages > xDrawPages(
GetSdImport().GetLocalDrawPages(), uno::UNO_QUERY);
308 if( !xDrawPages.is() )
311 if(
GetSdImport().GetNewPageCount() + 1 > xDrawPages->getCount())
314 xNewDrawPage = xDrawPages->insertNewByIndex(xDrawPages->getCount());
320 aAny >>= xNewDrawPage;
326 if(xNewDrawPage.is())
SdXMLBodyContext(SdXMLImport &rImport)
virtual ~SdXMLBodyContext() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const SdXMLImport & GetSdImport() const
SdXMLDrawPageContext(SdXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
virtual ~SdXMLDrawPageContext() override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
OUString maUseHeaderDeclName
const SdXMLImport & GetSdImport() const
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
void SetLayout()
sets the presentation layout at this page.
OUString maUseDateTimeDeclName
void DeleteAllShapes()
deletes all shapes on this drawing page
OUString maUseFooterDeclName
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const css::uno::Reference< css::drawing::XShapes > & GetLocalShapesContext() const
OUString maPageLayoutName
void SetStyle(OUString const &rStyleName)
sets the page style on this page
void IncrementNewPageCount()
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
static void postProcessRootNode(const css::uno::Reference< css::animations::XAnimationNode > &xNode, css::uno::Reference< css::beans::XPropertySet > const &xPageProps)
#define SAL_WARN_IF(condition, area, stream)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
@ XML_PRESENTATION_PAGE_LAYOUT_NAME
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XML_ELEMENT(prefix, name)