summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katehighlight.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katehighlight.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katehighlight.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
index 539d356..89024f7 100644
--- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp
+++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
@@ -386,19 +386,24 @@ const QChar *HlAnyChar::checkHgl(const QChar *s, int len, bool)
{
if (ustrchr(_charList, _charListLen, *s)) return s +1;
return 0L;
}
HlRegExpr::HlRegExpr(int attribute, int context,QString regexp)
- : HlItem(attribute, context) {
+ : HlItem(attribute, context), Expr(0) {
handlesLinestart=regexp.startsWith("^");
if(!handlesLinestart) regexp.prepend("^");
Expr=new QRegExp3(regexp);
}
+HlRegExpr::~HlRegExpr()
+{
+ delete Expr;
+}
+
const QChar *HlRegExpr::checkHgl(const QChar *s, int len, bool lineStart)
{
if ((!lineStart) && handlesLinestart) return 0;
QString line(s,len);
int pos = Expr->search( line, 0 );