chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx | 6 ++++-- sc/UITest_chart.mk | 6 +++--- vcl/source/control/wizardmachine.cxx | 12 +++++++++--- 3 files changed, 16 insertions(+), 8 deletions(-)
New commits: commit 14ef4875b3b4ccacd4846d564de08d368e9fabbd Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Apr 17 17:33:10 2019 +0200 Commit: Szymon Kłos <eszka...@gmail.com> CommitDate: Wed May 27 16:22:33 2020 +0200 Fix test UI_chart Sync chart wizard code with master Change-Id: I4ab2cbfa9efd3caca3c7951150b7daa3a133b634 diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index cd6bbe0557e2..ff90a3442f17 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -167,7 +167,7 @@ void CreationWizardUnoDlg::createDialogOnDemand() m_xParentWindow = xFrame->getContainerWindow(); } } - uno::Reference< XComponent > xComp( this ); + uno::Reference< XComponent > xKeepAlive( this ); if( m_xChartModel.is() ) { m_xDialog = std::make_shared<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC); @@ -195,7 +195,8 @@ void SAL_CALL CreationWizardUnoDlg::startExecuteModal( const css::uno::Reference if( m_bUnlockControllersOnExecute && m_xChartModel.is() ) m_xChartModel->unlockControllers(); - weld::DialogController::runAsync(m_xDialog, [xListener](sal_Int32 nResult){ + CreationWizardUnoDlg* xThat = this; + weld::DialogController::runAsync(m_xDialog, [xListener, xThat](sal_Int32 nResult){ if( xListener.is() ) { ::css::uno::Reference< ::css::uno::XInterface > xSource; @@ -203,6 +204,7 @@ void SAL_CALL CreationWizardUnoDlg::startExecuteModal( const css::uno::Reference css::ui::dialogs::DialogClosedEvent aEvent( xSource, nResult ); xListener->dialogClosed( aEvent ); } + xThat->m_xDialog.reset(); }); } diff --git a/sc/UITest_chart.mk b/sc/UITest_chart.mk index 5f9b3aa9d170..3e380391924b 100644 --- a/sc/UITest_chart.mk +++ b/sc/UITest_chart.mk @@ -9,9 +9,9 @@ $(eval $(call gb_UITest_UITest,chart)) -#$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\ -# chart/ \ -#)) +$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\ + chart/ \ +)) $(eval $(call gb_UITest_set_defs,chart, \ TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \ diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index 839c43e81842..2b3397573612 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -1153,11 +1153,17 @@ namespace vcl { if ( isTravelingSuspended() ) return; - WizardTravelSuspension aTravelGuard( *this ); - if (!prepareLeaveCurrentState(WizardTypes::eFinish)) + + // prevent WizardTravelSuspension from using this instance + // after will be destructed due to onFinish and async response call { - return; + WizardTravelSuspension aTravelGuard( *this ); + if (!prepareLeaveCurrentState(WizardTypes::eFinish)) + { + return; + } } + onFinish(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits