Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include "oox/drawingml/textliststylecontext.hxx"
21 : : #include "oox/drawingml/textparagraphpropertiescontext.hxx"
22 : : #include "oox/helper/attributelist.hxx"
23 : :
24 : : using ::rtl::OUString;
25 : : using namespace ::oox::core;
26 : : using namespace ::com::sun::star::uno;
27 : : using namespace ::com::sun::star::xml::sax;
28 : :
29 : : namespace oox { namespace drawingml {
30 : :
31 : : // --------------------------------------------------------------------
32 : :
33 : : // CT_TextListStyle
34 : 129 : TextListStyleContext::TextListStyleContext( ContextHandler& rParent, TextListStyle& rTextListStyle )
35 : : : ContextHandler( rParent )
36 : 129 : , mrTextListStyle( rTextListStyle )
37 : : {
38 : 129 : }
39 : :
40 : 129 : TextListStyleContext::~TextListStyleContext()
41 : : {
42 [ - + ]: 258 : }
43 : :
44 : : // --------------------------------------------------------------------
45 : :
46 : 129 : void TextListStyleContext::endFastElement( sal_Int32 ) throw (SAXException, RuntimeException)
47 : : {
48 : 129 : }
49 : :
50 : : // --------------------------------------------------------------------
51 : :
52 : 246 : Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& rxAttributes ) throw (SAXException, RuntimeException)
53 : : {
54 : 246 : Reference< XFastContextHandler > xRet;
55 [ + - - + : 246 : switch( aElementToken )
+ + + + +
+ + + - ]
56 : : {
57 : : case A_TOKEN( defPPr ): // CT_TextParagraphProperties
58 [ + - ][ + - ]: 12 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
[ + - ]
59 : 12 : break;
60 : : case A_TOKEN( outline1pPr ):
61 [ # # ][ # # ]: 0 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) );
[ # # ]
62 : 0 : break;
63 : : case A_TOKEN( outline2pPr ):
64 [ # # ][ # # ]: 0 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) );
[ # # ]
65 : 0 : break;
66 : : case A_TOKEN( lvl1pPr ):
67 [ + - ][ + - ]: 66 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
[ + - ]
68 : 66 : break;
69 : : case A_TOKEN( lvl2pPr ):
70 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) );
[ + - ]
71 : 21 : break;
72 : : case A_TOKEN( lvl3pPr ):
73 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) );
[ + - ]
74 : 21 : break;
75 : : case A_TOKEN( lvl4pPr ):
76 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) );
[ + - ]
77 : 21 : break;
78 : : case A_TOKEN( lvl5pPr ):
79 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) );
[ + - ]
80 : 21 : break;
81 : : case A_TOKEN( lvl6pPr ):
82 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) );
[ + - ]
83 : 21 : break;
84 : : case A_TOKEN( lvl7pPr ):
85 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) );
[ + - ]
86 : 21 : break;
87 : : case A_TOKEN( lvl8pPr ):
88 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) );
[ + - ]
89 : 21 : break;
90 : : case A_TOKEN( lvl9pPr ):
91 [ + - ][ + - ]: 21 : xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) );
[ + - ]
92 : 21 : break;
93 : : }
94 [ - + ]: 246 : if ( !xRet.is() )
95 [ # # ]: 0 : xRet.set( this );
96 : 246 : return xRet;
97 : : }
98 : :
99 : : // --------------------------------------------------------------------
100 : :
101 [ + - ][ + - ]: 285 : } }
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|