summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx6
-rw-r--r--sc/source/ui/view/reffact.cxx2
-rw-r--r--sc/source/ui/view/tabvwshc.cxx11
3 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 4bc50e5ed59a..04e21a965ada 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -356,9 +356,9 @@ public:
void DeactivateOle();
SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell();
- SfxModelessDialog* CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW,
- SfxChildWinInfo* pInfo,
- vcl::Window* pParent, sal_uInt16 nSlotId );
+ VclPtr<SfxModelessDialog> CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW,
+ SfxChildWinInfo* pInfo,
+ vcl::Window* pParent, sal_uInt16 nSlotId );
void UpdateOleZoom();
inline SbxObject* GetScSbxObject() const
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 4ba4eb96acac..b05db95f2c0d 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -90,7 +90,7 @@ namespace
pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); \
OSL_ENSURE( pViewShell, "missing view shell :-(" ); \
pWindow = pViewShell ? \
- pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : NULL; \
+ pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : nullptr; \
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 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;
}
}