LibreOffice Module chart2 (master) 1
BubbleChartTypeTemplate.cxx
Go to the documentation of this file.
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
21#include "BubbleChartType.hxx"
23#include <DataSeries.hxx>
24#include <DataSeriesHelper.hxx>
25#include <com/sun/star/drawing/LineStyle.hpp>
26#include <PropertyHelper.hxx>
27#include <com/sun/star/uno/XComponentContext.hpp>
29
30#include <algorithm>
31
32using namespace ::com::sun::star;
33
34using ::com::sun::star::uno::Reference;
35using ::com::sun::star::uno::Sequence;
36using ::com::sun::star::beans::Property;
37
38namespace
39{
40
41::cppu::OPropertyArrayHelper & StaticBubbleChartTypeTemplateInfoHelper()
42{
43 static ::cppu::OPropertyArrayHelper aPropHelper = []()
44 {
45 std::vector< css::beans::Property > aProperties;
46 std::sort( aProperties.begin(), aProperties.end(),
48 return comphelper::containerToSequence( aProperties );
49 }();
50 return aPropHelper;
51};
52
53} // anonymous namespace
54
55namespace chart
56{
57
60 uno::XComponentContext > const & xContext,
61 const OUString & rServiceName ) :
62 ChartTypeTemplate( xContext, rServiceName )
63{
64}
65
67{}
68
69// ____ OPropertySet ____
70void BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
71{
73 tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
74 if( aFound == aStaticDefaults.end() )
75 rAny.clear();
76 else
77 rAny = (*aFound).second;
78}
79
81{
82 return StaticBubbleChartTypeTemplateInfoHelper();
83}
84
85// ____ XPropertySet ____
87{
88 static const uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
89 ::cppu::OPropertySetHelper::createPropertySetInfo(StaticBubbleChartTypeTemplateInfoHelper() ) );
90 return xPropertySetInfo;
91}
92
94{
95 return 2;
96}
97
98StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
99{
100 return StackMode::NONE;
101}
102
104 const rtl::Reference< DataSeries >& xSeries,
105 ::sal_Int32 nChartTypeIndex,
106 ::sal_Int32 nSeriesIndex,
107 ::sal_Int32 nSeriesCount )
108{
109 ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
110 DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
111}
112
113// ____ XChartTypeTemplate ____
115{
116 return false;
117}
118
120{
121 return new BubbleChartType();
122}
123
125 const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
126{
128
129 try
130 {
131 xResult = new BubbleChartType();
132
133 ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
134 }
135 catch( const uno::Exception & )
136 {
137 DBG_UNHANDLED_EXCEPTION("chart2");
138 }
139
140 return xResult;
141}
142
144{
145 if( ! m_xDataInterpreter.is())
147
148 return m_xDataInterpreter;
149}
150
153
154} // namespace chart
155
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
virtual sal_Bool SAL_CALL supportsCategories() override
denotes if the chart needs categories at the first scale
virtual rtl::Reference< ::chart::ChartType > getChartTypeForNewSeries2(const std::vector< rtl::Reference< ::chart::ChartType > > &aFormerlyUsedChartTypes) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
merge XInterface implementations
virtual rtl::Reference< ::chart::ChartType > getChartTypeForIndex(sal_Int32 nChartTypeIndex) override
virtual void applyStyle2(const rtl::Reference< ::chart::DataSeries > &xSeries, ::sal_Int32 nChartTypeGroupIndex, ::sal_Int32 nSeriesIndex, ::sal_Int32 nSeriesCount) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
BubbleChartTypeTemplate(css::uno::Reference< css::uno::XComponentContext > const &xContext, const OUString &rServiceName)
virtual StackMode getStackMode(sal_Int32 nChartTypeIndex) const override
returns StackMode::NONE by default.
virtual sal_Int32 getDimension() const override
returns 2 by default. Supported are 2 and 3
virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override
For creating diagrams and modifying existing diagrams.
static void copyPropertiesFromOldToNewCoordinateSystem(const std::vector< rtl::Reference< ChartType > > &rOldChartTypesSeq, const rtl::Reference< ChartType > &xNewChartType)
rtl::Reference< ::chart::DataInterpreter > m_xDataInterpreter
virtual void applyStyle2(const rtl::Reference< ::chart::DataSeries > &xSeries, ::sal_Int32 nChartTypeIndex, ::sal_Int32 nSeriesIndex, ::sal_Int32 nSeriesCount)
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
#define DBG_UNHANDLED_EXCEPTION(...)
OOO_DLLPUBLIC_CHARTTOOLS void setPropertyAlsoToAllAttributedDataPoints(const rtl::Reference< ::chart::DataSeries > &xSeries, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
sal_Int32 nHandle
unsigned char sal_Bool