diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-04-01 21:09:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-01 21:57:57 +0200 |
commit | 84646117baa2ac3463a007207b6b5d1d3cf0e3ae (patch) | |
tree | d22d776c9b53da45e31b5bbdf0d10749f6caef37 /chart2/source/model/main | |
parent | 383f70fa9ed0ec7acd6fbc4e921bb5b91fde4689 (diff) |
fix locking in chart::Diagram
we can't return a reference to internal state that needs to be protected by a mutex
Change-Id: I13c0128559546cc2078584fc0de818c568617b7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149914
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/model/main')
-rw-r--r-- | chart2/source/model/main/Diagram.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 1522d168c542..63bead4ef1b2 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -354,6 +354,12 @@ uno::Reference< chart2::XLegend > SAL_CALL Diagram::getLegend() return m_xLegend; } +rtl::Reference< ::chart::Legend > Diagram::getLegend2() const +{ + MutexGuard aGuard( m_aMutex ); + return m_xLegend; +} + void SAL_CALL Diagram::setLegend( const uno::Reference< chart2::XLegend >& xNewLegend ) { auto pLegend = dynamic_cast<Legend*>(xNewLegend.get()); @@ -606,6 +612,12 @@ uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > SAL_CALL Diagram::g return comphelper::containerToSequence<uno::Reference< chart2::XCoordinateSystem >>( m_aCoordSystems ); } +Diagram::tCoordinateSystemContainerType Diagram::getBaseCoordinateSystems() const +{ + MutexGuard aGuard( m_aMutex ); + return m_aCoordSystems; +} + void SAL_CALL Diagram::setCoordinateSystems( const Sequence< Reference< chart2::XCoordinateSystem > >& aCoordinateSystems ) { @@ -772,7 +784,13 @@ void SAL_CALL Diagram::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) co uno::Reference<chart2::XDataTable> SAL_CALL Diagram::getDataTable() { - MutexGuard aGuard(m_aMutex); + MutexGuard aGuard( m_aMutex ); + return m_xDataTable; +} + +rtl::Reference<::chart::DataTable> Diagram::getDataTableRef() const +{ + MutexGuard aGuard( m_aMutex ); return m_xDataTable; } |