OSDN Git Service

Correct issues with searching not showing the correct results.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / REnSearch.java
index cec989a..7534d6b 100644 (file)
@@ -130,13 +130,16 @@ public class REnSearch {
                        if (tagNames.size() == 0 && !negative)\r
                                return false;\r
                        \r
+                       boolean matchFound = false;\r
                        for (int i=0; i<tagNames.size(); i++) { \r
                                boolean matches = Pattern.matches(filterName.toLowerCase(),tagNames.get(i).toLowerCase());\r
-                               if (!matches && !negative)\r
-                                       return false;\r
-                               if (matches && negative)\r
-                                       return false;\r
+                               if (matches)\r
+                                       matchFound = true;\r
                        }\r
+                       if (negative) \r
+                               matchFound = !matchFound;\r
+                       if (!matchFound) \r
+                               return false;\r
                }\r
                return true;\r
        }\r
@@ -541,7 +544,7 @@ public class REnSearch {
                                return false;\r
                        boolean returnTodo = false;\r
                        while (pos > -1) {\r
-                               int endPos = n.getContent().indexOf("/>", pos);\r
+                               int endPos = n.getContent().indexOf(">", pos);\r
                                String segment = n.getContent().substring(pos, endPos);\r
                                boolean currentState;\r
                                if (segment.toLowerCase().indexOf("checked=\"true\"") == -1)\r