fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / model / main / DataSeriesProperties.cxx
blobc6228549d8d75f361a133debd3091108c48faa1c
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 "DataSeriesProperties.hxx"
21 #include "DataPointProperties.hxx"
22 #include "DataPoint.hxx"
23 #include "macros.hxx"
24 #include <com/sun/star/beans/PropertyAttribute.hpp>
25 #include <com/sun/star/style/XStyle.hpp>
26 #include <com/sun/star/chart2/StackingDirection.hpp>
28 #include <algorithm>
30 using namespace ::com::sun::star;
32 using ::com::sun::star::beans::Property;
33 using ::com::sun::star::uno::Reference;
35 namespace chart
38 void DataSeriesProperties::AddPropertiesToVector(
39 ::std::vector< Property > & rOutProperties )
41 rOutProperties.push_back(
42 Property( "AttributedDataPoints",
43 PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
44 cppu::UnoType<uno::Sequence< sal_Int32 >>::get(),
45 beans::PropertyAttribute::BOUND
46 | beans::PropertyAttribute::MAYBEVOID ));
48 rOutProperties.push_back(
49 Property( "StackingDirection",
50 PROP_DATASERIES_STACKING_DIRECTION,
51 cppu::UnoType<chart2::StackingDirection>::get(),
52 beans::PropertyAttribute::BOUND
53 | beans::PropertyAttribute::MAYBEDEFAULT ));
55 rOutProperties.push_back(
56 Property( "VaryColorsByPoint",
57 PROP_DATASERIES_VARY_COLORS_BY_POINT,
58 cppu::UnoType<bool>::get(),
59 beans::PropertyAttribute::BOUND
60 | beans::PropertyAttribute::MAYBEDEFAULT ));
62 rOutProperties.push_back(
63 Property( "AttachedAxisIndex",
64 PROP_DATASERIES_ATTACHED_AXIS_INDEX,
65 cppu::UnoType<sal_Int32>::get(),
66 beans::PropertyAttribute::BOUND
67 | beans::PropertyAttribute::MAYBEVOID
68 | beans::PropertyAttribute::MAYBEDEFAULT ));
70 // add properties of service DataPointProperties
71 DataPointProperties::AddPropertiesToVector( rOutProperties );
74 void DataSeriesProperties::AddDefaultsToMap(
75 tPropertyValueMap & rOutMap )
77 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
78 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
79 PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
81 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
83 // add properties of service DataPointProperties
84 DataPointProperties::AddDefaultsToMap( rOutMap );
87 } // namespace chart
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */