X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Flstrings.cpp;h=8ffab19c7ef14b9a8f2a4fe0b3cbd371ac68e3ff;hb=5d3d26b0241da8f28e0b6b7cce23a8c5761e43de;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)