gboolean rotate_flag;
gchar *filename;
+ gint compression;
gboolean modified_flag;
gint untitled_instance;
label = g_object_new (gl_label_get_type(), NULL);
+ label->private->compression = 9;
+
label->private->modified_flag = FALSE;
gl_debug (DEBUG_LABEL, "END");
}
+/****************************************************************************/
+/* Set compression level. */
+/****************************************************************************/
+void
+gl_label_set_compression (glLabel *label,
+ gint compression)
+{
+ gl_debug (DEBUG_LABEL, "set %d", compression);
+
+ /* Older versions of libxml2 always return a -1 for documents "read in," so
+ * default to 9. Also, default to 9 for anything else out of range. */
+ if ((compression < 0) || (compression >9)) {
+ compression = 9;
+ }
+
+ gl_debug (DEBUG_LABEL, "actual set %d", compression);
+ label->private->compression = compression;
+}
+
+
+/****************************************************************************/
+/* Get compression level. */
+/****************************************************************************/
+gint
+gl_label_get_compression (glLabel *label)
+{
+ gl_debug (DEBUG_LABEL, "return %d", label->private->compression);
+ return label->private->compression;
+}
ns = xmlSearchNsByHref (doc, root, GL_XML_NAME_SPACE);
if (ns != NULL) {
label = xml_parse_label (root, status);
+ if (label)
+ gl_label_set_compression (label, xmlGetDocCompressMode (doc));
} else {
/* Try compatability mode 0.1 */
ns = xmlSearchNsByHref (doc, root, COMPAT01_NAME_SPACE);
if (!filename)
g_warning (_("Utf8 conversion error."));
else {
- xmlSetDocCompressMode (doc, 9);
+ xmlSetDocCompressMode (doc, gl_label_get_compression (label));
xml_ret = xmlSaveFormatFile (filename, doc, TRUE);
xmlFreeDoc (doc);
if (xml_ret == -1) {