summaryrefslogtreecommitdiff
path: root/src/xsane-front-gtk.c
diff options
context:
space:
mode:
authorJulien BLACHE <jblache@debian.org>2006-01-24 23:14:44 +0100
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:26 +0000
commit9d7d5dc7bfe282d0e3df4ea4111fa4a37f1629a2 (patch)
treedea383223c2d0e5bbe2012bbc36814fe68112b93 /src/xsane-front-gtk.c
parenta1871913efc67d71e7b355a8a03655cbf12ab07f (diff)
parent96b92dfa3cb0a3ae876a3e650984a404327cdf93 (diff)
Imported Debian patch 0.99+0.991-1debian/0.99+0.991-1
Diffstat (limited to 'src/xsane-front-gtk.c')
-rw-r--r--src/xsane-front-gtk.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 4eb4add..a11779e 100644
--- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c
@@ -93,7 +93,7 @@ int xsane_parse_options(char *options, char *argv[])
int optpos = 0;
int bufpos = 0;
int arg = 0;
- char buf[256];
+ char buf[TEXTBUFSIZE];
DBG(DBG_proc, "xsane_parse_options\n");
@@ -171,11 +171,11 @@ void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *m
{
if (min > -INF && min < INF)
{
- min = SANE_UNFIX (min);
+ min = SANE_UNFIX(min);
}
if (max > -INF && max < INF)
{
- max = SANE_UNFIX (max);
+ max = SANE_UNFIX(max);
}
}
*minp = min;
@@ -397,10 +397,6 @@ void xsane_set_all_resolutions(void)
printer_resolution = preferences.printer[preferences.printernr]->color_resolution;
break;
}
-
- xsane.zoom = xsane.resolution / printer_resolution;
- xsane.zoom_x = xsane.resolution_x / printer_resolution;
- xsane.zoom_y = xsane.resolution_y / printer_resolution;
}
/* ---------------------------------------------------------------------------------------------------------------------- */
@@ -433,15 +429,15 @@ void xsane_define_maximum_output_size()
if (preferences.paper_orientation >= 8) /* rotate: landscape */
{
preview_set_maximum_output_size(xsane.preview,
- preferences.printer[preferences.printernr]->height / xsane.zoom_y,
- preferences.printer[preferences.printernr]->width / xsane.zoom_x,
+ preferences.printer[preferences.printernr]->height / xsane.zoom,
+ preferences.printer[preferences.printernr]->width / xsane.zoom,
preferences.paper_orientation);
}
else /* do not rotate: portrait */
{
preview_set_maximum_output_size(xsane.preview,
- preferences.printer[preferences.printernr]->width / xsane.zoom_x,
- preferences.printer[preferences.printernr]->height / xsane.zoom_y,
+ preferences.printer[preferences.printernr]->width / xsane.zoom,
+ preferences.printer[preferences.printernr]->height / xsane.zoom,
preferences.paper_orientation);
}
break;
@@ -1062,7 +1058,7 @@ void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const
static void xsane_range_display_value_right_callback(GtkAdjustment *adjust, gpointer data)
{
- gchar buf[256];
+ gchar buf[TEXTBUFSIZE];
int digits = (int) data;
GtkLabel *label;
@@ -1264,8 +1260,8 @@ void xsane_range_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char *
static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data)
{
- char filename[1024];
- char windowname[256];
+ char filename[PATH_MAX];
+ char windowname[TEXTBUFSIZE];
DBG(DBG_proc, "xsane_browse_filename_callback\n");
@@ -1792,7 +1788,7 @@ int xsane_identify_output_format(char *filename, char *filetype, char **ext)
void xsane_change_working_directory(void)
{
char filename[PATH_MAX];
- char windowname[256];
+ char windowname[TEXTBUFSIZE];
DBG(DBG_proc, "xsane_change_working_directory\n");
@@ -1804,7 +1800,7 @@ void xsane_change_working_directory(void)
xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, TRUE, FALSE, TRUE, FALSE);
if (chdir(filename))
{
- char buf[256];
+ char buf[TEXTBUFSIZE];
snprintf(buf, sizeof(buf), "%s %s (%s).", ERR_CHANGE_WORKING_DIR, filename, strerror(errno));
xsane_back_gtk_error(buf, TRUE);
@@ -2362,7 +2358,7 @@ int xsane_front_gtk_getname_dialog(const char *dialog_title, const char *desc_te
GtkWidget *button;
GtkWidget *vbox, *hbox;
GtkAccelGroup *accelerator_group;
- char buf[256];
+ char buf[TEXTBUFSIZE];
DBG(DBG_proc, "xsane_getname_dialog, oldname = %s\n", oldname);