summaryrefslogtreecommitdiff
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
parente867b197540cfc8b75bb1108c8bcd7a0ff65d347 (diff)
tdf#106762 Keep the previous m_xColorWindow lifecycle
Some logic here seems to depend on it. Change-Id: I62a2eeba1511a9be77030f726ceaa67e3ca3ace8
-rw-r--r--include/svx/colorbox.hxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx12
2 files changed, 14 insertions, 0 deletions
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index be6165cdc5aa..7b0f8905249c 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -74,6 +74,8 @@ public:
void SaveValue() { m_aSaveColor = GetSelectEntryColor(); }
bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); }
+
+ DECL_LINK(WindowEventListener, VclWindowEvent&, void);
};
/** A wrapper for SvxColorListBox. */
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();