summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-31 11:38:41 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-01 10:09:20 +0200
commitbc4a592baa01279bf9718a80fef8eb1410f16831 (patch)
treef345e408a6c57dacf58c2eab914e8c314a91a3db
parent312d3add7970144d2312f0c5968a2b73f6064da2 (diff)
lokdocview: handle empty LOK_CALLBACK_DOCUMENT_SIZE_CHANGED payload
Calc omits the document size in the payload in several cases, and online.git handles that, so handle it in lokdocview as well for now, instead of fixing up all the sc code to always emit the doc size in the payload. Change-Id: Ib2cca1770d2a160e32540e3a3158eb00bf13207b (cherry picked from commit 127a34ef2cf9fe0ac13a273c12c6d45ef57eaf49)
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 2e5431c2bd5e..1f7d33007117 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1212,7 +1212,11 @@ callback (gpointer pData)
break;
case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
{
- payloadToSize(pCallback->m_aPayload.c_str(), priv->m_nDocumentWidthTwips, priv->m_nDocumentHeightTwips);
+ if (!pCallback->m_aPayload.empty())
+ payloadToSize(pCallback->m_aPayload.c_str(), priv->m_nDocumentWidthTwips, priv->m_nDocumentHeightTwips);
+ else
+ priv->m_pDocument->pClass->getDocumentSize(priv->m_pDocument, &priv->m_nDocumentWidthTwips, &priv->m_nDocumentHeightTwips);
+
gtk_widget_set_size_request(GTK_WIDGET(pDocView),
twipToPixel(priv->m_nDocumentWidthTwips, priv->m_fZoom),
twipToPixel(priv->m_nDocumentHeightTwips, priv->m_fZoom));