Bug 377319 Provide and use external API version of CaseInsensitiveFindInReadable r=Neil sr=bienvenu

This commit is contained in:
Jan Horak 2010-06-12 22:00:56 +01:00
Родитель 4a80ac54d3
Коммит a16d545d5f
5 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -639,7 +639,7 @@ nsMessenger::LoadURL(nsIDOMWindowInternal *aWin, const nsACString& aURL)
getDummyMsgHdr = PR_TRUE;
}
else if (StringBeginsWith(uriString, NS_LITERAL_STRING("mailbox:")) &&
(uriString.Find(NS_LITERAL_STRING(".eml?"), CaseInsensitiveCompare) != -1))
(CaseInsensitiveFindInReadable(NS_LITERAL_STRING(".eml?"), uriString)))
{
// if we have a mailbox:// url that points to an .eml file, we have to read
// the file size as well

Просмотреть файл

@ -375,6 +375,8 @@ NS_MSG_BASE PRUint64 ParseUint64Str(const char *str);
(dest).Append(NS_ConvertASCIItoUTF16(source))
#define Compare(str1, str2, comp) \
(str1).Compare(str2, comp)
#define CaseInsensitiveFindInReadable(what, str) \
((str).Find(what, CaseInsensitiveCompare) != kNotFound)
#define LossyAppendUTF16toASCII(source, dest) \
(dest).Append(NS_LossyConvertUTF16toASCII(source))
#define Last() \

Просмотреть файл

@ -504,7 +504,7 @@ nsresult nsMsgDownloadAllNewsgroups::AdvanceToNextGroup(PRBool *done)
if (!m_currentServer)
rv = AdvanceToNextServer(done);
else
rv = m_serverEnumerator->Next();
rv = m_serverEnumerator->Next();
if (NS_FAILED(rv))
rv = AdvanceToNextServer(done);

Просмотреть файл

@ -1868,7 +1868,7 @@ NS_IMETHODIMP nsMsgNewsFolder::SetSortOrder(PRInt32 order)
PRInt32 oldOrder = mSortOrder;
mSortOrder = order;
nsCOMPtr<nsIAtom> sortOrderAtom = do_GetAtom("SortOrder");
nsCOMPtr<nsIAtom> sortOrderAtom = MsgGetAtom("SortOrder");
// What to do if the atom can't be allocated?
NotifyIntPropertyChanged(sortOrderAtom, oldOrder, order);

Просмотреть файл

@ -66,6 +66,7 @@
#include "nsILineInputStream.h"
#include "nsNetUtil.h"
#include "nsISimpleEnumerator.h"
#include "nsMsgUtils.h"
#define INVALID_VERSION 0
#define VALID_VERSION 1
@ -131,8 +132,8 @@ nsNntpIncomingServer::nsNntpIncomingServer()
mLastUpdatedTime = 0;
// these atoms are used for subscribe search
mSubscribedAtom = do_GetAtom("subscribed");
mNntpAtom = do_GetAtom("nntp");
mSubscribedAtom = MsgGetAtom("subscribed");
mNntpAtom = MsgGetAtom("nntp");
// we have server wide and per group filters
m_canHaveFilters = PR_TRUE;
@ -1708,7 +1709,7 @@ nsresult
nsNntpIncomingServer::AppendIfSearchMatch(nsCString& newsgroupName)
{
NS_ConvertUTF8toUTF16 groupName(newsgroupName);
if (groupName.Find(mSearchValue, CaseInsensitiveCompare) != kNotFound)
if (CaseInsensitiveFindInReadable(mSearchValue, groupName))
mSubscribeSearchResult.AppendCString(newsgroupName);
return NS_OK;
}