[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate/part
From:       Sebastian Pipping <webmaster () hartwork ! org>
Date:       2007-05-06 3:41:11
Message-ID: 1178422871.073596.6208.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 661603 by sping:

Whole words fixed


 M  +6 -7      katedocument.cpp  


--- trunk/KDE/kdelibs/kate/part/katedocument.cpp #661602:661603
@@ -2156,6 +2156,7 @@
   // * support BlockInputRange
   // * support DotMatchesNewline
   // * return capture ranges (not only full match)
+  QString workPattern(pattern);
 
   KTextEditor::Search::SearchOptions finalOptions(options);
   const bool escapeSequences = finalOptions.testFlag(KTextEditor::Search::EscapeSequences);
@@ -2164,14 +2165,13 @@
   if (finalOptions.testFlag(KTextEditor::Search::WholeWords))
   {
     // resolve escape sequences like \t
-    QString expression(pattern);
     if (escapeSequences)
     {
-      KateDocument::escapePlaintext(expression);
+      KateDocument::escapePlaintext(workPattern);
     }
 
     // escape dot and friends
-    expression = "\\b" + QRegExp::escape(expression) + "\\b";
+    workPattern = "\\b" + QRegExp::escape(workPattern) + "\\b";
 
     // regex ON, whole words OFF
     finalOptions |= KTextEditor::Search::Regex;
@@ -2191,7 +2191,7 @@
         ? Qt::CaseSensitive
         : Qt::CaseInsensitive;
 
-    QRegExp matcher(pattern, caseSensitivity);
+    QRegExp matcher(workPattern, caseSensitivity);
     if (matcher.isValid())
     {
       // valid pattern
@@ -2209,14 +2209,13 @@
     // plaintext search
 
     // resolve escape sequences like \t
-    QString finalPattern(pattern);
     if (escapeSequences)
     {
-      KateDocument::escapePlaintext(finalPattern);
+      KateDocument::escapePlaintext(workPattern);
     }
 
     // run engine
-    resultRange = searchText(range, finalPattern, caseSensitive, backwards);
+    resultRange = searchText(range, workPattern, caseSensitive, backwards);
   }
 
   QVector<KTextEditor::Range> result;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic