summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();