1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: textliststylecontext.cxx,v $
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"
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 // --------------------------------------------------------------------
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 ] ) );
73 case NMSP_DRAWINGML
|XML_outline1pPr
:
74 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getAggregationListStyle()[ 0 ] ) );
76 case NMSP_DRAWINGML
|XML_outline2pPr
:
77 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getAggregationListStyle()[ 1 ] ) );
79 case NMSP_DRAWINGML
|XML_lvl1pPr
:
80 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 0 ] ) );
82 case NMSP_DRAWINGML
|XML_lvl2pPr
:
83 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 1 ] ) );
85 case NMSP_DRAWINGML
|XML_lvl3pPr
:
86 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 2 ] ) );
88 case NMSP_DRAWINGML
|XML_lvl4pPr
:
89 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 3 ] ) );
91 case NMSP_DRAWINGML
|XML_lvl5pPr
:
92 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 4 ] ) );
94 case NMSP_DRAWINGML
|XML_lvl6pPr
:
95 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 5 ] ) );
97 case NMSP_DRAWINGML
|XML_lvl7pPr
:
98 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 6 ] ) );
100 case NMSP_DRAWINGML
|XML_lvl8pPr
:
101 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 7 ] ) );
103 case NMSP_DRAWINGML
|XML_lvl9pPr
:
104 xRet
.set( new TextParagraphPropertiesContext( *this, rxAttributes
, *mrTextListStyle
.getListStyle()[ 8 ] ) );
112 // --------------------------------------------------------------------