Merge lp:~geoff-lankow/inkscape/1374870-loadcolor into lp:~inkscape.dev/inkscape/trunk

Proposed by Geoff
Status: Merged
Approved by: su_v
Approved revision: 14232
Merged at revision: 14323
Proposed branch: lp:~geoff-lankow/inkscape/1374870-loadcolor
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 99 lines (+17/-4)
4 files modified
src/attributes.cpp (+1/-0)
src/attributes.h (+1/-0)
src/sp-guide.cpp (+7/-0)
src/sp-namedview.cpp (+8/-4)
To merge this branch: bzr merge lp:~geoff-lankow/inkscape/1374870-loadcolor
Reviewer Review Type Date Requested Status
su_v (community) Approve
Review via email: mp+266982@code.launchpad.net
To post a comment you must log in.
Revision history for this message
su_v (suv-lp) wrote :

Tested successfully with Inkscape 0.91+devel r14322 on OS X 10.7.5.

review: Approve (ui)
Revision history for this message
su_v (suv-lp) wrote :

Code review by Mc- via irc (#inkscape-devel):
11:19 Mc- : su_v: the diff looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/attributes.cpp'
2--- src/attributes.cpp 2015-05-06 13:44:14 +0000
3+++ src/attributes.cpp 2015-08-05 00:36:51 +0000
4@@ -125,6 +125,7 @@
5 /* SPGuide */
6 {SP_ATTR_ORIENTATION, "orientation"},
7 {SP_ATTR_POSITION, "position"},
8+ {SP_ATTR_INKSCAPE_COLOR, "inkscape:color"},
9 /* SPImage */
10 {SP_ATTR_X, "x"},
11 {SP_ATTR_Y, "y"},
12
13=== modified file 'src/attributes.h'
14--- src/attributes.h 2015-05-06 13:44:14 +0000
15+++ src/attributes.h 2015-08-05 00:36:51 +0000
16@@ -127,6 +127,7 @@
17 /* SPGuide */
18 SP_ATTR_ORIENTATION,
19 SP_ATTR_POSITION,
20+ SP_ATTR_INKSCAPE_COLOR,
21 /* SPImage */
22 SP_ATTR_X,
23 SP_ATTR_Y,
24
25=== modified file 'src/sp-guide.cpp'
26--- src/sp-guide.cpp 2015-02-25 00:22:08 +0000
27+++ src/sp-guide.cpp 2015-08-05 00:36:51 +0000
28@@ -26,6 +26,7 @@
29 #include "display/sp-canvas.h"
30 #include "display/guideline.h"
31 #include "svg/svg.h"
32+#include "svg/svg-color.h"
33 #include "svg/stringstream.h"
34 #include "attributes.h"
35 #include "sp-guide.h"
36@@ -70,6 +71,7 @@
37 {
38 SPObject::build(document, repr);
39
40+ this->readAttr( "inkscape:color" );
41 this->readAttr( "inkscape:label" );
42 this->readAttr( "orientation" );
43 this->readAttr( "position" );
44@@ -95,6 +97,11 @@
45
46 void SPGuide::set(unsigned int key, const gchar *value) {
47 switch (key) {
48+ case SP_ATTR_INKSCAPE_COLOR:
49+ if (value) {
50+ this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f);
51+ }
52+ break;
53 case SP_ATTR_INKSCAPE_LABEL:
54 if (this->label) g_free(this->label);
55
56
57=== modified file 'src/sp-namedview.cpp'
58--- src/sp-namedview.cpp 2015-04-27 18:14:55 +0000
59+++ src/sp-namedview.cpp 2015-08-05 00:36:51 +0000
60@@ -249,6 +249,7 @@
61 //g_object_set(G_OBJECT(g), "color", nv->guidecolor, "hicolor", nv->guidehicolor, NULL);
62 g->setColor(this->guidecolor);
63 g->setHiColor(this->guidehicolor);
64+ g->readAttr( "inkscape:color" );
65 }
66 }
67
68@@ -325,8 +326,9 @@
69 }
70
71 for (GSList *l = this->guides; l != NULL; l = l->next) {
72- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
73- SP_GUIDE(l->data)->setColor(this->guidecolor);
74+ SPGuide * g = SP_GUIDE(l->data);
75+ g->setColor(this->guidecolor);
76+ g->readAttr("inkscape:color");
77 }
78
79 this->requestModified(SP_OBJECT_MODIFIED_FLAG);
80@@ -336,8 +338,9 @@
81 sp_nv_read_opacity(value, &this->guidecolor);
82
83 for (GSList *l = this->guides; l != NULL; l = l->next) {
84- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
85- SP_GUIDE(l->data)->setColor(this->guidecolor);
86+ SPGuide * g = SP_GUIDE(l->data);
87+ g->setColor(this->guidecolor);
88+ g->readAttr("inkscape:color");
89 }
90
91 this->requestModified(SP_OBJECT_MODIFIED_FLAG);
92@@ -662,6 +665,7 @@
93 //g_object_set(G_OBJECT(g), "color", this->guidecolor, "hicolor", this->guidehicolor, NULL);
94 g->setColor(this->guidecolor);
95 g->setHiColor(this->guidehicolor);
96+ g->readAttr("inkscape:color");
97
98 if (this->editable) {
99 for (GSList *l = this->views; l != NULL; l = l->next) {