Update ooo320-m1
[ooovba.git] / oox / source / drawingml / textliststylecontext.cxx
blob18cff95726432ef8637a100c3f60b359ad6a6094
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: textliststylecontext.cxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "oox/drawingml/textliststylecontext.hxx"
32 #include "oox/drawingml/textparagraphpropertiescontext.hxx"
33 #include "oox/core/namespaces.hxx"
34 #include "oox/helper/attributelist.hxx"
35 #include "tokens.hxx"
37 using ::rtl::OUString;
38 using namespace ::oox::core;
39 using namespace ::com::sun::star::uno;
40 using namespace ::com::sun::star::xml::sax;
42 namespace oox { namespace drawingml {
44 // --------------------------------------------------------------------
46 // CT_TextListStyle
47 TextListStyleContext::TextListStyleContext( ContextHandler& rParent, TextListStyle& rTextListStyle )
48 : ContextHandler( rParent )
49 , mrTextListStyle( rTextListStyle )
53 TextListStyleContext::~TextListStyleContext()
57 // --------------------------------------------------------------------
59 void TextListStyleContext::endFastElement( sal_Int32 ) throw (SAXException, RuntimeException)
63 // --------------------------------------------------------------------
65 Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& rxAttributes ) throw (SAXException, RuntimeException)
67 Reference< XFastContextHandler > xRet;
68 switch( aElementToken )
70 case NMSP_DRAWINGML|XML_defPPr: // CT_TextParagraphProperties
71 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
72 break;
73 case NMSP_DRAWINGML|XML_outline1pPr:
74 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) );
75 break;
76 case NMSP_DRAWINGML|XML_outline2pPr:
77 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) );
78 break;
79 case NMSP_DRAWINGML|XML_lvl1pPr:
80 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
81 break;
82 case NMSP_DRAWINGML|XML_lvl2pPr:
83 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) );
84 break;
85 case NMSP_DRAWINGML|XML_lvl3pPr:
86 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) );
87 break;
88 case NMSP_DRAWINGML|XML_lvl4pPr:
89 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) );
90 break;
91 case NMSP_DRAWINGML|XML_lvl5pPr:
92 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) );
93 break;
94 case NMSP_DRAWINGML|XML_lvl6pPr:
95 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) );
96 break;
97 case NMSP_DRAWINGML|XML_lvl7pPr:
98 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) );
99 break;
100 case NMSP_DRAWINGML|XML_lvl8pPr:
101 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) );
102 break;
103 case NMSP_DRAWINGML|XML_lvl9pPr:
104 xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) );
105 break;
107 if ( !xRet.is() )
108 xRet.set( this );
109 return xRet;
112 // --------------------------------------------------------------------