1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include "comphelper/anytostring.hxx" 25 #include "cppuhelper/exc_hlp.hxx" 26 27 #include <com/sun/star/beans/XMultiPropertySet.hpp> 28 #include <com/sun/star/container/XNamed.hpp> 29 30 #include "headerfootercontext.hxx" 31 #include "oox/ppt/layoutfragmenthandler.hxx" 32 #include "oox/drawingml/shapegroupcontext.hxx" 33 34 using rtl::OUString; 35 using namespace ::com::sun::star; 36 using namespace ::oox::core; 37 using namespace ::oox::drawingml; 38 using namespace ::com::sun::star::uno; 39 using namespace ::com::sun::star::xml::sax; 40 using namespace ::com::sun::star::container; 41 42 namespace oox { namespace ppt { 43 44 // CT_SlideLayout 45 46 LayoutFragmentHandler::LayoutFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) 47 throw() 48 : SlideFragmentHandler( rFilter, rFragmentPath, pMasterPersistPtr, Layout ) 49 { 50 } 51 52 LayoutFragmentHandler::~LayoutFragmentHandler() 53 throw() 54 { 55 56 } 57 58 Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) 59 throw (SAXException, RuntimeException) 60 { 61 Reference< XFastContextHandler > xRet = getFastContextHandler(); 62 switch( aElementToken ) 63 { 64 case PPT_TOKEN( sldLayout ): // CT_SlideLayout 65 mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType 66 break; 67 case PPT_TOKEN( hf ): // CT_HeaderFooter 68 xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) ); 69 break; 70 default: 71 xRet.set( SlideFragmentHandler::createFastChildContext( aElementToken, xAttribs ) ); 72 } 73 return xRet; 74 } 75 76 void SAL_CALL LayoutFragmentHandler::endDocument() 77 throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException) 78 { 79 } 80 81 } } 82 83