[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source

Michael Meeks michael.meeks at collabora.com
Mon Jul 6 04:05:39 PDT 2015


 sc/source/ui/inc/anyrefdg.hxx      |    1 +
 sc/source/ui/miscdlgs/anyrefdg.cxx |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit f7367996e8ba6474bad7be2238cc7ab79178f264
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Jul 3 16:37:06 2015 +0100

    tdf#92392 - Dispose ScFormulaReferenceHelper properly.
    
    Release the accelerator, and cleanup global references.
    
    Change-Id: Id9931527f1b6d89067bc1e520e521ccfa6e28197
    Reviewed-on: https://gerrit.libreoffice.org/16740
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/16751
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 5f717ff..395dcaf 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -74,6 +74,7 @@ class ScFormulaReferenceHelper
 public:
     ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings);
     ~ScFormulaReferenceHelper();
+    void dispose();
 
     void                ShowSimpleReference(const OUString& rStr);
     void                ShowFormulaReference(const OUString& rStr);
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index aab5194..6208048 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -65,17 +65,24 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi
 
 ScFormulaReferenceHelper::~ScFormulaReferenceHelper()
 {
+    dispose();
+}
+
+void ScFormulaReferenceHelper::dispose()
+{
     if (bAccInserted)
         Application::RemoveAccel( pAccel.get() );
+    bAccInserted = false;
 
     // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here
-
     HideReference();
     enableInput( true );
 
     ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
     if ( pInputHdl )
         pInputHdl->ResetDelayTimer();   // stop the timer for disabling the input line
+
+    pAccel.reset();
 }
 
 void ScFormulaReferenceHelper::enableInput( bool bEnable )
@@ -831,6 +838,7 @@ void ScRefHandler::disposeRefHandler()
     m_rWindow.clear();
     pActiveWin.clear();
     LeaveRefMode();
+    m_aHelper.dispose();
 }
 
 bool ScRefHandler::LeaveRefMode()


More information about the Libreoffice-commits mailing list