]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
reorder.
[lyx.git] / src / Font.cpp
index 8d5a018976b8794df13d4f9c9869b792be7fece2..4bf3040cd7fb8af60765f3a66266d4b71c4ff801 100644 (file)
@@ -552,23 +552,27 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                env = true; //We have opened a new environment
        }
        if (f.underbar() == FONT_ON) {
-               os << "\\underbar{";
+               os << "\\uline{";
                count += 10;
+               runparams.inulemcmd = true;
                env = true; //We have opened a new environment
        }
        if (f.strikeout() == FONT_ON) {
                os << "\\sout{";
-               count += 6;
+               count += 9;
+               runparams.inulemcmd = true;
                env = true; //We have opened a new environment
        }
        if (f.uuline() == FONT_ON) {
                os << "\\uuline{";
-               count += 8;
+               count += 11;
+               runparams.inulemcmd = true;
                env = true; //We have opened a new environment
        }
        if (f.uwave() == FONT_ON) {
                os << "\\uwave{";
-               count += 7;
+               count += 10;
+               runparams.inulemcmd = true;
                env = true; //We have opened a new environment
        }
        // \noun{} is a LyX special macro
@@ -638,21 +642,25 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
        if (f.underbar() == FONT_ON) {
                os << '}';
                ++count;
+               runparams.inulemcmd = false;
                env = true; // Size change need not bother about closing env.
        }
        if (f.strikeout() == FONT_ON) {
                os << '}';
                ++count;
+               runparams.inulemcmd = false;
                env = true; // Size change need not bother about closing env.
        }
        if (f.uuline() == FONT_ON) {
                os << '}';
                ++count;
+               runparams.inulemcmd = false;
                env = true; // Size change need not bother about closing env.
        }
        if (f.uwave() == FONT_ON) {
                os << '}';
                ++count;
+               runparams.inulemcmd = false;
                env = true; // Size change need not bother about closing env.
        }
        if (f.noun() == FONT_ON) {
@@ -818,6 +826,11 @@ void Font::validate(LaTeXFeatures & features) const
                features.require("noun");
                LYXERR(Debug::LATEX, "Noun enabled. Font: " << to_utf8(stateText(0)));
        }
+       if (bits_.underbar() == FONT_ON) {
+               LYXERR(Debug::LATEX, "font.underline: " << bits_.underbar());
+               features.require("ulem");
+               LYXERR(Debug::LATEX, "Underline enabled. Font: " << to_utf8(stateText(0)));
+       }
        if (bits_.strikeout() == FONT_ON) {
                LYXERR(Debug::LATEX, "font.strikeout: " << bits_.strikeout());
                features.require("ulem");