Blame SOURCES/0020-lokdocview-move-GtkDrawingArea-size-request-out-of-r.patch

f325b2
From 71ce3c4cc6e973d252f6db0a22c01670d9fc571f Mon Sep 17 00:00:00 2001
f325b2
From: Pranav Kant <pranavk@gnome.org>
f325b2
Date: Fri, 5 Jun 2015 20:38:55 +0530
f325b2
Subject: [PATCH 020/398] lokdocview: move GtkDrawingArea size request out of
f325b2
 renderDocument()
f325b2
f325b2
... and place it at places only where the widget can change its size.
f325b2
f325b2
Change-Id: I4a4b28b35eba06a6faab434677d4d70d2a33339a
f325b2
(cherry picked from commit 1483643ba5930474b9eab73b723a775dd3c8c850)
f325b2
---
f325b2
 libreofficekit/source/gtk/lokdocview.cxx | 13 +++++++++++--
f325b2
 1 file changed, 11 insertions(+), 2 deletions(-)
f325b2
f325b2
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
index d9e8c14aa9d5..42dd14cb34ed 100644
f325b2
--- a/libreofficekit/source/gtk/lokdocview.cxx
f325b2
+++ b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
@@ -790,7 +790,6 @@ void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
f325b2
     guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
f325b2
     guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
f325b2
 
f325b2
-    gtk_widget_set_size_request(m_pDrawingArea, nDocumentWidthPixels, nDocumentHeightPixels);
f325b2
     cairo_t *pcairo = gdk_cairo_create(m_pDrawingArea->window);
f325b2
 
f325b2
     // Render the tiles.
f325b2
@@ -826,7 +825,7 @@ void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
f325b2
 
f325b2
             if (bPaint)
f325b2
             {
f325b2
-                g_info("tile_buffer_get_tile (%d, %d)", nRow, nColumn);
f325b2
+                //g_info("tile_buffer_get_tile (%d, %d)", nRow, nColumn);
f325b2
 
f325b2
                 Tile& currentTile = m_pTileBuffer->getTile(nRow, nColumn);
f325b2
                 GdkPixbuf* pPixBuf = currentTile.getBuffer();
f325b2
@@ -1028,6 +1027,10 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
f325b2
     case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
f325b2
     {
f325b2
         payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
f325b2
+        gtk_widget_set_size_request(m_pDrawingArea,
f325b2
+                                    twipToPixel(m_nDocumentWidthTwips, m_fZoom),
f325b2
+                                    twipToPixel(m_nDocumentHeightTwips, m_fZoom));
f325b2
+        m_pTileBuffer->resetAllTiles();
f325b2
     }
f325b2
     break;
f325b2
     case LOK_CALLBACK_SET_PART:
f325b2
@@ -1252,6 +1255,9 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, c
f325b2
                                                           nTileSizePixels,
f325b2
                                                           nRows,
f325b2
                                                           nColumns);
f325b2
+        gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
f325b2
+                                    nDocumentWidthPixels,
f325b2
+                                    nDocumentHeightPixels);
f325b2
         pDocView->m_pImpl->renderDocument(0);
f325b2
     }
f325b2
 
f325b2
@@ -1273,6 +1279,9 @@ SAL_DLLPUBLIC_EXPORT void lok_docview_set_zoom ( LOKDocView* pDocView, float fZo
f325b2
     guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
f325b2
 
f325b2
     pDocView->m_pImpl->m_pTileBuffer->setZoom(fZoom, nRows, nColumns);
f325b2
+    gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
f325b2
+                                nDocumentWidthPixels,
f325b2
+                                nDocumentHeightPixels);
f325b2
 
f325b2
     if ( pDocView->m_pImpl->m_pDocument )
f325b2
         pDocView->m_pImpl->renderDocument(0);
f325b2
-- 
f325b2
2.12.0
f325b2