28#include <unonames.hxx>
30#include <com/sun/star/chart2/CurveStyle.hpp>
31#include <com/sun/star/chart2/SymbolStyle.hpp>
32#include <com/sun/star/chart2/Symbol.hpp>
33#include <com/sun/star/drawing/LineStyle.hpp>
34#include <com/sun/star/beans/PropertyAttribute.hpp>
35#include <com/sun/star/uno/XComponentContext.hpp>
42using ::com::sun::star::uno::Reference;
43using ::com::sun::star::uno::Sequence;
44using ::com::sun::star::beans::Property;
51 PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE,
52 PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
53 PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER
64 ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
68 ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
71 return aStaticDefaults;
76 static ::cppu::OPropertyArrayHelper aPropHelper(
81 PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE,
83 beans::PropertyAttribute::BOUND
84 | beans::PropertyAttribute::MAYBEDEFAULT },
86 PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
88 beans::PropertyAttribute::BOUND
89 | beans::PropertyAttribute::MAYBEDEFAULT },
91 PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER,
93 beans::PropertyAttribute::BOUND
94 | beans::PropertyAttribute::MAYBEDEFAULT } };
103uno::Reference< beans::XPropertySetInfo >& StaticLineChartTypeTemplateInfo()
105 static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
107 return xPropertySetInfo;
117 uno::XComponentContext >
const & xContext,
118 const OUString & rServiceName,
125 m_bHasSymbols( bSymbols ),
126 m_bHasLines( bHasLines ),
139 const tPropertyValueMap& rStaticDefaults = StaticLineChartTypeTemplateDefaults();
140 tPropertyValueMap::const_iterator aFound( rStaticDefaults.find(
nHandle ) );
141 if( aFound == rStaticDefaults.end() )
144 rAny = (*aFound).second;
149 return StaticLineChartTypeTemplateInfoHelper();
155 return StaticLineChartTypeTemplateInfo();
171 bool bAdaptProperties )
180 bool bSymbolFound =
false;
181 bool bLineFound =
false;
183 std::vector< rtl::Reference< DataSeries > > aSeriesVec =
184 xDiagram->getDataSeries();
186 for (
auto const& series : aSeriesVec)
190 chart2::Symbol aSymbProp;
191 drawing::LineStyle eLineStyle;
193 bool bCurrentHasSymbol = (series->getPropertyValue(
"Symbol") >>= aSymbProp) &&
194 (aSymbProp.Style != chart2::SymbolStyle_NONE);
196 if( bCurrentHasSymbol )
205 bool bCurrentHasLine = (series->getPropertyValue(
"LineStyle") >>= eLineStyle) &&
206 ( eLineStyle != drawing::LineStyle_NONE );
208 if( bCurrentHasLine )
217 catch(
const uno::Exception & )
229 else if( !bLineFound && !bSymbolFound )
235 if( bResult && bAdaptProperties )
244 catch(
const uno::Exception & )
261 xResult->setPropertyValue(
263 xResult->setPropertyValue(
265 xResult->setPropertyValue(
268 catch(
const uno::Exception & )
287 xResult->setPropertyValue(
289 xResult->setPropertyValue(
291 xResult->setPropertyValue(
294 catch(
const uno::Exception & )
304 ::sal_Int32 nChartTypeIndex,
305 ::sal_Int32 nSeriesIndex,
306 ::sal_Int32 nSeriesCount )
316 catch(
const uno::Exception & )
const StackMode m_eStackMode
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)
virtual void applyStyle2(const rtl::Reference< ::chart::DataSeries > &xSeries, ::sal_Int32 nChartTypeIndex, ::sal_Int32 nSeriesIndex, ::sal_Int32 nSeriesCount)
virtual sal_Int32 getDimension() const override
returns 2 by default. Supported are 2 and 3
LineChartTypeTemplate(css::uno::Reference< css::uno::XComponentContext > const &xContext, const OUString &rServiceName, StackMode eStackMode, bool bSymbols, bool bHasLines=true, sal_Int32 nDim=2)
virtual rtl::Reference< ::chart::ChartType > getChartTypeForIndex(sal_Int32 nChartTypeIndex) override
virtual bool matchesTemplate2(const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAdaptProperties) 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 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.
virtual ~LineChartTypeTemplate() override
virtual StackMode getStackMode(sal_Int32 nChartTypeIndex) const override
returns StackMode::NONE by default.
virtual rtl::Reference< ::chart::ChartType > getChartTypeForNewSeries2(const std::vector< rtl::Reference< ::chart::ChartType > > &aFormerlyUsedChartTypes) 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 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