From 64a708cba9b954afe3331f63c58218eb53b3d0ce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 5 Nov 2016 20:28:27 +0000 Subject: Revert "Reverts a commit series that cripple windows ci." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with addition of... - svxlo-SvxColorListBox + svxcorelo-SvxColorListBox This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601. Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128 Reviewed-on: https://gerrit.libreoffice.org/30598 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/sfx2/controlwrapper.hxx | 22 +------ include/svtools/ctrlbox.hxx | 82 ----------------------- include/svtools/svtools.hrc | 2 - include/svx/PaletteManager.hxx | 11 ++-- include/svx/bmpmask.hxx | 15 ++--- include/svx/colorbox.hxx | 94 +++++++++++++++++++++++++++ include/svx/colorwindow.hxx | 48 ++++++++++---- include/svx/dialogs.hrc | 7 +- include/svx/dlgctrl.hxx | 16 +---- include/svx/float3d.hxx | 34 +++++----- include/svx/fontwork.hxx | 9 +-- include/svx/sidebar/AreaPropertyPanelBase.hxx | 6 +- include/svx/svxids.hrc | 6 +- include/svx/tbcontrl.hxx | 16 +---- 14 files changed, 178 insertions(+), 190 deletions(-) create mode 100644 include/svx/colorbox.hxx (limited to 'include') diff --git a/include/sfx2/controlwrapper.hxx b/include/sfx2/controlwrapper.hxx index 079258dbfc1a..1e4a2c8f28f2 100644 --- a/include/sfx2/controlwrapper.hxx +++ b/include/sfx2/controlwrapper.hxx @@ -115,7 +115,7 @@ private: | +- DummyWindowWrapper [1] | +- CheckBoxWrapper [1] | +- EditWrapper [1] - | +- ColorListBoxWrapper [1] + | +- SvxColorListBoxWrapper [1] | | | +- MetricFieldWrapper< ValueT > [1] | | | @@ -241,26 +241,6 @@ public: }; -/** A wrapper for the SVTOOLS ColorListBox. */ -class SFX2_DLLPUBLIC ColorListBoxWrapper: - public SingleControlWrapper< ColorListBox, Color > -{ - /* Note: cannot use 'const Color&' as template argument, because the - SVTOOLS ColorListBox returns the color by value and not by reference, - therefore GetControlValue() must return a temporary object too. */ -public: - explicit ColorListBoxWrapper(ColorListBox & rListBox); - - virtual ~ColorListBoxWrapper() override; - - virtual bool IsControlDontKnow() const override; - virtual void SetControlDontKnow( bool bSet ) override; - - virtual Color GetControlValue() const override; - virtual void SetControlValue( Color aColor ) override; -}; - - /** A wrapper for the VCL MetricField. Adds support for field units during accessing the control value. The diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index c1ad071123eb..cb5e29d8ada3 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -33,26 +33,13 @@ #include class FontList; -class ImplColorListData; class ImpLineListData; -typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; typedef ::std::vector< FontMetric > ImplFontList; /************************************************************************* -Description -============ - -class ColorListBox - -Description - -Allows color selection - --------------------------------------------------------------------------- - class LineListBox Description @@ -141,75 +128,6 @@ FontList; FontNameBox; FontStyleBox; FontSizeMenu *************************************************************************/ -class SVT_DLLPUBLIC ColorListBox : public ListBox -{ - ImpColorList* pColorList; // separate liste, in case of user data are required from outside - Size aImageSize; - - using Window::ImplInit; - SVT_DLLPRIVATE void ImplInit(); - SVT_DLLPRIVATE void ImplDestroyColorEntries(); - -public: - ColorListBox( vcl::Window* pParent, - WinBits nWinStyle = WB_BORDER ); - virtual ~ColorListBox() override; - virtual void dispose() override; - - virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; - - using ListBox::InsertEntry; - sal_Int32 InsertEntry( const OUString& rStr, - sal_Int32 nPos = LISTBOX_APPEND ); - sal_Int32 InsertEntry( const Color& rColor, const OUString& rStr, - sal_Int32 nPos = LISTBOX_APPEND ); - void InsertAutomaticEntryColor(const Color &rAutoColorValue); - bool IsAutomaticSelected() { return !GetSelectEntryPos(); } - using ListBox::RemoveEntry; - void RemoveEntry( sal_Int32 nPos ); - void Clear(); - void CopyEntries( const ColorListBox& rBox ); - - using ListBox::GetEntryPos; - sal_Int32 GetEntryPos( const Color& rColor ) const; - Color GetEntryColor( sal_Int32 nPos ) const; - - void SelectEntry( const OUString& rStr ) - { ListBox::SelectEntry( rStr ); } - void SelectEntry( const Color& rColor ); - Color GetSelectEntryColor() const; - using ListBox::IsEntrySelected; - - bool IsEntrySelected(const Color& rColor) const - { - sal_Int32 nPos = GetEntryPos( rColor ); - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - return IsEntryPosSelected( nPos ); - else - return false; - } - -private: - ColorListBox( const ColorListBox& ) = delete; - ColorListBox& operator =( const ColorListBox& ) = delete; -}; - -inline void ColorListBox::SelectEntry( const Color& rColor ) -{ - sal_Int32 nPos = GetEntryPos( rColor ); - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - ListBox::SelectEntryPos( nPos ); -} - -inline Color ColorListBox::GetSelectEntryColor() const -{ - sal_Int32 nPos = GetSelectEntryPos(); - Color aColor; - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - aColor = GetEntryColor( nPos ); - return aColor; -} - /** Class computing border widths shared between Line style listbox and the SvxBorderLine implementation. diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc index 92cc8092ab7d..c149f8643c31 100644 --- a/include/svtools/svtools.hrc +++ b/include/svtools/svtools.hrc @@ -26,8 +26,6 @@ // various unsorted stuff -#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16) - #define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20) #define STR_SVT_FILEVIEW_COLUMN_SIZE (RID_SVTOOLS_START + 21) #define STR_SVT_FILEVIEW_COLUMN_DATE (RID_SVTOOLS_START + 22) 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_and_name; - std::deque maRecentColors; + std::deque maRecentColors; std::vector> m_Palettes; - std::function maColorSelectFunction; + std::function 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& aColorSelectFunction); + void SetColorSelectFunction(const std::function& 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 m_pCbx1; VclPtr m_pQSet1; VclPtr m_pSp1; - VclPtr m_pLbColor1; + VclPtr m_pLbColor1; VclPtr m_pCbx2; VclPtr m_pQSet2; VclPtr m_pSp2; - VclPtr m_pLbColor2; + VclPtr m_pLbColor2; VclPtr m_pCbx3; VclPtr m_pQSet3; VclPtr m_pSp3; - VclPtr m_pLbColor3; + VclPtr m_pLbColor3; VclPtr m_pCbx4; VclPtr m_pQSet4; VclPtr m_pSp4; - VclPtr m_pLbColor4; + VclPtr m_pLbColor4; MaskData* pData; VclPtr m_pCbxTrans; - VclPtr m_pLbColorTrans; + VclPtr 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 +#include +#include + +class SvxColorListBox; + +class SvxListBoxColorWrapper +{ +public: + SvxListBoxColorWrapper(SvxColorListBox* pControl); + void operator()(const OUString& rCommand, const NamedColor& rColor); + void dispose(); +private: + VclPtr mxControl; +}; + +class SVX_DLLPUBLIC SvxColorListBox : public MenuButton +{ +private: + friend class SvxListBoxColorWrapper; + VclPtr m_xColorWindow; + Link 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 getColorWindow() const; +public: + SvxColorListBox(vcl::Window* pParent, WinBits nStyle = 0); + virtual ~SvxColorListBox() override; + virtual void dispose() override; + + void SetSelectHdl(const Link& 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 +{ + /* 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 -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 ColorSelectFunction; + +#define COL_NONE_COLOR TRGB_COLORDATA(0x80, 0xFF, 0xFF, 0xFF) class SVX_DLLPUBLIC SvxColorWindow : public SfxPopupWindow { @@ -43,37 +57,49 @@ private: VclPtr mpPaletteListBox; VclPtr mpButtonAutoColor; + VclPtr mpButtonNoneColor; VclPtr mpButtonPicker; VclPtr mpAutomaticSeparator; OUString maCommand; - Link maSelectedLink; + Link maSelectedLink; PaletteManager& mrPaletteManager; BorderColorStatus& mrBorderColorStatus; - std::function 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 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& rLink ) { maSelectedLink = rLink; } + void SetSelectedHdl( const Link& 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 m_pBtnLight6; VclPtr m_pBtnLight7; VclPtr m_pBtnLight8; - VclPtr m_pLbLight1; - VclPtr m_pLbLight2; - VclPtr m_pLbLight3; - VclPtr m_pLbLight4; - VclPtr m_pLbLight5; - VclPtr m_pLbLight6; - VclPtr m_pLbLight7; - VclPtr m_pLbLight8; + VclPtr m_pLbLight1; + VclPtr m_pLbLight2; + VclPtr m_pLbLight3; + VclPtr m_pLbLight4; + VclPtr m_pLbLight5; + VclPtr m_pLbLight6; + VclPtr m_pLbLight7; + VclPtr m_pLbLight8; VclPtr m_pBtnLightColor; - VclPtr m_pLbAmbientlight; // ListBox + VclPtr m_pLbAmbientlight; // ListBox VclPtr m_pBtnAmbientColor; // color button // Textures @@ -144,13 +143,13 @@ private: // material editor VclPtr m_pFLMaterial; VclPtr m_pLbMatFavorites; - VclPtr m_pLbMatColor; + VclPtr m_pLbMatColor; VclPtr m_pBtnMatColor; - VclPtr m_pLbMatEmission; + VclPtr m_pLbMatEmission; VclPtr m_pBtnEmissionColor; VclPtr m_pFLMatSpecular; - VclPtr m_pLbMatSpecular; + VclPtr m_pLbMatSpecular; VclPtr m_pBtnSpecularColor; VclPtr 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 m_pFbShadowY; VclPtr m_pMtrFldShadowY; - VclPtr m_pShadowColorLB; + VclPtr 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 #include #include +#include #include #include #include @@ -124,8 +125,8 @@ protected: VclPtr mpColorTextFT; VclPtr mpLbFillType; VclPtr mpLbFillAttr; - VclPtr mpLbFillGradFrom; - VclPtr mpLbFillGradTo; + VclPtr mpLbFillGradFrom; + VclPtr mpLbFillGradTo; VclPtr mpToolBoxColor; // for new color picker VclPtr mpTrspTextFT; VclPtr 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 #include #include +#include #include #include @@ -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 ColorSelectFunction; -typedef std::function ColorSelectFunction; class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl { std::unique_ptr 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); -- cgit