]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetListings.cpp
index 5a15bbb54c210fe56f494789e7b370f0493f27c1..cfbcf8d1d6588828123fd69c3bc01310b0ce0887 100644 (file)
@@ -50,8 +50,9 @@ void InsetListings::init()
        font.decSize();
        font.setColor(Color::none);
        setLabelFont(font);
-       text_.current_font.setLanguage(latex_language);
-       text_.real_current_font.setLanguage(latex_language);
+       // FIXME: what to do with those?
+       //text_.current_font.setLanguage(latex_language);
+       //text_.real_current_font.setLanguage(latex_language);
 }
 
 
@@ -197,7 +198,13 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
                 os << code
                    << *delimiter;
        } else {
-               docstring const caption = getCaption(buf, runparams);
+               OutputParams rp = runparams;
+               // FIXME: the line below would fix bug 4182,
+               // but real_current_font moved to cursor.
+               //rp.local_font = &text_.real_current_font;
+               rp.moving_arg = true;
+               docstring const caption = getCaption(buf, rp);
+               runparams.encoding = rp.encoding;
                if (param_string.empty() && caption.empty())
                        os << "\n\\begingroup\n\\inputencoding{latin1}\n\\begin{lstlisting}\n";
                else {
@@ -268,16 +275,13 @@ void InsetListings::setButtonLabel()
 }
 
 
-bool InsetListings::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetListings::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        Font tmpfont = mi.base.font;
        getDrawFont(mi.base.font);
        mi.base.font.realize(tmpfont);
        InsetCollapsable::metrics(mi, dim);
        mi.base.font = tmpfont;
-       bool const changed = dim_ != dim;
-       dim_ = dim;
-       return changed;
 }