From: Randy Baumgarte Date: Sun, 3 Apr 2011 15:30:53 +0000 (-0400) Subject: Fix any: qualifier when searching. X-Git-Tag: version0.1.1~164 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=2e7d603980f854509b5cc6dfbb2b62f0d859d813 Fix any: qualifier when searching. --- diff --git a/src/cx/fbn/nevernote/sql/REnSearch.java b/src/cx/fbn/nevernote/sql/REnSearch.java index 1da5abe..ebbbaaf 100644 --- a/src/cx/fbn/nevernote/sql/REnSearch.java +++ b/src/cx/fbn/nevernote/sql/REnSearch.java @@ -115,8 +115,7 @@ public class REnSearch { public List getStack() { return stack; } // match tag names - private boolean matchTagsAll(List tagNames) { - List list = getTags(); + private boolean matchTagsAll(List tagNames, List list) { for (int j=0; j tagNames) { - List list = getTags(); + private boolean matchTagsAny(List tagNames, List list) { if (list.size() == 0) return true; @@ -178,6 +176,7 @@ public class REnSearch { return found; } + // Match notebooks in search terms against notes private boolean matchNotebook(String guid) { if (getNotebooks().size() == 0) @@ -764,7 +763,7 @@ public class REnSearch { // Start matching special stuff, like tags & notebooks if (any) { - if (good && !matchTagsAny(n.getTagNames())) + if (good && !matchTagsAny(n.getTagNames(), getTags())) good = false; if (good && !matchNotebook(n.getNotebookGuid())) good = false; @@ -787,7 +786,7 @@ public class REnSearch { if (good && n.getAttributes() != null && !matchDatesAny(getSubjectDate(), n.getAttributes().getSubjectDate())) good = false; } else { - if (good && !matchTagsAll(n.getTagNames())) + if (good && !matchTagsAll(n.getTagNames(), getTags())) good = false; if (good && !matchNotebook(n.getNotebookGuid())) good = false;