[goffice] Explicitly allow manual charts size. [728134]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Explicitly allow manual charts size. [728134]
- Date: Mon, 14 Apr 2014 07:44:37 +0000 (UTC)
commit e44b1050c1198fb2d18d4af5e7389ece238d3a4d
Author: Jean Brefort <jean brefort normalesup org>
Date: Mon Apr 14 09:44:21 2014 +0200
Explicitly allow manual charts size. [728134]
ChangeLog | 7 +++++++
NEWS | 3 +++
goffice/graph/gog-graph.c | 2 +-
goffice/graph/gog-object.c | 10 +++++++---
4 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b0f725c..a1ba5e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-04-14 Jean Brefort <jean brefort normalesup org>
+
+ * goffice/graph/gog-graph.c (gog_graph_class_init): explicitly allow manual
+ charts size. [728134]
+ * goffice/graph/gog-object.c (gog_object_get_manual_allocation): take
+ manual size flags into account.
+
2014-04-13 Morten Welinder <terra gnome org>
* goffice/graph/gog-object.c (cb_manual_size_changed): Use a
diff --git a/NEWS b/NEWS
index fb81f80..694ba2d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
goffice 0.10.15:
+Jean:
+ * Explicitly allow manual charts size. [728134]
+
--------------------------------------------------------------------------
goffice 0.10.14:
diff --git a/goffice/graph/gog-graph.c b/goffice/graph/gog-graph.c
index 2958472..9375a33 100644
--- a/goffice/graph/gog-graph.c
+++ b/goffice/graph/gog-graph.c
@@ -422,7 +422,7 @@ gog_graph_class_init (GogGraphClass *klass)
static GogObjectRole const roles[] = {
{ N_("Chart"), "GogChart", 1,
- GOG_POSITION_SPECIAL|GOG_POSITION_ANY_MANUAL,
+ GOG_POSITION_SPECIAL|GOG_POSITION_ANY_MANUAL|GOG_POSITION_ANY_MANUAL_SIZE,
GOG_POSITION_SPECIAL,
GOG_OBJECT_NAME_BY_ROLE,
NULL, NULL, NULL, role_chart_post_add, role_chart_pre_remove, NULL },
diff --git a/goffice/graph/gog-object.c b/goffice/graph/gog-object.c
index 38c4e05..c98a485 100644
--- a/goffice/graph/gog-object.c
+++ b/goffice/graph/gog-object.c
@@ -1932,16 +1932,20 @@ gog_object_get_manual_allocation (GogObject *gobj,
GogViewRequisition const *requisition)
{
GogViewAllocation pos;
- unsigned anchor;
+ unsigned anchor, size;
GogManualSizeMode size_mode = gog_object_get_manual_size_mode (gobj);
pos.x = parent_allocation->x + gobj->manual_position.x * parent_allocation->w;
pos.y = parent_allocation->y + gobj->manual_position.y * parent_allocation->h;
- pos.w = (size_mode & GOG_MANUAL_SIZE_WIDTH)?
+ size = gog_object_get_position_flags (gobj, GOG_POSITION_ANY_MANUAL_SIZE);
+
+ pos.w = ((size_mode & GOG_MANUAL_SIZE_WIDTH) &&
+ (size & (GOG_POSITION_MANUAL_W | GOG_POSITION_MANUAL_W_ABS)))?
gobj->manual_position.w * parent_allocation->w:
requisition->w;
- pos.h = (size_mode & GOG_MANUAL_SIZE_HEIGHT)?
+ pos.h = ((size_mode & GOG_MANUAL_SIZE_HEIGHT) &&
+ (size & (GOG_POSITION_MANUAL_H | GOG_POSITION_MANUAL_H_ABS)))?
gobj->manual_position.h * parent_allocation->h:
requisition->h;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]