X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsupport%2Flstrings.cpp;h=8ffab19c7ef14b9a8f2a4fe0b3cbd371ac68e3ff;hb=5608f6fdb67b86b4cf3d9215d24d7734239ad05a;hp=1e3d3464c25a04acd8ea2d5cef29ec70a88391d0;hpb=ef387c81af1294a3b5e7f65c23b313c371224b33;p=lyx.git diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp index 1e3d3464c2..8ffab19c7e 100644 --- a/src/support/lstrings.cpp +++ b/src/support/lstrings.cpp @@ -1203,6 +1203,16 @@ docstring const escape(docstring const & lab) } +docstring const protectArgument(docstring & arg, char const l, + char const r) +{ + if (contains(arg, l) || contains(arg, r)) + // protect brackets + arg = '{' + arg + '}'; + return arg; +} + + bool truncateWithEllipsis(docstring & str, size_t const len) { if (str.size() <= len)