diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-08-21 11:53:57 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-08-21 22:34:59 +0000 |
commit | 11b8a74d78e018c67217c05d83bd4947869e535a (patch) | |
tree | 7a3f4e995e2e7afe6e66e25cc50c6266fbd84c0b | |
parent | 373e71ee65a90daa9a27ff5bb7a3d6c867e4f393 (diff) |
tdf#93437: Calc RefDialogs were never actually destructed
as ScTabViewShell::CreateRefDialog was still holding VclPtr
reference to them and never released it -- regression from
commit 087f7fe50b03307e2d9202365886e8c37bd7e6e3 which is hereby
reverted.
Now it is *DlgWrapper holding the reference (via
SfxChildWindow::pWindow) and dialogs get properly destructed
when SfxChildWindow dies in SfxViewFrame::SetChildWindow(0, false)
Re tdf#91125, it turns out that the follow-up commit
06ecf7d2aebe64226142ee27c2512351960f8bb1 is actually enough to
prevent the crash.
Change-Id: I895825da59aabc7c0de530ecb528b9bf5acde562
Reviewed-on: https://gerrit.libreoffice.org/17899
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/reffact.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 11 |
3 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index df4ba4837d4b..9820553a36e8 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -341,9 +341,9 @@ public: void DeactivateOle(); SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell(); - VclPtr<SfxModelessDialog> CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW, - SfxChildWinInfo* pInfo, - vcl::Window* pParent, sal_uInt16 nSlotId ); + SfxModelessDialog* CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW, + SfxChildWinInfo* pInfo, + vcl::Window* pParent, sal_uInt16 nSlotId ); void UpdateOleZoom(); diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 75c69b1aea16..660a8778176c 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -91,7 +91,7 @@ namespace pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); \ OSL_ENSURE( pViewShell, "missing view shell :-(" ); \ pWindow = pViewShell ? \ - pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : nullptr; \ + pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : NULL; \ if (pViewShell && !pWindow) \ pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \ } diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 38502d2856a7..8a85b2230ce1 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -113,10 +113,9 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialog* pDialog) } } -VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( - SfxBindings* pB, SfxChildWindow* pCW, - SfxChildWinInfo* pInfo, - vcl::Window* pParent, sal_uInt16 nSlotId ) +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#). @@ -133,7 +132,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( return NULL; } - VclPtr<SfxModelessDialog> pResult; + SfxModelessDialog* pResult = 0; if(pCW) pCW->SetHideNotDelete(true); @@ -157,7 +156,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ), &maRangeMap); - static_cast<ScNameDlg*>(pResult.get())->SetEntry( maName, maScope); + static_cast<ScNameDlg*>(pResult)->SetEntry( maName, maScope); mbInSwitch = false; } } |