29#include <unonames.hxx>
31#include <com/sun/star/chart2/CurveStyle.hpp>
32#include <com/sun/star/chart2/SymbolStyle.hpp>
33#include <com/sun/star/chart2/Symbol.hpp>
34#include <com/sun/star/drawing/LineStyle.hpp>
35#include <com/sun/star/beans/PropertyAttribute.hpp>
36#include <com/sun/star/uno/XComponentContext.hpp>
43using ::com::sun::star::uno::Reference;
44using ::com::sun::star::uno::Sequence;
45using ::com::sun::star::beans::Property;
52 PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE,
53 PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
54 PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER
65 ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
69 ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
72 return aStaticDefaults;
78 static ::cppu::OPropertyArrayHelper aPropHelper(
83 PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE,
85 beans::PropertyAttribute::BOUND
86 | beans::PropertyAttribute::MAYBEDEFAULT },
88 PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
90 beans::PropertyAttribute::BOUND
91 | beans::PropertyAttribute::MAYBEDEFAULT },
93 PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER,
95 beans::PropertyAttribute::BOUND
96 | beans::PropertyAttribute::MAYBEDEFAULT } };
104const uno::Reference< beans::XPropertySetInfo >& StaticScatterChartTypeTemplateInfo()
106 static const uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
108 return xPropertySetInfo;
118 uno::XComponentContext >
const & xContext,
119 const OUString & rServiceName,
124 m_bHasSymbols( bSymbols ),
125 m_bHasLines( bHasLines ),
138 const tPropertyValueMap& rStaticDefaults = StaticScatterChartTypeTemplateDefaults();
139 tPropertyValueMap::const_iterator aFound( rStaticDefaults.find(
nHandle ) );
140 if( aFound == rStaticDefaults.end() )
143 rAny = (*aFound).second;
148 return StaticScatterChartTypeTemplateInfoHelper();
154 return StaticScatterChartTypeTemplateInfo();
171 ::sal_Int32 nChartTypeIndex,
172 ::sal_Int32 nSeriesIndex,
173 ::sal_Int32 nSeriesCount )
185 catch(
const uno::Exception & )
199 bool bAdaptProperties )
208 bool bSymbolFound =
false;
209 bool bLineFound =
false;
211 std::vector< rtl::Reference< DataSeries > > aSeriesVec =
212 xDiagram->getDataSeries();
214 for (
auto const& series : aSeriesVec)
218 chart2::Symbol aSymbProp;
219 drawing::LineStyle eLineStyle;
221 bool bCurrentHasSymbol = (series->getPropertyValue(
"Symbol") >>= aSymbProp) &&
222 (aSymbProp.Style != chart2::SymbolStyle_NONE);
224 if( bCurrentHasSymbol )
233 bool bCurrentHasLine = (series->getPropertyValue(
"LineStyle") >>= eLineStyle) &&
234 ( eLineStyle != drawing::LineStyle_NONE );
236 if( bCurrentHasLine )
245 catch(
const uno::Exception & )
257 else if( !bLineFound && !bSymbolFound )
263 if( bResult && bAdaptProperties )
268 xDiagram->getChartTypeByIndex(0);
273 catch(
const uno::Exception & )
290 xResult->setPropertyValue(
292 xResult->setPropertyValue(
294 xResult->setPropertyValue(
297 catch(
const uno::Exception & )
316 xResult->setPropertyValue(
318 xResult->setPropertyValue(
320 xResult->setPropertyValue(
323 catch(
const uno::Exception & )
PropertiesInfo aProperties
For creating diagrams and modifying existing diagrams.
virtual bool matchesTemplate2(const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAdaptProperties)
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)
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 rtl::Reference< ::chart::ChartType > getChartTypeForNewSeries2(const std::vector< rtl::Reference< ::chart::ChartType > > &aFormerlyUsedChartTypes) override
virtual bool matchesTemplate2(const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAdaptProperties) override
virtual sal_Int32 getDimension() const override
returns 2 by default. Supported are 2 and 3
virtual void applyStyle2(const rtl::Reference< ::chart::DataSeries > &xSeries, ::sal_Int32 nChartTypeGroupIndex, ::sal_Int32 nSeriesIndex, ::sal_Int32 nSeriesCount) override
virtual StackMode getStackMode(sal_Int32 nChartTypeIndex) const override
returns StackMode::NONE by default.
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
virtual ~ScatterChartTypeTemplate() override
virtual sal_Bool SAL_CALL supportsCategories() override
denotes if the chart needs categories at the first scale
ScatterChartTypeTemplate(css::uno::Reference< css::uno::XComponentContext > const &xContext, const OUString &rServiceName, bool bSymbols, bool bHasLines=true, sal_Int32 nDim=2)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
css::uno::Type const & get()
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
The same as getFastPropertyValue, but return the value through rValue and nHandle is always valid.
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
The same as setFastPropertyValue; nHandle is always valid.
#define DBG_UNHANDLED_EXCEPTION(...)
OOO_DLLPUBLIC_CHARTTOOLS void switchLinesOnOrOff(const rtl::Reference< ::chart::DataSeries > &xSeries, bool bLinesOn)
OOO_DLLPUBLIC_CHARTTOOLS void setPropertyAlsoToAllAttributedDataPoints(const rtl::Reference< ::chart::DataSeries > &xSeries, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
OOO_DLLPUBLIC_CHARTTOOLS void makeLinesThickOrThin(const rtl::Reference< ::chart::DataSeries > &xSeries, bool bThick)
OOO_DLLPUBLIC_CHARTTOOLS void switchSymbolsOnOrOff(const rtl::Reference< ::chart::DataSeries > &xSeries, bool bSymbolsOn, sal_Int32 nSeriesIndex)
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
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)
constexpr OUStringLiteral CHART_UNONAME_SPLINE_ORDER
constexpr OUStringLiteral CHART_UNONAME_CURVE_STYLE
constexpr OUStringLiteral CHART_UNONAME_CURVE_RESOLUTION