summaryrefslogtreecommitdiff
path: root/libreofficekit/source
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-05-08 00:26:08 +0200
committerpranavk <pranavk@collabora.co.uk>2017-05-11 17:56:09 +0200
commit9cc9300bc20e9367728aa4b7ec3a789fdd274aff (patch)
treeddde949f86a4b68e7864e22f293ba2da412abf31 /libreofficekit/source
parentb973b184a0870ad70e2db4e0e3842cf208b87abf (diff)
lok: sc: notify cell cursor position to address control in client
A new callback has been introduced for notifying the client: LOK_CALLBACK_CELL_ADDRESS Change-Id: I40b38a3cb8fb658c3f00332d56cfcbaf98e13771 Reviewed-on: https://gerrit.libreoffice.org/37357 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'libreofficekit/source')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index fd367052ddca..a59d72bcc374 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -273,6 +273,7 @@ enum
CURSOR_CHANGED,
SEARCH_RESULT_COUNT,
COMMAND_RESULT,
+ ADDRESS_CHANGED,
FORMULA_CHANGED,
TEXT_SELECTION,
PASSWORD_REQUIRED,
@@ -416,6 +417,8 @@ callbackTypeToString (int nType)
return "LOK_CALLBACK_TEXT_VIEW_SELECTION";
case LOK_CALLBACK_CELL_VIEW_CURSOR:
return "LOK_CALLBACK_CELL_VIEW_CURSOR";
+ case LOK_CALLBACK_CELL_ADDRESS:
+ return "LOK_CALLBACK_CELL_ADDRESS";
case LOK_CALLBACK_CELL_FORMULA:
return "LOK_CALLBACK_CELL_FORMULA";
case LOK_CALLBACK_UNO_COMMAND_RESULT:
@@ -882,6 +885,11 @@ static void commandResult(LOKDocView* pDocView, const std::string& rString)
g_signal_emit(pDocView, doc_view_signals[COMMAND_RESULT], 0, rString.c_str());
}
+static void addressChanged(LOKDocView* pDocView, const std::string& rString)
+{
+ g_signal_emit(pDocView, doc_view_signals[ADDRESS_CHANGED], 0, rString.c_str());
+}
+
static void formulaChanged(LOKDocView* pDocView, const std::string& rString)
{
g_signal_emit(pDocView, doc_view_signals[FORMULA_CHANGED], 0, rString.c_str());
@@ -1301,6 +1309,11 @@ callback (gpointer pData)
commandResult(pDocView, pCallback->m_aPayload);
}
break;
+ case LOK_CALLBACK_CELL_ADDRESS:
+ {
+ addressChanged(pDocView, pCallback->m_aPayload);
+ }
+ break;
case LOK_CALLBACK_CELL_FORMULA:
{
formulaChanged(pDocView, pCallback->m_aPayload);
@@ -3072,6 +3085,21 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
G_TYPE_STRING);
/**
+ * LOKDocView::address-changed:
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @aCommand: formula text content
+ */
+ doc_view_signals[ADDRESS_CHANGED] =
+ g_signal_new("address-changed",
+ G_TYPE_FROM_CLASS(pGObjectClass),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ nullptr, nullptr,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+
+ /**
* LOKDocView::formula-changed:
* @pDocView: the #LOKDocView on which the signal is emitted
* @aCommand: formula text content