27#include <com/sun/star/chart2/AxisType.hpp>
28#include <com/sun/star/container/NoSuchElementException.hpp>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
35#include <com/sun/star/beans/PropertyAttribute.hpp>
38using ::com::sun::star::uno::Reference;
39using ::com::sun::star::uno::Sequence;
40using ::com::sun::star::beans::Property;
46 PROP_COORDINATESYSTEM_SWAPXANDYAXIS
49void lcl_AddPropertiesToVector(
50 std::vector< Property > & rOutProperties )
52 rOutProperties.emplace_back(
"SwapXAndYAxis",
53 PROP_COORDINATESYSTEM_SWAPXANDYAXIS,
55 beans::PropertyAttribute::BOUND
56 | beans::PropertyAttribute::MAYBEVOID );
67 return aStaticDefaults;
72 static ::cppu::OPropertyArrayHelper aPropHelper = []()
75 lcl_AddPropertiesToVector( aProperties );
92 sal_Int32 nDimensionCount ) :
94 m_nDimensionCount( nDimensionCount )
104 chart2::ScaleData aScaleData( xAxis->getScaleData() );
107 aScaleData.AxisType = chart2::AxisType::CATEGORY;
111 aScaleData.AxisType = chart2::AxisType::REALNUMBER;
115 aScaleData.AxisType = chart2::AxisType::SERIES;
117 xAxis->setScaleData( aScaleData );
127 ::
property::OPropertySet( rSource ),
129 m_nDimensionCount( rSource.m_nDimensionCount )
132 tAxisVecVecType::size_type nN=0;
148 for(
const tAxisVecVecType::value_type &
i :
m_aAllAxis)
153 catch(
const uno::Exception & )
166 sal_Int32 nDimensionIndex,
170 if( nDimensionIndex < 0 || nDimensionIndex >=
getDimension() )
171 throw lang::IndexOutOfBoundsException();
174 throw lang::IndexOutOfBoundsException();
176 assert(!xAxis ||
dynamic_cast<Axis*
>(xAxis.get()));
180 m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 );
194 sal_Int32 nDimensionIndex,
198 if( nDimensionIndex < 0 || nDimensionIndex >=
getDimension() )
199 throw lang::IndexOutOfBoundsException();
202 throw lang::IndexOutOfBoundsException();
206 m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 );
220 sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
222 if( nDimensionIndex < 0 || nDimensionIndex >=
getDimension() )
223 throw lang::IndexOutOfBoundsException();
228 throw lang::IndexOutOfBoundsException();
230 return m_aAllAxis[ nDimensionIndex ][nAxisIndex];
234 sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
const
237 throw lang::IndexOutOfBoundsException();
242 throw lang::IndexOutOfBoundsException();
244 return m_aAllAxis[ nDimensionIndex ][nAxisIndex];
249 if( nDimensionIndex < 0 || nDimensionIndex >=
getDimension() )
250 throw lang::IndexOutOfBoundsException();
254 sal_Int32 nRet =
m_aAllAxis[ nDimensionIndex ].size();
264 auto pChartType =
dynamic_cast<ChartType*
>(aChartType.get());
269 throw lang::IllegalArgumentException(
"type not found",
static_cast<cppu::OWeakObject*
>(
this), 1);
278 auto pChartType =
dynamic_cast<ChartType*
>(aChartType.get());
282 throw container::NoSuchElementException(
283 "The given chart type is no element of the container",
284 static_cast< uno::XWeak *
>(
this ));
293 return comphelper::containerToSequence< Reference< chart2::XChartType > >(
m_aChartTypes );
301 for (
auto const & aChartType : aChartTypes)
303 auto pChartType =
dynamic_cast<ChartType*
>(aChartType.get());
359 tPropertyValueMap::const_iterator aFound( rStaticDefaults.find(
nHandle ) );
360 if( aFound == rStaticDefaults.end() )
363 rAny = (*aFound).second;
369 return StaticCooSysInfoHelper();
377 return xPropertySetInfo;
PropertiesInfo aProperties
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
virtual void SAL_CALL setChartTypes(const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > &aChartTypes) final override
virtual void SAL_CALL addChartType(const css::uno::Reference< css::chart2::XChartType > &aChartType) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
std::vector< rtl::Reference<::chart::ChartType > > m_aChartTypes
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL setAxisByDimension(::sal_Int32 nDimension, const css::uno::Reference< css::chart2::XAxis > &xAxis, ::sal_Int32 nIndex) override
virtual void SAL_CALL removeChartType(const css::uno::Reference< css::chart2::XChartType > &aChartType) override
virtual ~BaseCoordinateSystem() override
const rtl::Reference< ::chart::Axis > & getAxisByDimension2(sal_Int32 nDimension, sal_Int32 nIndex) const
sal_Int32 m_nDimensionCount
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
implement this method to provide default values for all properties supporting defaults.
virtual void firePropertyChangeEvent() override
implement this method in derived classes to get called when properties change.
virtual ::sal_Int32 SAL_CALL getDimension() override
merge XInterface implementations
BaseCoordinateSystem(sal_Int32 nDimensionCount)
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual ::sal_Int32 SAL_CALL getMaximumAxisIndexByDimension(::sal_Int32 nDimension) override
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
tAxisVecVecType m_aAllAxis
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
virtual css::uno::Reference< css::chart2::XAxis > SAL_CALL getAxisByDimension(::sal_Int32 nDimension, ::sal_Int32 nIndex) override
virtual css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > SAL_CALL getChartTypes() override
This helper class serves as forwarder of modify events.
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
void SAL_CALL disposing()
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 AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
void CloneRefVector(const std::vector< css::uno::Reference< Interface > > &rSource, std::vector< css::uno::Reference< Interface > > &rDestination)
clones a vector of UNO-References
void removeListener(const InterfaceRef &xObject, const css::uno::Reference< css::util::XModifyListener > &xListener)
void removeListenerFromAllElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void addListenerToAllElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void addListener(const InterfaceRef &xObject, const css::uno::Reference< css::util::XModifyListener > &xListener)
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::chart2::XCoordinateSystem, css::chart2::XChartTypeContainer, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > BaseCoordinateSystem_Base
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
HashMap_OWString_Interface aMap