xref: /trunk/main/oox/source/ppt/layoutfragmenthandler.cxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 
LayoutFragmentHandler(XmlFilterBase & rFilter,const OUString & rFragmentPath,SlidePersistPtr pMasterPersistPtr)46 LayoutFragmentHandler::LayoutFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr )
47     throw()
48 : SlideFragmentHandler( rFilter, rFragmentPath, pMasterPersistPtr, Layout )
49 {
50 }
51 
~LayoutFragmentHandler()52 LayoutFragmentHandler::~LayoutFragmentHandler()
53     throw()
54 {
55 
56 }
57 
createFastChildContext(sal_Int32 aElementToken,const Reference<XFastAttributeList> & xAttribs)58 Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs )
59 {
60     Reference< XFastContextHandler > xRet = getFastContextHandler();
61     switch( aElementToken )
62     {
63         case PPT_TOKEN( sldLayout ):        // CT_SlideLayout
64             mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) );   // CT_SlideLayoutType
65         break;
66         case PPT_TOKEN( hf ):               // CT_HeaderFooter
67             xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
68         break;
69         default:
70             xRet.set( SlideFragmentHandler::createFastChildContext( aElementToken, xAttribs ) );
71     }
72     return xRet;
73 }
74 
endDocument()75 void SAL_CALL LayoutFragmentHandler::endDocument()
76 {
77 }
78 
79 } }
80