diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-05 20:28:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-07 21:04:50 +0000 |
commit | 64a708cba9b954afe3331f63c58218eb53b3d0ce (patch) | |
tree | ddc1bea3b63f32a1c6d377c1d1dd7aee0803fb70 /include/svx | |
parent | f01c49c4a89ecad2376fd0023625186e5cac642e (diff) |
Revert "Reverts a commit series that cripple windows ci."
with addition of...
- svxlo-SvxColorListBox
+ svxcorelo-SvxColorListBox
This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601.
Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128
Reviewed-on: https://gerrit.libreoffice.org/30598
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/PaletteManager.hxx | 11 | ||||
-rw-r--r-- | include/svx/bmpmask.hxx | 15 | ||||
-rw-r--r-- | include/svx/colorbox.hxx | 94 | ||||
-rw-r--r-- | include/svx/colorwindow.hxx | 48 | ||||
-rw-r--r-- | include/svx/dialogs.hrc | 7 | ||||
-rw-r--r-- | include/svx/dlgctrl.hxx | 16 | ||||
-rw-r--r-- | include/svx/float3d.hxx | 34 | ||||
-rw-r--r-- | include/svx/fontwork.hxx | 9 | ||||
-rw-r--r-- | include/svx/sidebar/AreaPropertyPanelBase.hxx | 6 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 6 | ||||
-rw-r--r-- | include/svx/tbcontrl.hxx | 16 |
11 files changed, 177 insertions, 85 deletions
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx index c527b85f0f88..2347f0f65ef5 100644 --- a/include/svx/PaletteManager.hxx +++ b/include/svx/PaletteManager.hxx @@ -48,11 +48,10 @@ class SVX_DLLPUBLIC PaletteManager XColorListRef pColorList; Color mLastColor; - typedef std::pair<Color, OUString> color_and_name; - std::deque<color_and_name> maRecentColors; + std::deque<NamedColor> maRecentColors; std::vector<std::unique_ptr<Palette>> m_Palettes; - std::function<void(const OUString&, const Color&)> maColorSelectFunction; + std::function<void(const OUString&, const NamedColor&)> maColorSelectFunction; css::uno::Reference < css::uno::XComponentContext > m_context; public: PaletteManager(); @@ -74,14 +73,14 @@ public: const Color& GetLastColor(); void SetLastColor(const Color& rLastColor); - void AddRecentColor(const Color& rRecentColor, const OUString& rColorName); + void AddRecentColor(const Color& rRecentColor, const OUString& rColorName, bool bFront = true); void SetBtnUpdater(svx::ToolboxButtonColorUpdater* pBtnUpdater); void PopupColorPicker(const OUString& aCommand); - void SetColorSelectFunction(const std::function<void(const OUString&, const Color&)>& aColorSelectFunction); + void SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction); - static void DispatchColorCommand(const OUString& aCommand, const Color& rColor); + static void DispatchColorCommand(const OUString& aCommand, const NamedColor& rColor); }; #endif // INCLUDED_SVX_PALETTEMANAGER_HXX diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx index 1f66ee5ef7b5..6705b1c5fe5b 100644 --- a/include/svx/bmpmask.hxx +++ b/include/svx/bmpmask.hxx @@ -75,6 +75,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMaskChildWindow : public SfxChildWindo class MaskData; class MaskSet; class ColorWindow; +class SvxColorListBox; class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow { @@ -88,28 +89,27 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow VclPtr<CheckBox> m_pCbx1; VclPtr<MaskSet> m_pQSet1; VclPtr<MetricField> m_pSp1; - VclPtr<ColorLB> m_pLbColor1; + VclPtr<SvxColorListBox> m_pLbColor1; VclPtr<CheckBox> m_pCbx2; VclPtr<MaskSet> m_pQSet2; VclPtr<MetricField> m_pSp2; - VclPtr<ColorLB> m_pLbColor2; + VclPtr<SvxColorListBox> m_pLbColor2; VclPtr<CheckBox> m_pCbx3; VclPtr<MaskSet> m_pQSet3; VclPtr<MetricField> m_pSp3; - VclPtr<ColorLB> m_pLbColor3; + VclPtr<SvxColorListBox> m_pLbColor3; VclPtr<CheckBox> m_pCbx4; VclPtr<MaskSet> m_pQSet4; VclPtr<MetricField> m_pSp4; - VclPtr<ColorLB> m_pLbColor4; + VclPtr<SvxColorListBox> m_pLbColor4; MaskData* pData; VclPtr<CheckBox> m_pCbxTrans; - VclPtr<ColorLB> m_pLbColorTrans; + VclPtr<SvxColorListBox> m_pLbColorTrans; - XColorListRef pColLst; Color aPipetteColor; SvxBmpMaskSelectItem aSelItem; @@ -140,9 +140,6 @@ public: void SetColor( const Color& rColor ); void PipetteClicked(); - bool NeedsColorList() const; - void SetColorList( const XColorListRef &pColorList ); - void SetExecState( bool bEnable ); Graphic Mask( const Graphic& rGraphic ); diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx new file mode 100644 index 000000000000..4b7f2513a984 --- /dev/null +++ b/include/svx/colorbox.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVX_COLORBOX_HXX +#define INCLUDED_SVX_COLORBOX_HXX + +#include <vcl/menubtn.hxx> +#include <svx/colorwindow.hxx> +#include <sfx2/controlwrapper.hxx> + +class SvxColorListBox; + +class SvxListBoxColorWrapper +{ +public: + SvxListBoxColorWrapper(SvxColorListBox* pControl); + void operator()(const OUString& rCommand, const NamedColor& rColor); + void dispose(); +private: + VclPtr<SvxColorListBox> mxControl; +}; + +class SVX_DLLPUBLIC SvxColorListBox : public MenuButton +{ +private: + friend class SvxListBoxColorWrapper; + VclPtr<SvxColorWindow> m_xColorWindow; + Link<SvxColorListBox&, void> m_aSelectedLink; + SvxListBoxColorWrapper m_aColorWrapper; + Color m_aAutoDisplayColor; + NamedColor m_aSelectedColor; + sal_uInt16 m_nSlotId; + bool m_bShowNoneButton; + PaletteManager m_aPaletteManager; + BorderColorStatus m_aBorderColorStatus; + + DECL_LINK(MenuActivateHdl, MenuButton *, void); + void Selected(const NamedColor& rNamedColor); + void createColorWindow(); + void LockWidthRequest(); + VclPtr<SvxColorWindow> getColorWindow() const; +public: + SvxColorListBox(vcl::Window* pParent, WinBits nStyle = 0); + virtual ~SvxColorListBox() override; + virtual void dispose() override; + + void SetSelectHdl(const Link<SvxColorListBox&, void>& rLink) + { + m_aSelectedLink = rLink; + } + + void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false); + + NamedColor GetSelectEntry() const; + Color GetSelectEntryColor() const; + + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + + void SetNoSelection() { getColorWindow()->SetNoSelection(); } + bool IsNoSelection() const { return getColorWindow()->IsNoSelection(); } + + void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; } + void ShowPreview(const NamedColor &rColor); +}; + +/** A wrapper for SvxColorListBox. */ +class SVX_DLLPUBLIC SvxColorListBoxWrapper + : public sfx::SingleControlWrapper<SvxColorListBox, Color> +{ + /* Note: cannot use 'const Color&' as template argument, because the + SvxColorListBox returns the color by value and not by reference, + therefore GetControlValue() must return a temporary object too. */ +public: + explicit SvxColorListBoxWrapper(SvxColorListBox& rListBox); + + virtual ~SvxColorListBoxWrapper() override; + + virtual bool IsControlDontKnow() const override; + virtual void SetControlDontKnow( bool bSet ) override; + + virtual Color GetControlValue() const override; + virtual void SetControlValue( Color aColor ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx index 8b185d952de3..1e417130effb 100644 --- a/include/svx/colorwindow.hxx +++ b/include/svx/colorwindow.hxx @@ -31,8 +31,22 @@ #include <functional> -class BorderColorStatus; +class SVX_DLLPUBLIC BorderColorStatus +{ + Color maColor; + Color maTLBRColor; + Color maBLTRColor; +public: + BorderColorStatus(); + ~BorderColorStatus(); + bool statusChanged( const css::frame::FeatureStateEvent& rEvent ); + Color GetColor(); +}; + class Button; +typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction; + +#define COL_NONE_COLOR TRGB_COLORDATA(0x80, 0xFF, 0xFF, 0xFF) class SVX_DLLPUBLIC SvxColorWindow : public SfxPopupWindow { @@ -43,37 +57,49 @@ private: VclPtr<ListBox> mpPaletteListBox; VclPtr<PushButton> mpButtonAutoColor; + VclPtr<PushButton> mpButtonNoneColor; VclPtr<PushButton> mpButtonPicker; VclPtr<FixedLine> mpAutomaticSeparator; OUString maCommand; - Link<const Color&, void> maSelectedLink; + Link<const NamedColor&, void> maSelectedLink; PaletteManager& mrPaletteManager; BorderColorStatus& mrBorderColorStatus; - std::function<void(const OUString&, const Color&)> maColorSelectFunction; + ColorSelectFunction maColorSelectFunction; DECL_LINK( SelectHdl, ValueSet*, void ); DECL_LINK( SelectPaletteHdl, ListBox&, void); DECL_LINK( AutoColorClickHdl, Button*, void ); DECL_LINK( OpenPickerClickHdl, Button*, void ); + static bool SelectValueSetEntry(SvxColorValueSet* pColorSet, const Color& rColor); + static NamedColor GetSelectEntryColor(ValueSet* pColorSet); + NamedColor GetAutoColor() const; + NamedColor GetNoneColor() const; + public: - SvxColorWindow( const OUString& rCommand, - PaletteManager& rPaletteManager, - BorderColorStatus& rBorderColorStatus, - sal_uInt16 nSlotId, - const css::uno::Reference< css::frame::XFrame >& rFrame, - vcl::Window* pParentWindow, - std::function<void(const OUString&, const Color&)> const & maColorSelectFunction); + SvxColorWindow(const OUString& rCommand, + PaletteManager& rPaletteManager, + BorderColorStatus& rBorderColorStatus, + sal_uInt16 nSlotId, + const css::uno::Reference< css::frame::XFrame >& rFrame, + vcl::Window* pParentWindow, + ColorSelectFunction const& rColorSelectFunction); virtual ~SvxColorWindow() override; virtual void dispose() override; + void ShowNoneButton(); void StartSelection(); + void SetNoSelection(); + bool IsNoSelection() const; + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + NamedColor GetSelectEntryColor() const; virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; - void SetSelectedHdl( const Link<const Color&, void>& rLink ) { maSelectedLink = rLink; } + void SetSelectedHdl( const Link<const NamedColor&, void>& rLink ) { maSelectedLink = rLink; } }; #endif diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 3ccea55d2a4a..589b6a8a7413 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -31,8 +31,10 @@ // some strings also used in CUI #define RID_SVXERRCTX (RID_SVX_START + 351) #define RID_SVXSTR_COLOR (RID_SVX_START + 179) -#define RID_SVXSTR_TRANSPARENT (RID_SVX_START + 190) +#define RID_SVXSTR_NOFILL (RID_SVX_START + 190) #define RID_SVXSTR_AUTOMATIC (RID_SVX_START + 841) +#define RID_SVXSTR_BY_AUTHOR (RID_SVX_START + 842) +#define RID_SVXSTR_TRANSPARENT (RID_SVX_START + 843) #define RID_SVXSTR_INVISIBLE (RID_SVX_START + 178) #define RID_SVXSTR_NONE (RID_SVX_START + 183) #define RID_SVXSTR_SOLID (RID_SVX_START + 160) @@ -147,9 +149,6 @@ #define RID_SVXIMAGE_COLORDLG (RID_SVX_START + 214) #define RID_SVXFLOAT3D_FAVORITE (RID_SVX_START + 73) -#define RID_SVXFLOAT3D_FIX_X (RID_SVX_START + 74) -#define RID_SVXFLOAT3D_FIX_Y (RID_SVX_START + 75) -#define RID_SVXFLOAT3D_FIX_Z (RID_SVX_START + 76) #define RID_SVXFLOAT3D_FIX_R (RID_SVX_START + 77) #define RID_SVXFLOAT3D_FIX_G (RID_SVX_START + 78) #define RID_SVXFLOAT3D_FIX_B (RID_SVX_START + 84) diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index fbf9369eb608..39cc688b4ded 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -207,20 +207,6 @@ public: /************************************************************************/ -class SAL_WARN_UNUSED SVX_DLLPUBLIC ColorLB : public ColorListBox -{ - -public: - ColorLB( vcl::Window* pParent, WinBits aWB ) : ColorListBox( pParent, aWB ) {} - - void Fill( const XColorListRef &pTab ); - - void Append( const XColorEntry& rEntry ); - void Modify( const XColorEntry& rEntry, sal_Int32 nPos ); -}; - -/************************************************************************/ - class SAL_WARN_UNUSED SVX_DLLPUBLIC HatchingLB : public ListBox { public: @@ -245,7 +231,7 @@ public: /************************************************************************/ -class SAL_WARN_UNUSED SVX_DLLPUBLIC FillAttrLB : public ColorListBox +class SAL_WARN_UNUSED SVX_DLLPUBLIC FillAttrLB : public ListBox { private: BitmapEx maBitmapEx; diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx index c9a9f957701c..396d104a9f53 100644 --- a/include/svx/float3d.hxx +++ b/include/svx/float3d.hxx @@ -41,14 +41,13 @@ enum class ViewType3D Material }; -class SdrModel; class FmFormModel; class VirtualDevice; class E3dView; class SdrPageView; class Svx3DCtrlItem; class SvxConvertTo3DItem; - +class SvxColorListBox; struct Svx3DWinImpl; @@ -113,16 +112,16 @@ private: VclPtr<PushButton> m_pBtnLight6; VclPtr<PushButton> m_pBtnLight7; VclPtr<PushButton> m_pBtnLight8; - VclPtr<ColorLB> m_pLbLight1; - VclPtr<ColorLB> m_pLbLight2; - VclPtr<ColorLB> m_pLbLight3; - VclPtr<ColorLB> m_pLbLight4; - VclPtr<ColorLB> m_pLbLight5; - VclPtr<ColorLB> m_pLbLight6; - VclPtr<ColorLB> m_pLbLight7; - VclPtr<ColorLB> m_pLbLight8; + VclPtr<SvxColorListBox> m_pLbLight1; + VclPtr<SvxColorListBox> m_pLbLight2; + VclPtr<SvxColorListBox> m_pLbLight3; + VclPtr<SvxColorListBox> m_pLbLight4; + VclPtr<SvxColorListBox> m_pLbLight5; + VclPtr<SvxColorListBox> m_pLbLight6; + VclPtr<SvxColorListBox> m_pLbLight7; + VclPtr<SvxColorListBox> m_pLbLight8; VclPtr<PushButton> m_pBtnLightColor; - VclPtr<ColorLB> m_pLbAmbientlight; // ListBox + VclPtr<SvxColorListBox> m_pLbAmbientlight; // ListBox VclPtr<PushButton> m_pBtnAmbientColor; // color button // Textures @@ -144,13 +143,13 @@ private: // material editor VclPtr<VclContainer> m_pFLMaterial; VclPtr<ListBox> m_pLbMatFavorites; - VclPtr<ColorLB> m_pLbMatColor; + VclPtr<SvxColorListBox> m_pLbMatColor; VclPtr<PushButton> m_pBtnMatColor; - VclPtr<ColorLB> m_pLbMatEmission; + VclPtr<SvxColorListBox> m_pLbMatEmission; VclPtr<PushButton> m_pBtnEmissionColor; VclPtr<VclContainer> m_pFLMatSpecular; - VclPtr<ColorLB> m_pLbMatSpecular; + VclPtr<SvxColorListBox> m_pLbMatSpecular; VclPtr<PushButton> m_pBtnSpecularColor; VclPtr<MetricField> m_pMtrMatSpecularIntensity; @@ -191,6 +190,7 @@ private: DECL_LINK( ClickHdl, Button*, void ); DECL_LINK( ClickColorHdl, Button*, void ); DECL_LINK( SelectHdl, ListBox&, void ); + DECL_LINK( SelectColorHdl, SvxColorListBox&, void ); DECL_LINK( ModifyHdl, Edit&, void ); void ClickLight(PushButton &rBtn); @@ -199,9 +199,9 @@ private: SVX_DLLPRIVATE void Construct(); SVX_DLLPRIVATE void Reset(); - SVX_DLLPRIVATE static bool LBSelectColor( ColorLB* pLb, const Color& rColor ); + SVX_DLLPRIVATE static void LBSelectColor( SvxColorListBox* pLb, const Color& rColor ); SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn ); - SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = nullptr ); + SVX_DLLPRIVATE SvxColorListBox* GetLbByButton( const PushButton* pBtn = nullptr ); SVX_DLLPRIVATE bool GetUILightState( const PushButton& rBtn ) const; SVX_DLLPRIVATE void SetUILightState( PushButton& aBtn, bool bState ); @@ -215,7 +215,7 @@ public: virtual ~Svx3DWin() override; virtual void dispose() override; - void InitColorLB( const SdrModel* pDoc ); + void InitColorLB(); bool IsUpdateMode() const { return bUpdate; } void Update( SfxItemSet& rSet ); diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx index 5fe6ad0f7eb3..83d1f3c11ec3 100644 --- a/include/svx/fontwork.hxx +++ b/include/svx/fontwork.hxx @@ -35,6 +35,7 @@ class SdrView; class SdrPageView; class SdrObject; +class SvxColorListBox; class XFormTextAdjustItem; class XFormTextDistanceItem; @@ -107,7 +108,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow VclPtr<FixedImage> m_pFbShadowY; VclPtr<MetricField> m_pMtrFldShadowY; - VclPtr<ColorLB> m_pShadowColorLB; + VclPtr<SvxColorListBox> m_pShadowColorLB; SfxBindings& rBindings; Idle aInputIdle; @@ -138,8 +139,6 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow long nSaveShadowAngle; long nSaveShadowSize; - XColorListRef pColorList; - friend class SvxFontWorkChildWindow; friend class SvxFontWorkControllerItem; @@ -150,7 +149,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow DECL_LINK( ModifyInputHdl_Impl, Edit&, void ); DECL_LINK( InputTimoutHdl_Impl, Idle *, void ); - DECL_LINK( ColorSelectHdl_Impl, ListBox&, void ); + DECL_LINK( ColorSelectHdl_Impl, SvxColorListBox&, void ); void SetStyle_Impl(const XFormTextStyleItem*); void SetAdjust_Impl(const XFormTextAdjustItem*); @@ -175,8 +174,6 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow vcl::Window* pParent); virtual ~SvxFontWorkDialog() override; virtual void dispose() override; - - void SetColorList(const XColorListRef &pTable); }; #endif // INCLUDED_SVX_FONTWORK_HXX diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 9d7e62199f3e..372d216f68ba 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -25,6 +25,7 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/SidebarController.hxx> #include <sfx2/sidebar/SidebarToolBox.hxx> +#include <svx/colorbox.hxx> #include <svx/xgrad.hxx> #include <svx/itemwin.hxx> #include <svx/xfillit0.hxx> @@ -124,8 +125,8 @@ protected: VclPtr<FixedText> mpColorTextFT; VclPtr<SvxFillTypeBox> mpLbFillType; VclPtr<SvxFillAttrBox> mpLbFillAttr; - VclPtr<ColorLB> mpLbFillGradFrom; - VclPtr<ColorLB> mpLbFillGradTo; + VclPtr<SvxColorListBox> mpLbFillGradFrom; + VclPtr<SvxColorListBox> mpLbFillGradTo; VclPtr<sfx2::sidebar::SidebarToolBox> mpToolBoxColor; // for new color picker VclPtr<FixedText> mpTrspTextFT; VclPtr<ListBox> mpLBTransType; @@ -156,6 +157,7 @@ protected: DECL_LINK(SelectFillTypeHdl, ListBox&, void ); DECL_LINK(SelectFillAttrHdl, ListBox&, void ); + DECL_LINK(SelectFillColorHdl, SvxColorListBox&, void); DECL_LINK(ChangeGradientAngle, Edit&, void); DECL_LINK(ChangeTrgrTypeHdl_Impl, ListBox&, void); DECL_LINK(ModifyTransparentHdl_Impl, Edit&, void); diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index f2a301c63797..8a7f7c5fc4c5 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -750,7 +750,7 @@ #define SID_READONLY_MODE ( SID_SVX_START + 930 ) #define SID_ATTR_ALIGN_HYPHENATION ( SID_SVX_START + 931 ) #define SID_ATTR_NUMBERFORMAT_SOURCE ( SID_SVX_START + 932 ) -#define SID_ATTR_AUTO_COLOR_INVALID ( SID_SVX_START + 933 ) + #define SID_RULER_BORDER_DISTANCE ( SID_SVX_START + 935 ) #define SID_INSERT_DATEFIELD ( SID_SVX_START + 936 ) #define SID_INSERT_TIMEFIELD ( SID_SVX_START + 937 ) @@ -999,9 +999,11 @@ #define SID_LINE_ARROW_START ( SID_SVX_START + 1165 ) #define SID_LINE_ARROW_END ( SID_SVX_START + 1166 ) #define SID_DRAW_MEASURELINE ( SID_SVX_START + 1167 ) +#define SID_AUTHOR_COLOR ( SID_SVX_START + 1168 ) +#define SID_BMPMASK_COLOR ( SID_SVX_START + 1169 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_DRAW_MEASURELINE + 1 ) +#define SID_SVX_FIRSTFREE ( SID_BMPMASK_COLOR + 1 ) // Overflow check for slot IDs diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index dfa129a7c00b..bf808381c6ac 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -136,6 +136,7 @@ #include <svx/strarray.hxx> #include <svx/svxdllapi.h> #include <com/sun/star/awt/FontDescriptor.hpp> +#include <svx/colorwindow.hxx> #include <svx/PaletteManager.hxx> #include <memory> @@ -203,19 +204,8 @@ friend class SfxStyleControllerItem_Impl; SVX_DLLPRIVATE SfxStyleFamily GetActFamily(); }; -class BorderColorStatus -{ - Color maColor; - Color maTLBRColor; - Color maBLTRColor; -public: - BorderColorStatus(); - ~BorderColorStatus(); - bool statusChanged( const css::frame::FeatureStateEvent& rEvent ); - Color GetColor(); -}; +typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction; -typedef std::function<void(const OUString&, const Color&)> ColorSelectFunction; class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl { std::unique_ptr<svx::ToolboxButtonColorUpdater> m_xBtnUpdater; @@ -223,7 +213,7 @@ class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl BorderColorStatus m_aBorderColorStatus; bool m_bSplitButton; ColorSelectFunction m_aColorSelectFunction; - DECL_LINK(SelectedHdl, const Color&, void); + DECL_LINK(SelectedHdl, const NamedColor&, void); public: SFX_DECL_TOOLBOX_CONTROL(); SvxColorToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox); |