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

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