SF.net SVN: geany-plugins:[1270] trunk/geanylatex/src/geanylatex.c
frlan at users.sourceforge.net
frlan at xxxxx
Wed Apr 21 17:26:38 UTC 2010
Revision: 1270
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1270&view=rev
Author: frlan
Date: 2010-04-21 17:26:38 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
GeanyLaTeX: Fix an issue with broken template replacement in case of none particular encoding has been chosen on wizard
Modified Paths:
--------------
trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c 2010-04-21 17:26:15 UTC (rev 1269)
+++ trunk/geanylatex/src/geanylatex.c 2010-04-21 17:26:38 UTC (rev 1270)
@@ -1113,8 +1113,12 @@
GTK_COMBO_BOX(glatex_wizard.template_combobox));
encoding_int = gtk_combo_box_get_active(
GTK_COMBO_BOX(glatex_wizard.encoding_combobox));
- enc_latex_char = g_strconcat("\\usepackage[",
- latex_encodings[encoding_int].latex,"]{inputenc}\n", NULL);
+ /* We don't want to set an encoding, if there is none choosen */
+ if (encoding_int != LATEX_ENCODINGS_MAX)
+ {
+ enc_latex_char = g_strconcat("\\usepackage[",
+ latex_encodings[encoding_int].latex,"]{inputenc}\n", NULL);
+ }
fontsize = gtk_combo_box_get_active_text(
GTK_COMBO_BOX(glatex_wizard.fontsize_combobox));
author = g_strdup(gtk_entry_get_text(GTK_ENTRY(glatex_wizard.author_textbox)));
@@ -1327,7 +1331,12 @@
utils_string_replace_all(code, "{ENCODING}", enc_latex_char);
g_free(enc_latex_char);
}
-
+ else
+ /* If there is no encoding proberly set but {ENCODING} is set inside
+ * the template, replace it with nothing */
+ {
+ utils_string_replace_all(code, "{ENCODING}", "");
+ }
switch (paperorientation_int){
case 2:
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list