From 1ae74b2dd7cfa37cd8ef1df9568d64a043979bc6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 4 Dec 2014 17:27:56 +0100 Subject: [PATCH] \\subfloat captions are moving arguments Therefore insets should be protected in these captions. Fixes bug: #9346. --- src/insets/InsetFloat.cpp | 5 +++-- status.21x | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index beb5e0b557..9bd5bccaf9 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -337,8 +337,9 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const if (runparams_in.moving_arg) os << "\\protect"; os << "\\subfloat"; - + OutputParams rp = runparams_in; + rp.moving_arg = true; docstring const caption = getCaption(rp); if (!caption.empty()) { os << caption; @@ -347,7 +348,7 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const rp.inFloat = OutputParams::SUBFLOAT; InsetText::latex(os, rp); os << "}"; - + return; } OutputParams runparams(runparams_in); diff --git a/status.21x b/status.21x index e5c5923998..03ea97d865 100644 --- a/status.21x +++ b/status.21x @@ -103,6 +103,8 @@ What's new - Fix crash on exporting a recursive math macro (bug 9140). Recursive macros are invalid, so typesetting will still fail with "TeX capacity exceeded". +- Protect insets when needed in subfloat captions (bug 9346). + * LYX2LYX -- 2.39.5