Bug 1271733 - fix deletion of AB cards after search. r=rkent a=jorgk
authoraceman <acelists@atlas.sk>
Mon, 30 May 2016 22:09:21 +0200
changeset 27201 12128f286d4d74440cfa82d84710e88cc52103a0
parent 27200 572648db1b1234583175d9f7d4327c09dc409689
child 27202 876e5702c9f45185ccf2ac83ea877d29e2317c54
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent, jorgk
bugs1271733
Bug 1271733 - fix deletion of AB cards after search. r=rkent a=jorgk
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);