Resolves: tdf#145863 crash on click after quick double click
Change-Id: I18862328a3239424de80b478a09f568b5dcef1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125948
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index e88d991..6172012 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -396,12 +396,18 @@ void ScCheckListMenuControl::setSubMenuFocused(const ScListSubMenuControl* pSubM
void ScCheckListMenuControl::EndPopupMode()
{
if (!mbIsPoppedUp)
return;
mxPopover->connect_closed(Link<weld::Popover&, void>());
mxPopover->popdown();
PopupModeEndHdl(*mxPopover);
assert(mbIsPoppedUp == false);
}
void ScCheckListMenuControl::StartPopupMode(weld::Widget* pParent, const tools::Rectangle& rRect)
{
mxPopover->connect_closed(LINK(this, ScCheckListMenuControl, PopupModeEndHdl));
mbIsPoppedUp = true;
mxPopover->popup_at_rect(pParent, rRect);
GrabFocus();
}
@@ -461,6 +467,7 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent,
, mpNotifier(pNotifier)
, mbHasDates(bHasDates)
, mbCanHaveSubMenu(bCanHaveSubMenu)
, mbIsPoppedUp(false)
, maOpenTimer(this)
, maCloseTimer(this)
{
@@ -1400,8 +1407,8 @@ void ScCheckListMenuControl::setPopupEndAction(Action* p)
IMPL_LINK_NOARG(ScCheckListMenuControl, PopupModeEndHdl, weld::Popover&, void)
{
if (mxMenu)
clearSelectedMenuItem();
mbIsPoppedUp = false;
clearSelectedMenuItem();
if (mxPopupEndAction)
mxPopupEndAction->execute();
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index dd398dd..e6b4d25 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -294,6 +294,7 @@ private:
bool mbHasDates;
bool mbCanHaveSubMenu;
bool mbIsPoppedUp;
struct SubMenuItemData
{