From af60018734751c589d7b76b6a755ac7c2dee3a40 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 25 Jun 2014 14:46:57 +0100 Subject: fix build Change-Id: I33f06887b4b2b7950c6e322ccf1c7ec65240f9b0 --- libreofficekit/source/gtk/lokdocview.c | 13 ++++++++----- 1 file 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, -- cgit v1.2.3