Change more instances of NS_ConvertASCIItoUCS2 to NS_LITERAL_STRING.

Bug 104159, r=jag, sr=alecf
This commit is contained in:
bzbarsky%mit.edu 2002-01-11 19:39:51 +00:00
Родитель f833b1af22
Коммит 62bab8e43b
12 изменённых файлов: 30 добавлений и 30 удалений

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

@ -2258,7 +2258,7 @@ nsComboboxControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
eventReceiver->AddEventListenerByIID(mButtonListener, NS_GET_IID(nsIDOMMouseListener));
}
btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE);
btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
aChildList.AppendElement(btnContent);
}
}

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

@ -135,10 +135,10 @@ void nsFormControlHelper::ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame
void nsFormControlHelper::PlatformToDOMLineBreaks(nsString &aString)
{
// Windows linebreaks: Map CRLF to LF:
aString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"), NS_ConvertASCIItoUCS2("\n"));
aString.ReplaceSubstring(NS_LITERAL_STRING("\r\n").get(), NS_LITERAL_STRING("\n").get());
// Mac linebreaks: Map any remaining CR to LF:
aString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r"), NS_ConvertASCIItoUCS2("\n"));
aString.ReplaceSubstring(NS_LITERAL_STRING("\r").get(), NS_LITERAL_STRING("\n").get());
}
PRBool nsFormControlHelper::GetBool(const nsAReadableString& aValue)

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

@ -156,7 +156,7 @@ nsGfxCheckboxControlFrame::Init(nsIPresContext* aPresContext,
// give the attribute a default value so it's always present, if we're a tristate
if ( IsTristateCheckbox() )
mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE );
mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_LITERAL_STRING("0"), PR_FALSE );
return NS_OK;
}

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

@ -219,9 +219,9 @@ nsGfxRadioControlFrame::SetChecked(nsIPresContext* aPresContext, PRBool aValue,
{
if (aSetInitialValue) {
if (aValue) {
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_LITERAL_STRING("1"), PR_FALSE); // XXX should be "empty" value
} else {
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE);
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_LITERAL_STRING("0"), PR_FALSE);
}
}

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

@ -272,7 +272,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
result = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mInputContent);
if (NS_SUCCEEDED(result)) {
mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE);
mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
aChildList.AppendElement(mInputContent);
// Register as an event listener to submit on Enter press

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

@ -2258,7 +2258,7 @@ nsComboboxControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
eventReceiver->AddEventListenerByIID(mButtonListener, NS_GET_IID(nsIDOMMouseListener));
}
btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE);
btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
aChildList.AppendElement(btnContent);
}
}

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

@ -135,10 +135,10 @@ void nsFormControlHelper::ForceDrawFrame(nsIPresContext* aPresContext, nsIFrame
void nsFormControlHelper::PlatformToDOMLineBreaks(nsString &aString)
{
// Windows linebreaks: Map CRLF to LF:
aString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r\n"), NS_ConvertASCIItoUCS2("\n"));
aString.ReplaceSubstring(NS_LITERAL_STRING("\r\n").get(), NS_LITERAL_STRING("\n").get());
// Mac linebreaks: Map any remaining CR to LF:
aString.ReplaceSubstring(NS_ConvertASCIItoUCS2("\r"), NS_ConvertASCIItoUCS2("\n"));
aString.ReplaceSubstring(NS_LITERAL_STRING("\r").get(), NS_LITERAL_STRING("\n").get());
}
PRBool nsFormControlHelper::GetBool(const nsAReadableString& aValue)

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

@ -156,7 +156,7 @@ nsGfxCheckboxControlFrame::Init(nsIPresContext* aPresContext,
// give the attribute a default value so it's always present, if we're a tristate
if ( IsTristateCheckbox() )
mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE );
mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_LITERAL_STRING("0"), PR_FALSE );
return NS_OK;
}

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

@ -219,9 +219,9 @@ nsGfxRadioControlFrame::SetChecked(nsIPresContext* aPresContext, PRBool aValue,
{
if (aSetInitialValue) {
if (aValue) {
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_LITERAL_STRING("1"), PR_FALSE); // XXX should be "empty" value
} else {
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE);
mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_LITERAL_STRING("0"), PR_FALSE);
}
}

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

@ -980,7 +980,7 @@ NS_METHOD nsGfxTextControlFrame::HandleEvent(nsIPresContext* aPresContext,
break;
case NS_FORM_SELECTED:
return UpdateTextControlCommands(NS_ConvertASCIItoUCS2("select"));
return UpdateTextControlCommands(NS_LITERAL_STRING("select"));
break;
}
return NS_OK;
@ -1417,7 +1417,7 @@ nsGfxTextControlFrame::CreateSubDoc(nsRect *aSizeOfSubdocContainer)
if (!htmlElement) { return NS_ERROR_NULL_POINTER; }
// create the head
nimgr->GetNodeInfo(NS_ConvertASCIItoUCS2("head"), nsnull,
nimgr->GetNodeInfo(NS_LITERAL_STRING("head"), nsnull,
kNameSpaceID_None, *getter_AddRefs(nodeInfo));
rv = NS_NewHTMLHeadElement(getter_AddRefs(headElement), nodeInfo);
@ -3411,7 +3411,7 @@ nsGfxTextControlFrame::InitializeTextControl(nsIPresShell *aPresShell, nsIDOMDoc
if (NS_FAILED(result)) { return result; }
if (!selection) { return NS_ERROR_NULL_POINTER; }
nsCOMPtr<nsIDOMNode>bodyNode;
result = GetFirstNodeOfType(NS_ConvertASCIItoUCS2("body"), aDoc,
result = GetFirstNodeOfType(NS_LITERAL_STRING("body"), aDoc,
getter_AddRefs(bodyNode));
if (NS_SUCCEEDED(result) && bodyNode)
{
@ -3506,13 +3506,13 @@ nsGfxTextControlFrame::InternalContentChanged()
return mContent->HandleDOMEvent(mFramePresContext, &theEvent, nsnull, NS_EVENT_FLAG_INIT, &status);
}
nsresult nsGfxTextControlFrame::UpdateTextControlCommands(const nsString& aCommand)
nsresult nsGfxTextControlFrame::UpdateTextControlCommands(const nsAString& aCommand)
{
nsresult rv = NS_OK;
if (mEditor)
{
if (aCommand == NS_ConvertASCIItoUCS2("select")) // optimize select updates
if (aCommand == NS_LITERAL_STRING("select")) // optimize select updates
{
nsCOMPtr<nsISelection> domSelection;
rv = mEditor->GetSelection(getter_AddRefs(domSelection));
@ -3624,7 +3624,7 @@ nsGfxTextControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** aS
nsLinebreakConverter::eLinebreakPlatform, nsLinebreakConverter::eLinebreakContent);
NS_ASSERTION(NS_SUCCEEDED(res), "Converting linebreaks failed!");
(*aState)->SetStateProperty(NS_ConvertASCIItoUCS2("value"), theString);
(*aState)->SetStateProperty(NS_LITERAL_STRING("value"), theString);
return res;
}
@ -3632,7 +3632,7 @@ NS_IMETHODIMP
nsGfxTextControlFrame::RestoreState(nsIPresContext* aPresContext, nsIPresState* aState)
{
nsAutoString stateString;
aState->GetStateProperty(NS_ConvertASCIItoUCS2("value"), stateString);
aState->GetStateProperty(NS_LITERAL_STRING("value"), stateString);
nsresult res = SetProperty(aPresContext, nsHTMLAtoms::value, stateString);
return res;
}
@ -4651,7 +4651,7 @@ NS_IMETHODIMP nsEnderEventListener::DidDo(nsITransactionManager *aManager,
if (undoCount == 1)
{
if (mFirstDoOfFirstUndo)
gfxFrame->UpdateTextControlCommands(NS_ConvertASCIItoUCS2("undo"));
gfxFrame->UpdateTextControlCommands(NS_LITERAL_STRING("undo"));
mFirstDoOfFirstUndo = PR_FALSE;
}
@ -4678,7 +4678,7 @@ NS_IMETHODIMP nsEnderEventListener::DidUndo(nsITransactionManager *aManager,
if (undoCount == 0)
mFirstDoOfFirstUndo = PR_TRUE; // reset the state for the next do
gfxFrame->UpdateTextControlCommands(NS_ConvertASCIItoUCS2("undo"));
gfxFrame->UpdateTextControlCommands(NS_LITERAL_STRING("undo"));
}
return NS_OK;
@ -4697,7 +4697,7 @@ NS_IMETHODIMP nsEnderEventListener::DidRedo(nsITransactionManager *aManager,
nsGfxTextControlFrame *gfxFrame = mFrame.Reference();
if (gfxFrame)
{
gfxFrame->UpdateTextControlCommands(NS_ConvertASCIItoUCS2("undo"));
gfxFrame->UpdateTextControlCommands(NS_LITERAL_STRING("undo"));
}
return NS_OK;

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

@ -221,7 +221,7 @@ public:
protected:
nsresult UpdateTextInputCommands(const nsString& commandsToUpdate);
nsresult UpdateTextInputCommands(const nsAString& commandsToUpdate);
protected:
@ -406,7 +406,7 @@ nsTextInputListener::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection*
mSelectionWasCollapsed = collapsed;
mKnowSelectionCollapsed = PR_TRUE;
return UpdateTextInputCommands(NS_ConvertASCIItoUCS2("select"));
return UpdateTextInputCommands(NS_LITERAL_STRING("select"));
}
//EDITOR INTERFACE
@ -477,7 +477,7 @@ NS_IMETHODIMP nsTextInputListener::DidDo(nsITransactionManager *aManager,
if (undoCount == 1)
{
if (mFirstDoOfFirstUndo)
UpdateTextInputCommands(NS_ConvertASCIItoUCS2("undo"));
UpdateTextInputCommands(NS_LITERAL_STRING("undo"));
mFirstDoOfFirstUndo = PR_FALSE;
}
@ -500,7 +500,7 @@ NS_IMETHODIMP nsTextInputListener::DidUndo(nsITransactionManager *aManager,
if (undoCount == 0)
mFirstDoOfFirstUndo = PR_TRUE; // reset the state for the next do
UpdateTextInputCommands(NS_ConvertASCIItoUCS2("undo"));
UpdateTextInputCommands(NS_LITERAL_STRING("undo"));
return NS_OK;
}
@ -515,7 +515,7 @@ NS_IMETHODIMP nsTextInputListener::WillRedo(nsITransactionManager *aManager,
NS_IMETHODIMP nsTextInputListener::DidRedo(nsITransactionManager *aManager,
nsITransaction *aTransaction, nsresult aRedoResult)
{
UpdateTextInputCommands(NS_ConvertASCIItoUCS2("undo"));
UpdateTextInputCommands(NS_LITERAL_STRING("undo"));
return NS_OK;
}
@ -557,7 +557,7 @@ NS_IMETHODIMP nsTextInputListener::DidMerge(nsITransactionManager *aManager,
nsresult nsTextInputListener::UpdateTextInputCommands(const nsString& commandsToUpdate)
nsresult nsTextInputListener::UpdateTextInputCommands(const nsAString& commandsToUpdate)
{
if (!mFrame) return NS_ERROR_NOT_INITIALIZED;

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

@ -272,7 +272,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
result = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mInputContent);
if (NS_SUCCEEDED(result)) {
mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE);
mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
aChildList.AppendElement(mInputContent);
// Register as an event listener to submit on Enter press