diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-08 09:43:09 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-12 05:19:12 +0200 |
commit | cdd76e8877571556eba1a2d070e5fe23a2d4bd10 (patch) | |
tree | e7917503920ee92f9d38e57265d73d437b187ef0 /libreofficekit | |
parent | a864ab2ef17e02930df5ae91112b5104bdea1e39 (diff) |
LOK DocView: only rerender on zoom if we have a document open.
Otherwise we would segfault, and it's perfectly valid to set a zoom
level _before_ opening a document (as that would e.g. save the document
first being rendered on opening if the client wants to immediately
render at a non-standard zoom level).
Change-Id: Ide261b09f4aab8dc3b552f6c3bf55f78ffd7870c
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index f813e6894eac..12b004e08d35 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -161,7 +161,11 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, c SAL_DLLPUBLIC_EXPORT void lok_docview_set_zoom ( LOKDocView* pDocView, float fZoom ) { pDocView->fZoom = fZoom; - renderDocument( pDocView ); + + if ( pDocView->pDocument ) + { + renderDocument( pDocView ); + } // TODO: maybe remember and reset positiong? } |