[Libreoffice-commits] core.git: 3 commits - icon-themes/tango include/svx sc/inc sc/source sc/uiconfig svx/inc svx/source svx/uiconfig

Maxim Monastirsky momonasmon at gmail.com
Mon Oct 27 05:29:04 PDT 2014


 icon-themes/tango/links.txt                          |    1 
 include/svx/dialogs.hrc                              |    6 
 sc/inc/helpids.h                                     |    3 
 sc/inc/sc.hrc                                        |    1 
 sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx |   71 ----------
 sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc |    5 
 sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx |   13 -
 sc/source/ui/sidebar/CellAppearancePropertyPanel.src |   25 ---
 sc/uiconfig/scalc/ui/sidebarcellappearance.ui        |    4 
 svx/inc/helpid.hrc                                   |    1 
 svx/source/sidebar/area/AreaPropertyPanel.cxx        |  126 -------------------
 svx/source/sidebar/area/AreaPropertyPanel.hrc        |    2 
 svx/source/sidebar/area/AreaPropertyPanel.hxx        |   23 ---
 svx/source/sidebar/area/AreaPropertyPanel.src        |   21 ---
 svx/source/tbxctrls/tbcontrl.cxx                     |    4 
 svx/uiconfig/ui/sidebararea.ui                       |    6 
 16 files changed, 14 insertions(+), 298 deletions(-)

New commits:
commit 3c3257e499ff48e89b58ce722364ca96738970b1
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon Oct 27 13:57:38 2014 +0200

    fdo#84844 Sidebar: Use SvxColorToolBoxControl for fill color
    
    Change-Id: I0aa9dbef960391334097b68c980064724435db38

diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 4656c97..3bbd259 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -315,7 +315,6 @@ svx/res/symphony/rotate_left.png cmd/sc_rotateleft.png
 svx/res/symphony/rotate_right.png cmd/sc_rotateright.png
 svx/res/symphony/sc_backgroundcolor.png cmd/sc_formatarea.png
 svx/res/symphony/sch_backgroundcolor.png cmd/sc_formatarea.png
-svx/res/symphony/fill_color.png cmd/sc_formatarea.png
 sw/res/sidebar/pageproppanel/last_custom_common.png svx/res/symphony/last_custom_common.png
 sw/res/sidebar/pageproppanel/last_custom_common_grey.png svx/res/symphony/last_custom_common_grey.png
 sc/imglst/na05.png cmd/sc_upsearch.png
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 196a6eb..d3a74f0 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -206,7 +206,6 @@
 #define RID_POPUPPANEL_TEXTPAGE_FONT_COLOR  (RID_SVX_START + 316)
 #define RID_POPUPPANEL_TEXTPAGE_SPACING     (RID_SVX_START + 317)
 
-#define RID_POPUPPANEL_AERAPAGE_COLOR       (RID_SVX_START + 319)
 #define RID_POPUPPANEL_AREAPAGE_TRGR        (RID_SVX_START + 320)
 
 #define RID_SIDEBAR_LINE_PANEL              (RID_SVX_START + 321)
@@ -1043,9 +1042,8 @@
 #define IMG_RADIAL                       (RID_SVX_SIDEBAR_BEGIN + 33)
 #define IMG_SQUARE                       (RID_SVX_SIDEBAR_BEGIN + 34)
 #define IMG_LINEAR                       (RID_SVX_SIDEBAR_BEGIN + 35)
-#define IMG_AREA_COLOR                   (RID_SVX_SIDEBAR_BEGIN + 36)
-#define IMG_ROT_LEFT                     (RID_SVX_SIDEBAR_BEGIN + 37)
-#define IMG_ROT_RIGHT                    (RID_SVX_SIDEBAR_BEGIN + 38)
+#define IMG_ROT_LEFT                     (RID_SVX_SIDEBAR_BEGIN + 36)
+#define IMG_ROT_RIGHT                    (RID_SVX_SIDEBAR_BEGIN + 37)
 #define RID_SVX_SIDEBAR_END              (RID_SVX_START + 1279)
 
 #define RID_SVXIMG_GREENCHECK            (RID_SVX_START + 1280)
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 75bed5e..02c098e 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -118,7 +118,6 @@
 #define HID_PPROPERTYPANEL_LINE_VS_STYLE "SVX_HID_PPROPERTYPANEL_LINE_VS_STYLE"
 #define HID_PPROPERTYPANEL_LINE_BTN_STYLE "SVX_HID_PPROPERTYPANEL_LINE_BTN_STYLE"
 #define HID_PPROPERTYPANEL_TEXT_SPACING_VS "SVX_HID_PPROPERTYPANEL_TEXT_SPACING_VS"
-#define HID_PPROPERTYPANEL_AREA_COLOR_VS "SVX_HID_PPROPERTYPANEL_AREA_COLOR_VS"
 
 #define HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES "SVX_HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES"
 #define HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR "SVX_HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR"
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 9ab67b1..63467d2 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -38,7 +38,6 @@
 #include <svx/svxitems.hrc>
 #include <vcl/toolbox.hxx>
 #include <svtools/toolbarmenu.hxx>
-#include <svx/sidebar/ColorControl.hxx>
 
 #include <boost/bind.hpp>
 
@@ -46,7 +45,6 @@ using namespace css;
 using namespace css::uno;
 using ::sfx2::sidebar::Theme;
 
-const char UNO_SIDEBARCOLOR[]    = ".uno:sidebarcolor";
 const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
 
 namespace svx { namespace sidebar {
@@ -65,7 +63,6 @@ AreaPropertyPanel::AreaPropertyPanel(
     SfxBindings* pBindings)
     : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui", rxFrame),
       meLastXFS(static_cast<sal_uInt16>(-1)),
-      maLastColor(Color(COL_DEFAULT_SHAPE_FILLING)),
       mnLastPosGradient(0),
       mnLastPosHatch(0),
       mnLastPosBitmap(0),
@@ -86,7 +83,6 @@ AreaPropertyPanel::AreaPropertyPanel(
       maGradientControl(SID_ATTR_FILL_GRADIENT, *pBindings, *this),
       maHatchControl(SID_ATTR_FILL_HATCH, *pBindings, *this),
       maBitmapControl(SID_ATTR_FILL_BITMAP, *pBindings, *this),
-      maColorTableControl(SID_COLOR_TABLE, *pBindings, *this),
       maGradientListControl(SID_GRADIENT_LIST, *pBindings, *this),
       maHatchListControl(SID_HATCH_LIST, *pBindings, *this),
       maBitmapListControl(SID_BITMAP_LIST, *pBindings, *this),
@@ -98,14 +94,11 @@ AreaPropertyPanel::AreaPropertyPanel(
       maImgRadial(SVX_RES(IMG_RADIAL)),
       maImgSquare(SVX_RES(IMG_SQUARE)),
       maImgLinear(SVX_RES(IMG_LINEAR)),
-      maImgColor(SVX_RES(IMG_AREA_COLOR)),
       maTrGrPopup(this, ::boost::bind(&AreaPropertyPanel::CreateTransparencyGradientControl, this, _1)),
-      maColorPopup(this, ::boost::bind(&AreaPropertyPanel::CreateColorPopupControl, this, _1)),
       mpFloatTransparenceItem(),
       mpTransparanceItem(),
       mxFrame(rxFrame),
-      mpBindings(pBindings),
-      mbColorAvail(true)
+      mpBindings(pBindings)
 {
     get(mpColorTextFT,    "filllabel");
     get(mpLbFillType,     "fillstyle");
@@ -116,9 +109,6 @@ AreaPropertyPanel::AreaPropertyPanel(
     get(mpMTRTransparent, "settransparency");
     get(mpBTNGradient,    "selectgradient");
 
-    const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR);
-    mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, nIdColor, mpToolBoxColor)),
-
     Initialize();
 }
 
@@ -164,18 +154,6 @@ void AreaPropertyPanel::Initialize()
     aLink = LINK( this, AreaPropertyPanel, SelectFillAttrHdl );
     mpLbFillAttr->SetSelectHdl( aLink );
 
-    //add  for new color picker
-    mpLbFillAttr->Hide();
-    const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR);
-    mpToolBoxColor->SetItemImage(nIdColor, maImgColor);
-    mpToolBoxColor->SetItemBits( nIdColor, mpToolBoxColor->GetItemBits( nIdColor ) | ToolBoxItemBits::DROPDOWNONLY );
-    mpToolBoxColor->SetItemText(nIdColor, msHelpFillAttr);
-
-    aLink = LINK(this, AreaPropertyPanel, ToolBoxColorDropHdl);
-    mpToolBoxColor->SetDropdownClickHdl ( aLink );
-    mpToolBoxColor->SetSelectHdl ( aLink );
-
-    //add end
     mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanel, ChangeTrgrTypeHdl_Impl));
     mpLBTransType->SetAccessibleName(OUString( "Transparency"));    //wj acc
 
@@ -237,7 +215,7 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
                 mpLbFillAttr->Hide();
                 mpToolBoxColor->Show();
                 const OUString aTmpStr;
-                const Color aColor = maLastColor;
+                const Color aColor = mpColorItem->GetColorValue();
                 const XFillColorItem aXFillColorItem( aTmpStr, aColor );
 
                 // #i122676# change FillStyle and Color in one call
@@ -504,41 +482,6 @@ IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox )
 }
 
 
-IMPL_LINK(AreaPropertyPanel, ToolBoxColorDropHdl, ToolBox*, pToolBox)
-{
-    const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
-
-    if(UNO_SIDEBARCOLOR == aCommand)
-    {
-        maColorPopup.Show(*pToolBox);
-
-        if (mpColorItem)
-        {
-            maColorPopup.SetCurrentColor(mpColorItem->GetColorValue(), mbColorAvail);
-        }
-        else
-        {
-            maColorPopup.SetCurrentColor(COL_WHITE, false);
-        }
-    }
-
-    return 0;
-}
-
-
-
-void AreaPropertyPanel::SetColor (
-    const OUString& rsColorName,
-    const Color aColor)
-{
-    const XFillColorItem aXFillColorItem(rsColorName, aColor);
-    mpBindings->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, &aXFillColorItem, 0L);
-    maLastColor = aColor;
-}
-
-
-
-
 PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent)
 {
     return new AreaTransparencyGradientControl(pParent, *this);
@@ -547,22 +490,6 @@ PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContain
 
 
 
-PopupControl* AreaPropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
-{
-    return new ColorControl(
-        pParent,
-        mpBindings,
-        SVX_RES(RID_POPUPPANEL_AERAPAGE_COLOR),
-        SVX_RES(VS_COLOR),
-        ::boost::bind(&AreaPropertyPanel::GetLastColor, this),
-        ::boost::bind(&AreaPropertyPanel::SetColor, this, _1,_2),
-        pParent,
-        0);
-}
-
-
-
-
 void AreaPropertyPanel::SetupIcons(void)
 {
     if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
@@ -857,24 +784,7 @@ void AreaPropertyPanel::NotifyItemUpdate(
                 mpLbFillAttr->Hide();
                 mpToolBoxColor->Show();
 
-                if(SfxItemState::DEFAULT == eState)
-                {
-                    mpToolBoxColor->Enable();
-                    mbColorAvail = true;
-                    // maLastColor = mpColorItem->GetColorValue();
-                    Update();
-                }
-                else if(SfxItemState::DISABLED == eState)
-                {
-                    mpToolBoxColor->Disable();
-                    mbColorAvail = false;
-                    mpColorUpdater->Update(COL_WHITE);
-                }
-                else
-                {
-                    mbColorAvail = false;
-                    mpColorUpdater->Update(COL_WHITE);
-                }
+                Update();
             }
             break;
         }
@@ -965,31 +875,6 @@ void AreaPropertyPanel::NotifyItemUpdate(
             }
             break;
         }
-        case SID_COLOR_TABLE:
-        {
-            if(SfxItemState::DEFAULT == eState)
-            {
-                if(mpStyleItem && drawing::FillStyle_SOLID == (drawing::FillStyle)mpStyleItem->GetValue())
-                {
-                    if(mpColorItem)
-                    {
-                        const Color aColor = mpColorItem->GetColorValue();
-                        const SfxObjectShell* pSh = SfxObjectShell::Current();
-                        const SvxColorListItem aItem(*static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE)));
-
-                        mpLbFillAttr->Clear();
-                        mpLbFillAttr->Enable();
-                        mpLbFillAttr->Fill(aItem.GetColorList());
-                        mpLbFillAttr->SelectEntry(aColor);
-                    }
-                    else
-                    {
-                        mpLbFillAttr->SetNoSelection();
-                    }
-                }
-            }
-            break;
-        }
         case SID_GRADIENT_LIST:
         {
             if(SfxItemState::DEFAULT == eState)
@@ -1094,11 +979,6 @@ void AreaPropertyPanel::Update()
                 {
                     mpLbFillAttr->Hide();
                     mpToolBoxColor->Show();
-                    mpColorUpdater->Update(mpColorItem->GetColorValue());
-                }
-                else
-                {
-                    mpColorUpdater->Update(COL_WHITE);
                 }
                 break;
             }
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hrc b/svx/source/sidebar/area/AreaPropertyPanel.hrc
index c50783b..d627b63 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hrc
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hrc
@@ -22,8 +22,6 @@
 #define TBI_LEFT                            1
 #define TBI_RIGHT                           1
 
-#define VS_COLOR            1
-
 #define FT_TRGR_CENTER_X    9
 #define MTR_TRGR_CENTER_X   10
 #define FT_TRGR_CENTER_Y    11
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 0d3540f..3bc0353 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -19,7 +19,6 @@
 #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
 #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
 
-#include <svx/sidebar/ColorPopup.hxx>
 #include "AreaTransparencyGradientPopup.hxx"
 #include <vcl/ctrl.hxx>
 #include <sfx2/sidebar/SidebarPanelBase.hxx>
@@ -37,13 +36,11 @@
 #include <vcl/field.hxx>
 #include <vcl/fixed.hxx>
 #include <svl/intitem.hxx>
-#include <svx/tbxcolorupdate.hxx>
 #include <com/sun/star/ui/XUIElement.hpp>
 #include <boost/scoped_ptr.hpp>
 
 
 class XFillFloatTransparenceItem;
-namespace svx { class ToolboxButtonColorUpdater; }
 
 
 namespace svx { namespace sidebar {
@@ -85,7 +82,6 @@ public:
 
 private:
     sal_uInt16                                          meLastXFS;
-    Color                                               maLastColor;
 
     sal_Int32                                           mnLastPosGradient;
     sal_Int32                                           mnLastPosHatch;
@@ -109,8 +105,6 @@ private:
     MetricField*                                        mpMTRTransparent;
     ToolBox*                                            mpBTNGradient;
 
-    ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
-
     ::boost::scoped_ptr< XFillStyleItem >               mpStyleItem;
     ::boost::scoped_ptr< XFillColorItem >               mpColorItem;
     ::boost::scoped_ptr< XFillGradientItem >            mpFillGradientItem;
@@ -122,7 +116,6 @@ private:
     ::sfx2::sidebar::ControllerItem                     maGradientControl;
     ::sfx2::sidebar::ControllerItem                     maHatchControl;
     ::sfx2::sidebar::ControllerItem                     maBitmapControl;
-    ::sfx2::sidebar::ControllerItem                     maColorTableControl;
     ::sfx2::sidebar::ControllerItem                     maGradientListControl;
     ::sfx2::sidebar::ControllerItem                     maHatchListControl;
     ::sfx2::sidebar::ControllerItem                     maBitmapListControl;
@@ -135,12 +128,8 @@ private:
     Image                                               maImgRadial;
     Image                                               maImgSquare;
     Image                                               maImgLinear;
-    Image                                               maImgColor;
-
-    OUString                                            msHelpFillAttr;
 
     AreaTransparencyGradientPopup maTrGrPopup;
-    ColorPopup maColorPopup;
 
     ::boost::scoped_ptr< XFillFloatTransparenceItem >   mpFloatTransparenceItem;
     ::boost::scoped_ptr< SfxUInt16Item >                mpTransparanceItem;
@@ -148,9 +137,6 @@ private:
     css::uno::Reference<css::frame::XFrame>                 mxFrame;
     SfxBindings*                                        mpBindings;
 
-    /// bitfield
-    bool                                                mbColorAvail : 1;
-
     DECL_LINK(SelectFillTypeHdl, ListBox* );
     DECL_LINK(SelectFillAttrHdl, ListBox* );
     DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
@@ -160,10 +146,6 @@ private:
     PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
     DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
 
-    // for color picker
-    PopupControl* CreateColorPopupControl (PopupContainer* pParent);
-    DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker
-
     // constructor/destuctor
     AreaPropertyPanel(
         vcl::Window* pParent,
@@ -175,11 +157,6 @@ private:
     void Initialize();
     void Update();
     void ImpUpdateTransparencies();
-
-    const Color& GetLastColor (void) const { return maLastColor;}
-    void SetColor (
-        const OUString& rsColorName,
-        const Color aColor);
 };
 
 
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.src b/svx/source/sidebar/area/AreaPropertyPanel.src
index bc7a161..4dea34c 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.src
+++ b/svx/source/sidebar/area/AreaPropertyPanel.src
@@ -45,10 +45,6 @@ Image IMG_LINEAR
 {
     ImageBitmap = Bitmap{File = "symphony/linear.png";};
 };
-Image IMG_AREA_COLOR
-{
-    ImageBitmap = Bitmap{File = "symphony/fill_color.png";};
-};
 Image IMG_ROT_LEFT
 {
     ImageBitmap = Bitmap{File = "symphony/rotate_left.png";};
@@ -236,22 +232,5 @@ Control RID_POPUPPANEL_AREAPAGE_TRGR
         Text [ en-US ] = "Rotate clockwise by 45 degrees." ;
     };
 };
-Control RID_POPUPPANEL_AERAPAGE_COLOR
-{
-    OutputSize = TRUE;
-    DialogControl = TRUE;
-    Border = FALSE;
-    Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT  );
-
-    Control VS_COLOR
-    {
-        HelpID = HID_PPROPERTYPANEL_AREA_COLOR_VS;
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
-        Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
-        TabStop = TRUE ;
-        Text = "Color";
-    };
-};
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui
index 725980cc..cbea7cb 100644
--- a/svx/uiconfig/ui/sidebararea.ui
+++ b/svx/uiconfig/ui/sidebararea.ui
@@ -63,7 +63,7 @@
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
                 <child>
-                  <object class="GtkToolbar" id="selectcolor">
+                  <object class="sfxlo-SidebarToolBox" id="selectcolor">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
@@ -74,7 +74,7 @@
                         <property name="has_tooltip">True</property>
                         <property name="tooltip_markup" translatable="yes">Select the color to apply.</property>
                         <property name="tooltip_text" translatable="yes">Select the color to apply.</property>
-                        <property name="action_name">.uno:sidebarcolor</property>
+                        <property name="action_name">.uno:FillColor</property>
                         <property name="use_underline">True</property>
                       </object>
                       <packing>
@@ -91,7 +91,7 @@
                 </child>
                 <child>
                   <object class="svxlo-SvxFillAttrBox" id="fillattr">
-                    <property name="visible">True</property>
+                    <property name="visible">False</property>
                     <property name="can_focus">False</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_markup" translatable="yes">Select the effect to apply.</property>
commit 2dfa6b15ec315c587784070963c397bf5b75e2b0
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Oct 26 16:18:16 2014 +0200

    Fix color update for selection with multiple colors
    
    Change-Id: Ie6ec5596027b053cea49faba67bd82bd9bfa2d31

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index cc5b172..9df403e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2489,6 +2489,10 @@ void SvxColorToolBoxControl::StateChanged(
 
         pBtnUpdater->Update( aColor );
     }
+    else if ( bSidebarType )
+    {
+        pBtnUpdater->Update( COL_TRANSPARENT );
+    }
 }
 
 void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/)
commit bf87e743184b181d4189083896697096bb6a3fac
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Oct 26 15:38:21 2014 +0200

    fdo#84844 Sidebar: Use SvxColorToolBoxControl for cell fill color
    
    Change-Id: I4a067b31b4b518c56a0d18c6e6709955562d77fa

diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index a67cc87..86c1c0e 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -287,8 +287,6 @@
 
 // CellAppearancePropertyPanel -----------------------------------------
 #define HID_PROPERTYPANEL_SC_CELL_SECTION                       "SC_HID_PROPERTYPANEL_SC_CELL_SECTION"
-#define HID_PROPERTYPANEL_SC_TBX_BKCOLOR                        "SC_HID_PROPERTYPANEL_SC_TBX_BKCOLOR"
-#define HID_PROPERTYPANEL_SC_TBI_BKCOLOR                        "SC_HID_PROPERTYPANEL_SC_TBI_BKCOLOR"
 #define HID_PROPERTYPANEL_SC_TBX_BORDER                         "SC_HID_PROPERTYPANEL_SC_TBX_BORDER"
 #define HID_PROPERTYPANEL_SC_TBI_BORDER                         "SC_HID_PROPERTYPANEL_SC_TBI_BORDER"
 #define HID_PROPERTYPANEL_SC_TBX_STYLE                          "SC_HID_PROPERTYPANEL_SC_TBX_STYLE"
@@ -296,7 +294,6 @@
 #define HID_PROPERTYPANEL_SC_TBX_LINECOLOR                      "SC_HID_PROPERTYPANEL_SC_TBX_LINECOLOR"
 #define HID_PROPERTYPANEL_SC_TBI_LINECOLOR                      "SC_HID_PROPERTYPANEL_SC_TBI_LINECOLOR"
 #define HID_PROPERTYPANEL_SC_CBOX_SHOWGRID                      "SC_HID_PROPERTYPANEL_SC_CBOX_SHOWGRID"
-#define HID_PROPERTYPANEL_FILL_COLOR_VS                         "SC_HID_PROPERTYPANEL_FILL_COLOR_VS"
 #define HID_PROPERTYPANEL_LINE_COLOR_VS                         "SC_HID_PROPERTYPANEL_LINE_COLOR_VS"
 #define HID_PROPERTYPANEL_SC_STYLE_VS                           "SC_HID_PROPERTYPANEL_SC_STYLE_VS"
 #define HID_PROPERTYPANEL_SC_STYLE_PB                           "SC_HID_PROPERTYPANEL_SC_STYLE_PB"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 2d7d228..57b7c52 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1120,7 +1120,6 @@
 #define RID_PROPERTYPANEL_SC_ALIGNMENT  (SC_DIALOGS_START + 161)
 
 // defines for CellAppearancePropertyPanel
-#define RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR (SC_DIALOGS_START + 162)
 #define RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR (SC_DIALOGS_START + 163)
 #define RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE (SC_DIALOGS_START + 164)
 #define RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE (SC_DIALOGS_START + 165)
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index bb44cd9..4b687dd 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -47,7 +47,6 @@
 using namespace css;
 using namespace css::uno;
 
-const char UNO_BACKGROUNDCOLOR[] = ".uno:BackgroundColor";
 const char UNO_SETBORDERSTYLE[] = ".uno:SetBorderStyle";
 const char UNO_LINESTYLE[] = ".uno:LineStyle";
 const char UNO_FRAMELINECOLOR[] = ".uno:FrameLineColor";
@@ -66,30 +65,6 @@ namespace
 
 namespace sc { namespace sidebar {
 
-svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent)
-{
-    const ScResId aResId(VS_NOFILLCOLOR);
-
-    return new svx::sidebar::ColorControl(
-        pParent,
-        mpBindings,
-        ScResId(RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR),
-        ScResId(VS_FILLCOLOR),
-        ::boost::bind(GetTransparentColor),
-        ::boost::bind(&CellAppearancePropertyPanel::SetFillColor, this, _1, _2),
-        pParent,
-        &aResId);
-}
-
-void CellAppearancePropertyPanel::SetFillColor(
-    const OUString& /*rsColorName*/,
-    const Color aColor)
-{
-    const SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR);
-    mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SfxCallMode::RECORD, &aColorItem, 0L);
-    maBackColor = aColor;
-}
-
 svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent)
 {
     return new svx::sidebar::ColorControl(
@@ -144,7 +119,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
     SfxBindings* pBindings)
 :   PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui", rxFrame),
 
-    maBackColorControl(SID_BACKGROUND_COLOR, *pBindings, *this),
     maLineColorControl(SID_FRAME_LINECOLOR, *pBindings, *this),
     maLineStyleControl(SID_FRAME_LINESTYLE, *pBindings, *this),
     maBorderOuterControl(SID_ATTR_BORDER_OUTER, *pBindings, *this),
@@ -164,7 +138,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
     maIMGLineStyle8(ScResId(IMG_LINE_STYLE8)),
     maIMGLineStyle9(ScResId(IMG_LINE_STYLE9)),
 
-    maBackColor(COL_TRANSPARENT),
     maLineColor(COL_BLACK),
     maTLBRColor(COL_BLACK),
     maBLTRColor(COL_BLACK),
@@ -177,7 +150,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
     mnBLTRIn(0),
     mnBLTROut(0),
     mnBLTRDis(0),
-    mbBackColorAvailable(true),
     mbLineColorAvailable(true),
     mbBorderStyleAvailable(true),
     mbLeft(false),
@@ -191,7 +163,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
     mbTLBR(false),
     mbBLTR(false),
 
-    maFillColorPopup(this, ::boost::bind(&CellAppearancePropertyPanel::CreateFillColorPopupControl, this, _1)),
     maLineColorPopup(this, ::boost::bind(&CellAppearancePropertyPanel::CreateLineColorPopupControl, this, _1)),
     mpCellLineStylePopup(),
     mpCellBorderStylePopup(),
@@ -200,15 +171,11 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
     maContext(),
     mpBindings(pBindings)
 {
-    get(mpTBFillColor,  "cellbackgroundcolor");
     get(mpTBCellBorder, "cellbordertype");
     get(mpTBLineStyle,  "borderlinestyle");
     get(mpTBLineColor,  "borderlinecolor");
     get(mpCBXShowGrid,  "cellgridlines");
 
-    mpFillColorUpdater.reset( new ::svx::ToolboxButtonColorUpdater(SID_ATTR_BRUSH,
-        mpTBFillColor->GetItemId( UNO_BACKGROUNDCOLOR ),
-        mpTBFillColor) );
     mpLineColorUpdater.reset( new ::svx::ToolboxButtonColorUpdater(SID_FRAME_LINECOLOR,
         mpTBLineColor->GetItemId( UNO_FRAMELINECOLOR ),
         mpTBLineColor) );
@@ -224,16 +191,10 @@ CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
 
 void CellAppearancePropertyPanel::Initialize()
 {
-    const sal_uInt16 nIdBkColor = mpTBFillColor->GetItemId( UNO_BACKGROUNDCOLOR );
-    mpTBFillColor->SetItemBits( nIdBkColor, mpTBFillColor->GetItemBits( nIdBkColor ) | ToolBoxItemBits::DROPDOWNONLY );
-    Link aLink = LINK(this, CellAppearancePropertyPanel, TbxBKColorSelectHdl);
-    mpTBFillColor->SetDropdownClickHdl ( aLink );
-    mpTBFillColor->SetSelectHdl ( aLink );
-
     const sal_uInt16 nIdBorderType  = mpTBCellBorder->GetItemId( UNO_SETBORDERSTYLE );
     mpTBCellBorder->SetItemImage( nIdBorderType, maIMGCellBorder );
     mpTBCellBorder->SetItemBits( nIdBorderType, mpTBCellBorder->GetItemBits( nIdBorderType ) | ToolBoxItemBits::DROPDOWNONLY );
-    aLink = LINK(this, CellAppearancePropertyPanel, TbxCellBorderSelectHdl);
+    Link aLink = LINK(this, CellAppearancePropertyPanel, TbxCellBorderSelectHdl);
     mpTBCellBorder->SetDropdownClickHdl ( aLink );
     mpTBCellBorder->SetSelectHdl ( aLink );
 
@@ -259,18 +220,6 @@ void CellAppearancePropertyPanel::Initialize()
     mpTBLineStyle->SetAccessibleRelationLabeledBy(mpTBLineStyle);
 }
 
-IMPL_LINK(CellAppearancePropertyPanel, TbxBKColorSelectHdl, ToolBox*, pToolBox)
-{
-    const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
-
-    if(aCommand == UNO_BACKGROUNDCOLOR)
-    {
-        maFillColorPopup.Show(*pToolBox);
-        maFillColorPopup.SetCurrentColor(maBackColor, mbBackColorAvailable);
-    }
-    return 0;
-}
-
 IMPL_LINK(CellAppearancePropertyPanel, TbxLineColorSelectHdl, ToolBox*, pToolBox)
 {
     const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
@@ -386,24 +335,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
 
     switch(nSID)
     {
-    case SID_BACKGROUND_COLOR:
-        if(eState >= SfxItemState::DEFAULT)
-        {
-            const SvxColorItem* pSvxColorItem = dynamic_cast< const SvxColorItem* >(pState);
-
-            if(pSvxColorItem)
-            {
-                maBackColor = ((const SvxColorItem*)pState)->GetValue();
-                mbBackColorAvailable = true;
-                mpFillColorUpdater->Update(maBackColor);
-                break;
-            }
-        }
-
-        mbBackColorAvailable = false;
-        maBackColor.SetColor(COL_TRANSPARENT);
-        mpFillColorUpdater->Update(COL_TRANSPARENT);
-        break;
     case SID_FRAME_LINECOLOR:
         if( eState == SfxItemState::DONTCARE)
         {
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc
index 9ac8e76..8a01cb2 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-//BACK_COLOR PAGE
-#define STR_AUTOMATICE  2
-
 //line style page
 #define VS_STYLE        1
 #define PB_OPTIONS      2
@@ -75,8 +72,6 @@
 #define STR_BORDER_7            47
 #define STR_BORDER_8            48
 
-#define VS_FILLCOLOR            1
-#define VS_NOFILLCOLOR          2
 #define VS_LINECOLOR            1
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 90cb201..ef92c5c 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -70,16 +70,13 @@ public:
 private:
     //ui controls
 
-    ToolBox*                                mpTBFillColor;
     ToolBox*                                mpTBCellBorder;
     ToolBox*                                mpTBLineStyle;
     ToolBox*                                mpTBLineColor;
-    ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpFillColorUpdater;
     ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpLineColorUpdater;
     ::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater;
     CheckBox*                               mpCBXShowGrid;
 
-    ::sfx2::sidebar::ControllerItem         maBackColorControl;
     ::sfx2::sidebar::ControllerItem         maLineColorControl;
     ::sfx2::sidebar::ControllerItem         maLineStyleControl;
     ::sfx2::sidebar::ControllerItem         maBorderOuterControl;
@@ -100,9 +97,6 @@ private:
     Image                                   maIMGLineStyle8;
     Image                                   maIMGLineStyle9;
 
-    // cell background color
-    Color                                   maBackColor;
-
     // cell line color(s)
     Color                                   maLineColor;
     Color                                   maTLBRColor;
@@ -120,7 +114,6 @@ private:
     sal_uInt16                              mnBLTRDis;
 
     /// bitfield
-    bool                                    mbBackColorAvailable : 1;
     bool                                    mbLineColorAvailable : 1;
     bool                                    mbBorderStyleAvailable : 1;
 
@@ -139,7 +132,6 @@ private:
     bool                                    mbBLTR : 1;
 
     // popups
-    svx::sidebar::ColorPopup                maFillColorPopup;
     svx::sidebar::ColorPopup                maLineColorPopup;
     ::boost::scoped_ptr< CellLineStylePopup > mpCellLineStylePopup;
     ::boost::scoped_ptr< CellBorderStylePopup > mpCellBorderStylePopup;
@@ -148,16 +140,11 @@ private:
     ::sfx2::sidebar::EnumContext            maContext;
     SfxBindings*                            mpBindings;
 
-    DECL_LINK(TbxBKColorSelectHdl, ToolBox*);
     DECL_LINK(TbxLineColorSelectHdl, ToolBox*);
     DECL_LINK(TbxCellBorderSelectHdl, ToolBox*);
     DECL_LINK(TbxLineStyleSelectHdl, ToolBox*);
     DECL_LINK(CBOXGridShowClkHdl, void*);
 
-    // for fill color picker
-    svx::sidebar::PopupControl* CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent);
-    void SetFillColor(const OUString& rsColorName, const Color aColor);
-
     // for line color picker
     svx::sidebar::PopupControl* CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent);
     void SetLineColor(const OUString& rsColorName, const Color aColor);
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src
index fd6a287..18ef971 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src
@@ -65,31 +65,6 @@ Image IMG_LINE_STYLE9
     ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750.png";};
 };
 
-// fill color popup
-
-Control RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR
-{
-    OutputSize = TRUE;
-    DialogControl = TRUE;
-    Border = FALSE;
-    Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT  );
-
-    Control VS_FILLCOLOR
-    {
-        HelpID = HID_PROPERTYPANEL_FILL_COLOR_VS;
-        Hide = TRUE ;
-        Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
-        Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
-        TabStop = TRUE ;
-        Text [ en-US ] = "Color";
-    };
-
-    String VS_NOFILLCOLOR
-    {
-        Text [ en-US ] = "No Color" ;
-    };
-};
-
 // line color popup
 
 Control RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR
diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
index 893a748..26a9bb1 100644
--- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
+++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
@@ -32,14 +32,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkToolbar" id="cellbackgroundcolor">
+              <object class="sfxlo-SidebarToolBox" id="cellbackgroundcolor">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="has_tooltip">True</property>
                 <property name="tooltip_text" translatable="yes">Select the background color of the selected cells.</property>
                 <child>
                   <object class="GtkMenuToolButton" id="cellbackground">
-                    <property name="use_action_appearance">False</property>
                     <property name="width_request">105</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -48,7 +47,6 @@
                     <property name="halign">start</property>
                     <property name="use_action_appearance">False</property>
                     <property name="action_name">.uno:BackgroundColor</property>
-                    <property name="label" translatable="no">toolbutton1</property>
                     <property name="use_underline">True</property>
                   </object>
                   <packing>


More information about the Libreoffice-commits mailing list