summaryrefslogtreecommitdiff
path: root/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-10-20 14:56:32 +0200
committerMichael Stahl <mstahl@redhat.com>2014-10-20 17:14:26 +0200
commit908d1b6e632922a6fa59385c49828be3c3eeb969 (patch)
tree8748baf657b16dacc90c23696412dc9d4d274fe2 /chart2/source/view/axes/VCartesianCoordinateSystem.hxx
parentae218f4895082ea9fca8f414a332bcf47045ba8c (diff)
chart2: fix memory leak due to cyclic reference in VAxisBase
The VAxisBase::m_xNumberFormatsSupplier refers to the ChartModel itself, and apparently that is a cyclic reference. Naively using the ChartModel's m_xNumberFormatsSupplier in ChartView::impl_createDiagramAndContent() because it will later be passed to AxisHelper::getExplicitNumberFormatKeyForAxis(), which expects to be able to convert it to a ChartModel. Since passing around the ChartModel as an XNumberFormattingSupplier is sort of un-intuitive anyway, refactor some methods to use XChartDocument instead, and only create the VPolarAxis / VCartesianAxis with the ChartModel's m_xNumberFormatsSupplier. The drawback is that if ChartModel::attachNumberFormatsSupplier() is called after ChartView::update() has created the axes, it may not have an effect on them; not sure if that is a real or hypothetical problem. Change-Id: Ib5f0d5882b85adaf44f80e086f19178b3e64882f
Diffstat (limited to 'chart2/source/view/axes/VCartesianCoordinateSystem.hxx')
-rw-r--r--chart2/source/view/axes/VCartesianCoordinateSystem.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
index 71bdbf45c813..b5a5cc4f5904 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
@@ -34,7 +34,7 @@ public:
virtual ~VCartesianCoordinateSystem();
virtual void createVAxisList(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xNumberFormatsSupplier
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument> &ChartDoc
, const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels ) SAL_OVERRIDE;