Bug 1271733 - fix deletion of AB cards after search. r=rkent
authoraceman <acelists@atlas.sk>
Mon, 30 May 2016 22:09:21 +0200
changeset 19403 2ea521366c72695ab72b22391f3030b855708f03
parent 19402 4173015e14550ada9deb4540e0741278820c9532
child 19404 336c1a3c70add32a5b34b0a1498814585148e586
push id11937
push useracelists@atlas.sk
push dateMon, 30 May 2016 20:09:44 +0000
treeherdercomm-central@2ea521366c72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent
bugs1271733
Bug 1271733 - fix deletion of AB cards after search. r=rkent
mailnews/addrbook/src/nsAbView.cpp
--- a/mailnews/addrbook/src/nsAbView.cpp
+++ b/mailnews/addrbook/src/nsAbView.cpp
@@ -200,17 +200,17 @@ NS_IMETHODIMP nsAbView::SetView(nsIAbDir
   }
 
   if (Substring(uri, 0, searchBegin).EqualsLiteral(kAllDirectoryRoot)) {
     mIsAllDirectoryRootView = true;
     // We have special request case to search all addressbooks, so we need
     // to iterate over all addressbooks.
     // Since the request is for all addressbooks, the URI must have been
     // passed with an extra '?'. We still check it for sanity and trim it here.
-    if (searchQuery.Find("??") != kNotFound)
+    if (searchQuery.Find("??") == 0)
       searchQuery = Substring(searchQuery, 1);
 
     nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID,
                                                    &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsISimpleEnumerator> enumerator;
     rv = abManager->GetDirectories(getter_AddRefs(enumerator));
     NS_ENSURE_SUCCESS(rv, rv);