23#include <com/sun/star/drawing/Position3D.hpp>
24#include <com/sun/star/chart2/Symbol.hpp>
25#include <com/sun/star/drawing/Direction3D.hpp>
30using ::com::sun::star::uno::Reference;
35void getPropNamesAndValues(
const Reference< beans::XPropertySet >& xProp,
39 const awt::Size& aMaxSymbolExtent)
46 switch( ePropertyType )
48 case ::chart::VLegendSymbolFactory::PropertyType::FilledSeries:
51 case ::chart::VLegendSymbolFactory::PropertyType::LineSeries:
54 case ::chart::VLegendSymbolFactory::PropertyType::Line:
63 if( pLineWidthAny && (*pLineWidthAny>>=nLineWidth) )
66 sal_Int32 nMaxLineWidthForLegend = aMaxSymbolExtent.Height;
67 if( nLineWidth>nMaxLineWidthForLegend )
68 *pLineWidthAny <<= nMaxLineWidthForLegend;
72void lcl_setPropertiesToShape(
73 const Reference< beans::XPropertySet > & xProp,
76 const awt::Size& aMaxSymbolExtent)
80 getPropNamesAndValues( xProp, aPropNames, aPropValues,
81 ePropertyType, aMaxSymbolExtent );
92 const awt::Size& rEntryKeyAspectRatio,
95 const Reference< beans::XPropertySet > & xLegendEntryProperties,
100 if( !rSymbolContainer)
119 awt::Point( 0, rEntryKeyAspectRatio.Height/2 ));
120 lcl_setPropertiesToShape( xLegendEntryProperties, xLine, ePropertyType, rEntryKeyAspectRatio );
122 const sal_Int32 nSize = std::min(rEntryKeyAspectRatio.Width,rEntryKeyAspectRatio.Height);
123 chart2::Symbol aSymbol;
124 if( rExplicitSymbol >>= aSymbol )
126 drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
127 drawing::Position3D aPos( rEntryKeyAspectRatio.Width/2.0, rEntryKeyAspectRatio.Height/2.0, 0 );
128 if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
131 xLegendEntryProperties->getPropertyValue(
"Color") >>= aSymbol.FillColor;
133 aSymbol.BorderColor = aSymbol.FillColor;
139 aSymbol.StandardSymbol,
143 else if( aSymbol.Style == chart2::SymbolStyle_GRAPHIC )
151 else if( aSymbol.Style == chart2::SymbolStyle_AUTO )
153 SAL_WARN(
"chart2",
"the given parameter is not allowed to contain an automatic symbol style");
159 sal_Int32 nSize = std::min( rEntryKeyAspectRatio.Width, rEntryKeyAspectRatio.Height );
162 awt::Point( rEntryKeyAspectRatio.Width/2-nSize/2, rEntryKeyAspectRatio.Height/2-nSize/2 ));
163 lcl_setPropertiesToShape( xLegendEntryProperties, xShape, ePropertyType, awt::Size(0,0) );
170 getPropNamesAndValues( xLegendEntryProperties, aPropNames, aPropValues,
171 ePropertyType, awt::Size(0,0) );
174 rEntryKeyAspectRatio, awt::Point( 0, 0 ),
175 aPropNames, aPropValues );
178 catch(
const uno::Exception & )
static css::uno::Any * getValuePointer(tAnySequence &rPropValues, const tNameSequence &rPropNames, std::u16string_view rPropName)
static void setMultiProperties(const tNameSequence &rNames, const tAnySequence &rValues, SvxShape &xTarget)
static const tPropertyNameMap & getPropertyNameMapForLineProperties()
static const tPropertyNameMap & getPropertyNameMapForFilledSeriesProperties()
static void getMultiPropertyListsFromValueMap(tNameSequence &rNames, tAnySequence &rValues, const tPropertyNameValueMap &rValueMap)
static const tPropertyNameMap & getPropertyNameMapForLineSeriesProperties()
static void getValueMap(tPropertyNameValueMap &rValueMap, const tPropertyNameMap &rNameMap, const css::uno::Reference< css::beans::XPropertySet > &xSourceProp)
Fetch property values from the source object and map it to the destination container.
static rtl::Reference< SvxShapeRect > createRectangle(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::awt::Size &rSize, const css::awt::Point &rPosition, const tNameSequence &rPropNames, const tAnySequence &rPropValues, StackPosition ePos=StackPosition::Top)
static rtl::Reference< SvxShapePolyPolygon > createLine(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::awt::Size &rSize, const css::awt::Point &rPosition)
static rtl::Reference< SvxShapeRect > createInvisibleRectangle(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::awt::Size &rSize)
static rtl::Reference< SvxGraphicObject > createGraphic2D(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::drawing::Position3D &rPos, const css::drawing::Direction3D &rSize, const css::uno::Reference< css::graphic::XGraphic > &xGraphic)
static rtl::Reference< SvxShapeGroup > createGroup2D(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const OUString &aName=OUString())
static rtl::Reference< SvxShapeCircle > createCircle(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::awt::Size &rSize, const css::awt::Point &rPosition)
static rtl::Reference< SvxShapePolyPolygon > createSymbol2D(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::drawing::Position3D &rPos, const css::drawing::Direction3D &rSize, sal_Int32 nStandardSymbol, sal_Int32 nBorderColor, sal_Int32 nFillColor)
#define DBG_UNHANDLED_EXCEPTION(...)
#define SAL_WARN(area, stream)
rtl::Reference< SvxShapeGroup > createSymbol(const css::awt::Size &rEntryKeyAspectRatio, const rtl::Reference< SvxShapeGroupAnyD > &rSymbolContainer, LegendSymbolStyle eStyle, const css::uno::Reference< css::beans::XPropertySet > &xLegendEntryProperties, PropertyType ePropertyType, const css::uno::Any &rExplicitSymbol)
css::uno::Sequence< OUString > tNameSequence
@ Circle
A bordered circle which has the same bounding-box as the <member>BOX</member>.
@ Line
A line like with a symbol.
std::unordered_map< OUString, OUString > tPropertyNameMap
css::uno::Sequence< css::uno::Any > tAnySequence
std::unordered_map< OUString, css::uno::Any > tPropertyNameValueMap
const PropertyStruct aPropNames[]