making string conversions explicit
git-svn-id: svn://10.0.0.236/trunk@66630 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -235,7 +235,7 @@ nsHTMLToTXTSinkStream::Initialize(nsIOutputStream* aOutStream,
|
||||
NS_GET_IID(nsILineBreakerFactory),
|
||||
(nsISupports **)&lf);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
nsAutoString lbarg("");
|
||||
nsAutoString lbarg;
|
||||
result = lf->GetBreaker(lbarg, &mLineBreaker);
|
||||
if(NS_FAILED(result)) {
|
||||
mLineBreaker = nsnull;
|
||||
@@ -583,8 +583,11 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
// >>> fdfd
|
||||
// when a mail is sent.
|
||||
nsString value;
|
||||
if (NS_SUCCEEDED(GetValueOfAttribute(aNode, "type", value))
|
||||
&& value.StripChars("\"").EqualsWithConversion("cite", PR_TRUE))
|
||||
nsresult rv = GetValueOfAttribute(aNode, "type", value);
|
||||
if ( NS_SUCCEEDED(rv) )
|
||||
value.StripChars("\"");
|
||||
|
||||
if (NS_SUCCEEDED(rv) && value.EqualsWithConversion("cite", PR_TRUE))
|
||||
mCiteQuoteLevel++;
|
||||
else
|
||||
mIndent += gTabSize; // Check for some maximum value?
|
||||
@@ -594,7 +597,10 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
nsAutoString url;
|
||||
if (NS_SUCCEEDED(GetValueOfAttribute(aNode, "href", url))
|
||||
&& !url.IsEmpty())
|
||||
mURL = url.StripChars("\"");
|
||||
{
|
||||
url.StripChars("\"");
|
||||
mURL = url;
|
||||
}
|
||||
}
|
||||
else if (type == eHTMLTag_img)
|
||||
{
|
||||
@@ -606,15 +612,24 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
&& !desc.IsEmpty())
|
||||
{
|
||||
temp.AppendWithConversion(" (");
|
||||
temp += desc.StripChars("\"");
|
||||
|
||||
desc.StripChars("\"");
|
||||
temp += desc;
|
||||
|
||||
temp.AppendWithConversion(" <");
|
||||
temp += url.StripChars("\"");
|
||||
|
||||
url.StripChars("\"");
|
||||
temp += url;
|
||||
|
||||
temp.AppendWithConversion(">) ");
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.AppendWithConversion(" <");
|
||||
temp += url.StripChars("\"");
|
||||
|
||||
url.StripChars("\"");
|
||||
temp += url;
|
||||
|
||||
temp.AppendWithConversion("> ");
|
||||
}
|
||||
Write(temp);
|
||||
|
||||
@@ -1077,7 +1077,7 @@ nsresult nsXIFDTD::AddLeaf(const nsIParserNode& aNode)
|
||||
case eXIFTag_text:
|
||||
if(theToken) {
|
||||
nsString& temp =theToken->GetStringValueXXX();
|
||||
if (temp.Equals("<xml version=\"1.0\"?>")) handled=PR_TRUE;
|
||||
if (temp.EqualsWithConversion("<xml version=\"1.0\"?>")) handled=PR_TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1348,7 +1348,7 @@ nsresult nsXIFDTD::BeginCSSStyleSheet(const nsIParserNode& aNode)
|
||||
CToken* theToken=((nsCParserNode&)aNode).mToken;
|
||||
|
||||
if(theToken) {
|
||||
theToken->Reinitialize(eHTMLTag_style,"style");
|
||||
theToken->Reinitialize(eHTMLTag_style,NS_ConvertASCIItoUCS2("style"));
|
||||
mXIFContext->Push(&aNode);
|
||||
}
|
||||
|
||||
@@ -1368,9 +1368,9 @@ nsresult nsXIFDTD::EndCSSStyleSheet(const nsIParserNode& aNode)
|
||||
nsresult result=NS_OK;
|
||||
nsAutoString tagName(nsHTMLTags::GetStringValue(eHTMLTag_style));
|
||||
|
||||
mBuffer.Append("</");
|
||||
mBuffer.AppendWithConversion("</");
|
||||
mBuffer.Append(tagName);
|
||||
mBuffer.Append(">");
|
||||
mBuffer.AppendWithConversion(">");
|
||||
((nsCParserNode&)aNode).SetSkippedContent(mBuffer);
|
||||
|
||||
result=mSink->AddLeaf(aNode);
|
||||
@@ -1421,16 +1421,16 @@ nsresult nsXIFDTD::BeginCSSDeclarationList(const nsIParserNode& aNode)
|
||||
count = 0;
|
||||
|
||||
for (PRInt32 i = 0; i < count; i++)
|
||||
mBuffer.Append(" ");
|
||||
mBuffer.AppendWithConversion(" ");
|
||||
|
||||
mBuffer.Append(" {");
|
||||
mBuffer.AppendWithConversion(" {");
|
||||
mCSSDeclarationCount = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult nsXIFDTD::EndCSSDeclarationList(const nsIParserNode& aNode)
|
||||
{
|
||||
mBuffer.Append("}\n");
|
||||
mBuffer.AppendWithConversion("}\n");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -1445,10 +1445,10 @@ nsresult nsXIFDTD::AddCSSDeclaration(const nsIParserNode& aNode)
|
||||
if (PR_TRUE == GetAttribute(aNode, mGenericKey, value))
|
||||
{
|
||||
if (mCSSDeclarationCount != 0)
|
||||
mBuffer.Append(";");
|
||||
mBuffer.Append(" ");
|
||||
mBuffer.AppendWithConversion(";");
|
||||
mBuffer.AppendWithConversion(" ");
|
||||
mBuffer.Append(property);
|
||||
mBuffer.Append(": ");
|
||||
mBuffer.AppendWithConversion(": ");
|
||||
mBuffer.Append(value);
|
||||
mCSSDeclarationCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user