Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc

This commit is contained in:
jaggernaut%netscape.com 2001-10-27 11:28:06 +00:00
Родитель cad4ce97bb
Коммит 1903aa2e76
5 изменённых файлов: 23 добавлений и 30 удалений

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

@ -1017,7 +1017,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
EEditorType editorType = eHTMLTextEditorType;
// if the MIME type of the docment we are editing is text/plain, make a text editor
if (IsSupportedTextType(mContentMIMEType))
if (IsSupportedTextType(mContentMIMEType.get()))
{
editorFlags = nsIPlaintextEditor::eEditorPlaintextMask;
editorType = ePlainTextEditorType;
@ -1842,7 +1842,7 @@ nsEditorShell::SaveDocument(PRBool aSaveAs, PRBool aSaveCopy, const PRUnichar* a
if (!mEditor) return NS_ERROR_NOT_INITIALIZED;
nsCAutoString mimeTypeCStr; mimeTypeCStr.AssignWithConversion(aMimeType);
PRBool saveAsText = IsSupportedTextType(mimeTypeCStr);
PRBool saveAsText = IsSupportedTextType(mimeTypeCStr.get());
// Currently, we only understand plain text and html
if (!mimeTypeCStr.Equals("text/html") && !saveAsText)
@ -2018,7 +2018,7 @@ nsEditorShell::SaveDocument(PRBool aSaveAs, PRBool aSaveCopy, const PRUnichar* a
nsCAutoString fileExt(saveAsText ? "txt" : "html");
GetExtensionForMIMEType(mimeTypeCStr.get(), fileExt);
fileName.Append(PRUnichar('.'));
fileName.AppendWithConversion(fileExt);
fileName.AppendWithConversion(fileExt.get());
}
else // have a file spec
{
@ -2042,7 +2042,7 @@ nsEditorShell::SaveDocument(PRBool aSaveAs, PRBool aSaveCopy, const PRUnichar* a
// Truncate after "." and append "txt" extension
fileName.SetLength(index+1);
fileName.AppendWithConversion(fileExt);
fileName.AppendWithConversion(fileExt.get());
}
}
@ -5161,7 +5161,7 @@ nsresult nsEditorShell::EndPageLoad(nsIDOMWindow *aDOMWindow,
}
}
if ( !mContentMIMEType.Equals("text/html") && !IsSupportedTextType(mContentMIMEType) )
if ( !mContentMIMEType.Equals("text/html") && !IsSupportedTextType(mContentMIMEType.get()) )
{
mCloseWindowWhenLoaded = PR_TRUE;
mCantEditReason = eCantEditMimeType;

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

@ -1452,7 +1452,7 @@ nsPlaintextEditor::GetAndInitDocEncoder(const nsAReadableString& aFormatType,
nsCAutoString formatType(NS_DOC_ENCODER_CONTRACTID_BASE);
formatType.AppendWithConversion(aFormatType);
nsCOMPtr<nsIDocumentEncoder> docEncoder (do_CreateInstance(formatType, &rv));
nsCOMPtr<nsIDocumentEncoder> docEncoder (do_CreateInstance(formatType.get(), &rv));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc;

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

@ -898,7 +898,7 @@ nsPrefMigration::ProcessPrefsCallback(const char* oldProfilePathStr, const char
if (colonPos != -1 ) {
popServerNamewithoutPort.Truncate(colonPos);
rv = newPOPMailPath->AppendRelativeUnixPath(popServerNamewithoutPort);
rv = newPOPMailPath->AppendRelativeUnixPath(popServerNamewithoutPort.get());
}
else {
rv = newPOPMailPath->AppendRelativeUnixPath(popServerName);
@ -1309,7 +1309,7 @@ nsPrefMigration::GetDirFromPref(nsIFileSpec * oldProfilePath, nsIFileSpec * newP
if (NS_FAILED(rv)) return rv;
nsCString newleafname((const char *)leafname);
newleafname += NEW_DIR_SUFFIX;
rv = newPath->SetLeafName(newleafname);
rv = newPath->SetLeafName(newleafname.get());
if (NS_FAILED(rv)) return rv;
}
@ -2229,7 +2229,7 @@ convertPref(nsCString &aElement, void *aData)
PrefEnumerationClosure *closure;
closure = (PrefEnumerationClosure *)aData;
ConvertPrefToUTF8((const char *)aElement, closure->prefs, closure->charSet);
ConvertPrefToUTF8(aElement.get(), closure->prefs, closure->charSet);
return PR_TRUE;
}

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

@ -1306,10 +1306,10 @@ nsProfile::AddLevelOfIndirection(nsIFile *aDir)
}
saltStr.Append(kSaltExtensionCString);
#ifdef DEBUG_profile_verbose
printf("directory name: %s\n",(const char *)saltStr);
printf("directory name: %s\n",saltStr.get());
#endif
rv = aDir->Append((const char *)saltStr);
rv = aDir->Append(saltStr.get());
NS_ENSURE_SUCCESS(rv,rv);
exists = PR_FALSE;
@ -1428,13 +1428,10 @@ nsProfile::CreateNewProfileWithLocales(const PRUnichar* profileName,
{
printf("ProfileManager : CreateNewProfileWithLocales\n");
nsCAutoString temp1; temp1.AssignWithConversion(profileName);
printf("Profile Name: %s\n", NS_STATIC_CAST(const char*, temp1));
printf("Profile Name: %s\n", NS_LossyConvertUCS2toASCII(profileName).get());
if (nativeProfileDir) {
nsCAutoString temp2; temp2.AssignWithConversion(nativeProfileDir);
printf("Profile Dir: %s\n", NS_STATIC_CAST(const char*, temp2));
}
if (nativeProfileDir)
printf("Profile Dir: %s\n", NS_LossyConvertUCS2toASCII(nativeProfileDir).get());
}
#endif
@ -1639,10 +1636,10 @@ nsProfile::RenameProfile(const PRUnichar* oldName, const PRUnichar* newName)
printf("ProfileManager : Renaming profile\n");
nsCAutoString temp1; temp1.AssignWithConversion(oldName);
printf("Old name: %s\n", NS_STATIC_CAST(const char*, temp1));
printf("Old name: %s\n", NS_LossyConvertUCS2toASCII(oldName).get());
nsCAutoString temp2; temp2.AssignWithConversion(newName);
printf("New name: %s\n", NS_STATIC_CAST(const char*, temp2));
printf("New name: %s\n", NS_LossyConvertUCS2toASCII(newName).get());
}
#endif
@ -1824,8 +1821,7 @@ NS_IMETHODIMP nsProfile::StartApprunner(const PRUnichar* profileName)
{
printf("ProfileManager : StartApprunner\n");
nsCAutoString temp; temp.AssignWithConversion(profileName);
printf("profileName passed in: %s\n", NS_STATIC_CAST(const char*, temp));
printf("profileName passed in: %s\n", NS_LossyConvertUCS2toASCII(profileName).get());
}
#endif
@ -2227,7 +2223,7 @@ NS_IMETHODIMP nsProfile::CloneProfile(const PRUnichar* newProfile)
// Find a unique name in the dest dir
nsCAutoString suggestedName; suggestedName.AssignWithConversion(newProfile);
rv = destDir->CreateUnique(suggestedName, nsIFile::DIRECTORY_TYPE, 0775);
rv = destDir->CreateUnique(suggestedName.get(), nsIFile::DIRECTORY_TYPE, 0775);
if (NS_FAILED(rv)) return rv;
rv = RecursiveCopy(currProfileDir, destDir);

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

@ -1051,7 +1051,7 @@ nsProfileAccess::Get4xProfileInfo(const char *registryName)
rv = NS_NewFileSpec(getter_AddRefs(users4xDotNetscapeDirectory));
if (NS_FAILED(rv)) return rv;
rv = users4xDotNetscapeDirectory->SetNativePath((const char *)profileLocation);
rv = users4xDotNetscapeDirectory->SetNativePath(profileLocation.get());
if (NS_FAILED(rv)) return rv;
rv = users4xDotNetscapeDirectory->Exists(&exists);
@ -1070,7 +1070,7 @@ nsProfileAccess::Get4xProfileInfo(const char *registryName)
profileItem->profileName = NS_ConvertASCIItoUCS2(unixProfileName).get();
nsCOMPtr<nsILocalFile> localFile;
rv = NS_NewLocalFile(profileLocation, PR_TRUE, getter_AddRefs(localFile));
rv = NS_NewLocalFile(profileLocation.get(), PR_TRUE, getter_AddRefs(localFile));
if (NS_FAILED(rv)) return rv;
profileItem->SetResolvedProfileDir(localFile);
profileItem->isMigrated = PR_FALSE;
@ -1116,14 +1116,11 @@ nsProfileAccess::CheckRegString(const PRUnichar *profileName, char **info)
ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
if (!profileItem->NCHavePregInfo.IsEmpty()) {
nsCAutoString pregC;
pregC.AssignWithConversion(profileItem->NCHavePregInfo);
*info = nsCRT::strdup(NS_STATIC_CAST(const char*, pregC));
*info = ToNewCString(profileItem->NCHavePregInfo);
}
else
{
nsCAutoString noCString; noCString.AssignWithConversion(kRegistryNoString);
*info = nsCRT::strdup(NS_STATIC_CAST(const char*, noCString));
*info = ToNewCString(kRegistryNoString);
}
}
}
@ -1272,7 +1269,7 @@ nsresult ProfileStruct::InternalizeLocation(nsIRegistry *aRegistry, nsRegistryKe
// Decode the directory name to return the ordinary string
nsCAutoString regDataCString; regDataCString.AssignWithConversion(regData);
nsInputStringStream stream(regDataCString);
nsInputStringStream stream(regDataCString.get());
nsPersistentFileDescriptor descriptor;
char bigBuffer[MAX_PERSISTENT_DATA_SIZE + 1];