Implemented ag_chart_save_to_file

This commit is contained in:
Gergely Polonkai 2013-09-18 11:22:23 +02:00
parent ec75d9b4cd
commit 25ffd534e5

View File

@ -641,5 +641,14 @@ create_save_doc(AgChart *chart)
void void
ag_chart_save_to_file(AgChart *chart, GFile *file, GError **err) ag_chart_save_to_file(AgChart *chart, GFile *file, GError **err)
{ {
xmlChar *content = NULL;
int length;
xmlDocPtr save_doc = create_save_doc(chart);
xmlDocDumpFormatMemoryEnc(save_doc, &content, &length, "UTF-8", 1);
g_file_replace_contents(file, (const gchar *)content, length, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, err);
xmlFreeDoc(save_doc);
} }