Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering/StarTextPainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/rendering/StarTextPainter.cpp')
-rw-r--r--source/rendering/StarTextPainter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/rendering/StarTextPainter.cpp b/source/rendering/StarTextPainter.cpp
index 6db4a34..eb161d4 100644
--- a/source/rendering/StarTextPainter.cpp
+++ b/source/rendering/StarTextPainter.cpp
@@ -6,9 +6,9 @@
namespace Star {
namespace Text {
+ static auto stripEscapeRegex = std::regex(strf("\\{:c}[^;]*{:c}", CmdEsc, EndEsc));
String stripEscapeCodes(String const& s) {
- String regex = strf("\\{}[^;]*{}", CmdEsc, EndEsc);
- return std::regex_replace(s.utf8(), std::regex(regex.utf8()), "");
+ return std::regex_replace(s.utf8(), stripEscapeRegex, "");
}
String preprocessEscapeCodes(String const& s) {