summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-05-11 02:21:23 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2014-05-14 12:39:42 +0300
commit584b415924bba22db23a4258062e54973de0ed7c (patch)
tree6c1ee8bbbca7f20c61193710a99a6d4399d26d90 /include
parent2a98a03904895b6dce7ec53042b0204dbb379d5b (diff)
Keep only one class for toolbox color controls
instead of 5 (mostly identical) classes. Also the following bugs were fixed: * All pickers now use split buttons. (fdo#45671) * Color palette now indicates the current color. (fdo#73891) (Previous changes related to that bug are reverted as part of this commit.) * Selecting a color from a float panel now updates the button. (fdo#77683) * For Font color/background color in Writer, the color that is shown on the button, is always the one that's actually used. (Can be a different color after hiding the toolbar.) * For Font color/background color in Writer, the button now indicates when we're in the format paintbrush mode. (Removed in 085e8a07e61ef2d3a82e11094d8773ab17cfdb3c for some reason.) Change-Id: Idb4829552240c52fb0882aca627c8177bbe2f839
Diffstat (limited to 'include')
-rw-r--r--include/svx/extrusioncolorcontrol.hxx50
-rw-r--r--include/svx/tbcontrl.hxx134
2 files changed, 13 insertions, 171 deletions
diff --git a/include/svx/extrusioncolorcontrol.hxx b/include/svx/extrusioncolorcontrol.hxx
deleted file mode 100644
index 668b7109eadc..000000000000
--- a/include/svx/extrusioncolorcontrol.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_EXTRUSIONCOLORCONTROL_HXX
-#define INCLUDED_SVX_EXTRUSIONCOLORCONTROL_HXX
-
-#include <sfx2/tbxctrl.hxx>
-#include <svx/svxdllapi.h>
-#include <svx/tbxcolorupdate.hxx>
-
-namespace svx {
-
-class SVX_DLLPUBLIC ExtrusionColorControl : public SfxToolBoxControl
-{
-private:
- ToolboxButtonColorUpdater* mpBtnUpdater;
- Color mLastColor;
-
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- ExtrusionColorControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
- virtual ~ExtrusionColorControl();
-
- virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
-};
-
-}
-
-#endif // INCLUDED_SVX_EXTRUSIONCOLORCONTROL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 94868eaae8a3..e086b0ed274f 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -39,17 +39,8 @@
Additional information
from DocShell: SvxFontListItem (SID_ATTR_CHAR_FONTLIST)
- SvxFontColorToolBoxControl
- --------------------------
- Item type: SvxFontColorItem
- Execute-Id: SID_ATTR_CHAR_COLOR
- -> SvxFontColorItem
- Additional information
- from DocShell: presently none
- in future: color palette
-
- class SvxColorExtToolBoxControl
- -----------------------------------
+ SvxColorToolBoxControl
+ ----------------------
Item type: SvxColorItem
and SfxBoolItem
@@ -57,7 +48,8 @@
Execute-Id SID_ATTR_CHAR_COLOR2
and SID_ATTR_CHAR_COLOR_EXT
- for cell color (calc)
+ for font color
+ (calc/impress/draw and writer drawing objects)
Execute-Id SID_ATTR_CHAR_COLOR
for character background color (writer)
@@ -65,19 +57,14 @@
and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
for paragraph background color (writer)
+ and cell background color (calc)
Execute-Id SID_BACKGROUND_COLOR
- for cell background color (calc)
- Execute-Id SID_ATTR_CHAR_COLOR_BACKGROUND
-
for table/cell border color (writer, calc)
Execute-Id SID_FRAME_LINECOLOR
- SvxColorToolBoxControl
- --------------------------------
- Item type: SvxBrushItem
- Execute-Id: SID_BACKGROUND_COLOR
- -> SvxColorItem
+ for 3D extrusion
+ Execute-Id SID_EXTRUSION_3D_COLOR
SvxPatternToolBoxControl
------------------------
@@ -119,14 +106,6 @@
Bemerkung: provides a SvxLineItem, which provides a SvxBorderLine
without color information.
- SvxFrameLineColorToolBoxControl
- -------------------------------
- Item type: SvxColorItem
- Execute-Id: SID_FRAME_LINECOLOR
- -> SvxColorItem
- Additional information
- from DocShell: none
-
SvxStyleToolBoxControl
----------------------
Item type: SfxTemplateItem
@@ -147,7 +126,7 @@
#include <sfx2/tbxctrl.hxx>
#include <svx/strarray.hxx>
#include <svx/svxdllapi.h>
-
+#include <boost/scoped_ptr.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
// important im tbxctrls.hxx created HeDaBu !!!
@@ -164,7 +143,6 @@ namespace svx
}
-
// class SvxStyleToolBoxControl ------------------------------------------
class SVX_DLLPUBLIC SvxStyleToolBoxControl : public SfxToolBoxControl
@@ -218,8 +196,6 @@ friend class SfxStyleControllerItem_Impl;
// class SvxFontNameToolBoxControl ---------------------------------------
-
-
class SVX_DLLPUBLIC SvxFontNameToolBoxControl : public SfxToolBoxControl
{
public:
@@ -232,70 +208,17 @@ public:
};
+// class SvxColorToolBoxControl --------------------------------------
-
-// class SvxFontColorToolBoxControl --------------------------------------
-
-
-
-
-class SVX_DLLPUBLIC SvxFontColorToolBoxControl : public SfxToolBoxControl
-{
- ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
- Color mLastColor;
-
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- SvxFontColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
- virtual ~SvxFontColorToolBoxControl();
-
- virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
-};
-
-
-
-
-// class SvxColorExtToolBoxControl --------------------------------------
-
-
-
-
-class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl
+class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
{
using SfxToolBoxControl::StateChanged;
- ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
+ ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > pBtnUpdater;
Color mLastColor;
- bool bChoiceFromPalette;
-
+ DECL_LINK( SelectedHdl, Color* );
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxColorExtToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
- virtual ~SvxColorExtToolBoxControl();
-
- virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
- virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
-};
-
-
-
-
-// class SvxColorToolBoxControl ------------------------------------------
-
-
-
-class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
-{
- ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
- Color mLastColor;
-
-public:
SvxColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
virtual ~SvxColorToolBoxControl();
@@ -303,15 +226,12 @@ public:
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
};
-
-
// class SvxFrameToolBoxControl ------------------------------------------
-
-
class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
{
public:
@@ -326,12 +246,8 @@ public:
};
-
-
// class SvxLineStyleToolBoxControl --------------------------------------
-
-
class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
{
public:
@@ -345,30 +261,6 @@ public:
};
-
-
-// class SvxFrameLineColorToolBoxControl ---------------------------------
-
-
-
-class SVX_DLLPUBLIC SvxFrameLineColorToolBoxControl : public SfxToolBoxControl
-{
- ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
- Color mLastColor;
-
-public:
- SFX_DECL_TOOLBOX_CONTROL();
- SvxFrameLineColorToolBoxControl( sal_uInt16 nSlotId,
- sal_uInt16 nId,
- ToolBox& rTbx );
- virtual ~SvxFrameLineColorToolBoxControl();
-
- virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
-};
-
class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl
{
private: