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.get() );
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 OUString aBookmarkName( sHREF.copy( nIndex+1 ) );
199 xProps->setPropertyValue(
"BookmarkURL", uno::makeAny( 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() )
314 xNewDrawPage = xDrawPages->insertNewByIndex(xDrawPages->getCount());
320 aAny >>= xNewDrawPage;
326 if(xNewDrawPage.is())
SdXMLDrawPageContext(SdXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
void SetLayout()
sets the presentation layout at this page.
OUString maUseHeaderDeclName
SdXMLBodyContext(SdXMLImport &rImport)
const SdXMLImport & GetSdImport() const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SvXMLImport & GetImport()
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 ...
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
OUString maUseFooterDeclName
virtual ~SdXMLBodyContext() override
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
virtual ~SdXMLDrawPageContext() override
void DeleteAllShapes()
deletes all shapes on this drawing page
sal_Int32 GetNewPageCount() 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 ...
OUString maUseDateTimeDeclName
OUString maPageLayoutName
This class deliberately does not support XWeak, to improve performance when loading large documents...
OUString GetAbsoluteReference(const OUString &rValue) const
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
#define SAL_WARN_IF(condition, area, stream)
Handling of tokens in XML:
const css::uno::Reference< css::drawing::XShapes > & GetLocalShapesContext() const
#define XML_ELEMENT(prefix, name)
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) 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
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
const OUString & registerReference(const css::uno::Reference< css::uno::XInterface > &rInterface)
returns a unique identifier for the given uno object.
void SetStyle(OUString const &rStyleName)
sets the page style on this page
static void postProcessRootNode(const css::uno::Reference< css::animations::XAnimationNode > &xNode, css::uno::Reference< css::beans::XPropertySet > const &xPageProps)
void IncrementNewPageCount()
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()