Bug 844148 Followup to compile with external linkage r=irving
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 23 Jan 2014 20:38:19 +0000
changeset 19334 90bc6a3ced716d86571ce1f310eed22a76c231a3
parent 19333 0aa01b4601143d60932df3268b0c7d8dfd3945d3
child 19335 507cf80a989eeb205649c7d4db7bad995ebe52d4
push id1103
push usermbanner@mozilla.com
push dateTue, 18 Mar 2014 07:44:06 +0000
treeherdercomm-beta@50c6279a0af0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersirving
bugs844148
Bug 844148 Followup to compile with external linkage r=irving
mailnews/imap/src/nsImapFlagAndUidState.cpp
--- a/mailnews/imap/src/nsImapFlagAndUidState.cpp
+++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"  // for pre-compiled headers
 
 #include "nsImapCore.h"
 #include "nsImapFlagAndUidState.h"
+#include "nsMsgUtils.h"
 #include "prcmon.h"
 #include "nspr.h"
 
 NS_IMPL_ISUPPORTS1(nsImapFlagAndUidState, nsIImapFlagAndUidState)
 
 using namespace mozilla;
 
 NS_IMETHODIMP nsImapFlagAndUidState::GetNumberOfMessages(int32_t *result)
@@ -239,31 +240,31 @@ NS_IMETHODIMP nsImapFlagAndUidState::Add
   MutexAutoLock mon(mLock);
   nsCString ourCustomFlags;
   nsCString oldValue;
   if (m_customFlagsHash.Get(uid, &oldValue))
   {
     // We'll store multiple keys as space-delimited since space is not
     // a valid character in a keyword. First, we need to look for the
     // customFlag in the existing flags;
-    nsCString customFlagString(customFlag);
-    int32_t existingCustomFlagPos = oldValue.Find(customFlagString, false, 0, -1);
+    nsDependentCString customFlagString(customFlag);
+    int32_t existingCustomFlagPos = oldValue.Find(customFlagString);
     uint32_t customFlagLen = customFlagString.Length();
     while (existingCustomFlagPos != kNotFound)
     {
       // if existing flags ends with this exact flag, or flag + ' '
       // and the flag is at the beginning of the string or there is ' ' + flag
       // then we have this flag already;
       if (((oldValue.Length() == existingCustomFlagPos + customFlagLen) ||
            (oldValue.CharAt(existingCustomFlagPos + customFlagLen) == ' ')) &&
            ((existingCustomFlagPos == 0) ||
             (oldValue.CharAt(existingCustomFlagPos - 1) == ' ')))
         return NS_OK;
       // else, advance to next flag
-      existingCustomFlagPos = oldValue.Find(customFlagString, false, existingCustomFlagPos + customFlagLen, -1);
+      existingCustomFlagPos = MsgFind(oldValue, customFlagString, false, existingCustomFlagPos + customFlagLen);
     }
     ourCustomFlags.Assign(oldValue);
     ourCustomFlags.AppendLiteral(" ");
     ourCustomFlags.Append(customFlag);
     m_customFlagsHash.Remove(uid);
   }
   else
   {