summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index d23aa2ce7d2d..5f30908208fd 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2579,13 +2579,13 @@ lok_doc_view_set_partmode(LOKDocView* pDocView,
int nPartMode)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
+ if (!priv->m_pDocument)
+ return;
+
GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
LOEvent* pLOEvent = new LOEvent(LOK_SET_PARTMODE);
GError* error = nullptr;
- if (!priv->m_pDocument)
- return;
-
pLOEvent->m_nPartMode = nPartMode;
g_task_set_task_data(task, pLOEvent, LOEvent::destroy);