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 "SchXMLEnumConverter.hxx"
21 :
22 : #include <com/sun/star/chart/ChartLegendPosition.hpp>
23 : #include <com/sun/star/chart/ChartLegendExpansion.hpp>
24 : #include <com/sun/star/uno/Any.hxx>
25 :
26 : // header for rtl::Static
27 : #include <rtl/instance.hxx>
28 :
29 : using ::rtl::OUString;
30 : using namespace ::xmloff::token;
31 : using namespace ::com::sun::star;
32 :
33 : namespace
34 : {
35 : //-----------------------------------------------------------------------
36 :
37 : SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] =
38 : {
39 : { XML_START, chart::ChartLegendPosition_LEFT },
40 : { XML_TOP, chart::ChartLegendPosition_TOP },
41 : { XML_END, chart::ChartLegendPosition_RIGHT },
42 : { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM },
43 : { XML_TOKEN_INVALID, 0 }
44 : };
45 :
46 : class XMLLegendPositionPropertyHdl : public XMLEnumPropertyHdl
47 : {
48 : public:
49 0 : XMLLegendPositionPropertyHdl()
50 0 : : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap, ::getCppuType((const chart::ChartLegendPosition*)0) ) {}
51 0 : virtual ~XMLLegendPositionPropertyHdl() {};
52 : };
53 :
54 : struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl >
55 : {
56 : };
57 :
58 : //-----------------------------------------------------------------------
59 :
60 : SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] =
61 : {
62 : { XML_WIDE, chart::ChartLegendExpansion_WIDE },
63 : { XML_HIGH, chart::ChartLegendExpansion_HIGH },
64 : { XML_BALANCED, chart::ChartLegendExpansion_BALANCED },
65 : { XML_CUSTOM, chart::ChartLegendExpansion_CUSTOM },
66 : { XML_TOKEN_INVALID, 0 }
67 : };
68 :
69 : class XMLLegendExpansionPropertyHdl : public XMLEnumPropertyHdl
70 : {
71 : public:
72 0 : XMLLegendExpansionPropertyHdl()
73 0 : : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap, ::getCppuType((const chart::ChartLegendExpansion*)0) ) {}
74 0 : virtual ~XMLLegendExpansionPropertyHdl() {};
75 : };
76 :
77 : struct TheLegendExpansionPropertyHdl : public rtl::Static< XMLLegendExpansionPropertyHdl, TheLegendExpansionPropertyHdl >
78 : {
79 : };
80 :
81 : //-----------------------------------------------------------------------
82 :
83 : }//end anonymous namespace
84 :
85 : //-----------------------------------------------------------------------
86 :
87 0 : XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendPositionConverter()
88 : {
89 0 : return TheLegendPositionPropertyHdl::get();
90 : }
91 0 : XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendExpansionConverter()
92 : {
93 0 : return TheLegendExpansionPropertyHdl::get();
94 : }
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|