]> git.lyx.org Git - features.git/commitdiff
ulem commands can be nested.
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 22 Mar 2014 11:25:25 +0000 (12:25 +0100)
committerRichard Heck <rgheck@lyx.org>
Fri, 18 Apr 2014 14:52:47 +0000 (10:52 -0400)
src/Font.cpp
src/OutputParams.cpp
src/OutputParams.h
src/insets/InsetCitation.cpp
src/insets/InsetRef.cpp

index a155ec557ae24212d703d1d07c8515ab616091aa..7e8b3f4f2bcc2e9d8200b14305a0a848adb0460c 100644 (file)
@@ -418,22 +418,22 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
        if (f.underbar() == FONT_ON) {
                os << "\\uline{";
                count += 10;
-               runparams.inulemcmd = true;
+               ++runparams.inulemcmd;
        }
        if (f.strikeout() == FONT_ON) {
                os << "\\sout{";
                count += 9;
-               runparams.inulemcmd = true;
+               ++runparams.inulemcmd;
        }
        if (f.uuline() == FONT_ON) {
                os << "\\uuline{";
                count += 11;
-               runparams.inulemcmd = true;
+               ++runparams.inulemcmd;
        }
        if (f.uwave() == FONT_ON) {
                os << "\\uwave{";
                count += 10;
-               runparams.inulemcmd = true;
+               ++runparams.inulemcmd;
        }
        return count;
 }
@@ -497,22 +497,22 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
        if (f.underbar() == FONT_ON) {
                os << '}';
                ++count;
-               runparams.inulemcmd = false;
+               --runparams.inulemcmd;
        }
        if (f.strikeout() == FONT_ON) {
                os << '}';
                ++count;
-               runparams.inulemcmd = false;
+               --runparams.inulemcmd;
        }
        if (f.uuline() == FONT_ON) {
                os << '}';
                ++count;
-               runparams.inulemcmd = false;
+               --runparams.inulemcmd;
        }
        if (f.uwave() == FONT_ON) {
                os << '}';
                ++count;
-               runparams.inulemcmd = false;
+               --runparams.inulemcmd;
        }
 
        // If the current language is Hebrew, Arabic, or Farsi
index df58ff4cadb55667cf752834ac0f73fc336bdee2..e74eaa320ee6557176f3291805a2b4c32ab3875b 100644 (file)
@@ -20,7 +20,7 @@ namespace lyx {
 
 OutputParams::OutputParams(Encoding const * enc)
        : flavor(LATEX), math_flavor(NotApplicable), nice(false), is_child(false),
-         moving_arg(false), inulemcmd(false), local_font(0), master_language(0),
+         moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
          encoding(enc), free_spacing(false), use_babel(false), use_polyglossia(false),
          use_indices(false), use_japanese(false), linelen(0), depth(0),
          exportdata(new ExportData),
index f220b5e654d3cf7fa3f61393ec7ae2ead21f4c31..598b5753b8d4e2ae2a0fb032d26a583d77a24614 100644 (file)
@@ -99,13 +99,13 @@ public:
        */
        bool intitle;
 
-       /** inulemcmd == true means that the environment in which the
+       /** inulemcmd > 0 means that the environment in which the
            inset is typeset is part of a ulem command (\uline, \uuline,
            \uwave, or \sout). Insets that output latex commands relying
            on local assignments (such as \cite) should enclose such
            commands in \mbox{} in order to avoid breakage.
        */
-       mutable bool inulemcmd;
+       mutable int inulemcmd;
 
        /** the font at the point where the inset is
         */
index c0e61798a8fecda40ed999b9d0091ff0020f4841..96620c1412270df573658d2eea5443c02961d766 100644 (file)
@@ -422,7 +422,7 @@ void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
        // FIXME UNICODE
        docstring const cite_str = from_utf8(citationStyleToString(cs));
 
-       if (runparams.inulemcmd)
+       if (runparams.inulemcmd > 0)
                os << "\\mbox{";
 
        os << "\\" << cite_str;
index 9a2ddd8bd8aec618719ba9c4b7bb561d1564a2ca..e7e458f477ae1eabf0b724a7cbf0b5cbd40e36bb 100644 (file)
@@ -143,7 +143,7 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
        string const cmd = getCmdName();
        docstring const data = getEscapedLabel(rp);
 
-       if (rp.inulemcmd)
+       if (rp.inulemcmd > 0)
                os << "\\mbox{";
 
        if (cmd == "eqref" && buffer().params().use_refstyle) {
@@ -168,7 +168,7 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
                os << p.getCommand(rp);
        }
 
-       if (rp.inulemcmd)
+       if (rp.inulemcmd > 0)
                os << "}";
 }