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/chart/chartcontextbase.hxx"
21 : :
22 : : #include "oox/drawingml/chart/modelbase.hxx"
23 : : #include "oox/drawingml/shapepropertiescontext.hxx"
24 : :
25 : : namespace oox {
26 : : namespace drawingml {
27 : : namespace chart {
28 : :
29 : : // ============================================================================
30 : :
31 : : using ::oox::core::ContextHandler2Helper;
32 : : using ::oox::core::ContextHandlerRef;
33 : :
34 : : // ============================================================================
35 : :
36 : 0 : ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper& rParent, Shape& rModel ) :
37 : 0 : ContextBase< Shape >( rParent, rModel )
38 : : {
39 : 0 : }
40 : :
41 : 0 : ShapePrWrapperContext::~ShapePrWrapperContext()
42 : : {
43 [ # # ]: 0 : }
44 : :
45 : 0 : ContextHandlerRef ShapePrWrapperContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
46 : : {
47 [ # # ][ # # ]: 0 : return (isRootElement() && (nElement == C_TOKEN( spPr ))) ? new ShapePropertiesContext( *this, mrModel ) : 0;
[ # # ]
48 : : }
49 : :
50 : : // ============================================================================
51 : :
52 : 0 : LayoutContext::LayoutContext( ContextHandler2Helper& rParent, LayoutModel& rModel ) :
53 : 0 : ContextBase< LayoutModel >( rParent, rModel )
54 : : {
55 : 0 : }
56 : :
57 : 0 : LayoutContext::~LayoutContext()
58 : : {
59 [ # # ]: 0 : }
60 : :
61 : 0 : ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
62 : : {
63 [ # # # ]: 0 : switch( getCurrentElement() )
64 : : {
65 : : case C_TOKEN( layout ):
66 [ # # ]: 0 : switch( nElement )
67 : : {
68 : : case C_TOKEN( manualLayout ):
69 : 0 : mrModel.mbAutoLayout = false;
70 : 0 : return this;
71 : : }
72 : 0 : break;
73 : :
74 : : case C_TOKEN( manualLayout ):
75 [ # # # # : 0 : switch( nElement )
# # # # #
# ]
76 : : {
77 : : case C_TOKEN( x ):
78 : 0 : mrModel.mfX = rAttribs.getDouble( XML_val, 0.0 );
79 : 0 : return 0;
80 : : case C_TOKEN( y ):
81 : 0 : mrModel.mfY = rAttribs.getDouble( XML_val, 0.0 );
82 : 0 : return 0;
83 : : case C_TOKEN( w ):
84 : 0 : mrModel.mfW = rAttribs.getDouble( XML_val, 0.0 );
85 : 0 : return 0;
86 : : case C_TOKEN( h ):
87 : 0 : mrModel.mfH = rAttribs.getDouble( XML_val, 0.0 );
88 : 0 : return 0;
89 : : case C_TOKEN( xMode ):
90 : 0 : mrModel.mnXMode = rAttribs.getToken( XML_val, XML_factor );
91 : 0 : return 0;
92 : : case C_TOKEN( yMode ):
93 : 0 : mrModel.mnYMode = rAttribs.getToken( XML_val, XML_factor );
94 : 0 : return 0;
95 : : case C_TOKEN( wMode ):
96 : 0 : mrModel.mnWMode = rAttribs.getToken( XML_val, XML_factor );
97 : 0 : return 0;
98 : : case C_TOKEN( hMode ):
99 : 0 : mrModel.mnHMode = rAttribs.getToken( XML_val, XML_factor );
100 : 0 : return 0;
101 : : case C_TOKEN( layoutTarget ):
102 : 0 : mrModel.mnTarget = rAttribs.getToken( XML_val, XML_outer );
103 : 0 : return 0;
104 : : }
105 : 0 : break;
106 : : }
107 : 0 : return 0;
108 : : }
109 : :
110 : : // ============================================================================
111 : :
112 : : } // namespace chart
113 : : } // namespace drawingml
114 [ + - ][ + - ]: 285 : } // namespace oox
115 : :
116 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|