Revert parts of 7e69ac220d

This fixes the tex2lyx test test-refstyle-theorems.tex. It seems that the
intent of the fix was to remove a \protect in front of a \caption,
\captionabove or \captionbelow, but the implementation did not really do that.
Furthermore, it is not clear in which cases a \protect in front of a caption
needs to removed, and in which cases it needs to be kept: After looking at the
LyX sources I could not see that caprions are always output with \protect.
This commit is contained in:
Georg Baum 2014-12-22 21:32:45 +01:00
parent e32a3e7f57
commit bb87e0422a

View File

@ -3432,26 +3432,15 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else if (is_known(t.cs(), known_phrases) ||
(t.cs() == "protect" &&
p.next_token().cat() == catEscape &&
is_known(p.next_token().cs(), known_phrases)) ||
(t.cs() == "protect" &&
(p.next_token().cs() == "caption" ||
p.next_token().cs() == "captionabove" ||
p.next_token().cs() == "captionbelow"))) {
if (p.next_token().cs() == "caption" ||
p.next_token().cs() == "captionabove" ||
p.next_token().cs() == "captionbelow")
// we must ignore if \protect is in front of \caption*
;
else {
// LyX sometimes puts a \protect in front, so we have to ignore it
// FIXME: This needs to be changed when bug 4752 is fixed.
where = is_known(
t.cs() == "protect" ? p.get_token().cs() : t.cs(),
known_phrases);
context.check_layout(os);
os << known_coded_phrases[where - known_phrases];
skip_spaces_braces(p);
}
is_known(p.next_token().cs(), known_phrases))) {
// LyX sometimes puts a \protect in front, so we have to ignore it
// FIXME: This needs to be changed when bug 4752 is fixed.
where = is_known(
t.cs() == "protect" ? p.get_token().cs() : t.cs(),
known_phrases);
context.check_layout(os);
os << known_coded_phrases[where - known_phrases];
skip_spaces_braces(p);
}
// handle refstyle first to catch \eqref which can also occur