Kaydet (Commit) e931b059 authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Eike Rathke

tdf#93437: release reference held by ScFormulaReferenceHelper

This does two things: reverts a revert of
087f7fe5 -- turns out it was innocent.

Plus, it actually releases the reference that prevents destructor from 
being called. It was actually ScFormulaDlg's own m_aHelper member variable 
holding reference to 'this' (extra-wicked, through SetWindow(this)),
never releasing it.

Change-Id: I258a280e09674d1a2f1ddebea19ea1b42dcdc777
Reviewed-on: https://gerrit.libreoffice.org/17949Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst d2c09305
......@@ -248,6 +248,7 @@ void ScFormulaDlg::dispose()
{
ScModule* pScMod = SC_MOD();
ScFormEditData* pData = pScMod->GetFormEditData();
m_aHelper.dispose();
if (pData) // close dosen't destroy;
{
......
......@@ -341,9 +341,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();
......
......@@ -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 ) : NULL; \
pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : nullptr; \
if (pViewShell && !pWindow) \
pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
}
......
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment