[Libreoffice-commits] core.git: libreofficekit/source

Caolán McNamara caolanm at redhat.com
Wed Jun 25 06:47:30 PDT 2014


 libreofficekit/source/gtk/lokdocview.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit af60018734751c589d7b76b6a755ac7c2dee3a40
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 25 14:46:57 2014 +0100

    fix build
    
    Change-Id: I33f06887b4b2b7950c6e322ccf1c7ec65240f9b0

diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index bf86679..49aaf2e 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,


More information about the Libreoffice-commits mailing list