[gnumeric] Protect exported LaTeX files from babel shorthands.



commit 44361fca3c7b2112875c63209d10053f781000ec
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Thu Mar 4 22:55:40 2010 -0700

    Protect exported LaTeX files from babel shorthands.
    
    2010-03-04  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* latex.c (latex2e_write_file_header): protect the created
    	  LaTeX code from babel shorthands
    	(latex_file_save): try to reload the babel shorthands

 NEWS                   |    1 +
 plugins/html/ChangeLog |    6 ++++++
 plugins/html/latex.c   |    8 ++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 51ad85e..83b8f2d 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
 	* Apply filter on ODF import. [#610399]
 	* Fix display of autocomplete suggestions. [#610537]
 	* Fix formatting of multirow cells in LaTeX export. [#611633]
+	* Protect exported LaTeX files from babel shorthands.
 
 Jean:
 	* Fix a crasher in excelplugin: don't call a NULL function. [#610012]
diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index f20aad7..fd66606 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-04  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* latex.c (latex2e_write_file_header): protect the created
+	  LaTeX code from babel shorthands
+	(latex_file_save): try to reload the babel shorthands
+
 2010-03-03  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* latex.c (latex2e_write_multicolumn_cell): wrap multirows into
diff --git a/plugins/html/latex.c b/plugins/html/latex.c
index 2bc04d0..5881a29 100644
--- a/plugins/html/latex.c
+++ b/plugins/html/latex.c
@@ -567,6 +567,8 @@ latex2e_write_file_header(GsfOutput *output)
 "        \\newlength{\\gnumericMultiRowLength}\n"
 "        \\global\\def\\gnumericTableWidthDefined{}\n"
 " \\fi\n"
+"%% The following setting protects this code from babel shorthands.  %%\n"
+" \\ifthenelse{\\isundefined{\\languageshorthands}}{}{\\languageshorthands{english}}"
 "\n"
 "%%  The default table format retains the relative column widths of  %%\n"
 "%%  gnumeric. They can easily be changed to c, r or l. In that case %%\n"
@@ -1382,8 +1384,10 @@ latex_file_save (GOFileSaver const *fs, GOIOContext *io_context,
 
 	g_free (next_vert);
 
-	gsf_output_printf (output, "\\end{longtable}\n\n");
-	gsf_output_printf (output, "\\gnumericTableEnd\n");
+	gsf_output_puts (output, "\\end{longtable}\n\n"
+			 "\\ifthenelse{\\isundefined{\\languageshorthands}}"
+			 "{}{\\languageshorthands{\\languagename}}\n"
+			 "\\gnumericTableEnd\n");
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]