зеркало из https://github.com/mozilla/gecko-dev.git
making string conversions explicit
This commit is contained in:
Родитель
212305e1d1
Коммит
8d5a2627d8
|
@ -1270,7 +1270,8 @@ nsEditorShell::CheckAndSaveDocument(const PRUnichar *reasonToSave, PRBool *_retv
|
|||
|
||||
nsAutoString saveMsg;
|
||||
GetBundleString(NS_ConvertASCIItoUCS2("SaveFilePrompt"), saveMsg);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%title%"), title).ReplaceSubstring(NS_ConvertASCIItoUCS2("%reason%"), reasonToSaveStr);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%title%"), title);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%reason%"), reasonToSaveStr);
|
||||
|
||||
nsAutoString saveDocString;
|
||||
GetBundleString(NS_ConvertASCIItoUCS2("SaveDocument"), saveDocString);
|
||||
|
@ -2204,7 +2205,7 @@ nsEditorShell::Rewrap(PRBool aRespectNewlines)
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Variables we'll need either way
|
||||
nsAutoString format("text/plain");
|
||||
nsAutoString format; format.AssignWithConversion("text/plain");
|
||||
nsAutoString current;
|
||||
nsString wrapped;
|
||||
nsCOMPtr<nsIEditor> nsied (do_QueryInterface(mEditor));
|
||||
|
@ -2268,7 +2269,7 @@ nsEditorShell::StripCites()
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Variables we'll need either way
|
||||
nsAutoString format("text/plain");
|
||||
nsAutoString format; format.AssignWithConversion("text/plain");
|
||||
nsAutoString current;
|
||||
nsString stripped;
|
||||
nsCOMPtr<nsIEditor> nsied (do_QueryInterface(mEditor));
|
||||
|
|
|
@ -720,8 +720,8 @@ NS_IMETHODIMP nsHTMLEditor::EditorKeyPress(nsIDOMKeyEvent* aKeyEvent)
|
|||
else if (nsHTMLEditUtils::IsListItem(blockParent))
|
||||
{
|
||||
nsAutoString indentstr;
|
||||
if (isShift) indentstr = "outdent";
|
||||
else indentstr = "indent";
|
||||
if (isShift) indentstr.AssignWithConversion("outdent");
|
||||
else indentstr.AssignWithConversion("indent");
|
||||
res = Indent(indentstr);
|
||||
bHandled = PR_TRUE;
|
||||
}
|
||||
|
@ -2703,7 +2703,7 @@ nsHTMLEditor::SetCaretAfterElement(nsIDOMElement* aElement)
|
|||
NS_IMETHODIMP nsHTMLEditor::SetParagraphFormat(const nsString& aParagraphFormat)
|
||||
{
|
||||
//Kinda sad to waste memory just to force lower case
|
||||
nsAutoString tag = aParagraphFormat;
|
||||
nsAutoString tag; tag.Assign(aParagraphFormat);
|
||||
tag.ToLowerCase();
|
||||
return InsertBasicBlock(tag);
|
||||
}
|
||||
|
|
|
@ -1270,7 +1270,8 @@ nsEditorShell::CheckAndSaveDocument(const PRUnichar *reasonToSave, PRBool *_retv
|
|||
|
||||
nsAutoString saveMsg;
|
||||
GetBundleString(NS_ConvertASCIItoUCS2("SaveFilePrompt"), saveMsg);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%title%"), title).ReplaceSubstring(NS_ConvertASCIItoUCS2("%reason%"), reasonToSaveStr);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%title%"), title);
|
||||
saveMsg.ReplaceSubstring(NS_ConvertASCIItoUCS2("%reason%"), reasonToSaveStr);
|
||||
|
||||
nsAutoString saveDocString;
|
||||
GetBundleString(NS_ConvertASCIItoUCS2("SaveDocument"), saveDocString);
|
||||
|
@ -2204,7 +2205,7 @@ nsEditorShell::Rewrap(PRBool aRespectNewlines)
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Variables we'll need either way
|
||||
nsAutoString format("text/plain");
|
||||
nsAutoString format; format.AssignWithConversion("text/plain");
|
||||
nsAutoString current;
|
||||
nsString wrapped;
|
||||
nsCOMPtr<nsIEditor> nsied (do_QueryInterface(mEditor));
|
||||
|
@ -2268,7 +2269,7 @@ nsEditorShell::StripCites()
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Variables we'll need either way
|
||||
nsAutoString format("text/plain");
|
||||
nsAutoString format; format.AssignWithConversion("text/plain");
|
||||
nsAutoString current;
|
||||
nsString stripped;
|
||||
nsCOMPtr<nsIEditor> nsied (do_QueryInterface(mEditor));
|
||||
|
|
|
@ -720,8 +720,8 @@ NS_IMETHODIMP nsHTMLEditor::EditorKeyPress(nsIDOMKeyEvent* aKeyEvent)
|
|||
else if (nsHTMLEditUtils::IsListItem(blockParent))
|
||||
{
|
||||
nsAutoString indentstr;
|
||||
if (isShift) indentstr = "outdent";
|
||||
else indentstr = "indent";
|
||||
if (isShift) indentstr.AssignWithConversion("outdent");
|
||||
else indentstr.AssignWithConversion("indent");
|
||||
res = Indent(indentstr);
|
||||
bHandled = PR_TRUE;
|
||||
}
|
||||
|
@ -2703,7 +2703,7 @@ nsHTMLEditor::SetCaretAfterElement(nsIDOMElement* aElement)
|
|||
NS_IMETHODIMP nsHTMLEditor::SetParagraphFormat(const nsString& aParagraphFormat)
|
||||
{
|
||||
//Kinda sad to waste memory just to force lower case
|
||||
nsAutoString tag = aParagraphFormat;
|
||||
nsAutoString tag; tag.Assign(aParagraphFormat);
|
||||
tag.ToLowerCase();
|
||||
return InsertBasicBlock(tag);
|
||||
}
|
||||
|
|
|
@ -3466,7 +3466,8 @@ InternetSearchDataSource::GetData(const nsString &data, const char *sectionToFin
|
|||
if (attrib.EqualsIgnoreCase(attribToFind))
|
||||
{
|
||||
line.Cut(0, equal+1);
|
||||
value = line.Trim(" \t");
|
||||
line.Trim(" \t");
|
||||
value = line;
|
||||
|
||||
// strip of any enclosing quotes
|
||||
PRUnichar quoteChar;
|
||||
|
@ -3494,7 +3495,7 @@ InternetSearchDataSource::GetData(const nsString &data, const char *sectionToFin
|
|||
{
|
||||
value.Truncate(commentOffset);
|
||||
}
|
||||
value = value.Trim(" \t");
|
||||
value.Trim(" \t");
|
||||
}
|
||||
rv = NS_OK;
|
||||
break;
|
||||
|
@ -4718,7 +4719,7 @@ InternetSearchDataSource::ConvertEntities(nsString &nameStr, PRBool removeHTMLFl
|
|||
if (trimWhiteSpaceFlag == PR_TRUE)
|
||||
{
|
||||
// trim name
|
||||
nameStr = nameStr.Trim(" \t");
|
||||
nameStr.Trim(" \t");
|
||||
}
|
||||
|
||||
return(NS_OK);
|
||||
|
|
Загрузка…
Ссылка в новой задаче