making string conversions explicit

This commit is contained in:
scc%netscape.com 2000-04-03 11:39:09 +00:00
Родитель be4311c49a
Коммит 953490ff20
17 изменённых файлов: 119 добавлений и 119 удалений

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

@ -1190,7 +1190,7 @@ PresShell::GetActiveAlternateStyleSheet(nsString& aSheetTitle)
if (mStyleSet) {
PRInt32 count = mStyleSet->GetNumberOfDocStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mStyleSet->GetDocStyleSheetAt(index);
if (nsnull != sheet) {
@ -1217,7 +1217,7 @@ PresShell::SelectAlternateStyleSheet(const nsString& aSheetTitle)
if (mDocument && mStyleSet) {
PRInt32 count = mDocument->GetNumberOfStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mDocument->GetStyleSheetAt(index);
if (nsnull != sheet) {
@ -1249,7 +1249,7 @@ PresShell::ListAlternateStyleSheets(nsStringArray& aTitleList)
if (mDocument) {
PRInt32 count = mDocument->GetNumberOfStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mDocument->GetStyleSheetAt(index);
if (nsnull != sheet) {
@ -3554,7 +3554,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
}
}
else {
name = "(null)";
name.AssignWithConversion("(null)");
}
fputs(name, stdout);
@ -3569,7 +3569,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
}
}
else {
name = "(null)";
name.AssignWithConversion("(null)");
}
fputs(name, stdout);

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

@ -246,13 +246,13 @@ static void DecimalToText(PRInt32 ordinal, nsString& result)
{
char cbuf[40];
PR_snprintf(cbuf, sizeof(cbuf), "%ld", ordinal);
result.Append(cbuf);
result.AppendWithConversion(cbuf);
}
static void DecimalLeadingZeroToText(PRInt32 ordinal, nsString& result)
{
char cbuf[40];
PR_snprintf(cbuf, sizeof(cbuf), "%02ld", ordinal);
result.Append(cbuf);
result.AppendWithConversion(cbuf);
}
@ -267,7 +267,7 @@ static void RomanToText(PRInt32 ordinal, nsString& result, const char* achars, c
ordinal = 1;
}
nsAutoString addOn, decStr;
decStr.Append(ordinal, 10);
decStr.AppendWithConversion(ordinal, 10);
PRIntn len = decStr.Length();
const PRUnichar* dp = decStr.GetUnicode();
const PRUnichar* end = dp + len;
@ -744,7 +744,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX,
break;
}
result.Append(".");
result.AppendWithConversion(".");
}
#define MIN_BULLET_SIZE 5 // from laytext.c

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

@ -1813,22 +1813,22 @@ nsFrame::GetFrameName(nsString& aResult) const
nsresult
nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
{
aResult = aType;
aResult.AssignWithConversion(aType);
if (nsnull != mContent) {
nsIAtom* tag;
mContent->GetTag(tag);
if ((tag != nsnull) && (tag != nsLayoutAtoms::textTagName)) {
aResult.Append("(");
aResult.AppendWithConversion("(");
nsAutoString buf;
tag->ToString(buf);
aResult.Append(buf);
NS_RELEASE(tag);
aResult.Append(")");
aResult.AppendWithConversion(")");
}
}
char buf[40];
PR_snprintf(buf, sizeof(buf), "(%d)", ContentIndexInContainer(this));
aResult.Append(buf);
aResult.AppendWithConversion(buf);
return NS_OK;
}
#endif
@ -1840,21 +1840,21 @@ nsFrame::XMLQuote(nsString& aString)
for (i = 0; i < len; i++) {
PRUnichar ch = aString.CharAt(i);
if (ch == '<') {
nsAutoString tmp("&lt;");
nsAutoString tmp; tmp.AssignWithConversion("&lt;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 3;
i += 3;
}
else if (ch == '>') {
nsAutoString tmp("&gt;");
nsAutoString tmp; tmp.AssignWithConversion("&gt;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 3;
i += 3;
}
else if (ch == '\"') {
nsAutoString tmp("&quot;");
nsAutoString tmp; tmp.AssignWithConversion("&quot;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 5;

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

@ -281,14 +281,14 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("horizontal"), PR_FALSE);
elementFactory->CreateInstanceByTag(NS_ConvertToString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, NS_ConvertToString("horizontal"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
// create vertical scrollbar
content = nsnull;
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("vertical"), PR_FALSE);
elementFactory->CreateInstanceByTag(NS_ConvertToString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, NS_ConvertToString("vertical"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
// XXX For GFX never have scrollbars
@ -1028,7 +1028,7 @@ nsGfxScrollFrameInner::SetAttribute(nsIBox* aBox, nsIAtom* aAtom, nscoord aSize,
frame->GetContent(getter_AddRefs(content));
char ch[100];
sprintf(ch,"%d", aSize);
nsAutoString newValue(ch);
nsAutoString newValue; newValue.AssignWithConversion(ch);
content->SetAttribute(kNameSpaceID_None, aAtom, newValue, aReflow);
return PR_TRUE;
}

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

@ -785,7 +785,7 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
if (p.y < 0) p.y = 0;
char cbuf[50];
PR_snprintf(cbuf, sizeof(cbuf), "?%d,%d", p.x, p.y);
absURL.Append(cbuf);
absURL.AppendWithConversion(cbuf);
PRBool clicked = PR_FALSE;
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) {
*aEventStatus = nsEventStatus_eConsumeDoDefault;

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

@ -327,37 +327,37 @@ void Area::ToHTML(nsString& aResult)
}
aResult.Truncate();
aResult.Append("<AREA SHAPE=");
aResult.AppendWithConversion("<AREA SHAPE=");
nsAutoString shape;
GetShapeName(shape);
aResult.Append(shape);
aResult.Append(" COORDS=\"");
aResult.AppendWithConversion(" COORDS=\"");
if (nsnull != mCoords) {
PRInt32 i, n = mNumCoords;
for (i = 0; i < n; i++) {
aResult.Append(mCoords[i], 10);
aResult.AppendWithConversion(mCoords[i], 10);
if (i < n - 1) {
aResult.Append(',');
aResult.AppendWithConversion(',');
}
}
}
aResult.Append("\" HREF=\"");
aResult.AppendWithConversion("\" HREF=\"");
aResult.Append(href);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
if (0 < target.Length()) {
aResult.Append(" TARGET=\"");
aResult.AppendWithConversion(" TARGET=\"");
aResult.Append(target);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
}
if (0 < altText.Length()) {
aResult.Append(" ALT=\"");
aResult.AppendWithConversion(" ALT=\"");
aResult.Append(altText);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
}
if (mSuppressFeedback) {
aResult.Append(" SUPPRESS");
aResult.AppendWithConversion(" SUPPRESS");
}
aResult.Append('>');
aResult.AppendWithConversion('>');
}
/**
@ -376,11 +376,11 @@ void Area::BeginConvertToXIF(nsXIFConverter& aConverter) const
mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, altText);
}
nsAutoString tag("area");
nsAutoString tag; tag.AssignWithConversion("area");
aConverter.BeginStartTag(tag);
nsAutoString name("shape");
nsAutoString name; name.AssignWithConversion("shape");
nsAutoString shape;
GetShapeName(shape);
aConverter.AddAttribute(name,shape);
@ -390,36 +390,36 @@ void Area::BeginConvertToXIF(nsXIFConverter& aConverter) const
if (nsnull != mCoords) {
PRInt32 i, n = mNumCoords;
for (i = 0; i < n; i++) {
coords.Append(mCoords[i], 10);
coords.AppendWithConversion(mCoords[i], 10);
if (i < n - 1) {
coords.Append(',');
}
}
}
name.Assign("coords");
name.AssignWithConversion("coords");
aConverter.AddAttribute(name,coords);
name.Assign("href");
name.AssignWithConversion("href");
aConverter.AddAttribute(name,href);
if (0 < target.Length()) {
name.Assign("target");
name.AssignWithConversion("target");
aConverter.AddAttribute(name,target);
}
if (0 < altText.Length()) {
name.Assign("alt");
name.AssignWithConversion("alt");
aConverter.AddAttribute(name,altText);
}
if (mSuppressFeedback) {
name.Assign("suppress");
name.AssignWithConversion("suppress");
aConverter.AddAttribute(name);
}
}
void Area::FinishConvertToXIF(nsXIFConverter& aConverter) const
{
nsAutoString tag("area");
nsAutoString tag; tag.AssignWithConversion("area");
aConverter.FinishStartTag(tag,PR_TRUE);
}
@ -464,7 +464,7 @@ void DefaultArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void DefaultArea::GetShapeName(nsString& aResult) const
{
aResult.Append("default");
aResult.AppendWithConversion("default");
}
//----------------------------------------------------------------------
@ -525,7 +525,7 @@ void RectArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void RectArea::GetShapeName(nsString& aResult) const
{
aResult.Append("rect");
aResult.AppendWithConversion("rect");
}
//----------------------------------------------------------------------
@ -635,7 +635,7 @@ void PolyArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void PolyArea::GetShapeName(nsString& aResult) const
{
aResult.Append("polygon");
aResult.AppendWithConversion("polygon");
}
//----------------------------------------------------------------------
@ -700,7 +700,7 @@ void CircleArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void CircleArea::GetShapeName(nsString& aResult) const
{
aResult.Append("circle");
aResult.AppendWithConversion("circle");
}
//----------------------------------------------------------------------

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

@ -650,7 +650,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
if (classid.Find("clsid:") != -1)
{
classid.Cut(0, 6); // Strip off the "clsid:". What's left is the class ID.
bJavaPluginClsid = (classid.Equals(JAVA_CLASS_ID));
bJavaPluginClsid = (classid.EqualsWithConversion(JAVA_CLASS_ID));
}
// if we find "java:" in the class id, or we match the Java classid number, we have a java applet
@ -702,7 +702,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
{
// These are some builtin types that we know about for now.
// (Eventually this will move somewhere else.)
if (classid.Equals("browser"))
if (classid.EqualsWithConversion("browser"))
{
widgetCID = kCAppShellCID;
rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, widgetCID);
@ -1742,8 +1742,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
nsAutoString uniurl = nsAutoString(aURL);
nsAutoString unitarget = nsAutoString(aTarget);
nsAutoString uniurl; uniurl.AssignWithConversion(aURL);
nsAutoString unitarget; unitarget.AssignWithConversion(aTarget);
nsAutoString fullurl;
nsIURI* baseURL;
@ -1797,7 +1797,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char *aStatusMsg)
if(browserChrome)
{
nsAutoString msg = nsAutoString(aStatusMsg);
nsAutoString msg; msg.AssignWithConversion(aStatusMsg);
browserChrome->SetJSStatus(msg.GetUnicode());
}
}

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

@ -4385,14 +4385,14 @@ nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const
while (fragOffset < n) {
PRUnichar ch = frag->CharAt(fragOffset++);
if (ch == '\r') {
aBuf.Append("\\r");
aBuf.AppendWithConversion("\\r");
} else if (ch == '\n') {
aBuf.Append("\\n");
aBuf.AppendWithConversion("\\n");
} else if (ch == '\t') {
aBuf.Append("\\t");
aBuf.AppendWithConversion("\\t");
} else if ((ch < ' ') || (ch >= 127)) {
aBuf.Append("\\0");
aBuf.Append((PRInt32)ch, 8);
aBuf.AppendWithConversion("\\0");
aBuf.AppendWithConversion((PRInt32)ch, 8);
} else {
aBuf.Append(ch);
}

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

@ -246,13 +246,13 @@ static void DecimalToText(PRInt32 ordinal, nsString& result)
{
char cbuf[40];
PR_snprintf(cbuf, sizeof(cbuf), "%ld", ordinal);
result.Append(cbuf);
result.AppendWithConversion(cbuf);
}
static void DecimalLeadingZeroToText(PRInt32 ordinal, nsString& result)
{
char cbuf[40];
PR_snprintf(cbuf, sizeof(cbuf), "%02ld", ordinal);
result.Append(cbuf);
result.AppendWithConversion(cbuf);
}
@ -267,7 +267,7 @@ static void RomanToText(PRInt32 ordinal, nsString& result, const char* achars, c
ordinal = 1;
}
nsAutoString addOn, decStr;
decStr.Append(ordinal, 10);
decStr.AppendWithConversion(ordinal, 10);
PRIntn len = decStr.Length();
const PRUnichar* dp = decStr.GetUnicode();
const PRUnichar* end = dp + len;
@ -744,7 +744,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX,
break;
}
result.Append(".");
result.AppendWithConversion(".");
}
#define MIN_BULLET_SIZE 5 // from laytext.c

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

@ -1813,22 +1813,22 @@ nsFrame::GetFrameName(nsString& aResult) const
nsresult
nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
{
aResult = aType;
aResult.AssignWithConversion(aType);
if (nsnull != mContent) {
nsIAtom* tag;
mContent->GetTag(tag);
if ((tag != nsnull) && (tag != nsLayoutAtoms::textTagName)) {
aResult.Append("(");
aResult.AppendWithConversion("(");
nsAutoString buf;
tag->ToString(buf);
aResult.Append(buf);
NS_RELEASE(tag);
aResult.Append(")");
aResult.AppendWithConversion(")");
}
}
char buf[40];
PR_snprintf(buf, sizeof(buf), "(%d)", ContentIndexInContainer(this));
aResult.Append(buf);
aResult.AppendWithConversion(buf);
return NS_OK;
}
#endif
@ -1840,21 +1840,21 @@ nsFrame::XMLQuote(nsString& aString)
for (i = 0; i < len; i++) {
PRUnichar ch = aString.CharAt(i);
if (ch == '<') {
nsAutoString tmp("&lt;");
nsAutoString tmp; tmp.AssignWithConversion("&lt;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 3;
i += 3;
}
else if (ch == '>') {
nsAutoString tmp("&gt;");
nsAutoString tmp; tmp.AssignWithConversion("&gt;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 3;
i += 3;
}
else if (ch == '\"') {
nsAutoString tmp("&quot;");
nsAutoString tmp; tmp.AssignWithConversion("&quot;");
aString.Cut(i, 1);
aString.Insert(tmp, i);
len += 5;

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

@ -281,14 +281,14 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("horizontal"), PR_FALSE);
elementFactory->CreateInstanceByTag(NS_ConvertToString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, NS_ConvertToString("horizontal"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
// create vertical scrollbar
content = nsnull;
elementFactory->CreateInstanceByTag(nsAutoString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, nsAutoString("vertical"), PR_FALSE);
elementFactory->CreateInstanceByTag(NS_ConvertToString("scrollbar"), getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, NS_ConvertToString("vertical"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
// XXX For GFX never have scrollbars
@ -1028,7 +1028,7 @@ nsGfxScrollFrameInner::SetAttribute(nsIBox* aBox, nsIAtom* aAtom, nscoord aSize,
frame->GetContent(getter_AddRefs(content));
char ch[100];
sprintf(ch,"%d", aSize);
nsAutoString newValue(ch);
nsAutoString newValue; newValue.AssignWithConversion(ch);
content->SetAttribute(kNameSpaceID_None, aAtom, newValue, aReflow);
return PR_TRUE;
}

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

@ -81,7 +81,7 @@ void
nsHTMLImageLoader::SetURL(const nsString& aNewSpec)
{
mURLSpec = aNewSpec;
if (mBaseURL && !aNewSpec.Equals("")) {
if (mBaseURL && !aNewSpec.IsEmpty()) {
nsString empty;
nsresult rv;
rv = NS_MakeAbsoluteURI(mURL, mURLSpec, mBaseURL);
@ -170,7 +170,7 @@ nsHTMLImageLoader::StartLoadImage(nsIPresContext* aPresContext)
// We were not initialized!
return NS_ERROR_NULL_POINTER;
}
if (mURL.Equals("")) {
if (mURL.IsEmpty()) {
return NS_OK;
}
@ -179,14 +179,14 @@ nsHTMLImageLoader::StartLoadImage(nsIPresContext* aPresContext)
// of the absolute url...
nsAutoString internalImageURLSpec;
nsString* urlSpec = &mURL;
if (mURLSpec.Compare(GOPHER_SPEC, PR_FALSE, GOPHER_SPEC_SIZE) == 0) {
if (mURLSpec.CompareWithConversion(GOPHER_SPEC, PR_FALSE, GOPHER_SPEC_SIZE) == 0) {
// We found a special image source value that refers to a
// builtin image. Rewrite the source url as a resource url.
urlSpec = &internalImageURLSpec;
mURLSpec.Mid(internalImageURLSpec, GOPHER_SPEC_SIZE,
mURLSpec.Length() - GOPHER_SPEC_SIZE);
internalImageURLSpec.Insert("resource:/res/html/gopher-", 0);
internalImageURLSpec.Append(".gif");
internalImageURLSpec.InsertWithConversion("resource:/res/html/gopher-", 0);
internalImageURLSpec.AppendWithConversion(".gif");
}
// This is kind of sick, but its possible that we will get a

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

@ -785,7 +785,7 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
if (p.y < 0) p.y = 0;
char cbuf[50];
PR_snprintf(cbuf, sizeof(cbuf), "?%d,%d", p.x, p.y);
absURL.Append(cbuf);
absURL.AppendWithConversion(cbuf);
PRBool clicked = PR_FALSE;
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) {
*aEventStatus = nsEventStatus_eConsumeDoDefault;

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

@ -327,37 +327,37 @@ void Area::ToHTML(nsString& aResult)
}
aResult.Truncate();
aResult.Append("<AREA SHAPE=");
aResult.AppendWithConversion("<AREA SHAPE=");
nsAutoString shape;
GetShapeName(shape);
aResult.Append(shape);
aResult.Append(" COORDS=\"");
aResult.AppendWithConversion(" COORDS=\"");
if (nsnull != mCoords) {
PRInt32 i, n = mNumCoords;
for (i = 0; i < n; i++) {
aResult.Append(mCoords[i], 10);
aResult.AppendWithConversion(mCoords[i], 10);
if (i < n - 1) {
aResult.Append(',');
aResult.AppendWithConversion(',');
}
}
}
aResult.Append("\" HREF=\"");
aResult.AppendWithConversion("\" HREF=\"");
aResult.Append(href);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
if (0 < target.Length()) {
aResult.Append(" TARGET=\"");
aResult.AppendWithConversion(" TARGET=\"");
aResult.Append(target);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
}
if (0 < altText.Length()) {
aResult.Append(" ALT=\"");
aResult.AppendWithConversion(" ALT=\"");
aResult.Append(altText);
aResult.Append("\"");
aResult.AppendWithConversion("\"");
}
if (mSuppressFeedback) {
aResult.Append(" SUPPRESS");
aResult.AppendWithConversion(" SUPPRESS");
}
aResult.Append('>');
aResult.AppendWithConversion('>');
}
/**
@ -376,11 +376,11 @@ void Area::BeginConvertToXIF(nsXIFConverter& aConverter) const
mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, altText);
}
nsAutoString tag("area");
nsAutoString tag; tag.AssignWithConversion("area");
aConverter.BeginStartTag(tag);
nsAutoString name("shape");
nsAutoString name; name.AssignWithConversion("shape");
nsAutoString shape;
GetShapeName(shape);
aConverter.AddAttribute(name,shape);
@ -390,36 +390,36 @@ void Area::BeginConvertToXIF(nsXIFConverter& aConverter) const
if (nsnull != mCoords) {
PRInt32 i, n = mNumCoords;
for (i = 0; i < n; i++) {
coords.Append(mCoords[i], 10);
coords.AppendWithConversion(mCoords[i], 10);
if (i < n - 1) {
coords.Append(',');
}
}
}
name.Assign("coords");
name.AssignWithConversion("coords");
aConverter.AddAttribute(name,coords);
name.Assign("href");
name.AssignWithConversion("href");
aConverter.AddAttribute(name,href);
if (0 < target.Length()) {
name.Assign("target");
name.AssignWithConversion("target");
aConverter.AddAttribute(name,target);
}
if (0 < altText.Length()) {
name.Assign("alt");
name.AssignWithConversion("alt");
aConverter.AddAttribute(name,altText);
}
if (mSuppressFeedback) {
name.Assign("suppress");
name.AssignWithConversion("suppress");
aConverter.AddAttribute(name);
}
}
void Area::FinishConvertToXIF(nsXIFConverter& aConverter) const
{
nsAutoString tag("area");
nsAutoString tag; tag.AssignWithConversion("area");
aConverter.FinishStartTag(tag,PR_TRUE);
}
@ -464,7 +464,7 @@ void DefaultArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void DefaultArea::GetShapeName(nsString& aResult) const
{
aResult.Append("default");
aResult.AppendWithConversion("default");
}
//----------------------------------------------------------------------
@ -525,7 +525,7 @@ void RectArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void RectArea::GetShapeName(nsString& aResult) const
{
aResult.Append("rect");
aResult.AppendWithConversion("rect");
}
//----------------------------------------------------------------------
@ -635,7 +635,7 @@ void PolyArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void PolyArea::GetShapeName(nsString& aResult) const
{
aResult.Append("polygon");
aResult.AppendWithConversion("polygon");
}
//----------------------------------------------------------------------
@ -700,7 +700,7 @@ void CircleArea::Draw(nsIPresContext* aCX, nsIRenderingContext& aRC)
void CircleArea::GetShapeName(nsString& aResult) const
{
aResult.Append("circle");
aResult.AppendWithConversion("circle");
}
//----------------------------------------------------------------------

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

@ -650,7 +650,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
if (classid.Find("clsid:") != -1)
{
classid.Cut(0, 6); // Strip off the "clsid:". What's left is the class ID.
bJavaPluginClsid = (classid.Equals(JAVA_CLASS_ID));
bJavaPluginClsid = (classid.EqualsWithConversion(JAVA_CLASS_ID));
}
// if we find "java:" in the class id, or we match the Java classid number, we have a java applet
@ -702,7 +702,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
{
// These are some builtin types that we know about for now.
// (Eventually this will move somewhere else.)
if (classid.Equals("browser"))
if (classid.EqualsWithConversion("browser"))
{
widgetCID = kCAppShellCID;
rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, widgetCID);
@ -1742,8 +1742,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
nsAutoString uniurl = nsAutoString(aURL);
nsAutoString unitarget = nsAutoString(aTarget);
nsAutoString uniurl; uniurl.AssignWithConversion(aURL);
nsAutoString unitarget; unitarget.AssignWithConversion(aTarget);
nsAutoString fullurl;
nsIURI* baseURL;
@ -1797,7 +1797,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char *aStatusMsg)
if(browserChrome)
{
nsAutoString msg = nsAutoString(aStatusMsg);
nsAutoString msg; msg.AssignWithConversion(aStatusMsg);
browserChrome->SetJSStatus(msg.GetUnicode());
}
}

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

@ -1190,7 +1190,7 @@ PresShell::GetActiveAlternateStyleSheet(nsString& aSheetTitle)
if (mStyleSet) {
PRInt32 count = mStyleSet->GetNumberOfDocStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mStyleSet->GetDocStyleSheetAt(index);
if (nsnull != sheet) {
@ -1217,7 +1217,7 @@ PresShell::SelectAlternateStyleSheet(const nsString& aSheetTitle)
if (mDocument && mStyleSet) {
PRInt32 count = mDocument->GetNumberOfStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mDocument->GetStyleSheetAt(index);
if (nsnull != sheet) {
@ -1249,7 +1249,7 @@ PresShell::ListAlternateStyleSheets(nsStringArray& aTitleList)
if (mDocument) {
PRInt32 count = mDocument->GetNumberOfStyleSheets();
PRInt32 index;
nsAutoString textHtml("text/html");
nsAutoString textHtml; textHtml.AssignWithConversion("text/html");
for (index = 0; index < count; index++) {
nsIStyleSheet* sheet = mDocument->GetStyleSheetAt(index);
if (nsnull != sheet) {
@ -3554,7 +3554,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
}
}
else {
name = "(null)";
name.AssignWithConversion("(null)");
}
fputs(name, stdout);
@ -3569,7 +3569,7 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
}
}
else {
name = "(null)";
name.AssignWithConversion("(null)");
}
fputs(name, stdout);

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

@ -4385,14 +4385,14 @@ nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const
while (fragOffset < n) {
PRUnichar ch = frag->CharAt(fragOffset++);
if (ch == '\r') {
aBuf.Append("\\r");
aBuf.AppendWithConversion("\\r");
} else if (ch == '\n') {
aBuf.Append("\\n");
aBuf.AppendWithConversion("\\n");
} else if (ch == '\t') {
aBuf.Append("\\t");
aBuf.AppendWithConversion("\\t");
} else if ((ch < ' ') || (ch >= 127)) {
aBuf.Append("\\0");
aBuf.Append((PRInt32)ch, 8);
aBuf.AppendWithConversion("\\0");
aBuf.AppendWithConversion((PRInt32)ch, 8);
} else {
aBuf.Append(ch);
}