diff options
author | László Németh <nemeth@numbertext.org> | 2023-02-27 13:56:01 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2023-02-27 22:46:29 +0000 |
commit | e706698353a7187f46ddbf0faf1f6f7772753df6 (patch) | |
tree | d1405cc06b9fc27193caa6f819d9ad59f2f9a9c1 /chart2/source/controller/dialogs/DialogModel.cxx | |
parent | 3ffd375ffee648cdb67b1f3062f84a4b2f3af9df (diff) |
tdf#153859 sw: crash fix for setting chart with deleted data table
Opening Data Ranges dialog window of a chart with
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: I96e901db75d40ae234f58827a957204bca13aa92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147893
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/controller/dialogs/DialogModel.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/DialogModel.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 564343c62671..d6d1fbd71b97 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -631,13 +631,20 @@ void DialogModel::setCategories( const Reference< chart2::data::XLabeledDataSequ OUString DialogModel::getCategoriesRange() const { - uno::Reference< chart2::data::XLabeledDataSequence > xLSeq( getCategories()); OUString aRange; - if( xLSeq.is()) + try + { + uno::Reference< chart2::data::XLabeledDataSequence > xLSeq( getCategories()); + if( xLSeq.is()) + { + Reference< data::XDataSequence > xSeq( xLSeq->getValues()); + if( xSeq.is()) + aRange = xSeq->getSourceRangeRepresentation(); + } + } + catch (const lang::DisposedException&) { - Reference< data::XDataSequence > xSeq( xLSeq->getValues()); - if( xSeq.is()) - aRange = xSeq->getSourceRangeRepresentation(); + TOOLS_WARN_EXCEPTION( "chart2", "unexpected exception caught" ); } return aRange; } |