bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / chart / SchXMLEnumConverter.cxx
blob5bf2819b9fe77ac153cd30ad43a698e3aa6871bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 "SchXMLEnumConverter.hxx"
22 #include <com/sun/star/chart/ChartLegendPosition.hpp>
23 #include <com/sun/star/chart/ChartLegendExpansion.hpp>
24 #include <com/sun/star/uno/Any.hxx>
26 #include <rtl/instance.hxx>
28 using namespace ::xmloff::token;
29 using namespace ::com::sun::star;
31 namespace
34 const SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] =
36 { XML_START, chart::ChartLegendPosition_LEFT },
37 { XML_TOP, chart::ChartLegendPosition_TOP },
38 { XML_END, chart::ChartLegendPosition_RIGHT },
39 { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM },
40 { XML_TOKEN_INVALID, 0 }
43 class XMLLegendPositionPropertyHdl : public XMLEnumPropertyHdl
45 public:
46 XMLLegendPositionPropertyHdl()
47 : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap, cppu::UnoType<chart::ChartLegendPosition>::get()) {}
48 virtual ~XMLLegendPositionPropertyHdl() {};
51 struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl >
55 const SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] =
57 { XML_WIDE, chart::ChartLegendExpansion_WIDE },
58 { XML_HIGH, chart::ChartLegendExpansion_HIGH },
59 { XML_BALANCED, chart::ChartLegendExpansion_BALANCED },
60 { XML_CUSTOM, chart::ChartLegendExpansion_CUSTOM },
61 { XML_TOKEN_INVALID, 0 }
64 class XMLLegendExpansionPropertyHdl : public XMLEnumPropertyHdl
66 public:
67 XMLLegendExpansionPropertyHdl()
68 : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap, cppu::UnoType<chart::ChartLegendExpansion>::get()) {}
69 virtual ~XMLLegendExpansionPropertyHdl() {};
72 struct TheLegendExpansionPropertyHdl : public rtl::Static< XMLLegendExpansionPropertyHdl, TheLegendExpansionPropertyHdl >
76 }//end anonymous namespace
78 XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendPositionConverter()
80 return TheLegendPositionPropertyHdl::get();
82 XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendExpansionConverter()
84 return TheLegendExpansionPropertyHdl::get();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */