summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-09-19 14:26:24 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-09-24 15:37:29 +0300
commitbf9360e6f5e38c9de3b38d9748a84d4d1c5067f9 (patch)
treeffcfa801976fd11cf500f70eb8d6a8cdac535150 /svx
parente867b197540cfc8b75bb1108c8bcd7a0ff65d347 (diff)
tdf#106762 Keep the previous m_xColorWindow lifecycle
Some logic here seems to depend on it. Change-Id: I62a2eeba1511a9be77030f726ceaa67e3ca3ace8
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx12
1 files changed, 12 insertions, 0 deletions
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();