[GRASS-SVN] r46167 - grass/trunk/ps/ps.map
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 3 08:39:12 EDT 2011
Author: hamish
Date: 2011-05-03 05:39:12 -0700 (Tue, 03 May 2011)
New Revision: 46167
Modified:
grass/trunk/ps/ps.map/do_plt.c
grass/trunk/ps/ps.map/eps.c
grass/trunk/ps/ps.map/map_info.c
grass/trunk/ps/ps.map/r_plt.c
Log:
allow spaces in EPS file pathname (merge from devbr6)
Modified: grass/trunk/ps/ps.map/do_plt.c
===================================================================
--- grass/trunk/ps/ps.map/do_plt.c 2011-05-03 12:35:17 UTC (rev 46166)
+++ grass/trunk/ps/ps.map/do_plt.c 2011-05-03 12:39:12 UTC (rev 46167)
@@ -152,7 +152,7 @@
break;
case 'E': /* EPS file */
- if (sscanf(buf, "E %d %lf %lf %lf %lf %s",
+ if (sscanf(buf, "E %d %lf %lf %lf %lf %[^\n]s",
&masked, &e1, &n1, &scale, &rotate, name) == 6) {
if (masked && after_masking)
continue;
Modified: grass/trunk/ps/ps.map/eps.c
===================================================================
--- grass/trunk/ps/ps.map/eps.c 2011-05-03 12:35:17 UTC (rev 46166)
+++ grass/trunk/ps/ps.map/eps.c 2011-05-03 12:39:12 UTC (rev 46167)
@@ -1,5 +1,6 @@
#include <math.h>
#include <string.h>
+#include <grass/glocale.h>
#include "local_proto.h"
/* test if file is realy EPS file and find bbox
@@ -14,7 +15,7 @@
/* test if file is realy eps and find bbox */
if ((fp = fopen(eps, "r")) == NULL) {
- fprintf(stderr, "can't open eps file <%s>\n", eps);
+ G_warning(_("Can't open eps file <%s>"), eps);
return (0);
}
/* test if first row contains '%!PS-Adobe-m.n EPSF-m.n' string */
@@ -33,7 +34,7 @@
return (1);
}
}
- fprintf(stderr, "Bounding box in eps file <%s> was not found\n", eps);
+ G_warning(_("Bounding box in eps file <%s> was not found"), eps);
fclose(fp);
return (0);
}
Modified: grass/trunk/ps/ps.map/map_info.c
===================================================================
--- grass/trunk/ps/ps.map/map_info.c 2011-05-03 12:35:17 UTC (rev 46166)
+++ grass/trunk/ps/ps.map/map_info.c 2011-05-03 12:39:12 UTC (rev 46167)
@@ -25,6 +25,7 @@
/* get text location */
dy = fontsize;
+
if (m_info.x > 0.0)
x = 72.0 * m_info.x;
else
@@ -33,7 +34,9 @@
y = 72.0 * (PS.page_height - m_info.y);
else
y = PS.min_y;
+
margin = 0.2 * fontsize;
+
if (x < PS.map_left + margin)
x = PS.map_left + margin;
Modified: grass/trunk/ps/ps.map/r_plt.c
===================================================================
--- grass/trunk/ps/ps.map/r_plt.c 2011-05-03 12:35:17 UTC (rev 46166)
+++ grass/trunk/ps/ps.map/r_plt.c 2011-05-03 12:39:12 UTC (rev 46167)
@@ -1,6 +1,7 @@
#include <string.h>
#include <grass/colors.h>
#include <grass/raster.h>
+#include <grass/glocale.h>
#include "local_proto.h"
#define KEY(x)(strcmp(key,x)==0)
@@ -155,7 +156,7 @@
/* test if file is accessible */
if ((fp = fopen(eps, "r")) == NULL)
- error(key, data, "Can't open eps file");
+ error(key, data, _("Can't open eps file"));
have_eps = 1;
fclose(fp);
More information about the grass-commit
mailing list