making string conversions explicit. scc

This commit is contained in:
mjudge%netscape.com 2000-04-26 01:13:55 +00:00
Родитель 38554ee1aa
Коммит 6622635cab
130 изменённых файлов: 729 добавлений и 492 удалений

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

@ -1249,7 +1249,7 @@ NS_IMETHODIMP nsChromeRegistry::InstallProvider(const nsCAutoString& aProviderTy
// the package arcs.
if (val.Find(":packages") != -1 && !aProviderType.Equals(nsCAutoString("package"))) {
// Get the literal for our base URL.
nsAutoString unistr(aBaseURL);
nsAutoString unistr;unistr.AssignWithConversion(aBaseURL);
nsCOMPtr<nsIRDFLiteral> literal;
mRDFService->GetLiteral(unistr.GetUnicode(), getter_AddRefs(literal));

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

@ -218,7 +218,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsString& aName, nsIDOMNode** aReturn)
nsCOMPtr<nsIDOMNode> attribute;
nsCOMPtr<nsIAtom> nameAtom;
PRInt32 nameSpaceID;
nsAutoString name(aName);
nsAutoString name; name.Assign(aName);
mContent->ParseAttributeString(aName, *getter_AddRefs(nameAtom),
nameSpaceID);

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

@ -3081,7 +3081,7 @@ nsDocument::OutputDocumentAs(nsIOutputStream* aStream,
{
nsresult rv = NS_OK;
nsAutoString charsetStr = aCharset;
nsAutoString charsetStr; charsetStr.Assign(aCharset);
if (charsetStr.Length() == 0)
{
rv = GetDocumentCharacterSet(charsetStr);

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

@ -130,7 +130,7 @@ nsCSSKeywords::LookupKeyword(const nsCString& aKeyword)
nsCSSKeyword
nsCSSKeywords::LookupKeyword(const nsString& aKeyword) {
nsCAutoString theKeyword(aKeyword);
nsCAutoString theKeyword; theKeyword.AssignWithConversion(aKeyword);
return LookupKeyword(theKeyword);
}

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

@ -136,7 +136,7 @@ nsCSSProps::LookupProperty(const nsCString& aProperty)
nsCSSProperty
nsCSSProps::LookupProperty(const nsString& aProperty) {
nsCAutoString theProp(aProperty);
nsCAutoString theProp; theProp.AssignWithConversion(aProperty);
return LookupProperty(theProp);
}

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

@ -242,7 +242,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL)
if (binding)
return NS_OK;
nsCAutoString url = aURL;
nsCAutoString url; url.AssignWithConversion(aURL);
if (NS_FAILED(rv = GetBinding(url, getter_AddRefs(binding)))) {
NS_ERROR("Failed loading an XBL document for content node.");
return rv;
@ -405,7 +405,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(const nsCString& aURLStr, nsIXBLBinding**
if (!tag) {
// We have a base class binding. Load it right now.
nsCOMPtr<nsIXBLBinding> baseBinding;
nsCAutoString url = value;
nsCAutoString url; url.AssignWithConversion(value);
GetBinding(url, getter_AddRefs(baseBinding));
if (!baseBinding)
return NS_OK; // At least we got the derived class binding loaded.

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

@ -148,7 +148,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
// The complex looking if above is to make sure that we do not erroneously
// think a value of "./this:that" would have a scheme of "./that"
nsCAutoString str(value);
nsCAutoString str; str.AssignWithConversion(value);
rv = MakeURI(str,nsnull,aURI);
if (NS_FAILED(rv))
@ -191,7 +191,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
} else {
// XXX Need to convert unicode to ???
// XXX Need to URL-escape string
nsCAutoString str(base);
nsCAutoString str; str.AssignWithConversion(base);
rv = MakeURI(str,docBase,aURI);
}
}

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

@ -3508,7 +3508,9 @@ nsXULElement::GetResource(nsIRDFResource** aResource)
}
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
rv = gRDFService->GetResource(nsCAutoString(id), aResource);
nsCAutoString idC;
idC.AssignWithConversion(id);
rv = gRDFService->GetResource(idC, aResource);
if (NS_FAILED(rv)) return rv;
}
else {

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

@ -191,12 +191,15 @@ nsElementMap::Add(const nsString& aID, nsIContent* aContent)
rv = tag->ToString(tagname);
if (NS_FAILED(rv)) return rv;
nsCAutoString tagnameC, aidC;
tagnameC.AssignWithConversion(tagname);
aidC.AssignWithConversion(aID);
PR_LOG(gMapLog, PR_LOG_ALWAYS,
("xulelemap(%p) dup %s[%p] <-- %s\n",
this,
(const char*) nsCAutoString(tagname),
(const char*) tagnameC,
aContent,
(const char*) nsCAutoString(aID)));
(const char*) aidC));
}
#endif
@ -225,12 +228,15 @@ nsElementMap::Add(const nsString& aID, nsIContent* aContent)
rv = tag->ToString(tagname);
if (NS_FAILED(rv)) return rv;
nsCAutoString tagnameC, aidC;
tagnameC.AssignWithConversion(tagname);
aidC.AssignWithConversion(aID);
PR_LOG(gMapLog, PR_LOG_ALWAYS,
("xulelemap(%p) add %s[%p] <-- %s\n",
this,
(const char*) nsCAutoString(tagname),
(const char*) tagnameC,
aContent,
(const char*) nsCAutoString(aID)));
(const char*)aidC));
}
#endif
@ -257,12 +263,15 @@ nsElementMap::Remove(const nsString& aID, nsIContent* aContent)
rv = tag->ToString(tagname);
if (NS_FAILED(rv)) return rv;
nsCAutoString tagnameC, aidC;
tagnameC.AssignWithConversion(tagname);
aidC.AssignWithConversion(aID);
PR_LOG(gMapLog, PR_LOG_ALWAYS,
("xulelemap(%p) remove %s[%p] <-- %s\n",
this,
(const char*) nsCAutoString(tagname),
(const char*) tagnameC,
aContent,
(const char*) nsCAutoString(aID)));
(const char*) aidC));
}
#endif

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

@ -170,13 +170,19 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement,
while (updater) {
if (updater->mElement == aElement) {
nsCAutoString eventsC, targetsC, aeventsC, atargetsC;
eventsC.AssignWithConversion(updater->mEvents);
targetsC.AssignWithConversion(updater->mTargets);
aeventsC.AssignWithConversion(aEvents);
atargetsC.AssignWithConversion(aTargets);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xulcmd[%p] replace %p(events=%s targets=%s) with (events=%s targets=%s)",
this, aElement,
(const char*) nsCAutoString(updater->mEvents),
(const char*) nsCAutoString(updater->mTargets),
(const char*) nsCAutoString(aEvents),
(const char*) nsCAutoString(aTargets)));
(const char*) eventsC,
(const char*) targetsC,
(const char*) aeventsC,
(const char*) atargetsC));
// If the updater was already in the list, then replace
// (?) the 'events' and 'targets' filters with the new
@ -189,12 +195,15 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement,
link = &(updater->mNext);
updater = updater->mNext;
}
nsCAutoString aeventsC, atargetsC;
aeventsC.AssignWithConversion(aEvents);
atargetsC.AssignWithConversion(aTargets);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xulcmd[%p] add %p(events=%s targets=%s)",
this, aElement,
(const char*) nsCAutoString(aEvents),
(const char*) nsCAutoString(aTargets)));
(const char*) aeventsC,
(const char*) atargetsC));
// If we get here, this is a new updater. Append it to the list.
updater = new Updater(aElement, aEvents, aTargets);
@ -217,11 +226,14 @@ nsXULCommandDispatcher::RemoveCommandUpdater(nsIDOMElement* aElement)
while (updater) {
if (updater->mElement == aElement) {
nsCAutoString eventsC, targetsC;
eventsC.AssignWithConversion(updater->mEvents);
targetsC.AssignWithConversion(updater->mTargets);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xulcmd[%p] remove %p(events=%s targets=%s)",
this, aElement,
(const char*) nsCAutoString(updater->mEvents),
(const char*) nsCAutoString(updater->mTargets)));
(const char*) eventsC,
(const char*) targetsC));
*link = updater->mNext;
delete updater;
@ -271,10 +283,12 @@ nsXULCommandDispatcher::UpdateCommands(const nsString& aEventName)
if (! document)
continue;
nsCAutoString aeventnameC;
aeventnameC.AssignWithConversion(aEventName);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xulcmd[%p] update %p event=%s",
this, updater->mElement,
(const char*) nsCAutoString(aEventName)));
(const char*) aeventnameC));
PRInt32 count = document->GetNumberOfShells();
for (PRInt32 i = 0; i < count; i++) {

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

@ -595,11 +595,13 @@ XULContentSinkImpl::OpenContainer(const nsIParserNode& aNode)
while (--count >= 0)
extraWhiteSpace += " ";
nsCAutoString textC;
textC.AssignWithConversion(text);
PR_LOG(gLog, PR_LOG_DEBUG,
("xul: %.5d. %s<%s>",
aNode.GetSourceLineNumber(),
NS_STATIC_CAST(const char*, extraWhiteSpace),
NS_STATIC_CAST(const char*, nsCAutoString(text))));
NS_STATIC_CAST(const char*, textC)));
}
#endif
@ -620,9 +622,11 @@ XULContentSinkImpl::OpenContainer(const nsIParserNode& aNode)
rv = ParseTag(aNode.GetText(), *getter_AddRefs(tag), nameSpaceID);
if (NS_FAILED(rv)) {
#ifdef PR_LOGGING
nsCAutoString anodeC;
anodeC.AssignWithConversion(aNode.GetText());
PR_LOG(gLog, PR_LOG_ALWAYS,
("xul: unrecognized namespace on '%s' at line %d",
NS_STATIC_CAST(const char*, nsCAutoString(aNode.GetText())),
NS_STATIC_CAST(const char*,anodeC),
aNode.GetSourceLineNumber()));
#endif
@ -669,11 +673,14 @@ XULContentSinkImpl::CloseContainer(const nsIParserNode& aNode)
while (--count > 0)
extraWhiteSpace += " ";
nsCAutoString textC;
textC.AssignWithConversion(text);
PR_LOG(gLog, PR_LOG_DEBUG,
("xul: %.5d. %s</%s>",
aNode.GetSourceLineNumber(),
NS_STATIC_CAST(const char*, extraWhiteSpace),
NS_STATIC_CAST(const char*, nsCAutoString(text))));
NS_STATIC_CAST(const char*, textC)));
}
#endif
@ -1285,9 +1292,11 @@ XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode, nsXULPrototypeElem
rv = ParseAttributeString(qname, *getter_AddRefs(name), nameSpaceID);
if (NS_FAILED(rv)) {
nsCAutoString qnameC;
qnameC.AssignWithConversion(qname);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xul: unable to parse attribute '%s' at line %d",
(const char*) nsCAutoString(qname), aNode.GetSourceLineNumber()));
(const char*) qnameC, aNode.GetSourceLineNumber()));
// Bring it. We'll just fail to copy an attribute that we
// can't parse. And that's one less attribute to worry
@ -1308,13 +1317,15 @@ XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode, nsXULPrototypeElem
PRInt32 cnt = mContextStack.Depth();
while (--cnt >= 0)
extraWhiteSpace += " ";
nsCAutoString qnameC,valueC;
qnameC.AssignWithConversion(qname);
valueC.AssignWithConversion(attrs->mValue);
PR_LOG(gLog, PR_LOG_DEBUG,
("xul: %.5d. %s %s=%s",
aNode.GetSourceLineNumber(),
NS_STATIC_CAST(const char*, extraWhiteSpace),
NS_STATIC_CAST(const char*, nsCAutoString(qname)),
NS_STATIC_CAST(const char*, nsCAutoString(attrs->mValue))));
NS_STATIC_CAST(const char*, qnameC),
NS_STATIC_CAST(const char*, valueC)));
}
#endif
@ -1490,9 +1501,11 @@ XULContentSinkImpl::OpenRoot(const nsIParserNode& aNode, PRInt32 aNameSpaceID, n
if (NS_FAILED(rv)) {
#ifdef PR_LOGGING
nsCAutoString anodeC;
anodeC.AssignWithConversion(aNode.GetText());
PR_LOG(gLog, PR_LOG_ALWAYS,
("xul: unable to create element '%s' at line %d",
NS_STATIC_CAST(const char*, nsCAutoString(aNode.GetText())),
NS_STATIC_CAST(const char*, anodeC),
aNode.GetSourceLineNumber()));
#endif
@ -1531,9 +1544,11 @@ XULContentSinkImpl::OpenTag(const nsIParserNode& aNode, PRInt32 aNameSpaceID, ns
rv = CreateElement(aNameSpaceID, aTag, &element);
if (NS_FAILED(rv)) {
nsCAutoString anodeC;
anodeC.AssignWithConversion(aNode.GetText());
PR_LOG(gLog, PR_LOG_ALWAYS,
("xul: unable to create element '%s' at line %d",
NS_STATIC_CAST(const char*, nsCAutoString(aNode.GetText())),
NS_STATIC_CAST(const char*, anodeC),
aNode.GetSourceLineNumber()));
return rv;

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

@ -3983,10 +3983,11 @@ nsXULDocument::OpenWidgetItem(nsIContent* aElement)
nsAutoString tagStr;
tag->ToString(tagStr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagStr);
PR_LOG(gXULLog, PR_LOG_DEBUG,
("xuldoc open-widget-item %s",
(const char*) nsCAutoString(tagStr)));
(const char*) tagstrC));
}
#endif
@ -4032,10 +4033,12 @@ nsXULDocument::CloseWidgetItem(nsIContent* aElement)
nsAutoString tagStr;
tag->ToString(tagStr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagStr);
PR_LOG(gXULLog, PR_LOG_DEBUG,
("xuldoc close-widget-item %s",
(const char*) nsCAutoString(tagStr)));
(const char*) tagstrC));
}
#endif
@ -4083,9 +4086,11 @@ nsXULDocument::RebuildWidgetItem(nsIContent* aElement)
nsAutoString tagStr;
tag->ToString(tagStr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagStr);
PR_LOG(gXULLog, PR_LOG_DEBUG,
("xuldoc close-widget-item %s",
(const char*) nsCAutoString(tagStr)));
(const char*) tagstrC));
}
#endif
@ -5136,9 +5141,11 @@ nsXULDocument::CreateElement(nsXULPrototypeElement* aPrototype, nsIContent** aRe
nsAutoString tagstr;
aPrototype->mTag->ToString(tagstr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagstr);
PR_LOG(gXULLog, PR_LOG_ALWAYS,
("xul: creating <%s> from prototype",
(const char*) nsCAutoString(tagstr)));
(const char*) tagstrC));
}
#endif
@ -5436,7 +5443,10 @@ nsXULDocument::CheckTemplateBuilder(nsIContent* aElement)
}
nsCOMPtr<nsIRDFDataSource> ds;
rv = gRDFService->GetDataSource(nsCAutoString(uriStr), getter_AddRefs(ds));
nsCAutoString uristrC;
uristrC.AssignWithConversion(uriStr);
rv = gRDFService->GetDataSource(uristrC, getter_AddRefs(ds));
if (NS_FAILED(rv)) {
// This is only a warning because the data source may not
@ -5444,9 +5454,9 @@ nsXULDocument::CheckTemplateBuilder(nsIContent* aElement)
// security, a bad URL, etc.
#ifdef DEBUG
nsCAutoString msg;
msg += "unable to load datasource '";
msg += nsCAutoString(uriStr);
msg += '\'';
msg.Append("unable to load datasource '");
msg.AppendWithConversion(uriStr);
msg.Append('\'');
NS_WARNING((const char*) msg);
#endif
continue;
@ -5573,10 +5583,11 @@ nsXULDocument::OverlayForwardReference::Resolve()
rv = Merge(target, mOverlay);
if (NS_FAILED(rv)) return eResolve_Error;
nsCAutoString idC;
idC.AssignWithConversion(id);
PR_LOG(gXULLog, PR_LOG_ALWAYS,
("xul: overlay resolved '%s'",
(const char*) nsCAutoString(id)));
(const char*) idC));
mResolved = PR_TRUE;
return eResolve_Succeeded;
@ -5668,9 +5679,11 @@ nsXULDocument::OverlayForwardReference::~OverlayForwardReference()
nsAutoString id;
mOverlay->GetAttribute(kNameSpaceID_None, kIdAtom, id);
nsCAutoString idC;
idC.AssignWithConversion(id);
PR_LOG(gXULLog, PR_LOG_ALWAYS,
("xul: overlay failed to resolve '%s'",
(const char*) nsCAutoString(id)));
(const char*) idC));
}
#endif
}
@ -5726,11 +5739,15 @@ nsXULDocument::BroadcasterHookup::~BroadcasterHookup()
rv = tag->ToString(tagStr);
if (NS_FAILED(rv)) return;
nsCAutoString tagstrC, attributeC,broadcasteridC;
tagstrC.AssignWithConversion(tagStr);
attributeC.AssignWithConversion(attribute);
broadcasteridC.AssignWithConversion(broadcasterID);
PR_LOG(gXULLog, PR_LOG_ALWAYS,
("xul: broadcaster hookup failed <%s attribute='%s'> to %s",
(const char*) nsCAutoString(tagStr),
(const char*) nsCAutoString(attribute),
(const char*) nsCAutoString(broadcasterID)));
(const char*) tagstrC,
(const char*) attributeC,
(const char*) broadcasteridC));
}
#endif
}
@ -5857,11 +5874,15 @@ nsXULDocument::CheckBroadcasterHookup(nsXULDocument* aDocument,
rv = tag2->ToString(tagStr);
if (NS_FAILED(rv)) return rv;
nsCAutoString tagstrC, attributeC,broadcasteridC;
tagstrC.AssignWithConversion(tagStr);
attributeC.AssignWithConversion(attribute);
broadcasteridC.AssignWithConversion(broadcasterID);
PR_LOG(gXULLog, PR_LOG_ALWAYS,
("xul: broadcaster hookup <%s attribute='%s'> to %s",
(const char*) nsCAutoString(tagStr),
(const char*) nsCAutoString(attribute),
(const char*) nsCAutoString(broadcasterID)));
(const char*) tagstrC,
(const char*) attributeC,
(const char*) broadcasteridC));
}
#endif

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

@ -530,7 +530,8 @@ nsXULContentUtils::GetElementRefResource(nsIContent* aElement, nsIRDFResource**
if (! url)
return NS_ERROR_UNEXPECTED;
nsCAutoString uriStr(uri);
nsCAutoString uriStr;
uriStr.AssignWithConversion(uri);
rv = rdf_MakeAbsoluteURI(url, uriStr);
if (NS_FAILED(rv)) return rv;
@ -766,7 +767,7 @@ nsXULContentUtils::MakeElementURI(nsIDocument* aDocument, const nsString& aEleme
if (aElementID.First() != '#') {
aURI.Append('#');
}
aURI.Append(nsCAutoString(aElementID));
aURI.AppendWithConversion(aElementID);
#else
nsXPIDLCString spec;
rv = NS_MakeAbsoluteURI(nsCAutoString(aElementID), docURL, getter_Copies(spec));

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

@ -4355,12 +4355,14 @@ nsXULTemplateBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
nsAutoString templatestr;
aTemplateNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, templatestr);
nsCAutoString templatestrC,tagstrC;
tagstrC.AssignWithConversion(tagstr);
templatestrC.AssignWithConversion(templatestr);
PR_LOG(gLog, PR_LOG_DEBUG,
("xultemplate[%p] build-content-from-template %s (template='%s') [%s]",
this,
(const char*) nsCAutoString(tagstr),
(const char*) nsCAutoString(templatestr),
(const char*) tagstrC,
(const char*) templatestrC,
(const char*) resourceCStr));
}
#endif
@ -4454,9 +4456,11 @@ nsXULTemplateBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) {
nsAutoString tagname;
tag->ToString(tagname);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagname);
PR_LOG(gLog, PR_LOG_DEBUG,
("xultemplate[%p] building %s %s %s",
this, (const char*) nsCAutoString(tagname),
this, (const char*) tagstrC,
(isResourceElement ? "[resource]" : ""),
(isUnique ? "[unique]" : "")));
}
@ -5132,11 +5136,14 @@ nsXULTemplateBuilder::RemoveMember(nsIContent* aContainerElement,
rv = aMember->GetValueConst(&resourceCStr);
if (NS_FAILED(rv)) return rv;
nsCAutoString childtagstrC,parenttagstrC;
parenttagstrC.AssignWithConversion(parentTagStr);
childtagstrC.AssignWithConversion(childTagStr);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xultemplate[%p] remove-member %s->%s [%s]",
this,
(const char*) nsCAutoString(parentTagStr),
(const char*) nsCAutoString(childTagStr),
(const char*) parenttagstrC,
(const char*) childtagstrC,
resourceCStr));
}
#endif
@ -5782,10 +5789,12 @@ nsXULTemplateBuilder::Log(const char* aOperation,
rv = gXULUtils->GetTextForNode(aTarget, targetStr);
if (NS_FAILED(rv)) return rv;
nsCAutoString targetstrC;
targetstrC.AssignWithConversion(targetStr);
PR_LOG(gLog, PR_LOG_DEBUG,
(" --[%s]-->[%s]",
propertyStr,
(const char*) nsCAutoString(targetStr)));
(const char*) targetstrC));
}
return NS_OK;
}
@ -6461,9 +6470,11 @@ nsresult nsXULTemplateBuilder::CompileConditions(Rule* aRule,
nsAutoString tagstr;
tag->ToString(tagstr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagstr);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xultemplate[%p] unrecognized condition test <%s>",
this, NS_STATIC_CAST(const char*, nsCAutoString(tagstr))));
this, NS_STATIC_CAST(const char*, tagstrC)));
#endif
continue;
}
@ -6726,9 +6737,11 @@ nsXULTemplateBuilder::CompileBindings(Rule* aRule,
nsAutoString tagstr;
tag->ToString(tagstr);
nsCAutoString tagstrC;
tagstrC.AssignWithConversion(tagstr);
PR_LOG(gLog, PR_LOG_ALWAYS,
("xultemplate[%p] unrecognized binding <%s>",
this, NS_STATIC_CAST(const char*, nsCAutoString(tagstr))));
this, NS_STATIC_CAST(const char*, tagstrC)));
#endif
continue;

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

@ -656,14 +656,14 @@ public:
NS_IMETHOD GetUndoString(nsString *aString)
{
if (aString)
*aString = "";
aString->SetLength(0);
return NS_OK;
}
NS_IMETHOD GetRedoString(nsString *aString)
{
if (aString)
*aString = "";
aString->SetLength(0) ;
return NS_OK;
}

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

@ -426,7 +426,7 @@ nsresult cookie_Get(nsInputFileStream strm, char& c) {
static PRInt32 next = BUFSIZE, count = BUFSIZE;
if (next == count) {
if (count < BUFSIZE) {
if (BUFSIZE > count) { // never say "count < ..." vc6.0 thinks this is a template beginning and crashes
next = BUFSIZE;
count = BUFSIZE;
return NS_ERROR_FAILURE;

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

@ -503,7 +503,7 @@ nsPSMComponent::GetControlConnection( CMT_CONTROL * *_retval )
if (NS_FAILED(rv)) return rv;
PRUnichar *ptrv = nsnull;
rv = stringBundle->GetStringFromName( nsString("FindText").GetUnicode(), &ptrv);
rv = stringBundle->GetStringFromName( NS_ConvertASCIItoUCS2("FindText").GetUnicode(), &ptrv);
if (NS_FAILED(rv)) return rv;
handler->PromptForFile(ptrv, PSM_FILE_NAME, PR_TRUE, &filePath);
@ -534,10 +534,11 @@ nsPSMComponent::GetControlConnection( CMT_CONTROL * *_retval )
if (NS_FAILED(rv)) goto failure;
CMTStatus psmStatus;
nsCAutoString profilenameC;
profilenameC.AssignWithConversion(profileName);
psmStatus = CMT_Hello( mControl,
PROTOCOL_VERSION,
nsCAutoString(profileName),
profilenameC,
(char*)profileSpec.GetNativePathCString());
if (psmStatus == CMTFailure)

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

@ -112,7 +112,7 @@ nsPSMUIHandlerImpl::PromptForFile(const PRUnichar *prompt, const char *fileRegEx
fp->Init(nsnull, prompt, nsIFilePicker::modeOpen);
fp->SetFilters(nsIFilePicker::filterAll);
fp->AppendFilter(nsAutoString(fileRegEx).GetUnicode(), nsAutoString(fileRegEx).GetUnicode());
fp->AppendFilter(NS_ConvertASCIItoUCS2(fileRegEx).GetUnicode(), NS_ConvertASCIItoUCS2(fileRegEx).GetUnicode());
PRInt16 mode;
nsresult rv = fp->Show(&mode);
@ -299,7 +299,7 @@ char * PromptUserCallback(void *arg, char *prompt, int isPasswd)
NS_WITH_PROXIED_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, NS_UI_THREAD_EVENTQ, &rv);
if (NS_SUCCEEDED(rv)) {
rv = dialog->PromptPassword(nsString(prompt).GetUnicode(), nsString(" ").GetUnicode(), &password, &value);
rv = dialog->PromptPassword(NS_ConvertASCIItoUCS2(prompt).GetUnicode(), NS_ConvertASCIItoUCS2(" ").GetUnicode(), &password, &value);
if (NS_SUCCEEDED(rv)) {
nsString a(password);
@ -326,7 +326,7 @@ char * FilePathPromptCallback(void *arg, char *prompt, char *fileRegEx, CMUint32
NS_WITH_PROXIED_SERVICE(nsIPSMUIHandler, handler, nsPSMUIHandlerImpl::GetCID(), NS_UI_THREAD_EVENTQ, &rv);
if(NS_SUCCEEDED(rv))
handler->PromptForFile(nsAutoString(prompt).GetUnicode(), fileRegEx, (PRBool)shouldFileExist, &filePath);
handler->PromptForFile(NS_ConvertASCIItoUCS2(prompt).GetUnicode(), fileRegEx, (PRBool)shouldFileExist, &filePath);
return filePath;
}

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

@ -342,7 +342,7 @@ nsPSMSocketInfo::GetHostName(char * *aHostName)
nsresult
nsPSMSocketInfo::SetHostName(char *aHostName)
{
mHostName.Assign(aHostName);
mHostName.AssignWithConversion(aHostName);
return NS_OK;
}

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

@ -295,7 +295,7 @@ nsSecureBrowserUIImpl::OnStatusChange(nsIChannel* aChannel,
if (NS_SUCCEEDED(res))
{
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Icon set to lock\n", this));
res = mSecurityButton->SetAttribute( "level", nsString("high") );
res = mSecurityButton->SetAttribute( NS_ConvertASCIItoUCS2("level"), NS_ConvertASCIItoUCS2("high") );
}
}
}
@ -304,7 +304,7 @@ nsSecureBrowserUIImpl::OnStatusChange(nsIChannel* aChannel,
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Icon set to broken\n", this));
mIsDocumentBroken = PR_TRUE;
res = mSecurityButton->SetAttribute( "level", nsString("broken") );
res = mSecurityButton->SetAttribute( NS_ConvertASCIItoUCS2("level"), NS_ConvertASCIItoUCS2("broken") );
}
}
else // if (aProgressStatusFlags == nsIWebProgress::flag_net_redirecting)
@ -359,7 +359,7 @@ nsSecureBrowserUIImpl::OnChildStatusChange(nsIChannel* aChannel, PRInt32 aProgre
}
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnChildStatusChange - Icon set to broken\n", this));
mSecurityButton->SetAttribute( "level", nsString("broken") );
mSecurityButton->SetAttribute( NS_ConvertASCIItoUCS2("level"), NS_ConvertASCIItoUCS2("broken") );
mIsDocumentBroken = PR_TRUE;
}
@ -406,13 +406,13 @@ void nsSecureBrowserUIImpl::GetBundleString(const nsString& name, nsString &outS
if (NS_SUCCEEDED(mStringBundle->GetStringFromName(name.GetUnicode(), &ptrv)))
outString = ptrv;
else
outString = "";
outString.SetLength(0);;
nsAllocator::Free(ptrv);
}
else
{
outString = "";
outString.SetLength(0);;
}
}
@ -432,7 +432,7 @@ nsSecureBrowserUIImpl::CheckProtocolContextSwitch( nsIURI* newURI, nsIURI* oldUR
// Check to see if we are going from a secure page to and insecure page
if ( !isNewSchemeSecure && isOldSchemeSecure)
{
mSecurityButton->RemoveAttribute( "level" );
mSecurityButton->RemoveAttribute( NS_ConvertASCIItoUCS2("level") );
if ((mPref->GetBoolPref(LEAVE_SITE_PREF, &boolpref) != 0))
boolpref = PR_TRUE;
@ -445,9 +445,9 @@ nsSecureBrowserUIImpl::CheckProtocolContextSwitch( nsIURI* newURI, nsIURI* oldUR
nsAutoString windowTitle, message, dontShowAgain;
GetBundleString("Title", windowTitle);
GetBundleString("LeaveSiteMessage", message);
GetBundleString("DontShowAgain", dontShowAgain);
GetBundleString(NS_ConvertASCIItoUCS2("Title"), windowTitle);
GetBundleString(NS_ConvertASCIItoUCS2("LeaveSiteMessage"), message);
GetBundleString(NS_ConvertASCIItoUCS2("DontShowAgain"), dontShowAgain);
PRBool outCheckValue = PR_TRUE;
dialog->AlertCheck(mWindow,
@ -481,9 +481,9 @@ nsSecureBrowserUIImpl::CheckProtocolContextSwitch( nsIURI* newURI, nsIURI* oldUR
nsAutoString windowTitle, message, dontShowAgain;
GetBundleString("Title", windowTitle);
GetBundleString("EnterSiteMessage", message);
GetBundleString("DontShowAgain", dontShowAgain);
GetBundleString(NS_ConvertASCIItoUCS2("Title"), windowTitle);
GetBundleString(NS_ConvertASCIItoUCS2("EnterSiteMessage"), message);
GetBundleString(NS_ConvertASCIItoUCS2("DontShowAgain"), dontShowAgain);
PRBool outCheckValue = PR_TRUE;
dialog->AlertCheck(mWindow,
@ -520,7 +520,7 @@ nsSecureBrowserUIImpl::CheckMixedContext(nsIURI* nextURI)
if (!secure && mIsSecureDocument)
{
mIsDocumentBroken = PR_TRUE;
mSecurityButton->SetAttribute( "level", nsString("broken") );
mSecurityButton->SetAttribute( NS_ConvertASCIItoUCS2("level"), NS_ConvertASCIItoUCS2("broken") );
if (!mPref) return NS_ERROR_NULL_POINTER;
@ -536,9 +536,9 @@ nsSecureBrowserUIImpl::CheckMixedContext(nsIURI* nextURI)
nsAutoString windowTitle, message, dontShowAgain;
GetBundleString("Title", windowTitle);
GetBundleString("MixedContentMessage", message);
GetBundleString("DontShowAgain", dontShowAgain);
GetBundleString(NS_ConvertASCIItoUCS2("Title"), windowTitle);
GetBundleString(NS_ConvertASCIItoUCS2("MixedContentMessage"), message);
GetBundleString(NS_ConvertASCIItoUCS2("DontShowAgain"), dontShowAgain);
PRBool outCheckValue = PR_TRUE;
@ -590,9 +590,9 @@ nsSecureBrowserUIImpl::CheckPost(nsIURI *actionURL, PRBool *okayToPost)
nsAutoString windowTitle, message, dontShowAgain;
GetBundleString("Title", windowTitle);
GetBundleString("PostToInsecure", message);
GetBundleString("DontShowAgain", dontShowAgain);
GetBundleString(NS_ConvertASCIItoUCS2("Title"), windowTitle);
GetBundleString(NS_ConvertASCIItoUCS2("PostToInsecure"), message);
GetBundleString(NS_ConvertASCIItoUCS2("DontShowAgain"), dontShowAgain);
PRBool outCheckValue = PR_TRUE;
dialog->ConfirmCheck(mWindow,

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

@ -1158,19 +1158,21 @@ PUBLIC nsresult
Wallet_Encrypt (nsAutoString text, nsAutoString& crypt) {
/* convert text from unichar to UTF8 */
nsAutoString UTF8text = "";
//STRING USE WARNING: this CANT be right. utf8 text should not be stored in autostring
nsAutoString UTF8text;
PRUnichar c;
for (PRUint32 i=0; i<text.Length(); i++) {
c = text.CharAt(i);
if (c <= 0x7F) {
UTF8text += (char)c;
UTF8text.Append(c);
} else if (c <= 0x7FF) {
UTF8text += ((PRUnichar)0xC0) | ((c>>6) & 0x1F);
UTF8text += ((PRUnichar)0x80) | (c & 0x3F);
UTF8text += PRUnichar((0xC0) | ((c>>6) & 0x1F));
UTF8text += PRUnichar((0x80) | (c & 0x3F));
} else {
UTF8text += ((PRUnichar)0xE0) | ((c>>12) & 0xF);
UTF8text += ((PRUnichar)0x80) | ((c>>6) & 0x3F);
UTF8text += ((PRUnichar)0x80) | (c & 0x3F);
UTF8text += PRUnichar((0xE0) | ((c>>12) & 0xF));
UTF8text += PRUnichar((0x80) | ((c>>6) & 0x3F));
UTF8text += PRUnichar((0x80) | (c & 0x3F));
}
}
@ -1189,7 +1191,7 @@ Wallet_Encrypt (nsAutoString text, nsAutoString& crypt) {
if NS_FAILED(rv) {
return rv;
}
crypt = cryptCString;
crypt.AssignWithConversion(cryptCString);
Recycle (cryptCString);
return NS_OK;
}
@ -1216,15 +1218,15 @@ Wallet_Decrypt(nsAutoString crypt, nsAutoString& text) {
/* convert text from UTF8 to unichar */
PRUnichar c;
text = "";
text.SetLength(0);
for (PRUint32 i=0; i<PL_strlen(UTF8textCString); ) {
c = (PRUnichar)UTF8textCString[i++];
if ((c & 0x80) == 0x00) {
text += c;
} else if ((c & 0xE0) == 0xC0) {
text += (((c & 0x1F)<<6) + ((PRUnichar)UTF8textCString[i++] & 0x3F));
text += (PRUnichar)(((c & 0x1F)<<6) + ((PRUnichar)UTF8textCString[i++] & 0x3F));
} else if ((c & 0xF0) == 0xE0) {
text += (((c & 0x0F)<<12) + (((PRUnichar)UTF8textCString[i++] & 0x3F)<<6)
text += (PRUnichar)(((c & 0x0F)<<12) + (((PRUnichar)UTF8textCString[i++] & 0x3F)<<6)
+ ((PRUnichar)UTF8textCString[i++] & 0x3F));
} else {
Recycle(UTF8textCString);

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

@ -133,7 +133,7 @@ nsColorNames::LookupName(const nsCString& aColorName)
nsColorName
nsColorNames::LookupName(const nsString& aColorName) {
nsCAutoString theName(aColorName);
nsCAutoString theName; theName.AssignWithConversion(aColorName);
return LookupName(theName);
}

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

@ -103,7 +103,7 @@ PRBool nsFont::EnumerateFamilies(nsFontFamilyEnumFunc aFunc, void* aData) const
{
PRBool running = PR_TRUE;
nsAutoString familyList(name); // copy to work buffer
nsAutoString familyList; familyList.Assign(name); // copy to work buffer
nsAutoString familyStr;
familyList.Append(kNullCh); // put an extra null at the end

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

@ -382,7 +382,7 @@ nsresult GetSysFontInfo(HDC aHDC, nsSystemAttrID anID, nsFont * aFont)
}
aFont->name = logFont->lfFaceName;
aFont->name.AssignWithConversion(logFont->lfFaceName);
// Do Style
aFont->style = NS_FONT_STYLE_NORMAL;
@ -509,7 +509,7 @@ NS_IMETHODIMP nsDeviceContextWin :: GetSystemAttribute(nsSystemAttrID anID, Syst
}
case eSystemAttr_Font_Widget:
aInfo->mFont->name = "Arial";
aInfo->mFont->name.AssignWithConversion("Arial");
aInfo->mFont->style = NS_FONT_STYLE_NORMAL;
aInfo->mFont->weight = NS_FONT_WEIGHT_NORMAL;
aInfo->mFont->decorations = NS_FONT_DECORATION_NONE;

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

@ -848,7 +848,7 @@ GetMap(const char* aName, PRUint32* aMap)
nsFontHasConverter* f = gFontsHaveConverters;
while (f->mName) {
if (!strcmp(f->mName, aName)) {
encoding = f->mEncoding;
encoding.AssignWithConversion(f->mEncoding);
break;
}
f++;
@ -891,7 +891,7 @@ GetConverter(const char* aName)
nsFontHasConverter* f = gFontsHaveConverters;
while (f->mName) {
if (!strcmp(f->mName, aName)) {
encoding = f->mEncoding;
encoding.AssignWithConversion(f->mEncoding);
break;
}
f++;
@ -2130,7 +2130,7 @@ nsFontMetricsWin::LookForFontWeightTable(HDC aDC, nsString* aName)
// Use lower case name for hash table searches. This eliminates
// keeping multiple font weights entries when the font name varies
// only by case.
nsAutoString low = *aName;
nsAutoString low; low.Assign(*aName);
low.ToLowerCase();
// See if the font weight has already been computed.
@ -2203,16 +2203,18 @@ nsFontMetricsWin::InitializeFamilyNames(void)
if (!gFamilyNames) {
return nsnull;
}
gGeneric = new nsString("");
gGeneric = new nsString;
if (!gGeneric) {
return nsnull;
}
nsFontFamilyName* f = gFamilyNameTable;
while (f->mName) {
nsString* name = new nsString(f->mName);
nsString* name = new nsString;
name->AssignWithConversion(f->mName);
nsString* winName;
if (f->mWinName) {
winName = new nsString(f->mWinName);
winName = new nsString;
winName->AssignWithConversion(f->mWinName);
}
else {
winName = gGeneric;
@ -2341,17 +2343,17 @@ nsFontMetricsWin::FindGenericFont(HDC aDC, PRUnichar aChar)
if (mTriedAllGenerics) {
return nsnull;
}
nsAutoString prefix("font.name.");
nsAutoString prefix; prefix.AssignWithConversion("font.name.");
if (mGeneric) {
prefix.Append(*mGeneric);
}
else {
prefix.Append("serif");
prefix.AppendWithConversion("serif");
}
char name[128];
if (mLangGroup) {
nsAutoString pref = prefix;
pref.Append('.');
pref.AppendWithConversion('.');
const PRUnichar* langGroup = nsnull;
mLangGroup->GetUnicode(&langGroup);
pref.Append(langGroup);

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

@ -54,7 +54,7 @@ int main(int argc, char** argv)
index = nsColorName(PRInt32(index) + 1);
nsColorNames::GetStringValue(index).ToCString(tagName, sizeof(tagName));
id = nsColorNames::LookupName(nsAutoString(tagName));
id = nsColorNames::LookupName(NS_ConvertASCIItoUCS2(tagName));
if (id == eColorName_UNKNOWN) {
printf("bug: can't find '%s'\n", tagName);
rv = -1;
@ -66,7 +66,7 @@ int main(int argc, char** argv)
// fiddle with the case to make sure we can still find it
tagName[0] = tagName[0] - 32;
id = nsColorNames::LookupName(nsAutoString(tagName));
id = nsColorNames::LookupName(NS_ConvertASCIItoUCS2(tagName));
if (id == eColorName_UNKNOWN) {
printf("bug: can't find '%s'\n", tagName);
rv = -1;
@ -78,7 +78,7 @@ int main(int argc, char** argv)
// Check that color lookup by name gets the right rgb value
nscolor rgb;
if (!NS_ColorNameToRGB(nsAutoString(tagName), &rgb)) {
if (!NS_ColorNameToRGB(NS_ConvertASCIItoUCS2(tagName), &rgb)) {
printf("bug: name='%s' didn't NS_ColorNameToRGB\n", tagName);
rv = -1;
}
@ -96,7 +96,7 @@ int main(int argc, char** argv)
char cbuf[50];
PR_snprintf(cbuf, sizeof(cbuf), "%02x%02x%02x", r, g, b);
nscolor hexrgb;
if (!NS_HexToRGB(nsAutoString(cbuf), &hexrgb)) {
if (!NS_HexToRGB(NS_ConvertASCIItoUCS2(cbuf), &hexrgb)) {
printf("bug: hex conversion to color of '%s' failed\n", cbuf);
rv = -1;
}
@ -109,7 +109,7 @@ int main(int argc, char** argv)
// Now make sure we don't find some garbage
for (int i = 0; i < (int) (sizeof(kJunkNames) / sizeof(const char*)); i++) {
const char* tag = kJunkNames[i];
id = nsColorNames::LookupName(nsAutoString(tag));
id = nsColorNames::LookupName(NS_ConvertASCIItoUCS2(tag));
if (id > eColorName_UNKNOWN) {
printf("bug: found '%s'\n", tag ? tag : "(null)");
rv = -1;

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

@ -654,8 +654,8 @@ nscolor white,black;
aSurface->SetFont(*font);
// clear surface
NS_ColorNameToRGB(nsAutoString("white"), &white);
NS_ColorNameToRGB(nsAutoString("red"), &black);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("red"), &black);
aSurface->SetColor(white);
aSurface->FillRect(0,0,1000,1000);
aSurface->SetColor(black);
@ -663,18 +663,18 @@ nscolor white,black;
aSurface->DrawArc(20, 20,50,100,(float)0.0,(float)90.0);
aSurface->FillArc(70, 20,50,100,(float)0.0,(float)90.0);
aSurface->DrawArc(150, 20,50,100,(float)90.0,(float)0.0);
aSurface->DrawString("0 to 90\0",20,8);
aSurface->DrawString("Reverse (eg 90 to 0)\0",120,8);
aSurface->DrawString(NS_ConvertASCIItoUCS2("0 to 90\0"),20,8);
aSurface->DrawString(NS_ConvertASCIItoUCS2("Reverse (eg 90 to 0)\0"),120,8);
aSurface->DrawArc(20, 140,100,50,(float)130.0,(float)180.0);
aSurface->FillArc(70, 140,100,50,(float)130.0,(float)180.0);
aSurface->DrawArc(150, 140,100,50,(float)180.0,(float)130.0);
aSurface->DrawString("130 to 180\0",20,130);
aSurface->DrawString(NS_ConvertASCIItoUCS2("130 to 180\0"),20,130);
aSurface->DrawArc(20, 200,50,100,(float)170.0,(float)300.0);
aSurface->FillArc(70, 200,50,100,(float)170.0,(float)300.0);
aSurface->DrawArc(150, 200,50,100,(float)300.0,(float)170.0);
aSurface->DrawString("170 to 300\0",20,190);
aSurface->DrawString(NS_ConvertASCIItoUCS2("170 to 300\0"),20,190);
return(30);
@ -694,14 +694,14 @@ nscolor white,black;
// clear surface
NS_ColorNameToRGB(nsAutoString("white"), &white);
NS_ColorNameToRGB(nsAutoString("black"), &black);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("black"), &black);
aSurface->SetColor(white);
aSurface->FillRect(0,0,1000,1000);
aSurface->SetColor(black);
aSurface->DrawRect(20, 20, 100, 100);
aSurface->DrawString("This is a Rectangle\0",20,5);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a Rectangle\0"),20,5);
aSurface->DrawLine(0,0,300,400);
@ -713,7 +713,7 @@ nscolor white,black;
pointlist[4].x = 175;pointlist[4].y = 175;
pointlist[5].x = 150;pointlist[5].y = 150;
aSurface->DrawPolygon(pointlist,6);
aSurface->DrawString("This is a closed Polygon\0",210,150);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a closed Polygon\0"),210,150);
delete [] pointlist;
#ifdef WINDOWSBROKEN
@ -724,12 +724,12 @@ nscolor white,black;
pointlist[3].x = 260;pointlist[3].y = 240;
pointlist[4].x = 225;pointlist[4].y = 225;
aSurface->DrawPolygon(pointlist,6);
aSurface->DrawString("This is an open Polygon\0",250,200);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an open Polygon\0"),250,200);
delete [] pointlist;
#endif
aSurface->DrawEllipse(30, 150,50,100);
aSurface->DrawString("This is an Ellipse\0",30,140);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an Ellipse\0"),30,140);
return(30);
@ -748,14 +748,14 @@ nscolor white,black;
aSurface->SetFont(*font);
// clear surface
NS_ColorNameToRGB(nsAutoString("white"), &white);
NS_ColorNameToRGB(nsAutoString("black"), &black);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("black"), &black);
aSurface->SetColor(white);
aSurface->FillRect(0,0,1000,1000);
aSurface->SetColor(black);
aSurface->FillRect(20, 20, 100, 100);
aSurface->DrawString("This is a Rectangle\0",20,5);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a Rectangle\0"),20,5);
pointlist = new nsPoint[6];
pointlist[0].x = 150;pointlist[0].y = 150;
@ -765,7 +765,7 @@ nscolor white,black;
pointlist[4].x = 175;pointlist[4].y = 175;
pointlist[5].x = 150;pointlist[5].y = 150;
aSurface->FillPolygon(pointlist,6);
aSurface->DrawString("This is a closed Polygon\0",210,150);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a closed Polygon\0"),210,150);
delete [] pointlist;
@ -777,12 +777,12 @@ nscolor white,black;
pointlist[3].x = 260;pointlist[3].y = 240;
pointlist[4].x = 225;pointlist[4].y = 225;
aSurface->FillPolygon(pointlist,6);
aSurface->DrawString("This is an open Polygon\0",250,200);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an open Polygon\0"),250,200);
delete [] pointlist;
#endif
aSurface->FillEllipse(30, 150,50,100);
aSurface->DrawString("This is an Ellipse\0",30,140);
aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an Ellipse\0"),30,140);
return(30);
}
@ -882,13 +882,13 @@ char *str;
if(aGenLoad == PR_TRUE)
{
MyBlendObserver *observer = new MyBlendObserver(aTheImage);
NS_ColorNameToRGB(nsAutoString("white"), &white);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);
gImageReq = gImageGroup->GetImage(fileURL,observer,&white, 0, 0, 0);
}
else
{
MyObserver *observer = new MyObserver();
NS_ColorNameToRGB(nsAutoString("white"), &white);
NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);
gImageReq = gImageGroup->GetImage(fileURL,observer,&white, 0, 0, 0);
}
@ -1137,7 +1137,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
NS_RELEASE(widget);
}
PRUint32 size;
gBlendMessage->SetText("50",size);
gBlendMessage->SetText(NS_ConvertASCIItoUCS2("50"),size);
rect.SetRect(70,370,40,25);
nsComponentManager::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gQualMessage);
@ -1146,7 +1146,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
widget->Create(gWindow, rect, nsnull, nsnull);
NS_RELEASE(widget);
}
gQualMessage->SetText("3",size);
gQualMessage->SetText(NS_ConvertASCIItoUCS2("3"),size);
::ShowWindow(window, SW_SHOW);
::UpdateWindow(window);

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

@ -217,7 +217,7 @@ NS_IMETHODIMP RobotSink::CloseFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode)
{
nsAutoString tmp(aNode.GetText());
nsAutoString tmp; tmp.Assign(aNode.GetText());
tmp.ToLowerCase();
if (tmp.EqualsWithConversion("a")) {
nsAutoString k, v;
@ -333,7 +333,7 @@ NS_IMETHODIMP RobotSink::RemoveObserver(nsIRobotSinkObserver* aObserver)
void RobotSink::ProcessLink(const nsString& aLink)
{
nsAutoString absURLSpec(aLink);
nsAutoString absURLSpec; absURLSpec.Assign(aLink);
// Make link absolute
// XXX base tag handling

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

@ -19,7 +19,9 @@ int main(int argc, char **argv)
if(gWorkList) {
int i;
for (i = 1; i < argc; i++) {
gWorkList->AppendElement(new nsString(argv[i]));
nsString *tempString = new nsString;
tempString->AssignWithConversion(argv[i]);
gWorkList->AppendElement(tempString);
}
}

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

@ -1097,7 +1097,7 @@ nsresult nsObserverTopic::Notify(eHTMLTags aTag,nsIParserNode& aNode,void* aUniq
mKeys.Push((PRUnichar*)mDTDKey.GetUnicode());
mValues.Push((PRUnichar*)mTopic.GetUnicode());
nsAutoString theTagStr(nsHTMLTags::GetStringValue(aTag));
nsAutoString theTagStr; theTagStr.AssignWithConversion(nsHTMLTags::GetStringValue(aTag));
nsObserverNotifier theNotifier(theTagStr.GetUnicode(),(nsISupports*)aUniqueID,&mKeys,&mValues);
theDeque->FirstThat(theNotifier);
result=theNotifier.mResult;

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

@ -217,7 +217,7 @@ nsHTMLContentSinkStream::InitEncoders()
// Initialize a charset encoder if we're using the stream interface
if (mStream)
{
nsAutoString charsetName = mCharsetOverride;
nsAutoString charsetName; charsetName.AssignWithConversion(mCharsetOverride);
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &res);
if (NS_SUCCEEDED(res) && calias) {
nsAutoString temp; temp.AssignWithConversion(mCharsetOverride);
@ -235,7 +235,7 @@ nsHTMLContentSinkStream::InitEncoders()
if (NS_FAILED(res))
return res;
// SaveAsCharset requires a const char* in its first argument:
nsCAutoString charsetCString (charsetName);
nsCAutoString charsetCString; charsetCString.AssignWithConversion(charsetName);
// For ISO-8859-1 only, convert to entity first (always generate entites like &nbsp;).
res = mCharsetEncoder->Init(charsetCString,
charsetName.EqualsIgnoreCase("ISO-8859-1") ?
@ -1030,7 +1030,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode)
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
if (tag == eHTMLTag_userdefined)
{
nsAutoString name = aNode.GetText();
nsAutoString name; name.Assign(aNode.GetText());
if (name.EqualsWithConversion("document_info"))
{
PRInt32 count=aNode.GetAttributeCount();
@ -1047,7 +1047,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode)
}
else if (key.EqualsWithConversion("uri"))
{
nsAutoString uristring (aNode.GetValueAt(i));
nsAutoString uristring; uristring.Assign(aNode.GetValueAt(i));
// strip double quotes from beginning and end
uristring.Trim("\"", PR_TRUE, PR_TRUE);

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

@ -175,7 +175,7 @@ nsHTMLEntities::EntityToUnicode(const nsCString& aEntity)
PRInt32
nsHTMLEntities::EntityToUnicode(const nsString& aEntity) {
nsCAutoString theEntity(aEntity);
nsCAutoString theEntity; theEntity.AssignWithConversion(aEntity);
if(';'==theEntity.Last()) {
theEntity.Truncate(theEntity.Length()-1);
}
@ -215,7 +215,7 @@ public:
// Make sure we can find everything we are supposed to
for (int i = 0; i < NS_HTML_ENTITY_COUNT; i++) {
nsAutoString entity(gEntityArray[i].mStr);
nsAutoString entity; entity.AssignWithConversion(gEntityArray[i].mStr);
value = nsHTMLEntities::EntityToUnicode(entity);
NS_ASSERTION(value != -1, "can't find entity");

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

@ -128,7 +128,7 @@ nsHTMLTags::LookupTag(const nsCString& aTag)
nsHTMLTag
nsHTMLTags::LookupTag(const nsString& aTag) {
nsCAutoString theTag(aTag);
nsCAutoString theTag; theTag.AssignWithConversion(aTag);
return LookupTag(theTag);
}

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

@ -86,7 +86,7 @@ nsresult nsHTMLToTXTSinkStream::InitEncoder(const nsString& aCharset)
(nsISupports**)&calias);
NS_ASSERTION( nsnull != calias, "cannot find charset alias");
nsAutoString charsetName = aCharset;
nsAutoString charsetName;charsetName.Assign(aCharset);
if( NS_SUCCEEDED(res) && (nsnull != calias))
{
res = calias->GetPreferred(aCharset, charsetName);

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

@ -548,7 +548,7 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
RecordTrailingContent((CStartToken*)aToken,aScanner);
if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
nsAutoString endTag(nsHTMLTags::GetStringValue(theTag));
nsAutoString endTag; endTag.AssignWithConversion(nsHTMLTags::GetStringValue(theTag));
endTag.InsertWithConversion("</",0,2);
CToken* textToken=theRecycler->CreateTokenOfType(eToken_text,theTag);
result=((CTextToken*)textToken)->ConsumeUntil(0,PRBool(theTag!=eHTMLTag_script),aScanner,endTag,mParseMode,aFlushTokens); //tell new token to finish consuming text...

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

@ -134,7 +134,7 @@ nsresult nsScanner::SetDocumentCharset(const nsString& aCharset , nsCharsetSourc
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &res);
NS_ASSERTION( nsnull != calias, "cannot find charset alias");
nsAutoString charsetName = aCharset;
nsAutoString charsetName; charsetName.Assign(aCharset);
if( NS_SUCCEEDED(res) && (nsnull != calias))
{
PRBool same = PR_FALSE;

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

@ -999,8 +999,8 @@ PRBool nsXIFDTD::GetAttributePair(nsIParserNode& aNode, nsString& aKey, nsString
const nsString& k = aNode.GetKeyAt(i);
const nsString& v = aNode.GetValueAt(i);
nsAutoString key(k);
nsAutoString value(v);
nsAutoString key; key.Assign(k);
nsAutoString value; value.Assign(v);
char* quote = "\"";
@ -1366,7 +1366,7 @@ nsresult nsXIFDTD::BeginCSSStyleSheet(const nsIParserNode& aNode)
nsresult nsXIFDTD::EndCSSStyleSheet(const nsIParserNode& aNode)
{
nsresult result=NS_OK;
nsAutoString tagName(nsHTMLTags::GetStringValue(eHTMLTag_style));
nsAutoString tagName(NS_ConvertASCIItoUCS2(nsHTMLTags::GetStringValue(eHTMLTag_style)));
mBuffer.AppendWithConversion("</");
mBuffer.Append(tagName);

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

@ -70,7 +70,7 @@ Compare(nsString& str, nsString& aFileName)
int different = 0;
while ((c = getc(file)) != EOF)
{
inString += c;
inString.AppendWithConversion(c);
// CVS isn't doing newline comparisons on these files for some reason.
// So compensate for possible newline problems in the CVS file:
if (c == '\n' && str[index] == '\r')
@ -122,7 +122,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
nsIHTMLContentSink* sink = nsnull;
// Create the appropriate output sink
if (outType == "text/html")
if (outType.EqualsWithConversion("text/html"))
rv = NS_New_HTML_ContentSinkStream(&sink, &outString, flags);
else // default to plaintext
@ -136,7 +136,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
parser->SetContentSink(sink);
nsIDTD* dtd = nsnull;
if (inType == "text/xif")
if (inType.EqualsWithConversion("text/xif"))
rv = NS_NewXIFDTD(&dtd);
else
rv = NS_NewNavHTMLDTD(&dtd);
@ -149,7 +149,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
parser->RegisterDTD(dtd);
char* inTypeStr = inType.ToNewCString();
rv = parser->Parse(inString, 0, inTypeStr, PR_FALSE, PR_TRUE);
rv = parser->Parse(inString, 0, NS_ConvertASCIItoUCS2(inTypeStr), PR_FALSE, PR_TRUE);
delete[] inTypeStr;
if (NS_FAILED(rv))
{
@ -176,8 +176,8 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
int main(int argc, char** argv)
{
nsString inType ("text/html");
nsString outType ("text/plain");
nsString inType; inType.AssignWithConversion("text/html");
nsString outType; outType.AssignWithConversion("text/plain");
int wrapCol = 72;
int flags = 0;
nsString compareAgainst;
@ -204,9 +204,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'i':
if (argv[0][2] != '\0')
inType = argv[0]+2;
inType.AssignWithConversion(argv[0]+2);
else {
inType = argv[1];
inType.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -214,9 +214,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'o':
if (argv[0][2] != '\0')
outType = argv[0]+2;
outType.AssignWithConversion(argv[0]+2);
else {
outType = argv[1];
outType.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -244,9 +244,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'c':
if (argv[0][2] != '\0')
compareAgainst = argv[0]+2;
compareAgainst.AssignWithConversion(argv[0]+2);
else {
compareAgainst = argv[1];
compareAgainst.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -278,7 +278,7 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
nsString inString;
char c;
while ((c = getc(file)) != EOF)
inString += c;
inString.AppendWithConversion(c);
if (file != stdin)
fclose(file);

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

@ -55,7 +55,7 @@ NS_IMPL_ISUPPORTS(nsI18nCompatibility, NS_GET_IID(nsII18nCompatibility));
NS_IMETHODIMP nsI18nCompatibility::CSIDtoCharsetName(PRUint16 csid, PRUnichar **_retval)
{
nsString charsetname(I18N_CSIDtoCharsetName(csid));
nsString charsetname; charsetname.AssignWithConversion(I18N_CSIDtoCharsetName(csid));
*_retval = charsetname.ToNewUnicode();

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

@ -79,13 +79,13 @@ nsresult nsCollationWin::Initialize(nsILocale* locale)
}
// default charset name
mCharset.Assign("ISO-8859-1");
mCharset.AssignWithConversion("ISO-8859-1");
// default LCID (en-US)
mLCID = 1033;
PRUnichar *aLocaleUnichar = NULL;
nsString aCategory("NSILOCALE_COLLATE");
nsString aCategory; aCategory.AssignWithConversion("NSILOCALE_COLLATE");
// get locale string, use app default if no locale specified
if (locale == nsnull) {
@ -162,7 +162,7 @@ nsresult nsCollationWin::CreateRawSortKey(const nsCollationStrength strength,
{
int byteLen;
nsresult res = NS_OK;
nsAutoString stringNormalized(stringIn);
nsAutoString stringNormalized; stringNormalized.Assign(stringIn);
if (mCollation != NULL && strength == kCollationCaseInSensitive) {
mCollation->NormalizeString(stringNormalized);

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

@ -53,7 +53,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS(nsDateTimeFormatWin, kIDateTimeFormatIID);
nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale)
{
PRUnichar *aLocaleUnichar = NULL;
nsString aCategory("NSILOCALE_TIME");
nsString aCategory; aCategory.AssignWithConversion("NSILOCALE_TIME");
nsresult res = NS_OK;
// use cached info if match with stored locale
@ -86,7 +86,7 @@ nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale)
}
// default charset name
mCharset.Assign("ISO-8859-1");
mCharset.AssignWithConversion("ISO-8859-1");
// default LCID (en-US)
mLCID = 1033;
@ -239,7 +239,7 @@ nsresult nsDateTimeFormatWin::FormatTMTime(nsILocale* locale,
NS_ASSERTION(NSDATETIMEFORMAT_BUFFER_LEN >= (PRUint32) (timeLen + 1), "internal time buffer is not large enough");
// Copy the result
stringOut.Assign("");
stringOut.SetLength(0);
if (dateLen != 0 && timeLen != 0) {
stringOut.Assign(dateBuffer, dateLen);
stringOut.Append((PRUnichar *)(L" "), 1);
@ -327,7 +327,7 @@ int nsDateTimeFormatWin::nsGetTimeFormatW(DWORD dwFlags, const SYSTEMTIME *lpTim
nsresult res = NS_OK;
if (mW_API) {
nsString formatString(format ? format : "");
nsString formatString; if (format) formatString.AssignWithConversion(format);
LPCWSTR wstr = format ? (LPCWSTR) formatString.GetUnicode() : NULL;
len = GetTimeFormatW(mLCID, dwFlags, lpTime, wstr, (LPWSTR) timeStr, cchTime);
}
@ -355,7 +355,7 @@ int nsDateTimeFormatWin::nsGetDateFormatW(DWORD dwFlags, const SYSTEMTIME *lpDat
nsresult res = NS_OK;
if (mW_API) {
nsString formatString(format ? format : "");
nsString formatString; if (format) formatString.AssignWithConversion(format);
LPCWSTR wstr = format ? (LPCWSTR) formatString.GetUnicode() : NULL;
len = GetDateFormatW(mLCID, dwFlags, lpDate, wstr, (LPWSTR) dataStr, cchDate);
}

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

@ -64,7 +64,7 @@ public:
nsString& stringOut);
nsDateTimeFormatWin() {NS_INIT_REFCNT();
mLocale.Assign("");mAppLocale.Assign("");}
mLocale.SetLength(0);mAppLocale.SetLength(0);}
virtual ~nsDateTimeFormatWin() {}

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

@ -463,13 +463,13 @@ nsIWin32LocaleImpl::GetXPLocale(LCID winLCID, nsString* locale)
if (sublang_id == iso_list[i].sublang_list[j].win_code) {
PR_snprintf(rfc_locale_string,9,"%s-%s%c",iso_list[i].iso_code,
iso_list[i].sublang_list[j].iso_code,0);
*locale = rfc_locale_string;
locale->AssignWithConversion(rfc_locale_string);
return NS_OK;
}
}
// no sublang, so just lang
PR_snprintf(rfc_locale_string,9,"%s%c",iso_list[i].iso_code,0);
*locale = rfc_locale_string;
locale->AssignWithConversion(rfc_locale_string);
return NS_OK;
}
}

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

@ -87,7 +87,7 @@ PRBool TestASCIILB(nsILineBreaker *lb,
const char* in, const PRUint32 len,
const PRUint32* out, PRUint32 outlen)
{
nsAutoString eng1(in);
nsAutoString eng1; eng1.AssignWithConversion(in);
PRUint32 i,j;
PRUint32 res[256];
PRBool ok = PR_TRUE;
@ -145,7 +145,7 @@ PRBool TestASCIIWB(nsIWordBreaker *lb,
const char* in, const PRUint32 len,
const PRUint32* out, PRUint32 outlen)
{
nsAutoString eng1(in);
nsAutoString eng1; eng1.AssignWithConversion(in);
// nsBreakState bk(eng1.GetUnicode(), eng1.Length());
PRUint32 i,j;
@ -235,7 +235,7 @@ PRBool TestLineBreaker()
cout << "Test 3 - GetLineBreaker():\n";
nsILineBreaker *lb;
nsAutoString lb_arg("");
nsAutoString lb_arg;
res = t->GetBreaker(lb_arg, &lb);
if(NS_FAILED(res) || (lb == NULL)) {
cout << "GetBreaker(nsILineBreaker*) failed\n";
@ -319,7 +319,7 @@ PRBool TestWordBreaker()
cout << "Test 3 - GetWordBreaker():\n";
nsIWordBreaker *lb;
nsAutoString lb_arg("");
nsAutoString lb_arg;
res = t->GetBreaker(lb_arg, &lb);
if(NS_FAILED(res) || (lb == NULL)) {
cout << "GetBreaker(nsIWordBreaker*) failed\n";
@ -422,15 +422,15 @@ void SamplePrintWordWithBreak()
(nsISupports**) &t);
nsIWordBreaker *wbk;
nsAutoString wb_arg("");
nsAutoString wb_arg;
res = t->GetBreaker(wb_arg, &wbk);
nsAutoString result("");
nsAutoString tmp("");
nsAutoString result;
nsAutoString tmp;
for(PRUint32 i = 0; i < numOfFragment; i++)
{
nsAutoString fragText(wb[i]);
nsAutoString fragText; fragText.AssignWithConversion(wb[i]);
// nsBreakState bk(fragText.GetUnicode(), fragText.Length());
PRUint32 cur = 0;
@ -439,22 +439,22 @@ void SamplePrintWordWithBreak()
PRUint32 start = 0;
for(PRUint32 j = 0; ! done ; j++)
{
tmp="";
tmp.SetLength(0);
fragText.Mid(tmp, start, cur - start);
result.Append(tmp);
result.Append("^");
result.AppendWithConversion("^");
start = cur;
wbk->Next(fragText.GetUnicode(), fragText.Length(), cur, &cur, &done);
}
tmp="";
tmp.SetLength(0);
fragText.Mid(tmp, start, fragText.Length() - start);
result.Append(tmp);
if( i != (numOfFragment -1 ))
{
nsAutoString nextFragText(wb[i+1]);
nsAutoString nextFragText; nextFragText.AssignWithConversion(wb[i+1]);
PRBool canBreak = PR_TRUE;
res = wbk->BreakInBetween( fragText.GetUnicode(),
@ -464,7 +464,7 @@ void SamplePrintWordWithBreak()
&canBreak
);
if(canBreak)
result.Append("^");
result.AppendWithConversion("^");
fragText = nextFragText;
}
@ -483,16 +483,16 @@ void SampleFindWordBreakFromPosition(PRUint32 fragN, PRUint32 offset)
(nsISupports**) &t);
nsIWordBreaker *wbk;
nsAutoString wb_arg("");
nsAutoString wb_arg;
res = t->GetBreaker(wb_arg, &wbk);
nsAutoString fragText(wb[fragN]);
nsAutoString fragText; fragText.AssignWithConversion(wb[fragN]);
PRUint32 begin, end;
nsAutoString result("");
nsAutoString result;
res = wbk->FindWord(fragText.GetUnicode(), fragText.Length(),
offset, &begin, &end);
@ -504,7 +504,7 @@ void SampleFindWordBreakFromPosition(PRUint32 fragN, PRUint32 offset)
nsAutoString curFragText = fragText;
for(PRUint32 p = fragN +1; p < numOfFragment ;p++)
{
nsAutoString nextFragText(wb[p]);
nsAutoString nextFragText; nextFragText.AssignWithConversion(wb[p]);
res = wbk->BreakInBetween(curFragText.GetUnicode(),
curFragText.Length(),
nextFragText.GetUnicode(),
@ -517,7 +517,7 @@ void SampleFindWordBreakFromPosition(PRUint32 fragN, PRUint32 offset)
res = wbk->FindWord(nextFragText.GetUnicode(), nextFragText.Length(),
0, &b, &e);
nsAutoString tmp("");
nsAutoString tmp;
nextFragText.Mid(tmp,b,e-b);
result.Append(tmp);
@ -533,7 +533,7 @@ void SampleFindWordBreakFromPosition(PRUint32 fragN, PRUint32 offset)
nsAutoString curFragText = fragText;
for(PRUint32 p = fragN ; p > 0 ;p--)
{
nsAutoString prevFragText(wb[p-1]);
nsAutoString prevFragText; prevFragText.AssignWithConversion(wb[p-1]);
res = wbk->BreakInBetween(prevFragText.GetUnicode(),
prevFragText.Length(),
curFragText.GetUnicode(),
@ -546,7 +546,7 @@ void SampleFindWordBreakFromPosition(PRUint32 fragN, PRUint32 offset)
res = wbk->FindWord(prevFragText.GetUnicode(), prevFragText.Length(),
prevFragText.Length(), &b, &e);
nsAutoString tmp("");
nsAutoString tmp;
prevFragText.Mid(tmp,b,e-b);
result.Insert(tmp,0);

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

@ -62,7 +62,7 @@ nsWinCharset::nsWinCharset()
// XXX We should make the following block critical section
if(nsnull == gInfo)
{
nsAutoString propertyURL("resource:/res/wincharset.properties");
nsAutoString propertyURL; propertyURL.AssignWithConversion("resource:/res/wincharset.properties");
nsURLProperties *info = new nsURLProperties( propertyURL );
NS_ASSERTION( info , " cannot create nsURLProperties");
@ -73,16 +73,16 @@ nsWinCharset::nsWinCharset()
{
UINT acp = ::GetACP();
PRInt32 acpint = (PRInt32)(acp & 0x00FFFF);
nsAutoString acpKey("acp.");
acpKey.Append(acpint, 10);
nsAutoString acpKey; acpKey.AssignWithConversion("acp.");
acpKey.AppendInt(acpint, 10);
nsresult res = gInfo->Get(acpKey, mCharset);
if(NS_FAILED(res)) {
mCharset = "windows-1252";
mCharset.AssignWithConversion("windows-1252");
}
} else {
mCharset = "windows-1252";
mCharset.AssignWithConversion("windows-1252");
}
}
nsWinCharset::~nsWinCharset()
@ -108,7 +108,7 @@ nsWinCharset::GetDefaultCharsetForLocale(const PRUnichar* localeName, PRUnichar*
nsCOMPtr<nsIWin32Locale> winLocale;
LCID localeAsLCID;
char acp_name[6];
nsString charset("windows-1252");
nsString charset;charset.AssignWithConversion("windows-1252");
nsString localeAsNSString(localeName);
//
@ -126,8 +126,8 @@ nsWinCharset::GetDefaultCharsetForLocale(const PRUnichar* localeName, PRUnichar*
//
if (!gInfo) { *_retValue = charset.ToNewUnicode(); return NS_ERROR_OUT_OF_MEMORY; }
nsAutoString acp_key("acp.");
acp_key.Append(acp_name);
nsAutoString acp_key; acp_key.AssignWithConversion("acp.");
acp_key.AppendWithConversion(acp_name);
result = gInfo->Get(acp_key,charset);
*_retValue = charset.ToNewUnicode();

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

@ -229,8 +229,8 @@ nsresult nsTestUConv::TestCharsetManager()
}
// test alias resolving capability
nsAutoString csAlias("iso-10646-ucs-basic");
nsAutoString csName("UTF-16BE");
nsAutoString csAlias; csAlias.AssignWithConversion("iso-10646-ucs-basic");
nsAutoString csName; csName.AssignWithConversion("UTF-16BE");
res = ccMan->GetCharsetAtom(csAlias.GetUnicode(), getter_AddRefs(csAtom));
if (NS_FAILED(res)) {
mLog.PrintError("GetCharsetAtom()", res);
@ -247,7 +247,7 @@ nsresult nsTestUConv::TestCharsetManager()
}
// test self returning if alias was not found
nsAutoString csAlias2("Totally_dummy_charset_name");
nsAutoString csAlias2; csAlias2.AssignWithConversion("Totally_dummy_charset_name");
res = ccMan->GetCharsetAtom(csAlias2.GetUnicode(), getter_AddRefs(csAtom));
if (NS_FAILED(res)) {
mLog.PrintError("GetCharsetAtom()", res);
@ -320,7 +320,7 @@ nsresult nsTestUConv::DisplayDetectors()
str.ToCString(buff, BUFFER_SIZE);
res = ccMan->GetCharsetTitle2(cs, &str);
if (NS_FAILED(res)) str.Assign("");
if (NS_FAILED(res)) str.SetLength(0);
str.ToCString(buff2, BUFFER_SIZE);
printf("%s", buff);
@ -395,7 +395,7 @@ nsresult nsTestUConv::DisplayCharsets()
str.ToCString(buff, BUFFER_SIZE);
res = ccMan->GetCharsetTitle2(cs, &str);
if (NS_FAILED(res)) str.Assign("");
if (NS_FAILED(res)) str.SetLength(0);
str.ToCString(buff2, BUFFER_SIZE);
printf("%s", buff);
@ -413,22 +413,22 @@ nsresult nsTestUConv::DisplayCharsets()
printf(" ");
prop.Assign(".notForBrowser");
prop.AssignWithConversion(".notForBrowser");
res = ccMan->GetCharsetData2(cs, prop.GetUnicode(), &str);
if ((dec != NULL) && (NS_FAILED(res))) printf ("B");
else printf("X");
prop.Assign(".notForComposer");
prop.AssignWithConversion(".notForComposer");
res = ccMan->GetCharsetData2(cs, prop.GetUnicode(), &str);
if ((enc != NULL) && (NS_FAILED(res))) printf ("C");
else printf("X");
prop.Assign(".notForMailView");
prop.AssignWithConversion(".notForMailView");
res = ccMan->GetCharsetData2(cs, prop.GetUnicode(), &str);
if ((dec != NULL) && (NS_FAILED(res))) printf ("V");
else printf("X");
prop.Assign(".notForMailEdit");
prop.AssignWithConversion(".notForMailEdit");
res = ccMan->GetCharsetData2(cs, prop.GetUnicode(), &str);
if ((enc != NULL) && (NS_FAILED(res))) printf ("E");
else printf("X");
@ -446,7 +446,7 @@ nsresult nsTestUConv::TestTempBug()
mLog.AddTrace(trace);
nsresult res = NS_OK;
nsAutoString charset("ISO-2022-JP");
nsAutoString charset; charset.AssignWithConversion("ISO-2022-JP");
PRUnichar src[] = {0x0043, 0x004e, 0x0045, 0x0054, 0x0020, 0x004A, 0x0061,
0x0070, 0x0061, 0x006E, 0x0020, 0x7DE8, 0x96C6, 0x5C40};
PRUnichar * srcEnd = src + ARRAY_SIZE(src);

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

@ -114,7 +114,7 @@ int main(int argc, const char** argv)
if(strcmp(argv[i], "-f") == 0)
{
tocodeind = i+1;
nsAutoString str(argv[tocodeind]);
nsAutoString str; str.AssignWithConversion(argv[tocodeind]);
res = ccMain->GetUnicodeDecoder(&str, &decoder);
if(NS_FAILED(res)) {
fprintf(stderr, "Cannot get Unicode decoder %s %x\n",
@ -126,7 +126,7 @@ int main(int argc, const char** argv)
if(strcmp(argv[i], "-t") == 0)
{
fromcodeind = i+1;
nsAutoString str(argv[fromcodeind]);
nsAutoString str; str.AssignWithConversion(argv[fromcodeind]);
res = ccMain->GetUnicodeEncoder(&str, &encoder);
if(NS_FAILED(res)) {
fprintf(stderr, "Cannot get Unicode encoder %s %x\n",

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

@ -154,7 +154,7 @@ nsresult testCharsetConverterManager()
#define CREATE_DECODER(_charset) \
nsIUnicodeDecoder * dec; \
nsAutoString str(_charset); \
nsAutoString str;str.AssignWithConversion(_charset); \
nsresult res = ccMan->GetUnicodeDecoder(&str,&dec); \
if (NS_FAILED(res)) { \
printf("ERROR at GetUnicodeDecoder() code=0x%x.\n",res); \
@ -163,7 +163,7 @@ nsresult testCharsetConverterManager()
#define CREATE_ENCODER(_charset) \
nsIUnicodeEncoder * enc; \
nsAutoString str(_charset); \
nsAutoString str; str.AssignWithConversion(_charset); \
nsresult res = ccMan->GetUnicodeEncoder(&str,&enc); \
if (NS_FAILED(res)) { \
printf("ERROR at GetUnicodeEncoder() code=0x%x.\n",res); \

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

@ -98,7 +98,7 @@ int main(int argc, const char** argv)
// First check if a charset alias was given,
// and convert to the canonical name
res = aliasmgr->GetPreferred(argv[i+1], str);
res = aliasmgr->GetPreferred(NS_ConvertASCIItoUCS2(argv[i+1]), str);
if (NS_FAILED(res))
{
fprintf(stderr, "Cannot get charset alias for %s %x\n",
@ -123,7 +123,7 @@ int main(int argc, const char** argv)
// First check if a charset alias was given,
// and convert to the canonical name
res = aliasmgr->GetPreferred(argv[i+1], str);
res = aliasmgr->GetPreferred(NS_ConvertASCIItoUCS2(argv[i+1]), str);
if (NS_FAILED(res))
{
fprintf(stderr, "Cannot get charset alias for %s %x\n",

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

@ -36,7 +36,7 @@ main(int argc, const char** argv)
nsCOMPtr<nsILocaleService> locale_service;
nsCOMPtr<nsILocale> locale;
nsCOMPtr<nsIPlatformCharset> platform_charset;
nsString locale_category("NSILOCALE_MESSAGES");
nsString locale_category; locale_category.AssignWithConversion("NSILOCALE_MESSAGES");
PRUnichar* category_value, *charset;
nsString categoryAsNSString, charsetAsNSString;
@ -57,7 +57,7 @@ main(int argc, const char** argv)
categoryAsNSString = category_value;
printf("DefaultCharset for %s is %s\n",categoryAsNSString.ToNewCString(),charsetAsNSString.ToNewCString());
categoryAsNSString = "en-US";
categoryAsNSString.AssignWithConversion("en-US");
rv = platform_charset->GetDefaultCharsetForLocale(categoryAsNSString.GetUnicode(),&charset);
if (NS_FAILED(rv)) return -1;

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

@ -218,7 +218,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsString& aName, nsIDOMNode** aReturn)
nsCOMPtr<nsIDOMNode> attribute;
nsCOMPtr<nsIAtom> nameAtom;
PRInt32 nameSpaceID;
nsAutoString name(aName);
nsAutoString name; name.Assign(aName);
mContent->ParseAttributeString(aName, *getter_AddRefs(nameAtom),
nameSpaceID);

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

@ -3081,7 +3081,7 @@ nsDocument::OutputDocumentAs(nsIOutputStream* aStream,
{
nsresult rv = NS_OK;
nsAutoString charsetStr = aCharset;
nsAutoString charsetStr; charsetStr.Assign(aCharset);
if (charsetStr.Length() == 0)
{
rv = GetDocumentCharacterSet(charsetStr);

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

@ -111,7 +111,7 @@ void nsXIFConverter::BeginStartTag(const nsString& aTag)
void nsXIFConverter::BeginStartTag(nsIAtom* aTag)
{
nsAutoString tag(mNULL);
nsAutoString tag; tag.Assign(mNULL);
if (nsnull != aTag)
aTag->ToString(tag);

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

@ -58,5 +58,5 @@ void XXXNeverCalled()
NS_NewSimplePageSequenceFrame(ps, &f);
nsINameSpaceManager* nsm;
NS_NewNameSpaceManager(&nsm);
NS_CreateHTMLElement(nsnull, "");
NS_CreateHTMLElement(nsnull, nsAutoString());
}

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

@ -130,7 +130,7 @@ nsCSSKeywords::LookupKeyword(const nsCString& aKeyword)
nsCSSKeyword
nsCSSKeywords::LookupKeyword(const nsString& aKeyword) {
nsCAutoString theKeyword(aKeyword);
nsCAutoString theKeyword; theKeyword.AssignWithConversion(aKeyword);
return LookupKeyword(theKeyword);
}

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

@ -136,7 +136,7 @@ nsCSSProps::LookupProperty(const nsCString& aProperty)
nsCSSProperty
nsCSSProps::LookupProperty(const nsString& aProperty) {
nsCAutoString theProp(aProperty);
nsCAutoString theProp; theProp.AssignWithConversion(aProperty);
return LookupProperty(theProp);
}

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

@ -44,8 +44,8 @@ void testAttributes(nsIHTMLContent* content) {
nsIAtom* sHEIGHT = NS_NewAtom("height");
nsIAtom* sSRC = NS_NewAtom("src");
nsIAtom* sBAD = NS_NewAtom("badattribute");
nsString sempty("");
nsString sfoo_gif("foo.gif");
nsString sempty;
nsString sfoo_gif; sfoo_gif.AssignWithConversion("foo.gif");
content->SetHTMLAttribute(sBORDER, nullValue, PR_FALSE);
content->SetHTMLAttribute(sWIDTH, nsHTMLValue(5, eHTMLUnit_Pixel), PR_FALSE);
@ -118,53 +118,53 @@ void testStrings(nsIDocument* aDoc) {
PRBool val;
// regular Equals
val = (nsString("mrString")).Equals(nsString("mrString"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("mrString");
if (PR_TRUE != val) {
printf("test 0 failed\n");
}
val = (nsString("mrString")).Equals(nsString("MRString"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("MRString");
if (PR_FALSE != val) {
printf("test 1 failed\n");
}
val = (nsString("mrString")).Equals(nsString("mrStri"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("mrStri");
if (PR_FALSE != val) {
printf("test 2 failed\n");
}
val = (nsString("mrStri")).Equals(nsString("mrString"));
val = (NS_ConvertASCIItoUCS2("mrStri")).EqualsWithConversion("mrString");
if (PR_FALSE != val) {
printf("test 3 failed\n");
}
// EqualsIgnoreCase
val = (nsString("mrString")).EqualsIgnoreCase("mrString");
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase("mrString");
if (PR_TRUE != val) {
printf("test 4 failed\n");
}
val = (nsString("mrString")).EqualsIgnoreCase("mrStrinG");
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase("mrStrinG");
if (PR_TRUE != val) {
printf("test 5 failed\n");
}
val = (nsString("mrString")).EqualsIgnoreCase("mrStri");
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase("mrStri");
if (PR_FALSE != val) {
printf("test 6 failed\n");
}
val = (nsString("mrStri")).EqualsIgnoreCase("mrString");
val = (NS_ConvertASCIItoUCS2("mrStri")).EqualsIgnoreCase("mrString");
if (PR_FALSE != val) {
printf("test 7 failed\n");
}
// String vs. Ident
val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("mrString"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase(NS_NewAtom("mrString"));
if (PR_TRUE != val) {
printf("test 8 failed\n");
}
val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("MRStrINg"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase(NS_NewAtom("MRStrINg"));
if (PR_TRUE != val) {
printf("test 9 failed\n");
}
val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("mrStri"));
val = (NS_ConvertASCIItoUCS2("mrString")).EqualsIgnoreCase(NS_NewAtom("mrStri"));
if (PR_FALSE != val) {
printf("test 10 failed\n");
}
val = (nsString("mrStri")).EqualsIgnoreCase(NS_NewAtom("mrString"));
val = (NS_ConvertASCIItoUCS2("mrStri")).EqualsIgnoreCase(NS_NewAtom("mrString"));
if (PR_FALSE != val) {
printf("test 11 failed\n");
}

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

@ -91,7 +91,8 @@ int main(int argc, char** argv)
Usage();
return -1;
}
string = new nsString(argv[++i]);
string = new nsString;
string->AssignWithConversion(argv[++i]);
}
else {
Usage();

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

@ -65,7 +65,7 @@ int TestProps() {
if (('a' <= tagName[0]) && (tagName[0] <= 'z')) {
tagName[0] = tagName[0] - 32;
}
id = nsCSSProps::LookupProperty(nsAutoString(tagName));
id = nsCSSProps::LookupProperty(NS_ConvertASCIItoUCS2(tagName));
if (id < 0) {
printf("bug: can't find '%s'\n", tagName);
rv = -1;

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

@ -130,7 +130,7 @@ nsCSSKeywords::LookupKeyword(const nsCString& aKeyword)
nsCSSKeyword
nsCSSKeywords::LookupKeyword(const nsString& aKeyword) {
nsCAutoString theKeyword(aKeyword);
nsCAutoString theKeyword; theKeyword.AssignWithConversion(aKeyword);
return LookupKeyword(theKeyword);
}

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

@ -136,7 +136,7 @@ nsCSSProps::LookupProperty(const nsCString& aProperty)
nsCSSProperty
nsCSSProps::LookupProperty(const nsString& aProperty) {
nsCAutoString theProp(aProperty);
nsCAutoString theProp; theProp.AssignWithConversion(aProperty);
return LookupProperty(theProp);
}

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

@ -242,7 +242,7 @@ nsXBLService::LoadBindings(nsIContent* aContent, const nsString& aURL)
if (binding)
return NS_OK;
nsCAutoString url = aURL;
nsCAutoString url; url.AssignWithConversion(aURL);
if (NS_FAILED(rv = GetBinding(url, getter_AddRefs(binding)))) {
NS_ERROR("Failed loading an XBL document for content node.");
return rv;
@ -405,7 +405,7 @@ NS_IMETHODIMP nsXBLService::GetBinding(const nsCString& aURLStr, nsIXBLBinding**
if (!tag) {
// We have a base class binding. Load it right now.
nsCOMPtr<nsIXBLBinding> baseBinding;
nsCAutoString url = value;
nsCAutoString url; url.AssignWithConversion(value);
GetBinding(url, getter_AddRefs(baseBinding));
if (!baseBinding)
return NS_OK; // At least we got the derived class binding loaded.

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

@ -148,7 +148,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
// The complex looking if above is to make sure that we do not erroneously
// think a value of "./this:that" would have a scheme of "./that"
nsCAutoString str(value);
nsCAutoString str; str.AssignWithConversion(value);
rv = MakeURI(str,nsnull,aURI);
if (NS_FAILED(rv))
@ -191,7 +191,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
} else {
// XXX Need to convert unicode to ???
// XXX Need to URL-escape string
nsCAutoString str(base);
nsCAutoString str; str.AssignWithConversion(base);
rv = MakeURI(str,docBase,aURI);
}
}

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

@ -1197,7 +1197,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString)
#ifdef XP_MAC
commandValue.AssignWithConversion("true");
#elif defined(XP_PC) || defined(NTO)
controlValue = "true";
controlValue.AssignWithConversion("true");
#else
altValue = "true";
#endif

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

@ -168,13 +168,13 @@ nsAddbookUrl::CrackPrintURL(char *searchPart, PRInt32 aOperation)
if (!emailAddr.IsEmpty())
{
nsUnescape(emailAddr);
mAbCardProperty->SetCardValue(kPriEmailColumn, nsString(emailAddr).GetUnicode());
mAbCardProperty->SetCardValue(kPriEmailColumn, NS_ConvertASCIItoUCS2(emailAddr).GetUnicode());
}
if (!folderName.IsEmpty())
{
nsUnescape(folderName);
mAbCardProperty->SetCardValue(kWorkAddressBook, nsString(folderName).GetUnicode());
mAbCardProperty->SetCardValue(kWorkAddressBook, NS_ConvertASCIItoUCS2(folderName).GetUnicode());
}
return NS_OK;

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

@ -655,7 +655,7 @@ nsresult nsAbCardDataSource::DoNewCard(nsIAbCard *card, nsISupportsArray *argume
literal->GetValue(&name);
nsString tempStr = name;
nsAllocator::Free(name);
nsCAutoString nameStr(tempStr);
nsCAutoString nameStr; nameStr.AssignWithConversion(tempStr);
// rv = card->CreateNewCard(nameStr);
}

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

@ -435,8 +435,9 @@ nsresult nsMsgFilter::SaveRule()
case nsMsgFilterAction::ChangePriority:
{
nsAutoString priority;
nsCAutoString cStr(priority);
NS_MsgGetUntranslatedPriorityName (m_action.m_priority, &priority);
nsCAutoString cStr;
cStr.AssignWithConversion(priority);
err = filterList->WriteStrAttr(nsMsgFilterAttribActionValue, cStr);
}
break;

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

@ -356,7 +356,7 @@ nsresult nsMsgSearchTerm::OutputValue(nsCString &outputStr)
nsAutoString priority;
NS_MsgGetUntranslatedPriorityName( m_value.u.priority,
&priority);
outputStr += nsCAutoString(priority);
outputStr.AppendWithConversion(priority);
break;
}
default:

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

@ -1251,7 +1251,7 @@ nsMsgFolderDataSource::createBiffStateNode(nsIMsgFolder *folder, nsIRDFNode **ta
nsCAutoString biffString;
GetBiffStateString(biffState, biffString);
nsAutoString uniStr = biffString;
nsAutoString uniStr;uniStr.AssignWithConversion(biffString);
createNode(uniStr, target, getRDFService());
return NS_OK;
}

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

@ -94,7 +94,9 @@ static nsresult GetMessageValue(nsIRDFResource *message, nsString& propertyURI,
return rv;
nsCOMPtr<nsIRDFResource> propertyResource;
rv = info->rdfService->GetResource(nsCAutoString(propertyURI), getter_AddRefs(propertyResource));
nsCAutoString propertyuriC;
propertyuriC.AssignWithConversion(propertyURI);
rv = info->rdfService->GetResource(propertyuriC, getter_AddRefs(propertyResource));
if(NS_FAILED(rv))
return rv;
@ -176,7 +178,10 @@ static PRBool UnreadThreadNavigationFunction(nsIDOMXULElement *messageElement, n
return PR_FALSE;
nsCOMPtr<nsIRDFResource> messageResource;
rv = info->rdfService->GetResource(nsCAutoString(idResult), getter_AddRefs(messageResource));
nsCAutoString idresultC;
idresultC.AssignWithConversion(idResult);
rv = info->rdfService->GetResource(idresultC, getter_AddRefs(messageResource));
if(NS_FAILED(rv))
return PR_FALSE;
@ -761,7 +766,9 @@ nsresult nsMsgViewNavigationService::FindNextInChildren(nsIDOMNode *parent, navi
return rv;
nsCOMPtr<nsIRDFResource> parentResource;
rv = info->rdfService->GetResource(nsCAutoString(parentURI), getter_AddRefs(parentResource));
nsCAutoString parenturiC;
parenturiC.AssignWithConversion(parentURI);
rv = info->rdfService->GetResource(parenturiC, getter_AddRefs(parentResource));
if(NS_FAILED(rv))
return rv;

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

@ -837,8 +837,9 @@ NS_IMETHODIMP nsMsgDBFolder::WriteToFolderCacheElem(nsIMsgFolderCacheElement *el
element->SetInt32Property("flags", (PRInt32) mFlags);
element->SetInt32Property("totalMsgs", mNumTotalMessages);
element->SetInt32Property("totalUnreadMsgs", mNumUnreadMessages);
element->SetStringProperty("charset", (const char *) nsCAutoString(mCharset));
nsCAutoString mcharsetC;
mcharsetC.AssignWithConversion(mCharset);
element->SetStringProperty("charset", (const char *) mcharsetC);
#ifdef DEBUG_bienvenu1
char *uri;

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

@ -84,7 +84,7 @@ nsresult nsMsgI18NConvertFromUnicode(const nsCString& aCharset,
// Resolve charset alias
nsCOMPtr <nsICharsetAlias> calias = do_GetService(NS_CHARSETALIAS_PROGID, &res);
if (NS_SUCCEEDED(res)) {
nsAutoString aAlias(aCharset);
nsAutoString aAlias; aAlias.AssignWithConversion(aCharset);
if (aAlias.Length()) {
res = calias->GetPreferred(aAlias, convCharset);
}
@ -147,7 +147,7 @@ nsresult nsMsgI18NConvertToUnicode(const nsCString& aCharset,
// Resolve charset alias
nsCOMPtr <nsICharsetAlias> calias = do_GetService(NS_CHARSETALIAS_PROGID, &res);
if (NS_SUCCEEDED(res)) {
nsAutoString aAlias(aCharset);
nsAutoString aAlias; aAlias.AssignWithConversion(aCharset);
if (aAlias.Length()) {
res = calias->GetPreferred(aAlias, convCharset);
}

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

@ -74,7 +74,9 @@ nsresult GetMessageServiceFromURI(const char *uri, nsIMsgMessageService **messag
if(NS_SUCCEEDED(rv))
{
rv = nsServiceManager::GetService((const char *) nsCAutoString(progID), NS_GET_IID(nsIMsgMessageService),
nsCAutoString progidC;
progidC.AssignWithConversion(progID);
rv = nsServiceManager::GetService((const char *) progidC, NS_GET_IID(nsIMsgMessageService),
(nsISupports**)messageService, nsnull);
}
@ -89,7 +91,11 @@ nsresult ReleaseMessageServiceFromURI(const char *uri, nsIMsgMessageService *mes
rv = GetMessageServiceProgIDForURI(uri, progID);
if(NS_SUCCEEDED(rv))
rv = nsServiceManager::ReleaseService(nsCAutoString(progID), messageService);
{
nsCAutoString progidC;
progidC.AssignWithConversion(progID);
rv = nsServiceManager::ReleaseService(progidC, messageService);
}
return rv;
}

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

@ -1634,7 +1634,9 @@ nsMsgNewURL(nsIURI** aInstancePtrResult, const char * aSpec)
{
nsAutoString newSpec; newSpec.AssignWithConversion("http://");
newSpec.AppendWithConversion(aSpec);
rv = pNetService->NewURI(nsCAutoString(newSpec), nsnull, aInstancePtrResult);
nsCAutoString newspecC;
newspecC.AssignWithConversion(newSpec);
rv = pNetService->NewURI(newspecC, nsnull, aInstancePtrResult);
}
else
rv = pNetService->NewURI(aSpec, nsnull, aInstancePtrResult);

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

@ -687,7 +687,11 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode,
PR_Free(outCString);
}
else
m_compFields->SetBody(nsCAutoString(msgBody));
{
nsCAutoString msgbodyC;
msgbodyC.AssignWithConversion(msgBody);
m_compFields->SetBody(msgbodyC);
}
}
}
}
@ -1182,11 +1186,13 @@ QuotingOutputStreamListener::QuotingOutputStreamListener(const PRUnichar * origi
{
nsAutoString aCharset; aCharset.AssignWithConversion(msgCompHeaderInternalCharset());
char * utf8Author = nsnull;
nsAutoString authorStr(author);
nsAutoString authorStr; authorStr.Assign(author);
rv = ConvertFromUnicode(aCharset, authorStr, &utf8Author);
if (NS_SUCCEEDED(rv) && utf8Author)
{
rv = parser->ExtractHeaderAddressName(nsCAutoString(aCharset), utf8Author, &authorName);
nsCAutoString acharsetC;
acharsetC.AssignWithConversion(aCharset);
rv = parser->ExtractHeaderAddressName(acharsetC, utf8Author, &authorName);
if (NS_SUCCEEDED(rv))
rv = ConvertToUnicode(aCharset, authorName, authorStr);
}

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

@ -1425,8 +1425,9 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
// Create the URI
if (NS_FAILED(image->GetSrc(tUrl)))
return NS_ERROR_FAILURE;
if (NS_FAILED(nsMsgNewURL(&attachment.url, nsCAutoString(tUrl))))
nsCAutoString turlC;
turlC.AssignWithConversion(tUrl);
if (NS_FAILED(nsMsgNewURL(&attachment.url, turlC)))
{
// Well, the first time failed...which means we probably didn't get
// the full path name...
@ -1457,7 +1458,9 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
if (loc >= 0)
workURL.SetLength(loc+1);
workURL.Append(tUrl);
if (NS_FAILED(nsMsgNewURL(&attachment.url, nsCAutoString(workURL))))
nsCAutoString workurlC;
workurlC.AssignWithConversion(workURL);
if (NS_FAILED(nsMsgNewURL(&attachment.url, workurlC)))
{
// rhp - just try to continue and send it without this image.
continue;
@ -1483,7 +1486,9 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
// Create the URI
if (NS_FAILED(link->GetHref(tUrl)))
return NS_ERROR_FAILURE;
if (NS_FAILED(nsMsgNewURL(&attachment.url, nsCAutoString(tUrl))))
nsCAutoString turlC;
turlC.AssignWithConversion(tUrl);
if (NS_FAILED(nsMsgNewURL(&attachment.url, turlC)))
return NS_ERROR_OUT_OF_MEMORY;
NS_IF_ADDREF(attachment.url);
@ -1496,7 +1501,9 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
// Create the URI
if (NS_FAILED(anchor->GetHref(tUrl)))
return NS_ERROR_FAILURE;
if (NS_FAILED(nsMsgNewURL(&attachment.url, nsCAutoString(tUrl))))
nsCAutoString turlC;
turlC.AssignWithConversion(tUrl);
if (NS_FAILED(nsMsgNewURL(&attachment.url, turlC)))
return NS_ERROR_OUT_OF_MEMORY;
NS_IF_ADDREF(attachment.url);

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

@ -389,17 +389,17 @@ int main(int argc, char *argv[])
PR_FREEIF(aEmail);
PR_FREEIF(aFullName);
pMsgCompFields->SetFrom(nsAutoString(addr).GetUnicode());
pMsgCompFields->SetTo(nsAutoString("rhp@netscape.com").GetUnicode());
pMsgCompFields->SetFrom(NS_ConvertASCIItoUCS2(addr).GetUnicode());
pMsgCompFields->SetTo(NS_ConvertASCIItoUCS2("rhp@netscape.com").GetUnicode());
PR_snprintf(subject, sizeof(subject), "Spam from: %s", addr);
pMsgCompFields->SetSubject(nsAutoString(subject).GetUnicode());
pMsgCompFields->SetSubject(NS_ConvertASCIItoUCS2(subject).GetUnicode());
// pMsgCompFields->SetTheForcePlainText(PR_TRUE, &rv);
pMsgCompFields->SetBody(nsAutoString(email).GetUnicode());
pMsgCompFields->SetCharacterSet(nsAutoString("us-ascii").GetUnicode());
pMsgCompFields->SetBody(NS_ConvertASCIItoUCS2(email).GetUnicode());
pMsgCompFields->SetCharacterSet(NS_ConvertASCIItoUCS2("us-ascii").GetUnicode());
pMsgCompFields->SetAttachments(nsAutoString("http://www.netscape.com").GetUnicode());
pMsgCompFields->SetAttachments(NS_ConvertASCIItoUCS2("http://www.netscape.com").GetUnicode());
PRInt32 nBodyLength;
PRUnichar *pUnicharBody;

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

@ -434,7 +434,7 @@ int main(int argc, char *argv[])
return NS_ERROR_FAILURE;
}
pMsgCompFields->SetTo(nsAutoString("rhp@netscape.com").GetUnicode());
pMsgCompFields->SetTo(NS_ConvertASCIItoUCS2("rhp@netscape.com").GetUnicode());
pMsgSend->SendMessageFile(GetHackIdentity(), // identity...
pMsgCompFields, // nsIMsgCompFields *fields,
mailIFile, // nsFileSpec *sendFileSpec,

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

@ -384,11 +384,11 @@ main(int argc, char *argv[])
if (!email)
email = "rhp@netscape.com";
pMsgCompFields->SetFrom(nsAutoString(email).GetUnicode());
pMsgCompFields->SetTo(nsAutoString(argv[1]).GetUnicode());
pMsgCompFields->SetFrom(NS_ConvertASCIItoUCS2(email).GetUnicode());
pMsgCompFields->SetTo(NS_ConvertASCIItoUCS2(argv[1]).GetUnicode());
pMsgCompFields->SetSubject(nsAutoString(argv[3]).GetUnicode());
pMsgCompFields->SetBody(nsAutoString(argv[2]).GetUnicode());
pMsgCompFields->SetSubject(NS_ConvertASCIItoUCS2(argv[3]).GetUnicode());
pMsgCompFields->SetBody(NS_ConvertASCIItoUCS2(argv[2]).GetUnicode());
nsIURI *url;
char *ptr = argv[2];

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

@ -372,7 +372,7 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path)
}
}
// make the imap folder remember the file spec it was created with.
nsCAutoString leafName (currentFolderDBNameStr);
nsCAutoString leafName; leafName.AssignWithConversion(currentFolderDBNameStr);
nsCOMPtr <nsIFileSpec> msfFileSpec;
rv = NS_NewFileSpecWithSpec(currentFolderPath, getter_AddRefs(msfFileSpec));
if (NS_SUCCEEDED(rv) && msfFileSpec)
@ -615,7 +615,9 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
if (NS_FAILED(rv)) return rv;
parentFolder = do_QueryInterface(res, &rv);
if (NS_FAILED(rv)) return rv;
return parentFolder->CreateClientSubfolderInfo(nsCAutoString(leafName), hierarchyDelimiter);
nsCAutoString leafnameC;
leafnameC.AssignWithConversion(leafName);
return parentFolder->CreateClientSubfolderInfo(leafnameC, hierarchyDelimiter);
}
// if we get here, it's really a leaf, and "this" is the parent.

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

@ -423,7 +423,7 @@ nsIMAP4TestDriver::SetupInbox()
rdfResource(do_QueryInterface(m_inbox, &rv));
if (NS_SUCCEEDED(rv))
rdfResource->Init("imap:/Inbox");
nsString inboxName("Inbox");
nsString inboxName; inboxName.AssignWithConversion("Inbox");
m_inbox->SetName((PRUnichar *) inboxName.GetUnicode());
}
}

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

@ -420,7 +420,7 @@ nsresult nsEudoraWin32::ScanDescmap( nsIFileSpec *pFolder, nsISupportsArray *pAr
nsresult nsEudoraWin32::FoundMailbox( nsIFileSpec *mailFile, const char *pName, nsISupportsArray *pArray, nsIImportService *pImport)
{
nsString displayName = pName;
nsString displayName; displayName.AssignWithConversion(pName);
nsCOMPtr<nsIImportMailboxDescriptor> desc;
nsISupports * pInterface;
@ -461,7 +461,7 @@ nsresult nsEudoraWin32::FoundMailbox( nsIFileSpec *mailFile, const char *pName,
nsresult nsEudoraWin32::FoundMailFolder( nsIFileSpec *mailFolder, const char *pName, nsISupportsArray *pArray, nsIImportService *pImport)
{
nsString displayName = pName;
nsString displayName; displayName.AssignWithConversion(pName);
nsCOMPtr<nsIImportMailboxDescriptor> desc;
nsISupports * pInterface;
@ -687,17 +687,17 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
nsCString s = pSection;
if (!s.Compare( "Settings", PR_TRUE)) {
str = "Eudora ";
str.Append( pSection);
str.AssignWithConversion("Eudora ");
str.AppendWithConversion( pSection);
}
else {
nsCString tStr;
str = pSection;
str.AssignWithConversion(pSection);
if (s.Length() > 8) {
s.Left( tStr, 8);
if (!tStr.Compare( "Persona-", PR_TRUE)) {
s.Right( tStr, s.Length() - 8);
str = (const char *)tStr;
str.AssignWithConversion((const char *)tStr);
}
}
}
@ -843,7 +843,7 @@ void nsEudoraWin32::SetIdentities( nsIMsgAccountManager *accMgr, nsIMsgAccount *
nsCOMPtr<nsIMsgIdentity> id;
rv = accMgr->CreateIdentity( getter_AddRefs( id));
if (id) {
nsString fullName = realName;
nsString fullName; fullName.AssignWithConversion(realName);
id->SetFullName( fullName.GetUnicode());
id->SetIdentityName( fullName.GetUnicode());
id->SetEmail( email);
@ -1357,11 +1357,11 @@ nsresult nsEudoraWin32::FoundAddressBook( nsIFileSpec *spec, const PRUnichar *pN
return( rv);
if (!pLeaf)
return( NS_ERROR_FAILURE);
name = pLeaf;
name.AssignWithConversion(pLeaf);
nsCRT::free( pLeaf);
nsString tStr;
name.Right( tStr, 4);
if (!tStr.Compare( ".txt", PR_TRUE)) {
if (!tStr.Compare( NS_ConvertASCIItoUCS2(".txt").GetUnicode(), PR_TRUE)) {
name.Left( tStr, name.Length() - 4);
name = tStr;
}

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

@ -95,7 +95,7 @@ nsMimeConverter::DecodeMimePartIIStr(const nsString& header,
nsresult res = NS_OK;
(void) charset.ToCString(charsetCstr, kMAX_CSNAME+1);
nsCAutoString encodedStr(header);
nsCAutoString encodedStr; encodedStr.AssignWithConversion(header);
// apply MIME decode.
decodedCstr = MIME_DecodeMimePartIIStr(encodedStr,
charsetCstr, eatContinuations);

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

@ -334,7 +334,9 @@ nsNNTPNewsgroupList::GetRangeOfArtsToDownload(nsIMsgWindow * aMsgWindow,
if (m_knownArts.set) {
delete m_knownArts.set;
}
m_knownArts.set = nsMsgKeySet::Create(nsCAutoString(knownArtsString));
nsCAutoString knownartstringC;
knownartstringC.AssignWithConversion(knownArtsString);
m_knownArts.set = nsMsgKeySet::Create(knownartstringC);
}
else
{

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

@ -362,19 +362,33 @@ return NS_OK;
//-- Get its corresponding signature file
nsCAutoString sigFilename;
sigFilename = manifestFilename;
sigFilename.Assign(manifestFilename);
PRInt32 extension = sigFilename.RFindChar('.') + 1;
NS_ASSERTION(extension != 0, "Manifest Parser: Missing file extension.");
(void)sigFilename.Cut(extension, 2);
nsXPIDLCString sigBuffer;
PRUint32 sigLen;
rv = LoadEntry(sigFilename+"rsa", getter_Copies(sigBuffer), &sigLen);
nsCAutoString autostring; autostring.Assign(sigBuffer);
autostring.Append("rsa");
rv = LoadEntry(autostring.GetBuffer(), getter_Copies(sigBuffer), &sigLen);
if (NS_FAILED(rv))
rv = LoadEntry(sigFilename+"RSA", getter_Copies(sigBuffer), &sigLen);
{
autostring.Assign(sigBuffer);
autostring.Append("RSA");
rv = LoadEntry(autostring.GetBuffer(), getter_Copies(sigBuffer), &sigLen);
}
if (NS_FAILED(rv))
rv = LoadEntry(sigFilename+"dsa", getter_Copies(sigBuffer), &sigLen);
{
autostring.Assign(sigBuffer);
autostring.Append("dsa");
rv = LoadEntry(autostring.GetBuffer(), getter_Copies(sigBuffer), &sigLen);
}
if (NS_FAILED(rv))
rv = LoadEntry(sigFilename+"DSA", getter_Copies(sigBuffer), &sigLen);
{
autostring.Assign(sigBuffer);
autostring.Append("DSA");
rv = LoadEntry(autostring.GetBuffer(), getter_Copies(sigBuffer), &sigLen);
}
if (NS_FAILED(rv)) return rv;
//-- Verify that the signature file is a valid signature of the SF file

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

@ -89,9 +89,9 @@ public:
char* name = origFile.GetLeafName();
if (name == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
nsAutoString str(name);
nsAutoString str; str.AssignWithConversion(name);
nsAllocator::Free(name);
str += ".bak";
str.AppendWithConversion(".bak");
nsFileSpec spec(origFile);
spec.SetLeafName(str);
nsCOMPtr<nsILocalFile> file;
@ -172,8 +172,8 @@ TestAsyncWrite(const char* fileName, PRUint32 offset, PRInt32 length)
NS_WITH_SERVICE(nsIFileTransportService, fts, kFileTransportServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsString outFile(fileName);
outFile += ".out";
nsString outFile; outFile.AssignWithConversion(fileName);
outFile.AppendWithConversion(".out");
nsFileSpec fs(outFile);
nsIChannel* fileTrans;
nsCOMPtr<nsILocalFile> file;

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

@ -761,7 +761,7 @@ main(int argc, char* argv[])
PRUnichar* description;
rv = cache->GetDescription(&description);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get cache description");
nsCAutoString descStr(description);
nsCAutoString descStr; descStr.AssignWithConversion(description);
printf("Testing: %s\n", descStr.GetBuffer());
rv = cache->RemoveAll();

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

@ -217,7 +217,7 @@ NS_IMETHODIMP RobotSink::CloseFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode)
{
nsAutoString tmp(aNode.GetText());
nsAutoString tmp; tmp.Assign(aNode.GetText());
tmp.ToLowerCase();
if (tmp.EqualsWithConversion("a")) {
nsAutoString k, v;
@ -333,7 +333,7 @@ NS_IMETHODIMP RobotSink::RemoveObserver(nsIRobotSinkObserver* aObserver)
void RobotSink::ProcessLink(const nsString& aLink)
{
nsAutoString absURLSpec(aLink);
nsAutoString absURLSpec; absURLSpec.Assign(aLink);
// Make link absolute
// XXX base tag handling

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

@ -19,7 +19,9 @@ int main(int argc, char **argv)
if(gWorkList) {
int i;
for (i = 1; i < argc; i++) {
gWorkList->AppendElement(new nsString(argv[i]));
nsString *tempString = new nsString;
tempString->AssignWithConversion(argv[i]);
gWorkList->AppendElement(tempString);
}
}

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

@ -1097,7 +1097,7 @@ nsresult nsObserverTopic::Notify(eHTMLTags aTag,nsIParserNode& aNode,void* aUniq
mKeys.Push((PRUnichar*)mDTDKey.GetUnicode());
mValues.Push((PRUnichar*)mTopic.GetUnicode());
nsAutoString theTagStr(nsHTMLTags::GetStringValue(aTag));
nsAutoString theTagStr; theTagStr.AssignWithConversion(nsHTMLTags::GetStringValue(aTag));
nsObserverNotifier theNotifier(theTagStr.GetUnicode(),(nsISupports*)aUniqueID,&mKeys,&mValues);
theDeque->FirstThat(theNotifier);
result=theNotifier.mResult;

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

@ -217,7 +217,7 @@ nsHTMLContentSinkStream::InitEncoders()
// Initialize a charset encoder if we're using the stream interface
if (mStream)
{
nsAutoString charsetName = mCharsetOverride;
nsAutoString charsetName; charsetName.AssignWithConversion(mCharsetOverride);
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &res);
if (NS_SUCCEEDED(res) && calias) {
nsAutoString temp; temp.AssignWithConversion(mCharsetOverride);
@ -235,7 +235,7 @@ nsHTMLContentSinkStream::InitEncoders()
if (NS_FAILED(res))
return res;
// SaveAsCharset requires a const char* in its first argument:
nsCAutoString charsetCString (charsetName);
nsCAutoString charsetCString; charsetCString.AssignWithConversion(charsetName);
// For ISO-8859-1 only, convert to entity first (always generate entites like &nbsp;).
res = mCharsetEncoder->Init(charsetCString,
charsetName.EqualsIgnoreCase("ISO-8859-1") ?
@ -1030,7 +1030,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode)
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
if (tag == eHTMLTag_userdefined)
{
nsAutoString name = aNode.GetText();
nsAutoString name; name.Assign(aNode.GetText());
if (name.EqualsWithConversion("document_info"))
{
PRInt32 count=aNode.GetAttributeCount();
@ -1047,7 +1047,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode)
}
else if (key.EqualsWithConversion("uri"))
{
nsAutoString uristring (aNode.GetValueAt(i));
nsAutoString uristring; uristring.Assign(aNode.GetValueAt(i));
// strip double quotes from beginning and end
uristring.Trim("\"", PR_TRUE, PR_TRUE);

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

@ -175,7 +175,7 @@ nsHTMLEntities::EntityToUnicode(const nsCString& aEntity)
PRInt32
nsHTMLEntities::EntityToUnicode(const nsString& aEntity) {
nsCAutoString theEntity(aEntity);
nsCAutoString theEntity; theEntity.AssignWithConversion(aEntity);
if(';'==theEntity.Last()) {
theEntity.Truncate(theEntity.Length()-1);
}
@ -215,7 +215,7 @@ public:
// Make sure we can find everything we are supposed to
for (int i = 0; i < NS_HTML_ENTITY_COUNT; i++) {
nsAutoString entity(gEntityArray[i].mStr);
nsAutoString entity; entity.AssignWithConversion(gEntityArray[i].mStr);
value = nsHTMLEntities::EntityToUnicode(entity);
NS_ASSERTION(value != -1, "can't find entity");

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

@ -128,7 +128,7 @@ nsHTMLTags::LookupTag(const nsCString& aTag)
nsHTMLTag
nsHTMLTags::LookupTag(const nsString& aTag) {
nsCAutoString theTag(aTag);
nsCAutoString theTag; theTag.AssignWithConversion(aTag);
return LookupTag(theTag);
}

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

@ -86,7 +86,7 @@ nsresult nsHTMLToTXTSinkStream::InitEncoder(const nsString& aCharset)
(nsISupports**)&calias);
NS_ASSERTION( nsnull != calias, "cannot find charset alias");
nsAutoString charsetName = aCharset;
nsAutoString charsetName;charsetName.Assign(aCharset);
if( NS_SUCCEEDED(res) && (nsnull != calias))
{
res = calias->GetPreferred(aCharset, charsetName);

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

@ -548,7 +548,7 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
RecordTrailingContent((CStartToken*)aToken,aScanner);
if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
nsAutoString endTag(nsHTMLTags::GetStringValue(theTag));
nsAutoString endTag; endTag.AssignWithConversion(nsHTMLTags::GetStringValue(theTag));
endTag.InsertWithConversion("</",0,2);
CToken* textToken=theRecycler->CreateTokenOfType(eToken_text,theTag);
result=((CTextToken*)textToken)->ConsumeUntil(0,PRBool(theTag!=eHTMLTag_script),aScanner,endTag,mParseMode,aFlushTokens); //tell new token to finish consuming text...

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

@ -134,7 +134,7 @@ nsresult nsScanner::SetDocumentCharset(const nsString& aCharset , nsCharsetSourc
NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &res);
NS_ASSERTION( nsnull != calias, "cannot find charset alias");
nsAutoString charsetName = aCharset;
nsAutoString charsetName; charsetName.Assign(aCharset);
if( NS_SUCCEEDED(res) && (nsnull != calias))
{
PRBool same = PR_FALSE;

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

@ -999,8 +999,8 @@ PRBool nsXIFDTD::GetAttributePair(nsIParserNode& aNode, nsString& aKey, nsString
const nsString& k = aNode.GetKeyAt(i);
const nsString& v = aNode.GetValueAt(i);
nsAutoString key(k);
nsAutoString value(v);
nsAutoString key; key.Assign(k);
nsAutoString value; value.Assign(v);
char* quote = "\"";
@ -1366,7 +1366,7 @@ nsresult nsXIFDTD::BeginCSSStyleSheet(const nsIParserNode& aNode)
nsresult nsXIFDTD::EndCSSStyleSheet(const nsIParserNode& aNode)
{
nsresult result=NS_OK;
nsAutoString tagName(nsHTMLTags::GetStringValue(eHTMLTag_style));
nsAutoString tagName(NS_ConvertASCIItoUCS2(nsHTMLTags::GetStringValue(eHTMLTag_style)));
mBuffer.AppendWithConversion("</");
mBuffer.Append(tagName);

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

@ -70,7 +70,7 @@ Compare(nsString& str, nsString& aFileName)
int different = 0;
while ((c = getc(file)) != EOF)
{
inString += c;
inString.AppendWithConversion(c);
// CVS isn't doing newline comparisons on these files for some reason.
// So compensate for possible newline problems in the CVS file:
if (c == '\n' && str[index] == '\r')
@ -122,7 +122,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
nsIHTMLContentSink* sink = nsnull;
// Create the appropriate output sink
if (outType == "text/html")
if (outType.EqualsWithConversion("text/html"))
rv = NS_New_HTML_ContentSinkStream(&sink, &outString, flags);
else // default to plaintext
@ -136,7 +136,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
parser->SetContentSink(sink);
nsIDTD* dtd = nsnull;
if (inType == "text/xif")
if (inType.EqualsWithConversion("text/xif"))
rv = NS_NewXIFDTD(&dtd);
else
rv = NS_NewNavHTMLDTD(&dtd);
@ -149,7 +149,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
parser->RegisterDTD(dtd);
char* inTypeStr = inType.ToNewCString();
rv = parser->Parse(inString, 0, inTypeStr, PR_FALSE, PR_TRUE);
rv = parser->Parse(inString, 0, NS_ConvertASCIItoUCS2(inTypeStr), PR_FALSE, PR_TRUE);
delete[] inTypeStr;
if (NS_FAILED(rv))
{
@ -176,8 +176,8 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType,
int main(int argc, char** argv)
{
nsString inType ("text/html");
nsString outType ("text/plain");
nsString inType; inType.AssignWithConversion("text/html");
nsString outType; outType.AssignWithConversion("text/plain");
int wrapCol = 72;
int flags = 0;
nsString compareAgainst;
@ -204,9 +204,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'i':
if (argv[0][2] != '\0')
inType = argv[0]+2;
inType.AssignWithConversion(argv[0]+2);
else {
inType = argv[1];
inType.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -214,9 +214,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'o':
if (argv[0][2] != '\0')
outType = argv[0]+2;
outType.AssignWithConversion(argv[0]+2);
else {
outType = argv[1];
outType.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -244,9 +244,9 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
case 'c':
if (argv[0][2] != '\0')
compareAgainst = argv[0]+2;
compareAgainst.AssignWithConversion(argv[0]+2);
else {
compareAgainst = argv[1];
compareAgainst.AssignWithConversion(argv[1]);
--argc;
++argv;
}
@ -278,7 +278,7 @@ Usage: %s [-i intype] [-o outtype] [-f flags] [-w wrapcol] [-c comparison_file]
nsString inString;
char c;
while ((c = getc(file)) != EOF)
inString += c;
inString.AppendWithConversion(c);
if (file != stdin)
fclose(file);

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

@ -652,7 +652,8 @@ NS_IMETHODIMP nsProfile::GetProfileDir(const PRUnichar *profileName, nsFileSpec*
rv = NS_NewFileSpec(getter_AddRefs(spec));
if (NS_FAILED(rv)) return rv;
nsCAutoString profileLocation(aProfile->profileLocation);
nsCAutoString profileLocation;
profileLocation.AssignWithConversion(aProfile->profileLocation);
rv = spec->SetPersistentDescriptorString(profileLocation.GetBuffer());
if (NS_FAILED(rv)) return rv;

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

@ -1246,9 +1246,9 @@ nsProfileAccess::CheckRegString(const PRUnichar *profileName, char **info)
ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
if (!profileItem->NCHavePregInfo.IsEmpty()) {
*info = nsCRT::strdup(NS_CONST_CAST
(char*, nsCAutoString
(profileItem->NCHavePregInfo).GetBuffer()));
nsCAutoString pregC;
pregC.AssignWithConversion(profileItem->NCHavePregInfo);
*info = nsCRT::strdup(NS_STATIC_CAST(const char*, pregC));
}
else
*info = nsCRT::strdup(REGISTRY_NO_STRING);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше