34#include <com/sun/star/chart2/XDataSeries.hpp>
55 , m_xChartModel(xChartModel)
56 , m_xCC(
std::move(xContext))
57 , m_bAttachToMainAxis(true)
58 , m_bSupportingOverlapAndGapWidthProperties(false)
59 , m_bSupportingBarConnectors(false)
62 , m_bConnectBars(false)
63 , m_bSupportingAxisSideBySide(false)
64 , m_bGroupBarsPerAxis(true)
65 , m_bSupportingStartingAngle(false)
66 , m_nStartingAngle(90)
68 , m_nMissingValueTreatment(0)
69 , m_bSupportingPlottingOfHiddenCells(false)
70 , m_bIncludeHiddenCells(true)
71 , m_bHideLegendEntry(false)
84 chart2::ScaleData aScale( xAxis->getScaleData() );
85 m_bClockwise = (aScale.Orientation == chart2::AxisOrientation_REVERSE);
88 sal_Int32 nDimensionCount = xDiagram->getDimension();
99 if( xChartType->getPropertyValue(
"OverlapSequence" ) >>= aBarPositionSequence )
101 if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
104 if( xChartType->getPropertyValue(
"GapwidthSequence" ) >>= aBarPositionSequence )
106 if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
139 xProp->getPropertyValue(
"IncludeHiddenCells" );
144 catch(
const beans::UnknownPropertyException& )
151 catch(
const uno::Exception & )
174 bool bChanged =
false;
179 sal_Int32 nItemValue =
static_cast< const SfxInt32Item &
>(
186 bChanged =
m_xChartModel->getFirstChartDiagram()->attachSeriesToAxis( bAttachToMainAxis, xDataSeries
210 if( xChartType.is() )
214 if( xChartType->getPropertyValue(
aPropName ) >>= aBarPositionSequence )
217 if(!bGroupBarsPerAxis)
220 for(
auto &
pos : asNonConstRange(aBarPositionSequence) )
223 else if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
224 aBarPositionSequence.getArray()[nAxisIndex] = rBarPosition;
240 bool bOldConnectBars =
false;
242 if( xDiagramProperties.is() &&
243 (xDiagramProperties->getPropertyValue(
"ConnectBars" ) >>= bOldConnectBars) &&
259 bool bOldGroupBarsPerAxis =
true;
261 if( xDiagramProperties.is() &&
262 (xDiagramProperties->getPropertyValue(
"GroupBarsPerAxis" ) >>= bOldGroupBarsPerAxis) &&
278 if( xDiagramProperties.is() )
289 bool bClockwise =
static_cast< const SfxBoolItem &
>(
296 chart2::ScaleData aScaleData( xAxis->getScaleData() );
297 aScaleData.Orientation = bClockwise ? chart2::AxisOrientation_REVERSE : chart2::AxisOrientation_MATHEMATICAL;
298 xAxis->setScaleData( aScaleData );
315 if( xDiagramProperties.is() )
317 xDiagramProperties->setPropertyValue(
"MissingValueTreatment" ,
uno::Any( nNew ));
321 catch(
const uno::Exception& )
347 GetPropertySet()->setPropertyValue(
"ShowLegendEntry", css::uno::Any(!bHideLegendEntry));
356 sal_uInt16 nWhichId,
SfxItemSet & rOutItemSet )
const
#define CHART_AXIS_PRIMARY_Y
constexpr TypedWhichId< SfxInt32Item > SCHATTR_MISSING_VALUE_TREATMENT(SCHATTR_CHARTTYPE_START+9)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS(SCHATTR_STYLE_END+1)
constexpr TypedWhichId< SfxIntegerListItem > SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS(SCHATTR_CHARTTYPE_START+10)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_HIDE_LEGEND_ENTRY(SCHATTR_CHARTTYPE_START+12)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_CLOCKWISE(SCHATTR_CHARTTYPE_START+8)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_BAR_GAPWIDTH(SCHATTR_CHARTTYPE_START+1)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_BAR_CONNECT(SCHATTR_CHARTTYPE_START+2)
#define CHART_AXIS_SECONDARY_Y
constexpr TypedWhichId< SdrAngleItem > SCHATTR_STARTING_ANGLE(SCHATTR_CHARTTYPE_START+7)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_GROUP_BARS_PER_AXIS(SCHATTR_CHARTTYPE_START+6)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_INCLUDE_HIDDEN_CELLS(SCHATTR_CHARTTYPE_START+11)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_AXIS_FOR_ALL_SERIES(SCHATTR_MISC_START)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_BAR_OVERLAP(SCHATTR_CHARTTYPE_START)
const WhichRangesContainer nSeriesOptionsWhichPairs(svl::Items< SCHATTR_AXIS, SCHATTR_AXIS, SCHATTR_BAR_OVERLAP, SCHATTR_BAR_CONNECT, SCHATTR_GROUP_BARS_PER_AXIS, SCHATTR_AXIS_FOR_ALL_SERIES >)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static rtl::Reference< ::chart::Axis > getAxis(sal_Int32 nDimensionIndex, bool bMainAxis, const rtl::Reference< ::chart::Diagram > &xDiagram)
static bool setIncludeHiddenCells(bool bIncludeHiddenCells, ChartModel &rModel)
static bool isSupportingAxisSideBySide(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
static css::uno::Sequence< sal_Int32 > getSupportedMissingValueTreatments(const rtl::Reference< ::chart::ChartType > &xChartType)
static bool isSupportingBarConnectors(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
static bool isSupportingOverlapAndGapWidthProperties(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
static bool isSupportingStartingAngle(const rtl::Reference< ::chart::ChartType > &xChartType)
static bool isSeriesAttachedToMainAxis(const rtl::Reference< ::chart::DataSeries > &xDataSeries)
This class serves for conversion between properties of an XPropertySet and SfxItems in SfxItemSets.
std::pair< tPropertyNameType, tMemberIdType > tPropertyNameWithMemberId
const css::uno::Reference< css::beans::XPropertySet > & GetPropertySet() const
Returns the XPropertySet that was given in the CTOR and is used to apply items in ApplyItemSet().
rtl::Reference<::chart::ChartModel > m_xChartModel
css::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments
sal_Int32 m_nMissingValueTreatment
bool m_bSupportingStartingAngle
bool m_bIncludeHiddenCells
virtual ~SeriesOptionsItemConverter() override
virtual bool GetItemProperty(tWhichIdType nWhichId, tPropertyNameWithMemberId &rOutProperty) const override
implement this method to return a Property object for a given which id.
sal_Int32 m_nStartingAngle
bool m_bSupportingBarConnectors
bool m_bSupportingPlottingOfHiddenCells
SeriesOptionsItemConverter(const rtl::Reference<::chart::ChartModel > &xChartModel, css::uno::Reference< css::uno::XComponentContext > xContext, const rtl::Reference<::chart::DataSeries > &rPropertySet, SfxItemPool &rItemPool)
bool m_bSupportingAxisSideBySide
virtual void FillSpecialItem(sal_uInt16 nWhichId, SfxItemSet &rOutItemSet) const override
for items that can not be mapped directly to a property.
bool m_bSupportingOverlapAndGapWidthProperties
css::uno::Reference< css::uno::XComponentContext > m_xCC
virtual bool ApplySpecialItem(sal_uInt16 nWhichId, const SfxItemSet &rItemSet) override
for items that can not be mapped directly to a property.
rtl::Reference< ::chart::BaseCoordinateSystem > m_xCooSys
virtual const WhichRangesContainer & GetWhichPairs() const override
implement this method to provide an array of which-ranges
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemOfSeries(const rtl::Reference< ::chart::DataSeries > &xSeries, const rtl::Reference< ::chart::Diagram > &xDiagram)
OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getAttachedAxisIndex(const rtl::Reference< ::chart::DataSeries > &xSeries)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)