]> git.lyx.org Git - features.git/commitdiff
CT: Mark deleted floats in output
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 27 Dec 2019 08:50:11 +0000 (09:50 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:49 +0000 (15:48 +0200)
Fixes #11175

src/LaTeXFeatures.cpp
src/insets/InsetFloat.cpp

index 084552eac72d1b7c09c542f291edfbeb591c66a9..88e3ef8eb512f40c2a2d069e98dea70598fdb2ec 100644 (file)
@@ -299,10 +299,13 @@ static docstring const changetracking_tikz_object_sout_def = from_ascii(
        "\\usepackage{tikz}\n"
        "\\usetikzlibrary{calc}\n"
        "\\newcommand{\\lyxobjectsout}[1]{%\n"
+       "  \\bgroup%\n"
+       "  \\color{lyxdeleted}%\n"
        "  \\tikz[baseline=(obj.base)]{\n"
        "    \\node[inner sep=0pt,outer sep=0pt](obj){#1};\n"
        "    \\draw($(obj.south west)+(2em,.5em)$)--($(obj.north east)-(2em,.5em)$);\n"
        "  }\n"
+       "  \\egroup%\n"
        "}\n");
 
 static docstring const changetracking_none_def = from_ascii(
index 95e9af74d11a6a3e77c2cf61b27761d89c845bde..7093541c93ea19081463db937e77a80796fd46f8 100644 (file)
@@ -322,6 +322,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
        if (features.inFloat())
                features.require("subfig");
 
+       if (features.inDeletedInset())
+               features.require("ct-tikz-object-sout");
+
        features.useFloat(params_.type, features.inFloat());
        features.inFloat(true);
        InsetCaptionable::validate(features);
@@ -435,6 +438,11 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
                os << '[' << from_ascii(placement) << ']';
        os << '\n';
 
+       if (runparams.inDeletedInset) {
+               os << "\\lyxobjectsout{%" << breakln;
+               os << "\\parbox{\\linewidth}{%" << breakln;
+       }
+
        string alignment = getAlignment();
        if (alignment == "left")
                os << "\\raggedright" << breakln;
@@ -445,6 +453,9 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
 
        InsetText::latex(os, runparams);
 
+       if (runparams.inDeletedInset)
+               os << "}}";
+
        // Force \end{<floatname>} to appear in a new line.
        os << breakln << "\\end{" << from_ascii(tmptype) << "}\n";
 }