summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-17 18:20:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-17 23:43:26 +0100
commitde1ac1c349435a229aec8682f8f8a796c3ca4dc5 (patch)
tree9b22061cb7ba8dfbd3ddf856d75529f7bf358427
parent93b1adf7442839dcfbf16660b1fbe1139f14a4d0 (diff)
Reuse ColorSelectFunction from colorwindow.hxx in PaletteManager.hxx
Change-Id: I86b9bf57cbb5ee7e2b0d189d6ff78a3fbc9145fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106021 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--include/svx/Palette.hxx6
-rw-r--r--include/svx/PaletteManager.hxx4
-rw-r--r--include/svx/colorwindow.hxx3
-rw-r--r--svx/source/tbxctrls/PaletteManager.cxx2
4 files changed, 9 insertions, 6 deletions
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index 96417c7d3257..0ccc644a8b01 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -19,6 +19,10 @@
#ifndef INCLUDED_SVX_PALETTE_HXX
#define INCLUDED_SVX_PALETTE_HXX
+#include <sal/config.h>
+
+#include <functional>
+
#include <rtl/ustring.hxx>
class Color;
@@ -26,6 +30,8 @@ class SvxColorValueSet;
typedef std::pair<Color, OUString> NamedColor;
+typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction;
+
class Palette
{
public:
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index dbcf789f5cfd..5d22e1d1f42d 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -45,7 +45,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
std::deque<NamedColor> maRecentColors;
std::vector<std::unique_ptr<Palette>> m_Palettes;
- std::function<void(const OUString&, const NamedColor&)> maColorSelectFunction;
+ ColorSelectFunction maColorSelectFunction;
css::uno::Reference < css::uno::XComponentContext > m_context;
public:
PaletteManager();
@@ -69,7 +69,7 @@ public:
void SetBtnUpdater(svx::ToolboxButtonColorUpdaterBase* pBtnUpdater);
void PopupColorPicker(weld::Window* pParent, const OUString& aCommand, const Color& rInitialColor);
- void SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction);
+ void SetColorSelectFunction(const ColorSelectFunction& aColorSelectFunction);
static void DispatchColorCommand(const OUString& aCommand, const NamedColor& rColor);
};
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index ac141611d103..05917b2dfcfc 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -26,8 +26,6 @@
#include <svx/Palette.hxx>
#include <vcl/toolbox.hxx>
-#include <functional>
-
namespace com::sun::star::frame { class XFrame; }
class PaletteManager;
@@ -45,7 +43,6 @@ public:
};
class Button;
-typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction;
#define COL_NONE_COLOR ::Color(0x80, 0xFF, 0xFF, 0xFF)
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index 1e19ecd10b56..f3630cc492aa 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -292,7 +292,7 @@ void PaletteManager::SetBtnUpdater(svx::ToolboxButtonColorUpdaterBase* pBtnUpdat
mpBtnUpdater = pBtnUpdater;
}
-void PaletteManager::SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction)
+void PaletteManager::SetColorSelectFunction(const ColorSelectFunction& aColorSelectFunction)
{
maColorSelectFunction = aColorSelectFunction;
}