merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / model / main / DataSeriesProperties.cxx
blob29a41bd38e14742ee5e230f9710544c912ef60b7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
30 #include "DataSeriesProperties.hxx"
31 #include "DataPointProperties.hxx"
32 #include "DataPoint.hxx"
33 #include "macros.hxx"
34 #include <com/sun/star/beans/PropertyAttribute.hpp>
35 #include <com/sun/star/style/XStyle.hpp>
36 #include <com/sun/star/chart2/StackingDirection.hpp>
38 #include <algorithm>
40 using namespace ::com::sun::star;
42 using ::rtl::OUString;
43 using ::com::sun::star::beans::Property;
44 using ::com::sun::star::uno::Reference;
46 namespace chart
49 void DataSeriesProperties::AddPropertiesToVector(
50 ::std::vector< Property > & rOutProperties )
52 rOutProperties.push_back(
53 Property( C2U( "AttributedDataPoints" ),
54 PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
55 ::getCppuType( reinterpret_cast< const uno::Sequence< sal_Int32 > * >(0)),
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::MAYBEVOID ));
59 rOutProperties.push_back(
60 Property( C2U( "StackingDirection" ),
61 PROP_DATASERIES_STACKING_DIRECTION,
62 ::getCppuType( reinterpret_cast< const chart2::StackingDirection * >(0)),
63 beans::PropertyAttribute::BOUND
64 | beans::PropertyAttribute::MAYBEDEFAULT ));
66 rOutProperties.push_back(
67 Property( C2U( "VaryColorsByPoint" ),
68 PROP_DATASERIES_VARY_COLORS_BY_POINT,
69 ::getBooleanCppuType(),
70 beans::PropertyAttribute::BOUND
71 | beans::PropertyAttribute::MAYBEDEFAULT ));
73 rOutProperties.push_back(
74 Property( C2U( "AttachedAxisIndex" ),
75 PROP_DATASERIES_ATTACHED_AXIS_INDEX,
76 ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
77 beans::PropertyAttribute::BOUND
78 | beans::PropertyAttribute::MAYBEVOID
79 | beans::PropertyAttribute::MAYBEDEFAULT ));
81 // add properties of service DataPointProperties
82 DataPointProperties::AddPropertiesToVector( rOutProperties );
85 void DataSeriesProperties::AddDefaultsToMap(
86 tPropertyValueMap & rOutMap )
88 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
89 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
90 PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
92 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
94 // add properties of service DataPointProperties
95 DataPointProperties::AddDefaultsToMap( rOutMap );
98 } // namespace chart