From 5153304bc7b508a900853c89af913be97ddfdebb Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Fri, 16 Dec 2016 19:35:02 +0530 Subject: lok: Fix state feedback for ToggleMergeCells Now it broadcasts "disabled" to disable the command and true/false to tell the status of the command which automatically means "enabled" Change-Id: I3314da77fb2b84d97f64b9832d65791b84fcd7df Reviewed-on: https://gerrit.libreoffice.org/32086 Reviewed-by: pranavk Tested-by: pranavk (cherry picked from commit c5ceb0134dddb79207d3b8ddb7a36ee1ca294329) --- sfx2/source/control/unoctitm.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 678d5fad4423..5b00be5c3b84 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1050,7 +1050,6 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "EntireRow" || aEvent.FeatureURL.Path == "EntireColumn" || aEvent.FeatureURL.Path == "EntireCell" || - aEvent.FeatureURL.Path == "MergeCells" || aEvent.FeatureURL.Path == "SortAscending" || aEvent.FeatureURL.Path == "SortDescending") { @@ -1095,7 +1094,6 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c } else if (aEvent.FeatureURL.Path == "InsertMode" || aEvent.FeatureURL.Path == "WrapText" || - aEvent.FeatureURL.Path == "ToggleMergeCells" || aEvent.FeatureURL.Path == "NumberFormatCurrency" || aEvent.FeatureURL.Path == "NumberFormatPercent" || aEvent.FeatureURL.Path == "NumberFormatDate") @@ -1107,6 +1105,19 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aBuffer.append(OUString::boolean(aBool)); } } + else if (aEvent.FeatureURL.Path == "ToggleMergeCells") + { + if (aEvent.IsEnabled) + { + sal_Bool aBool; + aEvent.State >>= aBool; + aBuffer.append(OUString::boolean(aBool)); + } + else + { + aBuffer.append(OUString("disabled")); + } + } else if (aEvent.FeatureURL.Path == "Position") { css::awt::Point aPoint; -- cgit