Remedy patch for Bug 202388, runtime switch between system prefs and mozilla prefs. The original patch got sr=alecf, r=kyle.

This commit is contained in:
bolian.yin%sun.com 2003-06-17 05:52:04 +00:00
Родитель cabeb62746
Коммит 8442b87c63
2 изменённых файлов: 11 добавлений и 11 удалений

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

@ -441,11 +441,11 @@ NS_IMETHODIMP nsSystemPrefService::RemoveObserver(const char *aDomain, nsIObserv
NS_ENSURE_SUCCESS(rv, rv);
// need to find the index of observer, so we can remove it
PRInt32 count = mObservers->Count();
PRIntn count = mObservers->Count();
if (count <= 0)
return NS_OK;
PRInt32 i;
PRIntn i;
SysPrefCallbackData *pCallbackData;
for (i = 0; i < count; ++i) {
pCallbackData = (SysPrefCallbackData *)mObservers->ElementAt(i);
@ -591,7 +591,7 @@ GConfProxy::~GConfProxy()
mInitialized = PR_FALSE;
if (mGConfLib) {
// PR_UnloadLibrary(mGConfLib);
PR_UnloadLibrary(mGConfLib);
mGConfLib = nsnull;
}
if (mObservers) {
@ -734,11 +734,11 @@ GConfProxy::NotifyRemove (PRUint32 aAtom, const void *aUserData)
{
NS_ENSURE_TRUE(mInitialized, NS_ERROR_FAILURE);
PRInt32 count = mObservers->Count();
PRIntn count = mObservers->Count();
if (count <= 0)
return NS_OK;
PRInt32 i;
PRIntn i;
GConfCallbackData *pData;
for (i = 0; i < count; ++i) {
pData = (GConfCallbackData *)mObservers->ElementAt(i);

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

@ -234,16 +234,16 @@ nsSystemPref::UseSystemPrefs()
SYSPREF_LOG(("\n====Now Use system prefs==\n"));
nsresult rv = NS_OK;
if (!mSysPrefService) {
return NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
}
PRInt16 sysPrefCount= sizeof(sSysPrefList) / sizeof(sSysPrefList[0]);
PRIntn sysPrefCount= sizeof(sSysPrefList) / sizeof(sSysPrefList[0]);
if (!mSysPrefs) {
mSysPrefs = new SysPrefItem[sysPrefCount];
if (!mSysPrefs)
return NS_ERROR_OUT_OF_MEMORY;
for (PRInt16 index = 0; index < sysPrefCount; ++index)
for (PRIntn index = 0; index < sysPrefCount; ++index)
mSysPrefs[index].SetPrefName(sSysPrefList[index]);
}
@ -252,7 +252,7 @@ nsSystemPref::UseSystemPrefs()
if (!sysPrefBranchInternal)
return NS_ERROR_FAILURE;
for (PRInt16 index = 0; index < sysPrefCount; ++index) {
for (PRIntn index = 0; index < sysPrefCount; ++index) {
// save mozilla prefs
SaveMozDefaultPref(mSysPrefs[index].prefName,
&mSysPrefs[index].defaultValue,
@ -345,8 +345,8 @@ nsSystemPref::UseMozillaPrefs()
if (!sysPrefBranchInternal)
return NS_ERROR_FAILURE;
PRInt16 sysPrefCount= sizeof(sSysPrefList) / sizeof(sSysPrefList[0]);
for (PRInt16 index = 0; index < sysPrefCount; ++index) {
PRIntn sysPrefCount= sizeof(sSysPrefList) / sizeof(sSysPrefList[0]);
for (PRIntn index = 0; index < sysPrefCount; ++index) {
// restore mozilla default value and free string memory if needed
RestoreMozDefaultPref(mSysPrefs[index].prefName,
&mSysPrefs[index].defaultValue,