From a0fdc73984d0eb89eacbcd858db938ad5cf1157d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 16 Jan 2014 20:36:25 +0000 Subject: [PATCH] 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 --- svx/source/sidebar/text/TextPropertyPanel.cxx | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 8f29d2fa53af..2ed39fc78f60 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -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;