X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCommandParams.cpp;h=bb4882874af1b0220dba13776023ab8e34f1250e;hb=2906a35663b92030b0668a42ab370dba8ffca4cf;hp=0f4b82aaf868f81b2bb1aeca794f4638aafea4f5;hpb=bfa9991f9308c414357810cb1d1152929e96b70b;p=lyx.git diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 0f4b82aaf8..bb4882874a 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -84,7 +84,7 @@ static ParamInfo const & findInfo(InsetCode code, string const & cmdName) default: LASSERT(false, /**/); } - static const ParamInfo pi; + static ParamInfo pi; return pi; // to silence the warning } @@ -370,7 +370,8 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, ParamInfo::ParamHandling handling) const { docstring result; - if (handling == ParamInfo::HANDLING_LATEXIFY) { + switch (handling) { + case ParamInfo::HANDLING_LATEXIFY: { docstring uncodable; for (size_t n = 0; n < command.size(); ++n) { try { @@ -402,10 +403,15 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, "representable in the current encoding and therefore have been omitted:\n%2$s."), from_utf8(insetType()), uncodable)); } - } else if (handling == ParamInfo::HANDLING_ESCAPE) + break; + } + case ParamInfo::HANDLING_ESCAPE: result = escape(command); - else + break; + case ParamInfo::HANDLING_NONE: result = command; + break; + } // switch return result; }