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

Miklos Vajna vmiklos at collabora.co.uk
Fri Jul 22 09:35:14 UTC 2016


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 672b7411637f92acd30622ec2aaee840cbbbd0a9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 22 10:38:18 2016 +0200

    gtktiledviewer: align to top/left for Calc
    
    Otherwise when zooming out enough that not all available space is used,
    the default horizontal/vertical centering happens, and the row/column
    headers and the tiles become out of sync.
    
    Also revert to the previous default window size, I'm not sure why that
    was necessary. Currently checking the mentioned situation (empty Writer
    document with comments only) does not require this larger size, and
    testing two views is easier with the smaller size.
    
    Change-Id: Ia92a591387f62655a671e2d09f5053827fde5045
    Reviewed-on: https://gerrit.libreoffice.org/27427
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index f80b506..58139a5 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -1189,6 +1189,16 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
         return;
     }
 
+    LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pDocView);
+    if (pDocument && pDocument->pClass->getDocumentType(pDocument) == LOK_DOCTYPE_SPREADSHEET)
+    {
+        // Align to top left corner, so the tiles are in sync with the
+        // row/column bar, even when zooming out enough that not all space is
+        // used.
+        gtk_widget_set_halign(GTK_WIDGET(pDocView), GTK_ALIGN_START);
+        gtk_widget_set_valign(GTK_WIDGET(pDocView), GTK_ALIGN_START);
+    }
+
     populatePartSelector(pDocView);
     populatePartModeSelector( GTK_COMBO_BOX_TEXT(rWindow.m_pPartModeComboBox) );
     registerSelectorHandlers(rWindow);
@@ -1205,7 +1215,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
 {
     GtkWidget *pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_title(GTK_WINDOW(pWindow), "LibreOfficeKit GTK Tiled Viewer");
-    gtk_window_set_default_size(GTK_WINDOW(pWindow), 1280, 720);
+    gtk_window_set_default_size(GTK_WINDOW(pWindow), 1024, 768);
     g_signal_connect(pWindow, "destroy", G_CALLBACK(gtk_widget_destroy), pWindow);
 
     rWindow.m_pVBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);


More information about the Libreoffice-commits mailing list