[goffice] GogView: fix UMR.



commit 295115213569c6749d9e6ea3d187f5d74f652ce5
Author: Morten Welinder <terra gnome org>
Date:   Wed Apr 16 09:55:44 2014 -0400

    GogView: fix UMR.

 ChangeLog                |    6 ++++++
 NEWS                     |    1 +
 goffice/graph/gog-view.c |   15 +++++++++------
 3 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b552ece..8ea09e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-16  Morten Welinder  <terra gnome org>
+
+       * goffice/graph/gog-view.c (gog_view_size_request): Zero
+       requisition before calling virtual method.  All callers expect
+       this.
+
 2014-04-15  Morten Welinder  <terra gnome org>
 
        * goffice/utils/go-file.c (go_filename_simplify): Fix argument
diff --git a/NEWS b/NEWS
index 7cf3c14..b8c4748 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Jean:
 
 Morten:
        * Portability improvements.
+       * Fix UMR in graph view.
 
 --------------------------------------------------------------------------
 goffice 0.10.14:
diff --git a/goffice/graph/gog-view.c b/goffice/graph/gog-view.c
index a815a4b..bae878b 100644
--- a/goffice/graph/gog-view.c
+++ b/goffice/graph/gog-view.c
@@ -556,6 +556,7 @@ gog_view_size_allocate_real (GogView *view, GogViewAllocation const *allocation)
                if (pos & GOG_POSITION_MANUAL) {
                        available.w = res.w;
                        available.h = res.h;
+
                        gog_view_size_request (child, &available, &req);
                        tmp = gog_object_get_manual_allocation (gog_view_get_model (child),
                                                                allocation, &req);
@@ -787,9 +788,10 @@ gog_view_padding_request (GogView *view, GogViewAllocation const *bbox, GogViewP
  * @available: available space.
  * @requisition: a #GogViewRequisition.
  *
- * When called @available holds the available space and @requisition is populated
- * with the desired size based on that input and other elements of the view or
- * its model's state (eg the position).
+ * Determines the desired size of a view.
+ *
+ * Note, that the virtual method deviates slightly from this function.  This
+ * function will zero @requisition before calling the virtual method.
  *
  * Remember that the size request is not necessarily the size a view will
  * actually be allocated.
@@ -806,9 +808,10 @@ gog_view_size_request (GogView *view,
        g_return_if_fail (requisition != NULL);
        g_return_if_fail (available != NULL);
 
-       if (klass->size_request)
-               (klass->size_request) (view, available, requisition);
-       else
+       if (klass->size_request) {
+               requisition->w = requisition->h = 0;
+               klass->size_request (view, available, requisition);
+       } else
                requisition->w = requisition->h = 1.;
 }
 


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