summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2015-08-24 13:00:08 +0200
committerEike Rathke <erack@redhat.com>2015-08-24 13:05:29 +0000
commite931b059571c9f0cad4cc5ec6bd75a3ab46fb0d1 (patch)
treee321de7df74654571d97b15fcf528a742bd8df75 /sc
parentd2c09305084c218facdd282c3232a9929b81e342 (diff)
tdf#93437: release reference held by ScFormulaReferenceHelper
This does two things: reverts a revert of 087f7fe50b03307e2d9202365886e8c37bd7e6e3 -- 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/17949 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/formdlg/formula.cxx1
-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
4 files changed, 11 insertions, 9 deletions
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index d6c1b1734220..ba871d415bb3 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -248,6 +248,7 @@ void ScFormulaDlg::dispose()
{
ScModule* pScMod = SC_MOD();
ScFormEditData* pData = pScMod->GetFormEditData();
+ m_aHelper.dispose();
if (pData) // close dosen't destroy;
{
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 9820553a36e8..df4ba4837d4b 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();
- 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();
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 660a8778176c..75c69b1aea16 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 ) : 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 8a85b2230ce1..38502d2856a7 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;
}
}