Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goffice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
42
Issues
42
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
goffice
Commits
7ea91bb1
Commit
7ea91bb1
authored
May 26, 2016
by
Jean Bréfort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix color scale reference to its axis. [#766829]
parent
40e5905a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
11 deletions
+42
-11
ChangeLog
ChangeLog
+6
-0
NEWS
NEWS
+3
-0
goffice/graph/gog-color-scale.c
goffice/graph/gog-color-scale.c
+33
-11
No files found.
ChangeLog
View file @
7ea91bb1
2016-05-26 Jean Brefort <jean.brefort@normalesup.org>
* goffice/graph/gog-color-scale.c (gog_color_scale_set_property),
(gog_color_scale_get_property): properly save and load the reference to
the axis. [#766829]
2016-05-06 Morten Welinder <terra@gnome.org>
* configure.ac: Post-release bump.
...
...
NEWS
View file @
7ea91bb1
goffice 0.10.30:
Jean:
* Fix color scale reference to its axis. [#766829]
--------------------------------------------------------------------------
goffice 0.10.29:
...
...
goffice/graph/gog-color-scale.c
View file @
7ea91bb1
...
...
@@ -241,20 +241,36 @@ gog_color_scale_set_property (GObject *obj, guint param_id,
GogChart
*
chart
=
GOG_CHART
(
gog_object_get_parent
(
GOG_OBJECT
(
obj
)));
GSList
*
ptr
;
char
const
*
buf
=
g_value_get_string
(
value
);
GogAxisType
type
;
int
id
;
GogAxis
*
axis
=
NULL
;
for
(
ptr
=
gog_chart_get_axes
(
chart
,
GOG_AXIS_COLOR
);
ptr
&&
ptr
->
data
;
ptr
=
ptr
->
next
)
{
if
(
!
strcmp
(
buf
,
gog_object_get_name
(
GOG_OBJECT
(
ptr
->
data
))))
{
if
(
!
strncmp
(
buf
,
"color"
,
5
))
{
type
=
GOG_AXIS_COLOR
;
buf
+=
5
;
}
else
if
(
!
strncmp
(
buf
,
"3d"
,
2
))
{
type
=
GOG_AXIS_PSEUDO_3D
;
buf
+=
2
;
}
else
{
unsigned
index
;
/* kludge: old file searching for 3D in all known locales */
type
=
(
strstr
(
buf
,
"3D"
)
!=
NULL
||
strstr
(
buf
,
"3d"
)
!=
NULL
||
strstr
(
buf
,
"3Д"
)
!=
NULL
||
strstr
(
buf
,
"3Δ"
)
!=
NULL
||
strstr
(
buf
,
"ترويسات متعلقة بالمحور"
)
!=
NULL
)
?
GOG_AXIS_PSEUDO_3D:
GOG_AXIS_COLOR
;
index
=
strlen
(
buf
)
-
1
;
while
(
index
>
0
&&
buf
[
index
]
<=
'9'
&&
buf
[
index
]
>=
'0'
)
index
--
;
buf
+=
index
+
1
;
}
id
=
atoi
(
buf
);
if
(
id
<
1
)
/* this should not happen */
id
=
1
;
for
(
ptr
=
gog_chart_get_axes
(
chart
,
type
);
ptr
&&
ptr
->
data
;
ptr
=
ptr
->
next
)
{
if
((
unsigned
)
id
==
gog_object_get_id
(
GOG_OBJECT
(
ptr
->
data
)))
{
axis
=
GOG_AXIS
(
ptr
->
data
);
break
;
}
}
if
(
axis
==
NULL
)
/* try with the pseudo-3d axes */
for
(
ptr
=
gog_chart_get_axes
(
chart
,
GOG_AXIS_PSEUDO_3D
);
ptr
&&
ptr
->
data
;
ptr
=
ptr
->
next
)
{
if
(
!
strcmp
(
buf
,
gog_object_get_name
(
GOG_OBJECT
(
ptr
->
data
))))
{
axis
=
GOG_AXIS
(
ptr
->
data
);
break
;
}
}
gog_color_scale_set_axis
(
scale
,
axis
);
break
;
}
...
...
@@ -282,9 +298,15 @@ gog_color_scale_get_property (GObject *obj, guint param_id,
case
COLOR_SCALE_PROP_WIDTH
:
g_value_set_double
(
value
,
scale
->
width
);
break
;
case
COLOR_SCALE_PROP_AXIS
:
g_value_set_string
(
value
,
gog_object_get_name
(
GOG_OBJECT
(
scale
->
color_axis
)));
case
COLOR_SCALE_PROP_AXIS
:
{
char
buf
[
16
];
if
(
gog_axis_get_atype
(
scale
->
color_axis
)
==
GOG_AXIS_COLOR
)
snprintf
(
buf
,
16
,
"color%u"
,
gog_object_get_id
(
GOG_OBJECT
(
scale
->
color_axis
)));
else
snprintf
(
buf
,
16
,
"3d%u"
,
gog_object_get_id
(
GOG_OBJECT
(
scale
->
color_axis
)));
g_value_set_string
(
value
,
buf
);
break
;
}
case
COLOR_SCALE_PROP_TICK_SIZE_PTS
:
g_value_set_int
(
value
,
scale
->
tick_size
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment