From 12ca2d6d32d750abe0d452387c0b51bcedf54f58 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 7 Nov 2016 14:10:49 +0900 Subject: [PATCH] Avoid crash when calling a Worksheet's ShowDataForm() in VBA, e.g.: Option VBASupport 1 Sub Main Worksheets(1).ShowDataForm() End Sub Change-Id: Ice6cfccc4fc15a4d0044d6464c7d6c04243e86ae Reviewed-on: https://gerrit.libreoffice.org/30619 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- sc/source/ui/vba/vbaworksheet.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 8ac9cc62eecb..28c9573177c3 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -900,8 +900,8 @@ ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException, std::exception) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(), - pTabViewShell); + ScopedVclPtr pDlg(pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(), + pTabViewShell)); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->Execute();