diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-08 11:33:33 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-08 12:24:05 +0100 |
commit | 087f7fe50b03307e2d9202365886e8c37bd7e6e3 (patch) | |
tree | 759c053074ac07f08c993203bf08e9011483082f /sc/source/ui/view/tabvwshc.cxx | |
parent | ece4466e4ff5f89aad0ec88b39269cfac0dc76c3 (diff) |
tdf#91125 - nail a clutch of calc modeless dialog lifecycle issues.
Good idea to hold a reference after creation.
Change-Id: I450c415259c4011c8b3fb8be715e55643765d9db
Diffstat (limited to 'sc/source/ui/view/tabvwshc.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index fbbfa248d74e..4d5d2d4a66d8 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -113,9 +113,10 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialog* pDialog) } } -SfxModelessDialog* ScTabViewShell::CreateRefDialog( - SfxBindings* pB, SfxChildWindow* pCW, SfxChildWinInfo* pInfo, - vcl::Window* pParent, sal_uInt16 nSlotId ) +VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( + SfxBindings* pB, SfxChildWindow* pCW, + SfxChildWinInfo* pInfo, + vcl::Window* pParent, sal_uInt16 nSlotId ) { // Dialog nur aufmachen, wenn ueber ScModule::SetRefDialog gerufen, damit // z.B. nach einem Absturz offene Ref-Dialoge nicht wiederkommen (#42341#). @@ -132,7 +133,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( return NULL; } - SfxModelessDialog* pResult = 0; + VclPtr<SfxModelessDialog> pResult; if(pCW) pCW->SetHideNotDelete(true); @@ -156,7 +157,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ), &maRangeMap); - static_cast<ScNameDlg*>(pResult)->SetEntry( maName, maScope); + static_cast<ScNameDlg*>(pResult.get())->SetEntry( maName, maScope); mbInSwitch = false; } } |