--- gsf/gsf-outfile-zip.c.orig	2014-01-23 15:17:00.061480978 -0500
+++ gsf/gsf-outfile-zip.c	2014-01-23 15:50:28.891498312 -0500
@@ -54,6 +54,7 @@
 
 	z_stream  *stream;
 	GsfZipCompressionMethod compression_method;
+	gint compression_level;
 
 	gboolean   writing;
 
@@ -371,7 +372,7 @@
 		if (!zip->stream) {
 			zip->stream = g_new0 (z_stream, 1);
 		}
-		ret = deflateInit2 (zip->stream, Z_DEFAULT_COMPRESSION,
+		ret = deflateInit2 (zip->stream, zip->compression_level,
 				    Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL,
 				    Z_DEFAULT_STRATEGY);
 		if (ret != Z_OK)
@@ -645,6 +646,7 @@
 	zip->root_order = NULL;
 	zip->stream = NULL;
 	zip->compression_method = GSF_ZIP_DEFLATED;
+	zip->compression_level = Z_DEFAULT_COMPRESSION;
 	zip->writing = FALSE;
 	zip->buf = NULL;
 	zip->buf_size = 0;
@@ -666,11 +668,7 @@
 		g_value_set_string (value, zip->entry_name);
 		break;
 	case PROP_COMPRESSION_LEVEL:
-		g_value_set_int (value,
-				 zip->vdir->dirent
-				 ? zip->vdir->dirent->compr_method
-				 : 0);
-		break;
+		g_value_set_int (value, zip->compression_level);
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 		break;
@@ -694,12 +692,13 @@
 		break;
 	case PROP_COMPRESSION_LEVEL: {
 		int level = g_value_get_int (value);
-		switch (level) {
-		case GSF_ZIP_STORED:
-		case GSF_ZIP_DEFLATED:
-			zip->compression_method = level;
-			break;
-		default:
+		if (level == 0) {
+			zip->compression_level = level;
+			zip->compression_method = GSF_ZIP_STORED;
+		} else if ((level > 0 && level <= 9) || level == Z_DEFAULT_COMPRESSION) {
+			zip->compression_level = level;
+			zip->compression_method = GSF_ZIP_DEFLATED;
+		} else {
 			g_warning ("Unsupported compression level %d", level);
 		}
 		break;
@@ -754,8 +753,8 @@
 		 g_param_spec_int ("compression-level",
 				   _("Compression Level"),
 				   _("The level of compression used, zero meaning none"),
-				   0, 10,
-				   GSF_ZIP_DEFLATED,
+				   -1, 9,
+				   Z_DEFAULT_COMPRESSION,
 				   GSF_PARAM_STATIC |
 				   G_PARAM_READWRITE |
 				   G_PARAM_CONSTRUCT_ONLY));
