]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
some reindentation, revert workarea xpos++, constify, remove all traces of LyXParagra...
[lyx.git] / src / insets / insetquotes.C
index 378649e3f884b28922f868d15953e87ef64c072d..8de040602ba3e89720a04f2c9a2a3d0ff9a61f27 100644 (file)
@@ -24,6 +24,7 @@
 #include "support/lstrings.h"
 #include "Painter.h"
 #include "font.h"
+#include "language.h"
 
 using std::ostream;
 using std::endl;
@@ -31,13 +32,15 @@ using std::endl;
 // Quotes. Used for the various quotes. German, English, French,
 // Danish, Polish, all either double or single.
 
+namespace {
+
 // codes used to read/write quotes to LyX files
-static char const * const language_char = "esgpfa";
-static char const * const side_char = "lr" ;
-static char const * const times_char = "sd";
+char const * const language_char = "esgpfa";
+char const * const side_char = "lr" ;
+char const * const times_char = "sd";
 
 // List of known quote chars
-static char const * const quote_char = ",'`<>";
+char const * const quote_char = ",'`<>";
 
 // Index of chars used for the quote. Index is [side, language]
 int quote_index[2][6] = {
@@ -45,21 +48,23 @@ int quote_index[2][6] = {
        { 1, 1, 2, 1, 4, 3 } };  // "`'`'><"
 
 // Corresponding LaTeX code, for double and single quotes.
-static char const * const latex_quote_t1[2][5] = 
+char const * const latex_quote_t1[2][5] = 
 { { "\\quotesinglbase{}",  "'", "`", 
     "\\guilsinglleft{}", "\\guilsinglright{}" }, 
   { ",,", "''", "``", "<<", ">>" } };
 
-static char const * const latex_quote_ot1[2][5] = 
+char const * const latex_quote_ot1[2][5] = 
 { { "\\quotesinglbase{}",  "'", "`", 
     "\\guilsinglleft{}", "\\guilsinglright{}" }, 
   { "\\quotedblbase{}", "''", "``",
     "\\guillemotleft{}", "\\guillemotright{}" } };
 
-static char const * const latex_quote_babel[2][5] = 
+char const * const latex_quote_babel[2][5] = 
 { { "\\glq{}",  "'", "`", "\\flq{}", "\\frq{}" },
   { "\\glqq{}", "''", "``", "\\flqq{}", "\\frqq{}" } };
 
+} // namespace anon
+
 
 InsetQuotes::InsetQuotes(string const & str)
 {
@@ -255,7 +260,8 @@ int InsetQuotes::Latex(Buffer const * buf, ostream & os,
                qstr = latex_quote_babel[times][quoteind];
 
        // Always guard against unfortunate ligatures (!` ?`)
-       qstr.insert(0, "{}");
+       if (prefixIs(qstr, "`"))
+               qstr.insert(0, "{}");
 
        os << qstr;
        return 0;