30#include <com/sun/star/chart/ErrorBarStyle.hpp>
32#include <com/sun/star/drawing/LineStyle.hpp>
33#include <com/sun/star/util/Color.hpp>
34#include <com/sun/star/drawing/LineJoint.hpp>
44constexpr OUStringLiteral lcl_aServiceName =
u"com.sun.star.comp.chart2.ErrorBar";
46bool lcl_isInternalData(
const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq )
48 uno::Reference< lang::XServiceInfo > xServiceInfo( xLSeq, uno::UNO_QUERY );
49 return ( xServiceInfo.is() && xServiceInfo->getImplementationName() ==
"com.sun.star.comp.chart2.LabeledDataSequence" );
83 meLineStyle(drawing::LineStyle_SOLID),
85 mnLineTransparence(0),
86 meLineJoint(drawing::LineJoint_ROUND),
87 mbShowPositiveError(true),
88 mbShowNegativeError(true),
98 maDashName(rOther.maDashName),
99 maLineDash(rOther.maLineDash),
100 mnLineWidth(rOther.mnLineWidth),
101 meLineStyle(rOther.meLineStyle),
102 maLineColor(rOther.maLineColor),
103 mnLineTransparence(rOther.mnLineTransparence),
104 meLineJoint(rOther.meLineJoint),
105 mbShowPositiveError(rOther.mbShowPositiveError),
106 mbShowNegativeError(rOther.mbShowNegativeError),
107 mfPositiveError(rOther.mfPositiveError),
108 mfNegativeError(rOther.mfNegativeError),
109 mfWeight(rOther.mfWeight),
110 meStyle(rOther.meStyle),
116 CloneHelper::CloneRefVector< css::chart2::data::XLabeledDataSequence >(
144 if(rPropName ==
"ErrorBarStyle")
146 else if(rPropName ==
"PositiveError")
148 else if(rPropName ==
"PercentageError")
153 else if(rPropName ==
"Weight")
157 else if(rPropName ==
"NegativeError")
159 else if(rPropName ==
"ShowPositiveError")
161 else if(rPropName ==
"ShowNegativeError")
163 else if(rPropName ==
"ErrorBarRangePositive" || rPropName ==
"ErrorBarRangeNegative")
164 throw beans::UnknownPropertyException(
"read-only property",
static_cast< uno::XWeak*
>(
this));
165 else if(rPropName ==
"LineDashName")
167 else if(rPropName ==
"LineDash")
169 else if(rPropName ==
"LineWidth")
171 else if(rPropName ==
"LineStyle")
173 else if(rPropName ==
"LineColor")
175 else if(rPropName ==
"LineTransparence")
177 else if(rPropName ==
"LineJoint")
197 if( labeledData.is())
202 if( ( xSeqProp->getPropertyValue(
"Role" ) >>= aRole ) &&
203 aRole.match(
"error-bars" ) && aRole.indexOf(
aDirection) >= 0 )
205 return xSequence->getSourceRangeRepresentation();
209 catch (uno::Exception
const &)
219 SAL_WARN(
"chart2",
"unexpected exception! ");
233 if(rPropName ==
"ErrorBarStyle")
235 else if(rPropName ==
"PositiveError")
237 else if(rPropName ==
"NegativeError")
239 else if(rPropName ==
"PercentageError")
241 else if(rPropName ==
"ShowPositiveError")
243 else if(rPropName ==
"ShowNegativeError")
245 else if(rPropName ==
"Weight")
247 else if(rPropName ==
"ErrorBarRangePositive")
250 if(
meStyle == css::chart::ErrorBarStyle::FROM_DATA)
255 aRange = getSourceRangeStrFromLabeledSequences( aSequences,
true );
260 else if(rPropName ==
"ErrorBarRangeNegative")
263 if(
meStyle == css::chart::ErrorBarStyle::FROM_DATA)
268 aRange = getSourceRangeStrFromLabeledSequences( aSequences,
false );
273 else if(rPropName ==
"LineDashName")
275 else if(rPropName ==
"LineDash")
277 else if(rPropName ==
"LineWidth")
279 else if(rPropName ==
"LineStyle")
281 else if(rPropName ==
"LineColor")
283 else if(rPropName ==
"LineTransparence")
285 else if(rPropName ==
"LineJoint")
294 if(rPropName ==
"ErrorBarStyle")
296 if(
meStyle == css::chart::ErrorBarStyle::NONE)
297 return beans::PropertyState_DEFAULT_VALUE;
298 return beans::PropertyState_DIRECT_VALUE;
300 else if(rPropName ==
"PositiveError")
306 case css::chart::ErrorBarStyle::ABSOLUTE:
307 case css::chart::ErrorBarStyle::ERROR_MARGIN:
308 return beans::PropertyState_DIRECT_VALUE;
313 return beans::PropertyState_DEFAULT_VALUE;
315 else if(rPropName ==
"NegativeError")
321 case css::chart::ErrorBarStyle::ABSOLUTE:
322 case css::chart::ErrorBarStyle::ERROR_MARGIN:
323 return beans::PropertyState_DIRECT_VALUE;
328 return beans::PropertyState_DEFAULT_VALUE;
330 else if(rPropName ==
"PercentageError")
332 if(
meStyle != css::chart::ErrorBarStyle::RELATIVE)
333 return beans::PropertyState_DEFAULT_VALUE;
334 return beans::PropertyState_DIRECT_VALUE;
336 else if(rPropName ==
"ShowPositiveError")
339 return beans::PropertyState_DIRECT_VALUE;
341 else if(rPropName ==
"ShowNegativeError")
344 return beans::PropertyState_DIRECT_VALUE;
346 else if(rPropName ==
"ErrorBarRangePositive")
349 return beans::PropertyState_DIRECT_VALUE;
350 return beans::PropertyState_DEFAULT_VALUE;
352 else if(rPropName ==
"ErrorBarRangeNegative")
355 return beans::PropertyState_DIRECT_VALUE;
356 return beans::PropertyState_DEFAULT_VALUE;
359 return beans::PropertyState_DIRECT_VALUE;
365 auto aRetRange = asNonConstRange(aRet);
366 for(sal_Int32
i = 0;
i < rPropNames.getLength(); ++
i)
441 return lcl_aServiceName;
453 "com.sun.star.chart2.ErrorBar"
462extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
464 css::uno::Sequence<css::uno::Any>
const &)
466 return cppu::acquire(new ::chart::ErrorBar);
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_chart2_ErrorBar_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
tDataSequenceContainer m_aDataSequences
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
sal_Int16 mnLineTransparence
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo declarations.
css::util::Color maLineColor
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences() override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &rPropName) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL setData(const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &aData) override
virtual void SAL_CALL setPropertyToDefault(const OUString &rPropName) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual ~ErrorBar() override
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &rPropName) override
css::drawing::LineDash maLineDash
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &rPropNames) override
css::drawing::LineJoint meLineJoint
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
OOO_DLLPUBLIC_CHARTTOOLS ErrorBar()
css::drawing::LineStyle meLineStyle
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
This helper class serves as forwarder of modify events.
css::uno::Type const & get()
#define TOOLS_WARN_EXCEPTION(area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
void addListenerToAllElements(const Container &rContainer, const css::uno::Reference< css::lang::XEventListener > &xListener)
void removeListenerFromAllElements(const Container &rContainer, const css::uno::Reference< css::lang::XEventListener > &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)
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener, css::chart2::data::XDataSource, css::chart2::data::XDataSink, css::beans::XPropertySet, css::beans::XPropertyState > ErrorBar_Base
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::drawing::Direction3D aDirection