[dia] [cleanup] Remove unused pretty_format_xml option
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [cleanup] Remove unused pretty_format_xml option
- Date: Sat, 14 Dec 2013 21:32:27 +0000 (UTC)
commit 9d5178161c686e056471419a932b45ed878987dd
Author: Hans Breuer <hans breuer org>
Date: Sat Nov 16 23:31:38 2013 +0100
[cleanup] Remove unused pretty_format_xml option
app/preferences.c | 6 ------
lib/dia_xml.c | 23 ++++++++++-------------
lib/dia_xml.h | 3 ---
lib/dia_xml_libxml.h | 2 +-
lib/libdia.def | 2 --
lib/object_defaults.c | 7 -------
lib/plug-ins.c | 2 +-
plug-ins/shape/shape-export.c | 7 -------
8 files changed, 12 insertions(+), 40 deletions(-)
---
diff --git a/app/preferences.c b/app/preferences.c
index 90938ad..beae100 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -250,12 +250,6 @@ DiaPrefData prefs_data[] =
{ "fixed_icon_size", PREF_BOOLEAN,PREF_OFFSET(fixed_icon_size),
&default_true,0,"ensure fixed icon size",NULL, TRUE},
- /* There's really no reason to not pretty format it, and allowing non-pretty
- can lead to problems with long lines, CVS etc.
- { "pretty_formated_xml", PREF_BOOLEAN,PREF_OFFSET(pretty_formated_xml),
- &default_true,0,"pretty formated xml",NULL, TRUE},
- */
-
};
#define NUM_PREFS_DATA (sizeof(prefs_data)/sizeof(DiaPrefData))
diff --git a/lib/dia_xml.c b/lib/dia_xml.c
index 96a81ed..c90243a 100644
--- a/lib/dia_xml.c
+++ b/lib/dia_xml.c
@@ -85,10 +85,12 @@ static inline int isinf_ld (long double x) { return isnan (x - x); }
/*!
* \defgroup DiagramXmlOut Converting data to XML
* \ingroup DiagramXmlIo
+ * \brief Build XML DOM from simple types
*/
/*!
* \defgroup DiagramXmlIn Retrieving data from XML
* \ingroup DiagramXmlIo
+ * \brief Parse simple types from XML DOM
*/
/*!
@@ -1354,9 +1356,6 @@ data_add_composite(AttributeNode attr, const char *type)
#define BUFSIZE 2048
#define OVERRUN_SAFETY 16
-/* diarc option */
-int pretty_formated_xml = TRUE;
-
/*!
* \brief Save an XML document to a file.
* @param filename The file to save to.
@@ -1366,15 +1365,13 @@ int pretty_formated_xml = TRUE;
* \ingroup DiagramXmlIo
*/
int
-xmlDiaSaveFile(const char *filename,
- xmlDocPtr cur)
+xmlDiaSaveFile (const char *filename,
+ xmlDocPtr cur)
{
- int old = 0, ret;
-
- if (pretty_formated_xml)
- old = xmlKeepBlanksDefault (0);
- ret = xmlSaveFormatFileEnc (filename,cur, "UTF-8", pretty_formated_xml ? 1 : 0);
- if (pretty_formated_xml)
- xmlKeepBlanksDefault (old);
- return ret;
+ int old, ret;
+
+ old = xmlKeepBlanksDefault (0);
+ ret = xmlSaveFormatFileEnc (filename,cur, "UTF-8", 1);
+ xmlKeepBlanksDefault (old);
+ return ret;
}
diff --git a/lib/dia_xml.h b/lib/dia_xml.h
index d9a95e4..e5ae921 100644
--- a/lib/dia_xml.h
+++ b/lib/dia_xml.h
@@ -22,7 +22,6 @@
#include "geometry.h"
#include "color.h"
#include "font.h"
-#include "diavar.h"
#include "diacontext.h"
#include <libxml/tree.h>
@@ -42,8 +41,6 @@
*/
#define DIA_XML_NAME_SPACE_BASE "http://www.lysator.liu.se/~alla/dia/"
-DIAVAR int pretty_formated_xml;
-
typedef xmlNodePtr XML_NODE;
typedef XML_NODE ObjectNode;
diff --git a/lib/dia_xml_libxml.h b/lib/dia_xml_libxml.h
index a43e4a9..5e331b5 100644
--- a/lib/dia_xml_libxml.h
+++ b/lib/dia_xml_libxml.h
@@ -30,5 +30,5 @@ xmlDocPtr xmlDoParseFile(const char *filename);
/* use this instead of xmlSaveFile/xmlSaveFileEnc. Set the encoding to
UTF-8 at the very beginning ! */
int xmlDiaSaveFile(const char *filename,
- xmlDocPtr doc);
+ xmlDocPtr doc);
#endif
diff --git a/lib/libdia.def b/lib/libdia.def
index 19f6ed7..24331dd 100644
--- a/lib/libdia.def
+++ b/lib/libdia.def
@@ -4,8 +4,6 @@ EXPORTS
color_gdk_black
color_gdk_white
- pretty_formated_xml
-
; exported functions
apply_textattr_properties
apply_textstr_properties
diff --git a/lib/object_defaults.c b/lib/object_defaults.c
index 8db83df..cd0c7c1 100644
--- a/lib/object_defaults.c
+++ b/lib/object_defaults.c
@@ -393,13 +393,7 @@ dia_object_defaults_save (const gchar *filename)
xmlDocPtr doc;
gboolean ret;
gchar *real_filename;
- int old_blanks_default = pretty_formated_xml;
- /* FIXME HACK: we always want nice readable default files,
- * but toggling it by a global var is ugly --hb
- */
- pretty_formated_xml = TRUE;
-
if (!filename)
real_filename = dia_config_filename("defaults.dia");
else
@@ -425,7 +419,6 @@ dia_object_defaults_save (const gchar *filename)
ret = xmlDiaSaveFile (real_filename, doc);
g_free (real_filename);
xmlFreeDoc(doc);
- pretty_formated_xml = old_blanks_default;
g_hash_table_destroy (ni.layer_hash);
diff --git a/lib/plug-ins.c b/lib/plug-ins.c
index 7095414..ce31b18 100644
--- a/lib/plug-ins.c
+++ b/lib/plug-ins.c
@@ -614,7 +614,7 @@ dia_pluginrc_write(void)
filename = dia_config_filename("pluginrc");
- xmlDiaSaveFile(filename,pluginrc);
+ xmlDiaSaveFile(filename, pluginrc);
g_free(filename);
free_pluginrc();
diff --git a/plug-ins/shape/shape-export.c b/plug-ins/shape/shape-export.c
index afd45a7..e42c0e8 100644
--- a/plug-ins/shape/shape-export.c
+++ b/plug-ins/shape/shape-export.c
@@ -286,12 +286,6 @@ static void
end_render(DiaRenderer *self)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
- int old_blanks_default = pretty_formated_xml;
-
- /* FIXME HACK: we always want nice readable shape files,
- * but toggling it by a global var is ugly --hb
- */
- pretty_formated_xml = TRUE;
g_free(renderer->linestyle);
renderer->linestyle = NULL;
@@ -301,7 +295,6 @@ end_render(DiaRenderer *self)
g_free(renderer->filename);
renderer->filename = NULL;
xmlFreeDoc(renderer->doc);
- pretty_formated_xml = old_blanks_default;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]