[Libreoffice-commits] core.git: sc/source

Katarina Behrens Katarina.Behrens at cib.de
Mon Aug 24 06:05:50 PDT 2015


 sc/source/ui/formdlg/formula.cxx |    1 +
 sc/source/ui/inc/tabvwsh.hxx     |    6 +++---
 sc/source/ui/view/reffact.cxx    |    2 +-
 sc/source/ui/view/tabvwshc.cxx   |   11 ++++++-----
 4 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit e931b059571c9f0cad4cc5ec6bd75a3ab46fb0d1
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Mon Aug 24 13:00:08 2015 +0200

    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 at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index d6c1b17..ba871d4 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 9820553..df4ba48 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 660a877..75c69b1 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 8a85b22..38502d2 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;
             }
         }


More information about the Libreoffice-commits mailing list