]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
fix typo that put too many include paths for most people
[lyx.git] / src / insets / insetquotes.C
index d4e1541ad8721a8bf7ee7bd98c4189d8c000f664..4b7e678edf9268b8b2df05eaebc6b8f76d918f95 100644 (file)
@@ -1,8 +1,8 @@
 /* This file is part of
  * ======================================================
- * 
+ *
  *           LyX, The Document Processor
- *      
+ *
  *         Copyright 1995 Matthias Ettrich
  *          Copyright 1995-2001 The LyX Team.
  *
@@ -47,22 +47,22 @@ char const * const quote_char = ",'`<>";
 
 // Index of chars used for the quote. Index is [side, language]
 int quote_index[2][6] = {
-       { 2, 1, 0, 0, 3, 4 },    // "'',,<>" 
+       { 2, 1, 0, 0, 3, 4 },    // "'',,<>"
        { 1, 1, 2, 1, 4, 3 } };  // "`'`'><"
 
 // Corresponding LaTeX code, for double and single quotes.
-char const * const latex_quote_t1[2][5] = 
-{ { "\\quotesinglbase{}",  "'", "`", 
-    "\\guilsinglleft{}", "\\guilsinglright{}" }, 
+char const * const latex_quote_t1[2][5] =
+{ { "\\quotesinglbase{}",  "'", "`",
+    "\\guilsinglleft{}", "\\guilsinglright{}" },
   { ",,", "''", "``", "<<", ">>" } };
 
-char const * const latex_quote_ot1[2][5] = 
-{ { "\\quotesinglbase{}",  "'", "`", 
-    "\\guilsinglleft{}", "\\guilsinglright{}" }, 
+char const * const latex_quote_ot1[2][5] =
+{ { "\\quotesinglbase{}",  "'", "`",
+    "\\guilsinglleft{}", "\\guilsinglright{}" },
   { "\\quotedblbase{}", "''", "``",
     "\\guillemotleft{}", "\\guillemotright{}" } };
 
-char const * const latex_quote_babel[2][5] = 
+char const * const latex_quote_babel[2][5] =
 { { "\\glq{}",  "'", "`", "\\flq{}", "\\frq{}" },
   { "\\glqq{}", "''", "``", "\\flqq{}", "\\frqq{}" } };
 
@@ -85,12 +85,12 @@ InsetQuotes::InsetQuotes(quote_language l,
 InsetQuotes::InsetQuotes(char c, BufferParams const & params)
        : language_(params.quotes_language), times_(params.quotes_times)
 {
-       // Decide whether left or right 
+       // Decide whether left or right
        switch (c) {
-       case ' ': case '(': 
+       case ' ': case '(':
        case Paragraph::META_HFILL:
-       case Paragraph::META_NEWLINE: 
-               side_ = LeftQ;   // left quote 
+       case Paragraph::META_NEWLINE:
+               side_ = LeftQ;   // left quote
                break;
        default:
                side_ = RightQ;  // right quote
@@ -108,7 +108,7 @@ void InsetQuotes::parseString(string const & s)
        }
 
        int i;
-       
+
        for (i = 0; i < 6; ++i) {
                if (str[0] == language_char[i]) {
                        language_ = quote_language(i);
@@ -118,7 +118,7 @@ void InsetQuotes::parseString(string const & s)
        if (i >= 6) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad language specification." << endl;
-               language_ = EnglishQ; 
+               language_ = EnglishQ;
        }
 
        for (i = 0; i < 2; ++i) {
@@ -130,7 +130,7 @@ void InsetQuotes::parseString(string const & s)
        if (i >= 2) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad side specification." << endl;
-               side_ = LeftQ; 
+               side_ = LeftQ;
        }
 
        for (i = 0; i < 2; ++i) {
@@ -142,30 +142,30 @@ void InsetQuotes::parseString(string const & s)
        if (i >= 2) {
                lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
                        " bad times specification." << endl;
-               times_ = DoubleQ; 
+               times_ = DoubleQ;
        }
 }
 
 
 string const InsetQuotes::dispString(Language const * loclang) const
 {
-       string disp;
+       string disp;
        disp += quote_char[quote_index[side_][language_]];
        if (times_ == DoubleQ)
                disp += disp;
 
-       if (lyxrc.font_norm_type == LyXRC::ISO_8859_1
-           || lyxrc.font_norm_type == LyXRC::ISO_8859_3
-           || lyxrc.font_norm_type == LyXRC::ISO_8859_4
-           || lyxrc.font_norm_type == LyXRC::ISO_8859_9) {
+       if (lyxrc.font_norm_type == LyXRC::ISO_8859_1
+           || lyxrc.font_norm_type == LyXRC::ISO_8859_3
+           || lyxrc.font_norm_type == LyXRC::ISO_8859_4
+           || lyxrc.font_norm_type == LyXRC::ISO_8859_9) {
                if (disp == "'")
                        disp = "´";
                else if (disp == "''")
                        disp = "´´";
        }
-       if (lyxrc.font_norm_type == LyXRC::ISO_8859_1
-           || lyxrc.font_norm_type == LyXRC::ISO_8859_9
-           || lyxrc.font_norm_type == LyXRC::ISO_8859_15) {
+       if (lyxrc.font_norm_type == LyXRC::ISO_8859_1
+           || lyxrc.font_norm_type == LyXRC::ISO_8859_9
+           || lyxrc.font_norm_type == LyXRC::ISO_8859_15) {
                if (disp == "<<")
                        disp = '«';
                else if (disp == ">>")
@@ -179,8 +179,8 @@ string const InsetQuotes::dispString(Language const * loclang) const
                else
                        disp = " " + disp;
        }
-       
-       return disp;
+
+       return disp;
 }
 
 
@@ -242,7 +242,7 @@ void InsetQuotes::write(Buffer const *, ostream & os) const
        string text;
        text += language_char[language_];
        text += side_char[side_];
-       text += times_char[times_]; 
+       text += times_char[times_];
        os << "Quotes " << text;
 }
 
@@ -272,18 +272,18 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os,
 
        const int quoteind = quote_index[side_][language_];
        string qstr;
-       
+
        if (language_ == FrenchQ && times_ == DoubleQ
            && curr_lang == "frenchb") {
-               if (side_ == LeftQ) 
+               if (side_ == LeftQ)
                        qstr = "\\og "; //the spaces are important here
-               else 
+               else
                        qstr = " \\fg{}"; //and here
        } else if (language_ == FrenchQ && times_ == DoubleQ
                   && curr_lang == "french") {
-               if (side_ == LeftQ) 
+               if (side_ == LeftQ)
                        qstr = "<< "; //the spaces are important here
-               else 
+               else
                        qstr = " >>"; //and here
        } else if (lyxrc.fontenc == "T1") {
                qstr = latex_quote_t1[times_][quoteind];
@@ -293,7 +293,7 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os,
        } else if (!use_babel) {
 #endif
                qstr = latex_quote_ot1[times_][quoteind];
-       } else { 
+       } else {
                qstr = latex_quote_babel[times_][quoteind];
        }
 
@@ -337,24 +337,24 @@ int InsetQuotes::docbook(Buffer const *, ostream & os) const
 }
 
 
-void InsetQuotes::validate(LaTeXFeatures & features) const 
+void InsetQuotes::validate(LaTeXFeatures & features) const
 {
        char type = quote_char[quote_index[side_][language_]];
 
 #ifdef DO_USE_DEFAULT_LANGUAGE
-       if (features.bufferParams().language->lang() == "default" 
+       if (features.bufferParams().language->lang() == "default"
 #else
        if (!use_babel
 #endif
            && lyxrc.fontenc != "T1") {
-               if (times_ == SingleQ) 
+               if (times_ == SingleQ)
                        switch (type) {
                        case ',': features.require("quotesinglbase");  break;
                        case '<': features.require("guilsinglleft");  break;
                        case '>': features.require("guilsinglright"); break;
                        default: break;
                        }
-               else 
+               else
                        switch (type) {
                        case ',': features.require("quotedblbase");   break;
                        case '<': features.require("guillemotleft");  break;