chart2/source/controller/accessibility/AccessibleChartView.cxx | 22 +++------- 1 file changed, 8 insertions(+), 14 deletions(-)
New commits: commit 3ce2232c05f13a5b1303156d2b0321009b017620 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Sep 6 12:34:02 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Sep 6 13:20:09 2023 +0200 tdf#157115 crash on inserting chart (gtk3) regression from commit bdf2d664784b3ebe3e7078b9ec82a02d09d9ded8 Author: Noel Grandin <noelgran...@gmail.com> Date: Sat Sep 2 10:44:51 2023 +0200 use more concrete type in AccessibleChartView Change-Id: I5f76f10404d6a202b1653f5e7cabc665b5962557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index 8f4103ee6060..acedf732cc87 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -213,32 +213,26 @@ void AccessibleChartView::initialize( ChartController& rNewChartController, if( xNewWindow != xWindow ) { - xWindow.set( xNewWindow ); + xWindow = xNewWindow; bChanged = true; } - if( xChartModel.is() && xChartView.is() ) + if(xChartController != &rNewChartController) { - if(xChartController != &rNewChartController) - { - bChanged = true; + if (xChartController) xChartController->removeSelectionChangeListener(this); - rNewChartController.addSelectionChangeListener(this); - xChartController = &rNewChartController; - } - } - else if( xChartController.is() ) - { + rNewChartController.addSelectionChangeListener(this); + xChartController = &rNewChartController; bChanged = true; - xChartController->removeSelectionChangeListener(this); - xChartController = nullptr; } if( !xChartController.is() || !xChartModel.is() || !xChartView.is() ) { if(xChartController.is()) + { xChartController->removeSelectionChangeListener(this); - xChartController = nullptr; + xChartController.clear(); + } xChartModel.clear(); xChartView.clear(); xParent.clear();