25#include <unonames.hxx>
37using ::com::sun::star::uno::Reference;
41constexpr sal_Int32 constDiagramTitleSpace = 200;
45 bool bSwapXAndY =
false;
49 const std::vector<rtl::Reference<BaseCoordinateSystem>>& aCooSysList(
50 xDiagram->getBaseCoordinateSystems());
51 if (!aCooSysList.empty())
55 aCooSysList[0]->getPropertyValue(
"SwapXAndYAxis") >>= bSwapXAndY;
57 catch (
const uno::Exception&)
68sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
74 xAxis, xCorrespondingCoordinateSystem, xChartDoc,
78sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
79 const uno::Reference<beans::XPropertySet>& xSeriesOrPointProp)
81 sal_Int32 nFormat = 0;
82 if (!xSeriesOrPointProp.is())
89 catch (
const beans::UnknownPropertyException&)
98sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
99 const uno::Reference<beans::XPropertySet>& xSeriesOrPointProp,
100 const uno::Reference<util::XNumberFormatsSupplier>& xNumberFormatsSupplier)
102 sal_Int32 nFormat = 0;
103 if (!xSeriesOrPointProp.is())
105 if (!(xSeriesOrPointProp->getPropertyValue(
"PercentageNumberFormat") >>= nFormat))
114awt::Rectangle ExplicitValueProvider::AddSubtractAxisTitleSizes(
115 ChartModel& rModel, ExplicitValueProvider* pChartView,
const awt::Rectangle& rPositionAndSize,
118 awt::Rectangle aRet(rPositionAndSize);
129 if (xTitle_Height.is() || xTitle_Width.is() || xSecondTitle_Height.is()
130 || xSecondTitle_Width.is())
132 ExplicitValueProvider* pExplicitValueProvider = pChartView;
133 if (pExplicitValueProvider)
136 if (lcl_getPropertySwapXAndYAxis(rModel.getFirstChartDiagram()))
138 std::swap(xTitle_Height, xTitle_Width);
139 std::swap(xSecondTitle_Height, xSecondTitle_Width);
142 sal_Int32 nTitleSpaceWidth = 0;
143 sal_Int32 nTitleSpaceHeight = 0;
144 sal_Int32 nSecondTitleSpaceWidth = 0;
145 sal_Int32 nSecondTitleSpaceHeight = 0;
147 if (xTitle_Height.is())
152 = pExplicitValueProvider->getRectangleOfObject(aCID_X,
true).Height;
153 if (nTitleSpaceHeight)
154 nTitleSpaceHeight += constDiagramTitleSpace;
156 if (xTitle_Width.is())
160 nTitleSpaceWidth = pExplicitValueProvider->getRectangleOfObject(aCID_Y,
true).Width;
161 if (nTitleSpaceWidth)
162 nTitleSpaceWidth += constDiagramTitleSpace;
164 if (xSecondTitle_Height.is())
167 xSecondTitle_Height, &rModel));
168 nSecondTitleSpaceHeight
169 = pExplicitValueProvider->getRectangleOfObject(aCID_X,
true).Height;
170 if (nSecondTitleSpaceHeight)
171 nSecondTitleSpaceHeight += constDiagramTitleSpace;
173 if (xSecondTitle_Width.is())
176 xSecondTitle_Width, &rModel));
177 nSecondTitleSpaceWidth
178 += pExplicitValueProvider->getRectangleOfObject(aCID_Y,
true).Width;
179 if (nSecondTitleSpaceWidth)
180 nSecondTitleSpaceWidth += constDiagramTitleSpace;
184 aRet.X += nTitleSpaceWidth;
185 aRet.Y += nSecondTitleSpaceHeight;
186 aRet.Width -= (nTitleSpaceWidth + nSecondTitleSpaceWidth);
187 aRet.Height -= (nTitleSpaceHeight + nSecondTitleSpaceHeight);
191 aRet.X -= nTitleSpaceWidth;
192 aRet.Y -= nSecondTitleSpaceHeight;
193 aRet.Width += nTitleSpaceWidth + nSecondTitleSpaceWidth;
194 aRet.Height += nTitleSpaceHeight + nSecondTitleSpaceHeight;
static sal_Int32 getExplicitNumberFormatKeyForAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::BaseCoordinateSystem > &xCorrespondingCoordinateSystem, const rtl::Reference< ::chart::ChartModel > &xChartDoc, bool bSearchForParallelAxisIfNothingIsFound)
static sal_Int32 getPercentNumberFormat(const css::uno::Reference< css::util::XNumberFormatsSupplier > &xNumberFormatsSupplier)
static OUString createClassifiedIdentifierForObject(const css::uno::Reference< css::uno::XInterface > &xObject, const rtl::Reference<::chart::ChartModel > &xChartModel)
static rtl::Reference< ::chart::Title > getTitle(eTitleType nTitleIndex, ChartModel &rModel)
@ TITLE_AT_STANDARD_X_AXIS_POSITION
@ TITLE_AT_STANDARD_Y_AXIS_POSITION
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral CHART_UNONAME_NUMFMT