diff options
author | László Németh <nemeth@numbertext.org> | 2023-02-27 11:20:09 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2023-02-27 15:22:52 +0000 |
commit | 4f2dcc4bc70c3602e2612dab611b610410637920 (patch) | |
tree | 52d3c329c2dc7f5d4c6ac8844aeee2d86191d289 /chart2/source/controller | |
parent | c23c071f38978f51a03dc352058c34448d314e03 (diff) |
tdf#153858 sw: crash fix for chart with deleted data table
Using mouse, e.g. simply moving the mouse pointer
during editing a chart with a deleted data table
crashed Writer immediately.
Follow-up to commit 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827
"tdf#132714 sw: fix crash at table row deletion associated
to a chart".
Change-Id: I6d89eabc84565c548e2d9ded922789d623367ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147882
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/controller')
-rw-r--r-- | chart2/source/controller/dialogs/ObjectNameProvider.cxx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 2bf6af625555..c60ff1ca364a 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -124,13 +124,15 @@ OUString lcl_getDataPointValueText( const rtl::Reference< DataSeries >& xSeries, uno::Reference<data::XDataSequence> xDataSequence( aDataSequences[nN]->getValues()); if( !xDataSequence.is() ) continue; - Sequence< Any > aData( xDataSequence->getData() ); - if( nPointIndex >= aData.getLength() ) - continue; - uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY ); - if( xProp.is()) + + try { - try + Sequence< Any > aData( xDataSequence->getData() ); + + if( nPointIndex >= aData.getLength() ) + continue; + uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY ); + if( xProp.is()) { uno::Any aARole = xProp->getPropertyValue( "Role" ); OUString aRole; @@ -179,10 +181,14 @@ OUString lcl_getDataPointValueText( const rtl::Reference< DataSeries >& xSeries, a_Size = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged ); } } - catch( const uno::Exception& ) - { - TOOLS_WARN_EXCEPTION("chart2", "" ); - } + } + catch (const lang::DisposedException&) + { + TOOLS_WARN_EXCEPTION( "chart2", "unexpected exception caught" ); + } + catch( const uno::Exception& ) + { + TOOLS_WARN_EXCEPTION("chart2", "" ); } } |