changeset 377:9efefd85684a

Cleanup read/write of image.zoom_mode option.
author zas_
date Tue, 15 Apr 2008 21:06:00 +0000
parents 9c89fc358c16
children f1bdbbdb73ba
files src/rcfile.c
diffstat 1 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/rcfile.c	Tue Apr 15 20:56:55 2008 +0000
+++ b/src/rcfile.c	Tue Apr 15 21:06:00 2008 +0000
@@ -367,11 +367,19 @@
 
 
 	WRITE_SUBTITLE("Image Options");
-
+	
+	secure_fprintf(ssi, "# image.zoom_mode possible values are:\n"
+			    "#   original\n"
+			    "#   fit\n"
+			    "#   dont_change\n");
 	secure_fprintf(ssi, "image.zoom_mode: ");
-	if (options->image.zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n");
-	if (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n");
-	if (options->image.zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n");
+	if (options->image.zoom_mode == ZOOM_RESET_ORIGINAL)
+		secure_fprintf(ssi, "original\n");
+	else if (options->image.zoom_mode == ZOOM_RESET_FIT_WINDOW)
+		secure_fprintf(ssi, "fit\n");
+	else if (options->image.zoom_mode == ZOOM_RESET_NONE)
+		secure_fprintf(ssi, "dont_change\n");
+	WRITE_SEPARATOR();
 	WRITE_BOOL(image.zoom_2pass);
 	WRITE_BOOL(image.zoom_to_fit_allow_expand);
 	WRITE_INT(image.zoom_quality);
@@ -639,9 +647,12 @@
 		/* image options */
 		if (strcasecmp(option, "image.zoom_mode") == 0)
                         {
-                        if (strcasecmp(value, "original") == 0) options->image.zoom_mode = ZOOM_RESET_ORIGINAL;
-                        if (strcasecmp(value, "fit") == 0) options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW;
-                        if (strcasecmp(value, "dont_change") == 0) options->image.zoom_mode = ZOOM_RESET_NONE;
+                        if (strcasecmp(value, "original") == 0)
+				options->image.zoom_mode = ZOOM_RESET_ORIGINAL;
+                        else if (strcasecmp(value, "fit") == 0)
+				options->image.zoom_mode = ZOOM_RESET_FIT_WINDOW;
+                        else if (strcasecmp(value, "dont_change") == 0)
+				options->image.zoom_mode = ZOOM_RESET_NONE;
                         }
 		READ_BOOL(image.zoom_2pass);
 		READ_BOOL(image.zoom_to_fit_allow_expand);