]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetquotes.C
index 8e7b76c1c41de125fa8766990d2287575318048c..779b78d9e48f6bf13a7aa2cf737b96329ee40667 100644 (file)
@@ -85,14 +85,14 @@ char const * const latex_quote_babel[2][5] =
 InsetQuotes::InsetQuotes(string const & str)
 {
        parseString(str);
-       setInsetName("InsetQuotes");
+       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
 InsetQuotes::InsetQuotes(quote_language l, quote_side s, quote_times t)
        : language_(l), side_(s), times_(t)
 {
-       setInsetName("InsetQuotes");
+       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -100,7 +100,7 @@ InsetQuotes::InsetQuotes(char_type c, BufferParams const & params)
        : language_(params.quotes_language), times_(params.quotes_times)
 {
        getPosition(c);
-       setInsetName("InsetQuotes");
+       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -108,7 +108,7 @@ InsetQuotes::InsetQuotes(char_type c, quote_language l, quote_times t)
        : language_(l), times_(t)
 {
        getPosition(c);
-       setInsetName("InsetQuotes");
+       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -221,7 +221,7 @@ docstring const InsetQuotes::dispString(Language const * loclang) const
 }
 
 
-void InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        LyXFont & font = mi.base.font;
        frontend::FontMetrics const & fm =
@@ -239,7 +239,9 @@ void InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
                else
                        dim.wid += fm.width(',');
        }
+       bool const changed = dim_ != dim;
        dim_ = dim;
+       return changed;
 }
 
 
@@ -294,7 +296,7 @@ void InsetQuotes::read(Buffer const &, LyXLex & lex)
 
 
 int InsetQuotes::latex(Buffer const &, odocstream & os,
-                      OutputParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        const int quoteind = quote_index[side_][language_];
        string qstr;
@@ -326,16 +328,17 @@ int InsetQuotes::latex(Buffer const &, odocstream & os,
 }
 
 
-int InsetQuotes::plaintext(Buffer const &, odocstream & os,
-                      OutputParams const &) const
+int InsetQuotes::plaintext(Buffer const & buf, odocstream & os,
+                           OutputParams const &) const
 {
-       os << '"';
-       return 0;
+       docstring const str = dispString(buf.params().language);
+       os << str;
+       return str.size();
 }
 
 
 int InsetQuotes::docbook(Buffer const &, odocstream & os,
-                        OutputParams const &) const
+                         OutputParams const &) const
 {
        if (times_ == DoubleQ) {
                if (side_ == LeftQ)
@@ -352,10 +355,9 @@ int InsetQuotes::docbook(Buffer const &, odocstream & os,
 }
 
 
-int InsetQuotes::textString(Buffer const & buf, odocstream & os,
-                      OutputParams const & op) const
+void InsetQuotes::textString(Buffer const & buf, odocstream & os) const
 {
-       return plaintext(buf, os, op);
+       os << dispString(buf.params().language);
 }