summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-06-30 10:33:20 -0400
committerHenry Castro <hcastro@collabora.com>2016-07-02 23:44:36 +0000
commit7e3e55c39e0f01321aee9875f55627f4eefcec27 (patch)
treed8da968246854b5c1b1d4c9548b70630e0bbec2e /sfx2
parent527b88efbd9175e4fe376aa3617533f75ef99393 (diff)
sc lok: add status 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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/unoctitm.cxx56
1 files changed, 51 insertions, 5 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 3ade4be41141..171155308fc8 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -942,7 +942,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
OUStringBuffer aBuffer;
aBuffer.append(aEvent.FeatureURL.Complete);
- aBuffer.append("=");
+ aBuffer.append(static_cast<sal_Unicode>('='));
if (aEvent.FeatureURL.Path == "Bold" ||
aEvent.FeatureURL.Path == "CenterPara" ||
@@ -1021,16 +1021,62 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
{
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")
{
- 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")
+ {
+ OUString aString;
+
+ if (aEvent.IsEnabled && (aEvent.State >>= aString))
+ {
+ aBuffer.append(aString);
+ }
+ }
+ else if (aEvent.FeatureURL.Path == "InsertMode")
+ {
+ 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();
if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());