]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insetquotes.C
index 1cf4d5bb8a6125bb35df9531992f408dabfa9c1e..7a85306c6d5cff8ca1ce9eb9603e94fcfd3b5630 100644 (file)
@@ -254,7 +254,7 @@ void InsetQuotes::write(Buffer const &, ostream & os) const
 
 void InsetQuotes::read(Buffer const &, LyXLex & lex)
 {
-       lex.nextToken();
+       lex.next();
        parseString(lex.getString());
        lex.next();
        if (lex.getString() != "\\end_inset") {
@@ -263,39 +263,18 @@ void InsetQuotes::read(Buffer const &, LyXLex & lex)
 }
 
 
-int InsetQuotes::latex(Buffer const & buf, ostream & os,
+int InsetQuotes::latex(Buffer const &, ostream & os,
                       OutputParams const & runparams) const
 {
-       // How do we get the local language here??
-       lyx::pos_type curr_pos = ownerPar(buf, this).getPositionOfInset(this);
-       BOOST_ASSERT(curr_pos != -1);
-
-#ifdef WITH_WARNINGS
-#warning FIXME. We _must_ find another way to get the language. (Lgb)
-#endif
-#if 0
-       // This cannot be used. (Lgb)
-       string const curr_lang =
-               parOwner()->getFont(buf->params, curr_pos).language()->babel();
-#else
-       // And this is not the way... (Lgb)
-       string const curr_lang = buf.params().language->lang();
-#endif
        const int quoteind = quote_index[side_][language_];
        string qstr;
 
        if (language_ == FrenchQ && times_ == DoubleQ
-           && curr_lang == "frenchb") {
+           && prefixIs(runparams.local_font->language()->code(), "fr")) {
                if (side_ == LeftQ)
                        qstr = "\\og "; //the spaces are important here
                else
                        qstr = " \\fg{}"; //and here
-       } else if (language_ == FrenchQ && times_ == DoubleQ
-                  && curr_lang == "french") {
-               if (side_ == LeftQ)
-                       qstr = "<< "; //the spaces are important here
-               else
-                       qstr = " >>"; //and here
        } else if (lyxrc.fontenc == "T1") {
                qstr = latex_quote_t1[times_][quoteind];
 #ifdef DO_USE_DEFAULT_LANGUAGE
@@ -351,6 +330,13 @@ int InsetQuotes::docbook(Buffer const &, ostream & os,
 }
 
 
+int InsetQuotes::textString(Buffer const & buf, ostream & os,
+                      OutputParams const & op) const
+{
+       return plaintext(buf, os, op);
+}
+
+
 void InsetQuotes::validate(LaTeXFeatures & features) const
 {
        bool const use_babel = features.useBabel();
@@ -380,13 +366,13 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<InsetBase> InsetQuotes::clone() const
+auto_ptr<InsetBase> InsetQuotes::doClone() const
 {
        return auto_ptr<InsetBase>(new InsetQuotes(language_, side_, times_));
 }
 
 
-InsetOld::Code InsetQuotes::lyxCode() const
+InsetBase::Code InsetQuotes::lyxCode() const
 {
-  return InsetOld::QUOTE_CODE;
+  return InsetBase::QUOTE_CODE;
 }