Revision: 1746 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1746&view=re... Author: frlan Date: 2010-11-13 21:38:37 +0000 (Sat, 13 Nov 2010)
Log Message: ----------- GeanyLaTeX: Clean up some code
Modified Paths: -------------- trunk/geanylatex/src/datatypes.h trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/latexenvironments.c trunk/geanylatex/src/latexenvironments.h trunk/geanylatex/src/latexutils.c trunk/geanylatex/src/latexutils.h trunk/geanylatex/src/letters.c trunk/geanylatex/src/letters.h
Modified: trunk/geanylatex/src/datatypes.h =================================================================== --- trunk/geanylatex/src/datatypes.h 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/datatypes.h 2010-11-13 21:38:37 UTC (rev 1746) @@ -25,8 +25,8 @@ typedef struct { gint cat; - gchar *label; - gchar *latex; + const gchar *label; + const gchar *latex; } SubMenuTemplate;
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/geanylatex.c 2010-11-13 21:38:37 UTC (rev 1746) @@ -772,7 +772,7 @@ };
-static inline gchar* +static inline const gchar* get_latex_command(gint tab_index) { return glatex_char_array[tab_index].latex; @@ -827,8 +827,8 @@ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gchar *label_str = NULL; - label_str = g_strconcat("\label{",g_strdup(gtk_entry_get_text( - GTK_ENTRY(textbox_label))), "}", NULL); + label_str = g_strconcat("\label{",gtk_entry_get_text( + GTK_ENTRY(textbox_label)), "}", NULL); glatex_insert_string(label_str, TRUE); }
Modified: trunk/geanylatex/src/latexenvironments.c =================================================================== --- trunk/geanylatex/src/latexenvironments.c 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/latexenvironments.c 2010-11-13 21:38:37 UTC (rev 1746) @@ -60,7 +60,7 @@
/* if type == -1 then we will try to autodetect the type */ -void glatex_insert_environment(gchar *environment, gint type) +void glatex_insert_environment(const gchar *environment, gint type) { GeanyDocument *doc = NULL;
Modified: trunk/geanylatex/src/latexenvironments.h =================================================================== --- trunk/geanylatex/src/latexenvironments.h 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/latexenvironments.h 2010-11-13 21:38:37 UTC (rev 1746) @@ -50,7 +50,7 @@
extern CategoryName glatex_environment_cat_names[];
-void glatex_insert_environment(gchar *environment, gint type); +void glatex_insert_environment(const gchar *environment, gint type);
void glatex_insert_environment_dialog(G_GNUC_UNUSED GtkMenuItem *menuitem,
Modified: trunk/geanylatex/src/latexutils.c =================================================================== --- trunk/geanylatex/src/latexutils.c 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/latexutils.c 2010-11-13 21:38:37 UTC (rev 1746) @@ -98,7 +98,7 @@
void -glatex_insert_string(gchar *string, gboolean reset_position) +glatex_insert_string(const gchar *string, gboolean reset_position) { GeanyDocument *doc = NULL;
@@ -148,11 +148,12 @@
if (entity != NULL) { - replacement = g_string_append(replacement, entity); + + g_string_append(replacement, entity); } else { - replacement = g_string_append(replacement, buf); + g_string_append(replacement, buf); } } new = g_string_free(replacement, FALSE);
Modified: trunk/geanylatex/src/latexutils.h =================================================================== --- trunk/geanylatex/src/latexutils.h 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/latexutils.h 2010-11-13 21:38:37 UTC (rev 1746) @@ -26,7 +26,7 @@ gchar **glatex_read_file_in_array(const gchar *filename); void glatex_usepackage(const gchar *pkg, const gchar *options); void glatex_enter_key_pressed_in_entry(G_GNUC_UNUSED GtkWidget *widget, gpointer dialog); -void glatex_insert_string(gchar *string, gboolean reset_position); +void glatex_insert_string(const gchar *string, gboolean reset_position); void glatex_replace_special_character(void);
#endif
Modified: trunk/geanylatex/src/letters.c =================================================================== --- trunk/geanylatex/src/letters.c 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/letters.c 2010-11-13 21:38:37 UTC (rev 1746) @@ -222,7 +222,7 @@
};
-gchar *glatex_get_entity(const gchar *letter) +const gchar *glatex_get_entity(const gchar *letter) { if (! utils_str_equal(letter, "\")) {
Modified: trunk/geanylatex/src/letters.h =================================================================== --- trunk/geanylatex/src/letters.h 2010-11-13 11:38:06 UTC (rev 1745) +++ trunk/geanylatex/src/letters.h 2010-11-13 21:38:37 UTC (rev 1746) @@ -33,6 +33,6 @@
extern CategoryName glatex_cat_names[];
-gchar *glatex_get_entity(const gchar *letter); +const gchar *glatex_get_entity(const gchar *letter);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org