[LyX/master] CT: Mark deleted floats in output
Juergen Spitzmueller
spitz at lyx.org
Fri Dec 27 08:34:12 UTC 2019
commit 7c63896c601f43ced313b74e04336235ff09212e
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Fri Dec 27 09:50:11 2019 +0100
CT: Mark deleted floats in output
Fixes #11175
---
src/LaTeXFeatures.cpp | 3 +++
src/insets/InsetFloat.cpp | 11 +++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 084552e..88e3ef8 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -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(
diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index 95e9af7..7093541 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -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";
}
More information about the lyx-cvs
mailing list