summaryrefslogtreecommitdiff
path: root/libreofficekit/source
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-11-13 09:48:14 +0200
committerMihai Varga <mihai.mv13@gmail.com>2015-11-13 10:00:13 +0200
commit5b1e22e9ba941305a7f138adcef75a464161a145 (patch)
tree28cd17b06803468cd32c3e0a6b35f2d4aae00760 /libreofficekit/source
parent96cd2abd748ed24e5aba50cc4c300cf06e512db3 (diff)
LOK: calc formula callback + formula bar implementation in gtk
We need the callback to be able implement the formula bar Change-Id: I1c78ab0b9ed9304c0465a9993a7101f8efb91052 Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h libreofficekit/source/gtk/lokdocview.cxx
Diffstat (limited to 'libreofficekit/source')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index f52ba6176b31..0a7e8b8dda56 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -184,6 +184,7 @@ enum
CURSOR_CHANGED,
SEARCH_RESULT_COUNT,
COMMAND_RESULT,
+ FORMULA_CHANGED,
LAST_SIGNAL
};
@@ -495,6 +496,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 formulaChanged(LOKDocView* pDocView, const std::string& rString)
+{
+ g_signal_emit(pDocView, doc_view_signals[FORMULA_CHANGED], 0, rString.c_str());
+}
+
static void
setPart(LOKDocView* pDocView, const std::string& rString)
{
@@ -809,6 +815,11 @@ callback (gpointer pData)
commandResult(pDocView, pCallback->m_aPayload);
}
break;
+ case LOK_CALLBACK_CELL_FORMULA:
+ {
+ formulaChanged(pDocView, pCallback->m_aPayload);
+ }
+ break;
default:
g_assert(false);
break;
@@ -2248,6 +2259,20 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
G_TYPE_NONE, 1,
G_TYPE_STRING);
+ /**
+ * LOKDocView::formula-changed:
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @aCommand: formula text content
+ */
+ doc_view_signals[FORMULA_CHANGED] =
+ g_signal_new("formula-changed",
+ G_TYPE_FROM_CLASS(pGObjectClass),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
}
SAL_DLLPUBLIC_EXPORT GtkWidget*