[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - include/LibreOfficeKit libreofficekit/source
Pranav Kant
pranavk at collabora.co.uk
Fri Jan 12 07:35:50 UTC 2018
include/LibreOfficeKit/LibreOfficeKitEnums.h | 6 +++---
libreofficekit/source/gtk/lokdocview.cxx | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+), 3 deletions(-)
New commits:
commit 70f874b18dcbfc9c0469f5e6ec03502e9fa3183d
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Dec 21 13:20:26 2017 +0530
lokdocview: Handle INVALIDATE_HEADER cb
With this calc gtktiledviewer or any other lok client shouldn't crash
anymore when a new view is opened.
And while at it, update documentation of callbacks.
Change-Id: I436c3b424dd4e2e6b8c312b0d3ba43d7006e944b
(cherry picked from commit 71cd37fad9792038279969c82e0cb209df06f024)
Reviewed-on: https://gerrit.libreoffice.org/46952
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 300b71bb01ff..6169a53afd3c 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -498,14 +498,14 @@ typedef enum
* The column/row header is no more valid because of a column/row insertion
* or a similar event. Clients must query a new column/row header set.
*
- * The payload says if we are invalidating a row or column header.
+ * The payload says if we are invalidating a row or column header. So,
+ * payload values can be: "row", "column", "all".
*/
LOK_CALLBACK_INVALIDATE_HEADER = 33,
/**
- * The text content of the address field in Calc.
+ * The text content of the address field in Calc. Eg: "A7"
*/
LOK_CALLBACK_CELL_ADDRESS = 34
-
}
LibreOfficeKitCallbackType;
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 08e40736e6f8..d753632a9868 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -276,6 +276,7 @@ enum
TEXT_SELECTION,
PASSWORD_REQUIRED,
COMMENT,
+ INVALIDATE_HEADER,
LAST_SIGNAL
};
@@ -429,6 +430,8 @@ callbackTypeToString (int nType)
return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED";
case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED:
return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED";
+ case LOK_CALLBACK_INVALIDATE_HEADER:
+ return "LOK_CALLBACK_INVALIDATE_HEADER";
case LOK_CALLBACK_COMMENT:
return "LOK_CALLBACK_COMMENT";
}
@@ -1420,6 +1423,9 @@ callback (gpointer pData)
case LOK_CALLBACK_COMMENT:
g_signal_emit(pCallback->m_pDocView, doc_view_signals[COMMENT], 0, pCallback->m_aPayload.c_str());
break;
+ case LOK_CALLBACK_INVALIDATE_HEADER:
+ g_signal_emit(pCallback->m_pDocView, doc_view_signals[INVALIDATE_HEADER], 0, pCallback->m_aPayload.c_str());
+ break;
default:
g_assert(false);
break;
@@ -3206,6 +3212,23 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
g_cclosure_marshal_generic,
G_TYPE_NONE, 1,
G_TYPE_STRING);
+
+ /**
+ * The column/row header is no more valid because of a column/row insertion
+ * or a similar event. Clients must query a new column/row header set.
+ *
+ * The payload says if we are invalidating a row or column header. So,
+ * payload values can be: "row", "column", "all".
+ */
+ doc_view_signals[INVALIDATE_HEADER] =
+ g_signal_new("invalidate-header",
+ G_TYPE_FROM_CLASS(pGObjectClass),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ nullptr, nullptr,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
}
SAL_DLLPUBLIC_EXPORT GtkWidget*
More information about the Libreoffice-commits
mailing list