]> git.lyx.org Git - lyx.git/blobdiff - src/MetricsInfo.cpp
Re-organization of Additional Features manual by John Hudson.
[lyx.git] / src / MetricsInfo.cpp
index 3353a7d3e65f617facd8496630ecb481c3aac7f7..9f2baa81aa992ec5157c091b15b4d715629f4762 100644 (file)
@@ -36,9 +36,10 @@ namespace lyx {
 //
 /////////////////////////////////////////////////////////////////////////
 
-MetricsBase::MetricsBase()
-       : bv(0), font(), style(LM_ST_TEXT), fontname("mathnormal"), textwidth(0),
-         solid_line_thickness_(1), solid_line_offset_(1), dotted_line_thickness_(1)
+MetricsBase::MetricsBase(BufferView * b, FontInfo f, int w)
+       : bv(b), font(move(f)), style(LM_ST_TEXT), fontname("mathnormal"),
+         textwidth(w), solid_line_thickness_(1), solid_line_offset_(1),
+         dotted_line_thickness_(1)
 {
        if (lyxrc.zoom >= 200) {
                // derive the line thickness from zoom factor
@@ -57,24 +58,15 @@ MetricsBase::MetricsBase()
 }
 
 
-MetricsBase::MetricsBase(BufferView * b, FontInfo f, int w)
-       : MetricsBase()
-{
-       bv = b;
-       font = f;
-       textwidth = w;
-}
-
-
-Changer MetricsBase::changeFontSet(docstring const & name, bool cond)
+Changer MetricsBase::changeFontSet(string const & name, bool cond)
 {
        RefChanger<MetricsBase> rc = make_save(*this);
        if (!cond)
                rc->keep();
        else {
                ColorCode oldcolor = font.color();
-               docstring const oldname = from_ascii(fontname);
-               fontname = to_utf8(name);
+               string const oldname = fontname;
+               fontname = name;
                font = sane_font;
                augmentFont(font, name);
                font.setSize(rc->old.font.size());
@@ -87,12 +79,6 @@ Changer MetricsBase::changeFontSet(docstring const & name, bool cond)
 }
 
 
-Changer MetricsBase::changeFontSet(char const * name, bool cond)
-{
-       return changeFontSet(from_ascii(name), cond);
-}
-
-
 /////////////////////////////////////////////////////////////////////////
 //
 // MetricsInfo