basctl/source/basicide/bastype3.hxx | 1 + basctl/source/basicide/bastypes.cxx | 5 +++++ 2 files changed, 6 insertions(+)
New commits: commit 1ec00032089c14f1afe7dd303b92f9866ed0064a Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Mon May 16 15:36:20 2022 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon May 16 15:57:11 2022 +0200 Remove accelerator when control dies Change-Id: I83826f0a4fdd581caa8e890026349fb1e86df93c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134408 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx index 41ddf81b93f8..29d7bf882c5f 100644 --- a/basctl/source/basicide/bastype3.hxx +++ b/basctl/source/basicide/bastype3.hxx @@ -36,6 +36,7 @@ class ExtendedEdit final : public Edit public: ExtendedEdit(vcl::Window* pParent, WinBits nStyle); + ~ExtendedEdit(); void SetAccHdl( const Link<Accelerator&,void>& rLink ) { aAccHdl = rLink; } Accelerator& GetAccelerator() { return aAcc; } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index f38ba5d33e8c..9df106d2b528 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -418,6 +418,11 @@ ExtendedEdit::ExtendedEdit(vcl::Window* pParent, WinBits nStyle) Control::SetLoseFocusHdl( LINK( this, ExtendedEdit, ImplLoseFocusHdl ) ); } +ExtendedEdit::~ExtendedEdit() +{ + Application::RemoveAccel( &aAcc ); +} + IMPL_LINK_NOARG(ExtendedEdit, ImplGetFocusHdl, Control&, void) { Application::InsertAccel( &aAcc );