[gnumeric] Fix background filling for rtl sheets. [#725276]



commit 089f746cd3a01d504f78938600b920f28c9c159f
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Feb 27 16:24:47 2014 +0100

    Fix background filling for rtl sheets. [#725276]

 ChangeLog       |    5 +++++
 NEWS            |    1 +
 src/item-grid.c |   17 ++++++++++++-----
 3 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0655026..62b1ec6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-27  Jean Brefort  <jean brefort normalesup org>
+
+       * src/item-grid.c (item_grid_draw_region): fix background filling for
+       rtl sheets. [#725276]
+
 2014-02-25  Morten Welinder  <terra gnome org>
 
        * src/gui-util.c (kill_popup_menu): Avoid criticals inside gtk+.
diff --git a/NEWS b/NEWS
index 1bc1b1a..5dfe0e1 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Andreas:
 
 Jean:
        * Fix persistence of hyperlinks tips. [see #724108]
+       * Fix background filling for rtl sheets. [#725276]
 
 Morten:
        * Fix BIFF7 import of long strings.  [#724399]
diff --git a/src/item-grid.c b/src/item-grid.c
index ebdf55a..d48ccb7 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -516,11 +516,18 @@ item_grid_draw_region (GocItem const *item, cairo_t *cr,
 
        /* Fill entire region with default background (even past far edge) */
        cairo_save (cr);
-       gtk_render_background (goc_item_get_style_context (item),
-                              cr,
-                              x0 - canvas->scroll_x1 * scale,
-                              y0 - canvas->scroll_y1 * scale,
-                              width, height);
+       if (canvas->direction == GOC_DIRECTION_LTR)
+               gtk_render_background (goc_item_get_style_context (item),
+                                      cr,
+                                      x0 - canvas->scroll_x1 * scale,
+                                      y0 - canvas->scroll_y1 * scale,
+                                      width, height);
+       else
+               gtk_render_background (goc_item_get_style_context (item),
+                                      cr,
+                                      canvas->width - x0 + canvas->scroll_x1 * scale - width,
+                                      y0 - canvas->scroll_y1 * scale,
+                                      width, height);
        cairo_restore (cr);
 
        /* Get ordered list of merged regions */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]