From d5263c2c564c88e3dafe4c1ab8d3d9c1c48ede73 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 29 Sep 2016 12:49:23 +0200 Subject: LOK: conditionally include part number in invalidation payload Since desktop/ code queues, compresses and only emits callbacks on idle, it's possible that two invalidations are in the queue, and there was a setPart() call between them. In this case it's impossible to tell what part the invalidation was sent for. Fix this by conditionally including the part number in the invalidation payload. It's off by default, a new feature flag is added to request this behavior. gtktiledviewer enables this feature flag by default, though just to show the part number in the debug output. Android doesn't enable it. Change-Id: I73e6def848c0eb61d64e71026002c7a0e750aab4 --- libreofficekit/source/gtk/lokdocview.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libreofficekit') diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 1601d1b76e1e..0362d256db6b 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1039,7 +1039,8 @@ payloadToRectangle (LOKDocView* pDocView, const char* pPayload) { LOKDocViewPrivate& priv = getPrivate(pDocView); GdkRectangle aRet; - gchar** ppCoordinates = g_strsplit(pPayload, ", ", 4); + // x, y, width, height, part number. + gchar** ppCoordinates = g_strsplit(pPayload, ", ", 5); gchar** ppCoordinate = ppCoordinates; aRet.width = aRet.height = aRet.x = aRet.y = 0; @@ -2622,6 +2623,8 @@ static gboolean lok_doc_view_initable_init (GInitable *initable, GCancellable* / priv->m_aLOPath); return FALSE; } + priv->m_nLOKFeatures |= LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK; + priv->m_pOffice->pClass->setOptionalFeatures(priv->m_pOffice, priv->m_nLOKFeatures); return TRUE; } -- cgit