Blame SOURCES/0137-lokdocview-set-up-the-widget-in-all-windows.patch

135360
From d439c2271500a145d4c6e37e3a8d504cc2027b5f Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Tue, 15 Sep 2015 15:41:46 +0200
135360
Subject: [PATCH 137/398] lokdocview: set up the widget in all windows
135360
135360
With this finally the number of GTK+ windows always match the number
135360
returned by SfxLokHelper::getViews().
135360
135360
Change-Id: Ia45bef7dea86b80cfac00e2ad7c1a16d7f5b507b
135360
(cherry picked from commit b3498e9fcdc895853564d13173075bebc7407ef2)
135360
---
135360
 libreofficekit/source/gtk/lokdocview.cxx | 11 +++++++++--
135360
 1 file changed, 9 insertions(+), 2 deletions(-)
135360
135360
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
135360
index 0b0b5e9d9659..92095f2d9707 100644
135360
--- a/libreofficekit/source/gtk/lokdocview.cxx
135360
+++ b/libreofficekit/source/gtk/lokdocview.cxx
135360
@@ -1850,8 +1850,15 @@ lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error)
135360
 SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pLOKDocView)
135360
 {
135360
     LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private(pLOKDocView));
135360
-    return GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, /*error=*/0,
135360
-                                     "lopath", priv->m_aLOPath, "lopointer", priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
135360
+    GtkWidget* pDocView = GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, /*error=*/0,
135360
+                                                    "lopath", priv->m_aLOPath, "lopointer", priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
135360
+
135360
+    // No documentLoad(), just a createView().
135360
+    LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(pDocView));
135360
+    pDocument->pClass->createView(pDocument);
135360
+
135360
+    postDocumentLoad(pDocView);
135360
+    return pDocView;
135360
 }
135360
 
135360
 /**
135360
-- 
135360
2.12.0
135360