Kaydet (Commit) c904a292 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Andras Timar

tdf#92392 - Dispose ScFormulaReferenceHelper properly.

Release the accelerator, and cleanup global references.

Change-Id: Id9931527f1b6d89067bc1e520e521ccfa6e28197
Reviewed-on: https://gerrit.libreoffice.org/16740Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/16751Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst d2b97084
...@@ -74,6 +74,7 @@ class ScFormulaReferenceHelper ...@@ -74,6 +74,7 @@ class ScFormulaReferenceHelper
public: public:
ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings); ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings);
~ScFormulaReferenceHelper(); ~ScFormulaReferenceHelper();
void dispose();
void ShowSimpleReference(const OUString& rStr); void ShowSimpleReference(const OUString& rStr);
void ShowFormulaReference(const OUString& rStr); void ShowFormulaReference(const OUString& rStr);
......
...@@ -64,18 +64,25 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi ...@@ -64,18 +64,25 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi
} }
ScFormulaReferenceHelper::~ScFormulaReferenceHelper() ScFormulaReferenceHelper::~ScFormulaReferenceHelper()
{
dispose();
}
void ScFormulaReferenceHelper::dispose()
{ {
if (bAccInserted) if (bAccInserted)
Application::RemoveAccel( pAccel.get() ); Application::RemoveAccel( pAccel.get() );
bAccInserted = false;
// common cleanup for ScAnyRefDlg and ScFormulaDlg is done here // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here
HideReference(); HideReference();
enableInput( true ); enableInput( true );
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
if ( pInputHdl ) if ( pInputHdl )
pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line
pAccel.reset();
} }
void ScFormulaReferenceHelper::enableInput( bool bEnable ) void ScFormulaReferenceHelper::enableInput( bool bEnable )
...@@ -831,6 +838,7 @@ void ScRefHandler::disposeRefHandler() ...@@ -831,6 +838,7 @@ void ScRefHandler::disposeRefHandler()
m_rWindow.clear(); m_rWindow.clear();
pActiveWin.clear(); pActiveWin.clear();
LeaveRefMode(); LeaveRefMode();
m_aHelper.dispose();
} }
bool ScRefHandler::LeaveRefMode() bool ScRefHandler::LeaveRefMode()
......
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