summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-15 15:41:46 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-21 07:30:19 +0200
commitb3498e9fcdc895853564d13173075bebc7407ef2 (patch)
treeca54caf864e125e0a34dafdf35439947ced91bbc /libreofficekit
parente6e5c248e52524ddaddc6d1a2627f10f169d0167 (diff)
lokdocview: set up the widget in all windows
With this finally the number of GTK+ windows always match the number returned by SfxLokHelper::getViews(). Change-Id: Ia45bef7dea86b80cfac00e2ad7c1a16d7f5b507b
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index ff9b2cd9a9a8..271625f766bf 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1850,8 +1850,15 @@ lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error)
SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pLOKDocView)
{
LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private(pLOKDocView));
- return GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, /*error=*/0,
- "lopath", priv->m_aLOPath, "lopointer", priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
+ GtkWidget* pDocView = GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, /*error=*/0,
+ "lopath", priv->m_aLOPath, "lopointer", priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
+
+ // No documentLoad(), just a createView().
+ LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(pDocView));
+ pDocument->pClass->createView(pDocument);
+
+ postDocumentLoad(pDocView);
+ return pDocView;
}
/**