From: Jürgen Spitzmüller Date: Thu, 21 Oct 2010 13:16:28 +0000 (+0000) Subject: * InsetCommandParams.cpp (prepareCommand): X-Git-Tag: 2.0.0~2317 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2cf666e3cddf42937082de7d4d4eb06d9602c793;p=features.git * InsetCommandParams.cpp (prepareCommand): - properly terminate LaTeX macros (reported in bug 6959). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35746 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 87084c3ee9..31ea514a79 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -375,7 +375,15 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, docstring uncodable; for (size_t n = 0; n < command.size(); ++n) { try { - result += runparams.encoding->latexChar(command[n]); + char_type const c = command[n]; + docstring const latex = runparams.encoding->latexChar(c); + result += latex; + if (latex.length() > 1 && latex[latex.length() - 1] != '}') { + // Prevent eating of a following + // space or command corruption by + // following characters + result += "{}"; + } } catch (EncodingException & /* e */) { LYXERR0("Uncodable character in command inset!"); if (runparams.dryrun) {