]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfont.C
partial framebox support
[lyx.git] / src / lyxfont.C
index 8cd660eed0561da8b487b1240abdbf760913f4e4..54548a9104cd555bfe21925d4b0174a7487acc52 100644 (file)
@@ -571,8 +571,7 @@ string const LyXFont::stateText(BufferParams * params) const
                ost << _("  Number ") << _(GUIMiscNames[number()]);
 
        string buf(ost.str().c_str());
-       buf = strip(buf, ' ');
-       buf = strip(buf, ',');
+       buf = rtrim(buf, ", ");
        return buf;
 }
 
@@ -580,7 +579,7 @@ string const LyXFont::stateText(BufferParams * params) const
 // Set family according to lyx format string
 LyXFont & LyXFont::setLyXFamily(string const & fam)
 {
-       string const s = lowercase(fam);
+       string const s = ascii_lowercase(fam);
 
        int i = 0;
        while (s != LyXFamilyNames[i] && LyXFamilyNames[i] != "error") ++i;
@@ -596,7 +595,7 @@ LyXFont & LyXFont::setLyXFamily(string const & fam)
 // Set series according to lyx format string
 LyXFont & LyXFont::setLyXSeries(string const & ser)
 {
-       string const s = lowercase(ser);
+       string const s = ascii_lowercase(ser);
 
        int i = 0;
        while (s != LyXSeriesNames[i] && LyXSeriesNames[i] != "error") ++i;
@@ -612,7 +611,7 @@ LyXFont & LyXFont::setLyXSeries(string const & ser)
 // Set shape according to lyx format string
 LyXFont & LyXFont::setLyXShape(string const & sha)
 {
-       string const s = lowercase(sha);
+       string const s = ascii_lowercase(sha);
 
        int i = 0;
        while (s != LyXShapeNames[i] && LyXShapeNames[i] != "error") ++i;
@@ -628,7 +627,7 @@ LyXFont & LyXFont::setLyXShape(string const & sha)
 // Set size according to lyx format string
 LyXFont & LyXFont::setLyXSize(string const & siz)
 {
-       string const s = lowercase(siz);
+       string const s = ascii_lowercase(siz);
        int i = 0;
        while (s != LyXSizeNames[i] && LyXSizeNames[i] != "error") ++i;
        if (s == LyXSizeNames[i]) {
@@ -643,7 +642,7 @@ LyXFont & LyXFont::setLyXSize(string const & siz)
 // Set size according to lyx format string
 LyXFont::FONT_MISC_STATE LyXFont::setLyXMisc(string const & siz)
 {
-       string const s = lowercase(siz);
+       string const s = ascii_lowercase(siz);
        int i = 0;
        while (s != LyXMiscNames[i] && LyXMiscNames[i] != "error") ++i;
        if (s == LyXMiscNames[i])
@@ -677,7 +676,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
        bool finished = false;
        while (!finished && lex.isOK() && !error) {
                lex.next();
-               string const tok = lowercase(lex.getString());
+               string const tok = ascii_lowercase(lex.getString());
 
                if (tok.empty()) {
                        continue;
@@ -701,7 +700,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
                        setLyXSize(ttok);
                } else if (tok == "misc") {
                        lex.next();
-                       string const ttok = lowercase(lex.getString());
+                       string const ttok = ascii_lowercase(lex.getString());
 
                        if (ttok == "no_bar") {
                                setUnderbar(OFF);
@@ -903,12 +902,11 @@ int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
        int count = 0;
        bool env = false;
 
-       LyXFont f = *this; // why do you need this?
-       f.reduce(base); // why isn't this just "reduce(base);" (Lgb)
-       // Because this function is const. Everything breaks if this
-       // method changes the font it represents. There is no speed penalty
-       // by using the temporary. (Asger)
-
+       // reduce the current font to changes against the base
+       // font (of the layout). We use a temporary for this to
+       // avoid changing this font instance, as that would break
+       LyXFont f = *this;
+       f.reduce(base);
 
        if (f.family() != INHERIT_FAMILY) {
                os << '}';