Revision: 2148 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2148&view=re... Author: frlan Date: 2011-08-15 06:55:23 +0000 (Mon, 15 Aug 2011)
Log Message: ----------- Tableconvert: Use a switch to differ between filetypes
Modified Paths: -------------- trunk/geany-plugins/tableconvert/src/tableconvert.c
Modified: trunk/geany-plugins/tableconvert/src/tableconvert.c =================================================================== --- trunk/geany-plugins/tableconvert/src/tableconvert.c 2011-08-15 06:55:03 UTC (rev 2147) +++ trunk/geany-plugins/tableconvert/src/tableconvert.c 2011-08-15 06:55:23 UTC (rev 2148) @@ -45,7 +45,6 @@
static GtkWidget *main_menu_item = NULL;
- static GString* convert_to_table_html(gchar **rows, gboolean header) { guint i; @@ -165,15 +164,29 @@ /* Checking whether we do have something we can work on - Returning if not */ if (rows != NULL) { - if (doc->file_type->id == GEANY_FILETYPES_HTML) + switch (doc->file_type->id) { - replacement_str = convert_to_table_html(rows, header); - } - - else if (doc->file_type->id == GEANY_FILETYPES_LATEX) - { - replacement_str = convert_to_table_latex(rows, header); - } + case GEANY_FILETYPES_NONE: + { + g_free(rows); + g_free(replacement); + return; + } + case GEANY_FILETYPES_HTML: + { + replacement_str = convert_to_table_html(rows, header); + break; + } + case GEANY_FILETYPES_LATEX: + { + replacement_str = convert_to_table_latex(rows, header); + break; + } + default: + { + replacement_str = NULL; + } + } /* filetype switch */ } else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org