summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorWinfried Donkers <osc@dci-electronics.nl>2012-03-11 09:05:02 +0100
committerStefan Knorr (astron) <heinzlesspam@gmail.com>2012-03-21 11:44:36 +0100
commitae7c80640df922630060b82ffa91fd7db2e4d6d7 (patch)
treec8b35e0f80866df461b0f919480b381ffc48b03f /svx
parent4c40593e3e936e6a966410ab807df4b775fc2464 (diff)
fdo#45671 set initial color for split buttons
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx12
-rw-r--r--svx/source/tbxctrls/tbxcolorupdate.cxx16
2 files changed, 26 insertions, 2 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0ecf87d08e63..cb56facafa6a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2231,6 +2231,14 @@ void SvxColorToolBoxControl::StateChanged(
//========================================================================
// class SvxColorExtToolBoxControl ----------------------------------------
//========================================================================
+/* Note:
+ The initial color shown on the button is set in /core/svx/source/tbxctrls/tbxcolorupdate.cxx
+ (ToolboxButtonColorUpdater::ToolboxButtonColorUpdater()) .
+ The initial color used by the button is set in /core/svx/source/tbxcntrls/tbcontrl.cxx
+ (SvxColorExtToolBoxControl::SvxColorExtToolBoxControl())
+ and in case of writer for text(background)color also in /core/sw/source/ui/docvw/edtwin.cxx
+ (SwEditWin::aTextBackColor and SwEditWin::aTextBackColor)
+ */
SvxColorExtToolBoxControl::SvxColorExtToolBoxControl(
sal_uInt16 nSlotId,
@@ -2252,11 +2260,13 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl(
case SID_ATTR_CHAR_COLOR:
addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Color" )));
nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW;
+ mLastColor = COL_RED;
break;
case SID_ATTR_CHAR_COLOR2:
addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharColorExt" )));
nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW;
+ mLastColor = COL_RED;
break;
case SID_BACKGROUND_COLOR:
@@ -2264,11 +2274,13 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl(
default:
addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharBackgroundExt" )));
nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW;
+ mLastColor = COL_YELLOW;
break;
case SID_FRAME_LINECOLOR:
addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FrameLineColor" )));
nMode = 0;
+ mLastColor = COL_BLUE;
break;
}
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 1b567d44212b..c62ce1bcfafe 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -44,6 +44,14 @@ namespace svx
//====================================================================
//= ToolboxButtonColorUpdater
//====================================================================
+ /* Note:
+ The initial color shown on the button is set in /core/svx/source/tbxctrls/tbxcolorupdate.cxx
+ (ToolboxButtonColorUpdater::ToolboxButtonColorUpdater()) .
+ The initial color used by the button is set in /core/svx/source/tbxcntrls/tbcontrl.cxx
+ (SvxColorExtToolBoxControl::SvxColorExtToolBoxControl())
+ and in case of writer for text(background)color also in /core/sw/source/ui/docvw/edtwin.cxx
+ (SwEditWin::aTextBackColor and SwEditWin::aTextBackColor)
+ */
ToolboxButtonColorUpdater::ToolboxButtonColorUpdater(
sal_uInt16 nId,
@@ -64,13 +72,17 @@ namespace svx
{
case SID_ATTR_CHAR_COLOR :
case SID_ATTR_CHAR_COLOR2 :
- Update( COL_BLACK );
+ Update( COL_RED );
+ break;
+ case SID_FRAME_LINECOLOR :
+ Update( COL_BLUE );
break;
case SID_ATTR_CHAR_COLOR_BACKGROUND :
+ case SID_BACKGROUND_COLOR :
Update( COL_YELLOW );
break;
default :
- Update( COL_GRAY );
+ Update( COL_TRANSPARENT );
}
}