summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-06-30 10:33:20 -0400
committerHenry Castro <hcastro@collabora.com>2016-07-12 10:07:54 -0400
commit4fb1a8705549dd471d1ec687f8828818c106f20e (patch)
tree6db387d646fdd35a92d2fe1cde4d8d54bf4d6b24
parentebb9ef48e4fa5007086c811edfda6bb93f151627 (diff)
lok: add status and tool bar UNO commands
Change-Id: I2dbed808a23609773baf9154820a7121c7919c70 Reviewed-on: https://gerrit.libreoffice.org/26809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx20
-rw-r--r--sfx2/source/control/unoctitm.cxx68
2 files changed, 82 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e88dce861f61..a052b6f17dc1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -796,7 +796,25 @@ static void doc_iniUnoCommands ()
OUString(".uno:EntireColumn"),
OUString(".uno:EntireCell"),
OUString(".uno:MergeCells"),
- OUString(".uno:AssignLayout")
+ OUString(".uno:AssignLayout"),
+ OUString(".uno:StatusDocPos"),
+ OUString(".uno:RowColSelCount"),
+ OUString(".uno:StatusPageStyle"),
+ OUString(".uno:InsertMode"),
+ OUString(".uno:StatusSelectionMode"),
+ OUString(".uno:StateTableCell"),
+ OUString(".uno:StatusBarFunc"),
+ OUString(".uno:StatePageNumber"),
+ OUString(".uno:StateWordCount"),
+ OUString(".uno:SelectionMode"),
+ OUString(".uno:PageStatus"),
+ OUString(".uno:LayoutStatus"),
+ OUString(".uno:Context"),
+ OUString(".uno:WrapText"),
+ OUString(".uno:ToggleMergeCells"),
+ OUString(".uno:NumberFormatCurrency"),
+ OUString(".uno:NumberFormatPercent"),
+ OUString(".uno:NumberFormatDate")
};
util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index e317ae401869..bca77ec6e74f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1064,7 +1064,7 @@ void SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
OUStringBuffer aBuffer;
aBuffer.append(aEvent.FeatureURL.Complete);
- aBuffer.append("=");
+ aBuffer.append(static_cast<sal_Unicode>('='));
if (aEvent.FeatureURL.Path == "Bold" ||
aEvent.FeatureURL.Path == "CenterPara" ||
@@ -1143,16 +1143,74 @@ void SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
{
aBuffer.append(OUString::boolean(aEvent.IsEnabled));
}
- else if (aEvent.FeatureURL.Path == "AssignLayout")
+ else if (aEvent.FeatureURL.Path == "AssignLayout" ||
+ aEvent.FeatureURL.Path == "StatusSelectionMode" ||
+ aEvent.FeatureURL.Path == "Signature" ||
+ aEvent.FeatureURL.Path == "SelectionMode")
{
- sal_Int32 nLayout = 0;
- aEvent.State >>= nLayout;
- aBuffer.append(nLayout);
+ sal_Int32 aInt32;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aInt32))
+ {
+ aBuffer.append(OUString::number(aInt32));
+ }
+ }
+ else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
+ aEvent.FeatureURL.Path == "RowColSelCount" ||
+ aEvent.FeatureURL.Path == "StatusPageStyle" ||
+ aEvent.FeatureURL.Path == "StateTableCell" ||
+ aEvent.FeatureURL.Path == "StatePageNumber" ||
+ aEvent.FeatureURL.Path == "StateWordCount" ||
+ aEvent.FeatureURL.Path == "PageStyleName" ||
+ aEvent.FeatureURL.Path == "PageStatus" ||
+ aEvent.FeatureURL.Path == "LayoutStatus" ||
+ aEvent.FeatureURL.Path == "Context")
+ {
+ OUString aString;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aString))
+ {
+ aBuffer.append(aString);
+ }
+ }
+ 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")
+ {
+ sal_Bool aBool;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aBool))
+ {
+ aBuffer.append(OUString::boolean(aBool));
+ }
+ }
+ else if (aEvent.FeatureURL.Path == "Position")
+ {
+ css::awt::Point aPoint;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aPoint))
+ {
+ aBuffer.append(OUString::number(aPoint.X) + OUString(" / ") + OUString::number(aPoint.Y));
+ }
+ }
+ else if (aEvent.FeatureURL.Path == "StatusBarFunc" ||
+ aEvent.FeatureURL.Path == "Size")
+ {
+ css::awt::Size aSize;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aSize))
+ {
+ aBuffer.append(OUString::number(aSize.Width) + OUString(" x ") + OUString::number(aSize.Height));
+ }
}
else
{
return;
}
+
OUString payload = aBuffer.makeStringAndClear();
objSh->libreOfficeKitCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
}