Related: fdo#73414 use frame::XDispatch::dispatch directly

This hopefully is a model which we can build in further
to remove the rest of the direct SID... stuff and the fragile
mapping from the known .uno: commands to SIDS to dispatch, and
instead just dispatch the .uno: command directly

Change-Id: Iec0f92123fa4c2dae15e0ac716d5ef687e67da79
This commit is contained in:
Caolán McNamara
2014-01-16 20:36:25 +00:00
parent 36e590ee00
commit a0fdc73984

View File

@@ -81,9 +81,6 @@ namespace svx { namespace sidebar {
#undef HAS_IA2
#define FN_GROW_FONT_SIZE (FN_FORMAT + 3 )
#define FN_SHRINK_FONT_SIZE (FN_FORMAT + 4 )
PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
return new TextCharacterSpacingControl(pParent, *this, mpBindings);
@@ -553,44 +550,10 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
const sal_uInt16 nId = pToolBox->GetCurItemId();
const OUString aCommand(pToolBox->GetItemCommand(nId));
// font size +/- enhancement in sd
switch (maContext.GetCombinedContext_DI())
{
case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
case CombinedEnumContext(Application_DrawImpress, Context_Text):
case CombinedEnumContext(Application_DrawImpress, Context_Table):
case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
case CombinedEnumContext(Application_DrawImpress, Context_Draw):
case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
if(aCommand == UNO_GROW)
{
EndTracking();
SfxVoidItem aItem(SID_GROW_FONT_SIZE);
mpBindings->GetDispatcher()->Execute( SID_GROW_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L );
}
else if(aCommand == UNO_SHRINK)
{
EndTracking();
SfxVoidItem aItem(SID_SHRINK_FONT_SIZE);
mpBindings->GetDispatcher()->Execute( SID_SHRINK_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L );
}
break;
EndTracking();
dispatch(aCommand);
default:
if(aCommand == UNO_GROW)
{
EndTracking();
SfxVoidItem aItem(FN_GROW_FONT_SIZE);
mpBindings->GetDispatcher()->Execute( FN_GROW_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L );
}
else if(aCommand == UNO_SHRINK)
{
EndTracking();
SfxVoidItem aItem(FN_SHRINK_FONT_SIZE);
mpBindings->GetDispatcher()->Execute( FN_SHRINK_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L );
}
}
UpdateItem(SID_ATTR_CHAR_FONTHEIGHT);
return 0;