From bf9360e6f5e38c9de3b38d9748a84d4d1c5067f9 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Tue, 19 Sep 2017 14:26:24 +0300 Subject: tdf#106762 Keep the previous m_xColorWindow lifecycle Some logic here seems to depend on it. Change-Id: I62a2eeba1511a9be77030f726ceaa67e3ca3ace8 --- svx/source/tbxctrls/tbcontrl.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'svx/source') diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5d8237f07fa0..605568a88a28 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3351,6 +3351,15 @@ void SvxColorListBox::ShowPreview(const NamedColor &rColor) SetText(rColor.second); } +IMPL_LINK(SvxColorListBox, WindowEventListener, VclWindowEvent&, rWindowEvent, void) +{ + if (rWindowEvent.GetId() == VclEventId::WindowEndPopupMode) + { + m_xColorWindow.disposeAndClear(); + SetPopover(nullptr); + } +} + IMPL_LINK_NOARG(SvxColorListBox, MenuActivateHdl, MenuButton *, void) { if (!m_xColorWindow || m_xColorWindow->isDisposed()) @@ -3373,6 +3382,9 @@ void SvxColorListBox::createColorWindow() xFrame, this, m_aColorWrapper); + + m_xColorWindow->AddEventListener(LINK(this, SvxColorListBox, WindowEventListener)); + SetNoSelection(); if (m_bShowNoneButton) m_xColorWindow->ShowNoneButton(); -- cgit