1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "drawingml/chart/chartcontextbase.hxx"
22 #include "oox/drawingml/chart/modelbase.hxx"
23 #include "drawingml/shapepropertiescontext.hxx"
29 using ::oox::core::ContextHandler2Helper
;
30 using ::oox::core::ContextHandlerRef
;
32 ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper
& rParent
, Shape
& rModel
) :
33 ContextBase
< Shape
>( rParent
, rModel
)
37 ShapePrWrapperContext::~ShapePrWrapperContext()
41 ContextHandlerRef
ShapePrWrapperContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& )
43 return (isRootElement() && (nElement
== C_TOKEN( spPr
))) ? new ShapePropertiesContext( *this, mrModel
) : 0;
46 LayoutContext::LayoutContext( ContextHandler2Helper
& rParent
, LayoutModel
& rModel
) :
47 ContextBase
< LayoutModel
>( rParent
, rModel
)
51 LayoutContext::~LayoutContext()
55 ContextHandlerRef
LayoutContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
57 switch( getCurrentElement() )
59 case C_TOKEN( layout
):
62 case C_TOKEN( manualLayout
):
63 mrModel
.mbAutoLayout
= false;
68 case C_TOKEN( manualLayout
):
72 mrModel
.mfX
= rAttribs
.getDouble( XML_val
, 0.0 );
75 mrModel
.mfY
= rAttribs
.getDouble( XML_val
, 0.0 );
78 mrModel
.mfW
= rAttribs
.getDouble( XML_val
, 0.0 );
81 mrModel
.mfH
= rAttribs
.getDouble( XML_val
, 0.0 );
83 case C_TOKEN( xMode
):
84 mrModel
.mnXMode
= rAttribs
.getToken( XML_val
, XML_factor
);
86 case C_TOKEN( yMode
):
87 mrModel
.mnYMode
= rAttribs
.getToken( XML_val
, XML_factor
);
89 case C_TOKEN( wMode
):
90 mrModel
.mnWMode
= rAttribs
.getToken( XML_val
, XML_factor
);
92 case C_TOKEN( hMode
):
93 mrModel
.mnHMode
= rAttribs
.getToken( XML_val
, XML_factor
);
95 case C_TOKEN( layoutTarget
):
96 mrModel
.mnTarget
= rAttribs
.getToken( XML_val
, XML_outer
);
105 } // namespace drawingml
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */