summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-10-28 16:41:17 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2014-10-28 22:44:21 +0200
commit2b54af3b6479d131ea7b6040eac1bb2ef0e416c1 (patch)
treeaee3c765847f986d397fb0973c0d2c95386b4163
parenta48145a854f13baaa9cde17790ada26df365fed5 (diff)
colorwindow: Unify SelectHdl and SelectRecentHdl
Change-Id: I680517bc7d91ef15593d235a7ff72588c7513b15
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx3
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx28
2 files changed, 7 insertions, 24 deletions
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index 0dc41ee09292..f0ccdc508304 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -49,8 +49,7 @@ private:
const sal_uInt16 mnColorSetCols;
- DECL_LINK( SelectHdl, void * );
- DECL_LINK( SelectRecentHdl, void * );
+ DECL_LINK( SelectHdl, SvxColorValueSet* );
DECL_LINK( SelectPaletteHdl, void *);
DECL_LINK( AutoColorClickHdl, void * );
DECL_LINK( OpenPickerClickHdl, void * );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9df403e17dd8..8900416a8fac 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1209,7 +1209,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
mpButtonPicker->SetClickHdl( LINK( this, SvxColorWindow_Impl, OpenPickerClickHdl ) );
mpColorSet->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectHdl ) );
- mpRecentColorSet->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectRecentHdl ) );
+ mpRecentColorSet->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectHdl ) );
SetHelpId( HID_POPUP_COLOR );
mpColorSet->SetHelpId( HID_POPUP_COLOR_CTRL );
SetText( rWndTitle );
@@ -1234,35 +1234,19 @@ SfxPopupWindow* SvxColorWindow_Impl::Clone() const
return new SvxColorWindow_Impl( maCommand, mrPaletteManager, theSlotId, GetFrame(), GetText(), GetParent() );
}
-IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectHdl)
+IMPL_LINK(SvxColorWindow_Impl, SelectHdl, SvxColorValueSet*, pColorSet)
{
- Color aColor = mpColorSet->GetItemColor( mpColorSet->GetSelectItemId() );
+ Color aColor = pColorSet->GetItemColor( pColorSet->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. */
- mpColorSet->SetNoSelection();
+ pColorSet->SetNoSelection();
if ( IsInPopupMode() )
EndPopupMode();
- if ( maSelectedLink.IsSet() )
- maSelectedLink.Call(&aColor);
-
- PaletteManager::DispatchColorCommand(maCommand, aColor);
- mrPaletteManager.AddRecentColor(aColor);
- return 0;
-}
-
-IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectRecentHdl)
-{
- 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. */
- mpRecentColorSet->SetNoSelection();
-
- if ( IsInPopupMode() )
- EndPopupMode();
+ if ( pColorSet != mpRecentColorSet )
+ mrPaletteManager.AddRecentColor( aColor );
if ( maSelectedLink.IsSet() )
maSelectedLink.Call(&aColor);