diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-25 14:46:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-25 14:46:57 +0100 |
commit | af60018734751c589d7b76b6a755ac7c2dee3a40 (patch) | |
tree | 053ed36f0c3b4990605d8a7ebda0b351d09b3140 /libreofficekit | |
parent | 0a5e6614bd4a11f5e19f5089bf7ff3b3f3d0f28e (diff) |
fix build
Change-Id: I33f06887b4b2b7950c6e322ccf1c7ec65240f9b0
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index bf86679a7abb..49aaf2e941b3 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -93,6 +93,11 @@ SAL_DLLPUBLIC_EXPORT GtkWidget* lok_docview_new( LibreOfficeKit* pOffice ) void renderDocument( LOKDocView* pDocView ) { + long nWidth, nHeight; + int nRenderWidth, nRenderHeight; + unsigned char* pBuffer; + int nRowStride; + g_assert( pDocView->pDocument ); if ( pDocView->pPixBuf ) @@ -100,23 +105,21 @@ void renderDocument( LOKDocView* pDocView ) g_object_unref( G_OBJECT( pDocView->pPixBuf ) ); } - long nWidth, nHeight; pDocView->pDocument->pClass->getDocumentSize( pDocView->pDocument, &nWidth, &nHeight ); // Draw the whole document at once (for now) // TODO: we really should scale by screen DPI here -- 10 seems to be a vaguely // correct factor for my screen at least. - int nRenderWidth = nWidth * pDocView->fZoom / 10; - int nRenderHeight = nHeight * pDocView->fZoom / 10; + nRenderWidth = nWidth * pDocView->fZoom / 10; + nRenderHeight = nHeight * pDocView->fZoom / 10; pDocView->pPixBuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, nRenderWidth, nRenderHeight); - unsigned char* pBuffer = gdk_pixbuf_get_pixels( pDocView->pPixBuf ); - int nRowStride; + pBuffer = gdk_pixbuf_get_pixels( pDocView->pPixBuf ); pDocView->pDocument->pClass->paintTile( pDocView->pDocument, pBuffer, nRenderWidth, nRenderHeight, |