27#include <com/sun/star/beans/PropertyAttribute.hpp>
28#include <com/sun/star/drawing/LineStyle.hpp>
29#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
30#include <com/sun/star/uno/XComponentContext.hpp>
37using ::com::sun::star::uno::Reference;
38using ::com::sun::star::uno::Sequence;
39using ::com::sun::star::beans::Property;
46 PROP_BAR_TEMPLATE_DIMENSION,
47 PROP_BAR_TEMPLATE_GEOMETRY3D
50void lcl_AddPropertiesToVector(
51 std::vector< Property > & rOutProperties )
53 rOutProperties.emplace_back(
"Dimension",
54 PROP_BAR_TEMPLATE_DIMENSION,
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::MAYBEDEFAULT );
58 rOutProperties.emplace_back(
"Geometry3D",
59 PROP_BAR_TEMPLATE_GEOMETRY3D,
61 beans::PropertyAttribute::BOUND
62 | beans::PropertyAttribute::MAYBEDEFAULT );
67 static ::cppu::OPropertyArrayHelper aPropHelper = []()
70 lcl_AddPropertiesToVector( aProperties );
87 uno::XComponentContext >
const & xContext,
88 const OUString & rServiceName,
94 m_eBarDirection( eDirection ),
119 bool bAdaptProperties )
127 bool bAmbiguous =
false;
128 bool bVertical = xDiagram->getVertical( bFound, bAmbiguous );
132 bResult = !bVertical;
136 if( bAdaptProperties &&
141 bool bGeomFound =
false, bGeomAmbiguous =
false;
142 sal_Int32 aCommonGeom = xDiagram->getGeometry3D( bGeomFound, bGeomAmbiguous );
144 if( !bGeomAmbiguous )
147 PROP_BAR_TEMPLATE_GEOMETRY3D,
uno::Any( aCommonGeom ));
173 ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_BAR_TEMPLATE_DIMENSION, 2 );
177 tPropertyValueMap::const_iterator aFound( aStaticDefaults.find(
nHandle ) );
178 if( aFound == aStaticDefaults.end() )
181 rAny = (*aFound).second;
186 return StaticBarChartTypeTemplateInfoHelper();
194 return xPropertySetInfo;
199 ::sal_Int32 nChartTypeIndex,
200 ::sal_Int32 nSeriesIndex,
201 ::sal_Int32 nSeriesCount )
215 catch(
const uno::Exception & )
225 std::vector< rtl::Reference< DataSeries > > aSeriesVec(
226 xDiagram->getDataSeries());
227 uno::Any aLineStyleAny( drawing::LineStyle_NONE );
228 for (
auto const& series : aSeriesVec)
231 series->setPropertyToDefault(
"Geometry3D");
232 if( series->getPropertyValue(
"BorderStyle") == aLineStyleAny )
234 series->setPropertyToDefault(
"BorderStyle");
238 xDiagram->setVertical(
false );
const StackMode m_eStackMode
PropertiesInfo aProperties
virtual bool matchesTemplate2(const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAdaptProperties) override
virtual ~BarChartTypeTemplate() override
virtual rtl::Reference< ::chart::ChartType > getChartTypeForNewSeries2(const std::vector< rtl::Reference< ::chart::ChartType > > &aFormerlyUsedChartTypes) override
virtual void createCoordinateSystems(const rtl::Reference< ::chart::Diagram > &xDiagram) override
Creates a 2d or 3d cartesian coordinate system with mathematically oriented, linear scales with auto-...
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
merge XInterface implementations
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void resetStyles2(const rtl::Reference< ::chart::Diagram > &xDiagram) 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 ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
virtual bool isSwapXAndY() const override
BarChartTypeTemplate(css::uno::Reference< css::uno::XComponentContext > const &xContext, const OUString &rServiceName, StackMode eStackMode, BarDirection eDirection, sal_Int32 nDim=2)
BarDirection m_eBarDirection
virtual rtl::Reference< ::chart::ChartType > getChartTypeForIndex(sal_Int32 nChartTypeIndex) override
virtual StackMode getStackMode(sal_Int32 nChartTypeIndex) const override
returns StackMode::NONE by default.
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 void createCoordinateSystems(const rtl::Reference< ::chart::Diagram > &xDiagram)
Creates a 2d or 3d cartesian coordinate system with mathematically oriented, linear scales with auto-...
virtual void resetStyles2(const rtl::Reference< ::chart::Diagram > &xDiagram)
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
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 setPropertyAlsoToAllAttributedDataPoints(const rtl::Reference< ::chart::DataSeries > &xSeries, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
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)