[GRASS-SVN] r35041 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 26 11:35:31 EST 2008
Author: martinl
Date: 2008-12-26 11:35:31 -0500 (Fri, 26 Dec 2008)
New Revision: 35041
Modified:
grass/trunk/display/d.vect/main.c
grass/trunk/display/d.vect/plot1.c
Log:
d.vect: fix bug for vector maps open at level 1
message standardization
(merge from devbr6, r35040)
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2008-12-26 16:33:06 UTC (rev 35040)
+++ grass/trunk/display/d.vect/main.c 2008-12-26 16:35:31 UTC (rev 35041)
@@ -418,13 +418,13 @@
has_fcolor = 0;
}
else if (ret == 0) { /* error */
- G_fatal_error(_("Unknown color: [%s]"), fcolor_opt->answer);
+ G_fatal_error(_("Unknown color: '%s'"), fcolor_opt->answer);
}
size = atoi(size_opt->answer);
Symb = S_read(icon_opt->answer);
if (Symb == NULL)
- G_warning(_("Cannot read symbol, cannot display points"));
+ G_warning(_("Unable to read symbol, unable todisplay points"));
else
S_stroke(Symb, size, 0.0, 0);
@@ -623,12 +623,12 @@
D_line_width(default_width);
}
else
- G_warning(_("Cannot display areas, topology not available"));
+ G_warning(_("Unable to display areas, topology not available"));
}
if (display & DISP_SHAPE) {
if (id_flag->answer && level < 2) {
- G_warning(_("Cannot display lines by id, topology not available"));
+ G_warning(_("Unable to display lines by id, topology not available"));
}
else {
stat = plot1(&Map, type, area, Clist,
@@ -670,7 +670,7 @@
if (level >= 2)
stat = topo(&Map, type, area, &lattr);
else
- G_warning(_("Cannot display topology, not available"));
+ G_warning(_("Unable to display topology, not available"));
}
}
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2008-12-26 16:33:06 UTC (rev 35040)
+++ grass/trunk/display/d.vect/plot1.c 2008-12-26 16:35:31 UTC (rev 35041)
@@ -189,8 +189,8 @@
line = 0;
while (1) {
+ line++;
if (Vect_level(Map) >= 2) {
- line++;
if (line > nlines)
break;
if (!Vect_line_alive(Map, line))
@@ -199,11 +199,10 @@
}
else {
ltype = Vect_read_next_line(Map, Points, Cats);
- switch (ltype) {
- case -1:
- G_warning(_("Unable to read vector map"));
- return -1;
- case -2: /* EOF */
+ if (ltype == -1) {
+ G_fatal_error(_("Unable to read vector map"));
+ }
+ else if (ltype == -2) { /* EOF */
break;
}
}
@@ -264,12 +263,11 @@
}
if (table_colors_flag) {
-
/* only first category */
- cat = Vect_get_line_cat(Map, line,
- (Clist->field > 0 ? Clist->field :
- (Cats->n_cats >
- 0 ? Cats->field[0] : 1)));
+ Vect_cat_get(Cats,
+ (Clist->field > 0 ? Clist->field :
+ (Cats->n_cats >
+ 0 ? Cats->field[0] : 1)), &cat);
if (cat >= 0) {
G_debug(3, "display element %d, cat %d", line, cat);
@@ -319,7 +317,7 @@
if (cats_color_flag) {
custom_rgb = FALSE;
if (Clist->field > 0) {
- cat = Vect_get_line_cat(Map, line, Clist->field);
+ Vect_cat_get(Cats, Clist->field, &cat);
if (cat >= 0) {
G_debug(3, "display element %d, cat %d", line, cat);
/* fetch color number from category */
@@ -350,13 +348,12 @@
if (nrec_width) {
-
/* only first category */
- cat = Vect_get_line_cat(Map, line,
- (Clist->field > 0 ? Clist->field :
- (Cats->n_cats >
- 0 ? Cats->field[0] : 1)));
-
+ Vect_cat_get(Cats,
+ (Clist->field > 0 ? Clist->field :
+ (Cats->n_cats >
+ 0 ? Cats->field[0] : 1)), &cat);
+
if (cat >= 0) {
G_debug(3, "display element %d, cat %d", line, cat);
More information about the grass-commit
mailing list