Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Attached patch is the next one from meta bug 45671.

Winfried
From 4c326a629ddc9e04fb7aa5cedf99a61eaa70074f Mon Sep 17 00:00:00 2001
From: Winfried Donkers <osc@dci-electronics.nl>
Date: Mon, 5 Mar 2012 17:24:40 +0100
Subject: [PATCH] fdo#45688 split button for calc cell font color

---
 sc/source/ui/app/scdll.cxx             |    2 +-
 sc/source/ui/view/formatsh.cxx         |    2 +-
 svx/inc/svx/tbcontrl.hxx               |    3 +++
 svx/source/tbxctrls/tbcontrl.cxx       |   15 +++++++++++++--
 svx/source/tbxctrls/tbxcolorupdate.cxx |    1 +
 5 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index cb98122..ece5a1f 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -203,7 +203,7 @@ void ScDLL::Init()
     SvxStyleToolBoxControl          ::RegisterControl(SID_STYLE_APPLY,          pMod);
     SvxFontNameToolBoxControl       ::RegisterControl(SID_ATTR_CHAR_FONT,       pMod);
 //  SvxFontHeightToolBoxControl     ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
-    SvxFontColorToolBoxControl      ::RegisterControl(SID_ATTR_CHAR_COLOR,      pMod);
+    SvxColorExtToolBoxControl       ::RegisterControl(SID_ATTR_CHAR_COLOR,      pMod);
     SvxColorExtToolBoxControl       ::RegisterControl(SID_BACKGROUND_COLOR,     pMod);
     SvxFrameToolBoxControl          ::RegisterControl(SID_ATTR_BORDER,          pMod);
     SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE,      pMod);
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index bc72117..61522d6 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1425,11 +1425,11 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
     sal_uInt16 nSlot = rReq.GetSlot();
 
     pTabViewShell->HideListBox();                   // Autofilter-DropDown-Listbox
-
     if ( !pNewAttrs )
     {
         switch ( nSlot )
         {
+            case SID_ATTR_CHAR_COLOR:
             case SID_ATTR_CHAR_FONT:
             case SID_ATTR_CHAR_FONTHEIGHT:
                 pTabViewShell->ExecuteCellFormatDlg( rReq, TP_FONT );       // wenn ToolBar 
vertikal
diff --git a/svx/inc/svx/tbcontrl.hxx b/svx/inc/svx/tbcontrl.hxx
index 3f2bd39..8fb558e 100644
--- a/svx/inc/svx/tbcontrl.hxx
+++ b/svx/inc/svx/tbcontrl.hxx
@@ -74,6 +74,9 @@
         Execute-Id      SID_ATTR_CHAR_COLOR2
                     and SID_ATTR_CHAR_COLOR_EXT
 
+        for cell color (calc)
+        Execute-Id      SID_ATTR_CHAR_COLOR
+
         for character background color (writer)
         Execute-Id      SID_ATTR_CHAR_COLOR_BACKGROUND
                     and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index e366952..2a20d4a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2325,6 +2325,7 @@ void SvxColorExtToolBoxControl::StateChanged(
         bChoiceFromPalette = sal_False;
         switch( nSID )
         {
+            case SID_ATTR_CHAR_COLOR :
             case SID_ATTR_CHAR_COLOR2 :
             case SID_ATTR_CHAR_COLOR_BACKGROUND :
             case SID_BACKGROUND_COLOR :
@@ -2347,21 +2348,28 @@ void SvxColorExtToolBoxControl::Select( sal_Bool )
 {
     OUString aCommand;
     OUString aParamName;
+    sal_Bool bNoArgs = sal_False;
 
     switch( GetSlotId() )
     {
         case SID_ATTR_CHAR_COLOR2 :
-        case SID_ATTR_CHAR_COLOR  :
+            bNoArgs     = sal_True;
             aCommand    = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharColorExt" ));
             aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColorExt" ));
             break;
 
+        case SID_ATTR_CHAR_COLOR  :
+            aCommand    = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Color" ));
+            aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( "Color" ));
+            break;
+
         case SID_BACKGROUND_COLOR :
             aCommand    = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:BackgroundColor" ));
             aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ));
             break;
 
         case SID_ATTR_CHAR_COLOR_BACKGROUND :
+            bNoArgs     = sal_True;
             aCommand    = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharBackgroundExt" ));
             aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( "CharBackgroundExt" ));
             break;
@@ -2369,7 +2377,10 @@ void SvxColorExtToolBoxControl::Select( sal_Bool )
 
     Sequence< PropertyValue > aArgs( 1 );
     aArgs[0].Name  = aParamName;
-    aArgs[0].Value = makeAny( (sal_uInt32)( mLastColor.GetColor() ));
+    if ( bNoArgs )
+        aArgs[0].Value = makeAny( GetToolBox().IsItemChecked( GetId() ));
+    else
+        aArgs[0].Value = makeAny( (sal_uInt32)( mLastColor.GetColor() ));
     Dispatch( aCommand, aArgs );
 }
 
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 5c3453a..1b567d4 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -62,6 +62,7 @@ namespace svx
         mbWasHiContrastMode = ptrTbx ? ( 
ptrTbx->GetSettings().GetStyleSettings().GetHighContrastMode() ) : sal_False;
         switch( mnSlotId )
         {
+            case SID_ATTR_CHAR_COLOR  :
             case SID_ATTR_CHAR_COLOR2 :
                 Update( COL_BLACK );
                 break;
-- 
1.7.7


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.