diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2014-09-18 15:17:40 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2014-09-18 15:27:19 +0300 |
commit | 05ed3a5da62b1c552f24d559f4a35c314f23a4f0 (patch) | |
tree | 377fe2c7f63fe1cb646ba854847e544a5fdbdda1 /svx | |
parent | 5aa24b83fca3a507f1c2dc03e3ec52f063029522 (diff) |
Adapt the code for the new automatic button
It's now used instead of the 0 item of the ValueSet,
but part of the code wasn't adapted:
* Set the correct text (Automatic/No Fill) depending on
the command.
* Hide the button for frame/line colors, since there is
no such thing as "Automatic" color.
* Remove the selection and the status update code of the
0 item.
Change-Id: Ib7d3d97a16368f2a59373efd6b81a220151881d5
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/colorwindow.hxx | 1 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 36 | ||||
-rw-r--r-- | svx/uiconfig/ui/colorwindow.ui | 1 |
3 files changed, 15 insertions, 23 deletions
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx index faffc6718214..2d25c7e06da4 100644 --- a/svx/source/tbxctrls/colorwindow.hxx +++ b/svx/source/tbxctrls/colorwindow.hxx @@ -41,6 +41,7 @@ private: ListBox* mpPaletteListBox; PushButton* mpButtonAutoColor; PushButton* mpButtonPicker; + FixedLine* mpAutomaticSeparator; OUString maCommand; Link maSelectedLink; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index f6f189c58708..0c3c227fa342 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1014,11 +1014,12 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, mnColorSetCols( 10 ) { - get(mpPaletteListBox, "palette_listbox"); - get(mpButtonAutoColor, "auto_color_button"); - get(mpButtonPicker, "color_picker_button"); - get(mpColorSet, "colorset"); - get(mpRecentColorSet, "recent_colorset"); + get(mpPaletteListBox, "palette_listbox"); + get(mpButtonAutoColor, "auto_color_button"); + get(mpButtonPicker, "color_picker_button"); + get(mpColorSet, "colorset"); + get(mpRecentColorSet, "recent_colorset"); + get(mpAutomaticSeparator, "separator4"); mpColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT) ); mpRecentColorSet->SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT) ); @@ -1031,7 +1032,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, if ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR == theSlotId ) { - mpColorSet->SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) ); + mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) ); mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) ); } else if ( SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId ) @@ -1045,16 +1046,20 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, SfxItemState eState = aQueryStatus.QueryState( pDummy ); if( (SfxItemState::DEFAULT > eState) || ( SID_EXTRUSION_3D_COLOR == theSlotId ) ) { - mpColorSet->SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) ); + mpButtonAutoColor->SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) ); mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) ); } } else if ( SID_FRAME_LINECOLOR == theSlotId ) { + mpButtonAutoColor->Hide(); + mpAutomaticSeparator->Hide(); mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) ); } else { + mpButtonAutoColor->Hide(); + mpAutomaticSeparator->Hide(); mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) ); } @@ -1099,15 +1104,7 @@ SfxPopupWindow* SvxColorWindow_Impl::Clone() const IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectHdl) { - sal_uInt16 nItemId = mpColorSet->GetSelectItemId(); - Color aColor; - if ( !nItemId && ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR == theSlotId ) ) - aColor = COL_TRANSPARENT; - else if ( !nItemId && (SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId) ) - aColor = COL_AUTO; - else - aColor = mpColorSet->GetItemColor( nItemId ); - + Color aColor = mpColorSet->GetItemColor( mpColorSet->GetSelectItemId() ); /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls. This instance may be deleted in the meantime (i.e. when a dialog is opened while in Dispatch()), accessing members will crash in this case. */ @@ -1126,10 +1123,7 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectHdl) IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectRecentHdl) { - sal_uInt16 nItemId = mpRecentColorSet->GetSelectItemId(); - Color aColor; - aColor = mpRecentColorSet->GetItemColor( nItemId ); - + Color aColor = mpRecentColorSet->GetItemColor( mpRecentColorSet->GetSelectItemId() ); /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls. This instance may be deleted in the meantime (i.e. when a dialog is opened while in Dispatch()), accessing members will crash in this case. */ @@ -1227,8 +1221,6 @@ void SvxColorWindow_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, co return; } } - if ( aColor == COL_AUTO || aColor == COL_TRANSPARENT ) - mpColorSet->SelectItem(0); } } } diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui index 8daa9b2f4da2..0cbeaadf18b6 100644 --- a/svx/uiconfig/ui/colorwindow.ui +++ b/svx/uiconfig/ui/colorwindow.ui @@ -20,7 +20,6 @@ <property name="orientation">vertical</property> <child> <object class="GtkButton" id="auto_color_button"> - <property name="label" translatable="yes">Automatic</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> |