diff --git a/content/base/src/nsContentAreaDragDrop.cpp b/content/base/src/nsContentAreaDragDrop.cpp index 68ada2068d9..1c3e4f02685 100644 --- a/content/base/src/nsContentAreaDragDrop.cpp +++ b/content/base/src/nsContentAreaDragDrop.cpp @@ -291,7 +291,7 @@ nsContentAreaDragDrop::ExtractURLFromData(const nsACString & inFlavor, nsISuppor if ( inFlavor.Equals(kUnicodeMime) ) { // the data is regular unicode, just go with what we get. It may be a url, it // may not be. *shrug* - nsCOMPtr stringData(do_QueryInterface(inDataWrapper)); + nsCOMPtr stringData(do_QueryInterface(inDataWrapper)); if ( stringData ) { nsXPIDLString data; stringData->GetData(getter_Copies(data)); @@ -301,7 +301,7 @@ nsContentAreaDragDrop::ExtractURLFromData(const nsACString & inFlavor, nsISuppor else if ( inFlavor.Equals(kURLMime) ) { // the data is an internet shortcut of the form \n. Strip // out the url piece and return that. - nsCOMPtr<nsISupportsWString> stringData(do_QueryInterface(inDataWrapper)); + nsCOMPtr<nsISupportsString> stringData(do_QueryInterface(inDataWrapper)); if ( stringData ) { nsXPIDLString data; stringData->GetData(getter_Copies(data)); @@ -912,7 +912,7 @@ nsContentAreaDragDrop::CreateTransferable(const nsAString & inURLString, const n nsAutoString dragData ( inURLString ); dragData += NS_LITERAL_STRING("\n"); dragData += inTitleString; - nsCOMPtr<nsISupportsWString> urlPrimitive(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> urlPrimitive(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if ( !urlPrimitive ) return NS_ERROR_FAILURE; urlPrimitive->SetData(dragData.get()); @@ -920,7 +920,7 @@ nsContentAreaDragDrop::CreateTransferable(const nsAString & inURLString, const n } // add the full html - nsCOMPtr<nsISupportsWString> htmlPrimitive(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> htmlPrimitive(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if ( !htmlPrimitive ) return NS_ERROR_FAILURE; htmlPrimitive->SetData(PromiseFlatString(inHTMLString).get()); @@ -929,7 +929,7 @@ nsContentAreaDragDrop::CreateTransferable(const nsAString & inURLString, const n // add the plain (unicode) text. we use the url for text/unicode data if an anchor // is being dragged, rather than the title text of the link or the alt text for // an anchor image. - nsCOMPtr<nsISupportsWString> textPrimitive(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> textPrimitive(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if ( !textPrimitive ) return NS_ERROR_FAILURE; textPrimitive->SetData(PromiseFlatString(inIsAnchor ? inURLString : inTitleString).get()); diff --git a/content/base/src/nsContentPolicy.cpp b/content/base/src/nsContentPolicy.cpp index d84d06187a2..0ed0ad51190 100644 --- a/content/base/src/nsContentPolicy.cpp +++ b/content/base/src/nsContentPolicy.cpp @@ -78,7 +78,7 @@ nsContentPolicy::nsContentPolicy() */ nsCOMPtr<nsISupports> item; while (NS_SUCCEEDED(catEnum->GetNext(getter_AddRefs(item)))) { - nsCOMPtr<nsISupportsString> string = do_QueryInterface(item, &rv); + nsCOMPtr<nsISupportsCString> string = do_QueryInterface(item, &rv); if (NS_FAILED(rv)) continue; diff --git a/content/base/src/nsCopySupport.cpp b/content/base/src/nsCopySupport.cpp index 746d192325a..a0fa4545d9b 100644 --- a/content/base/src/nsCopySupport.cpp +++ b/content/base/src/nsCopySupport.cpp @@ -195,14 +195,14 @@ nsresult nsCopySupport::HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, PRInt16 } // get wStrings to hold clip data - nsCOMPtr<nsISupportsWString> dataWrapper, contextWrapper, infoWrapper; - dataWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + nsCOMPtr<nsISupportsString> dataWrapper, contextWrapper, infoWrapper; + dataWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(dataWrapper, NS_ERROR_FAILURE); if (bIsHTMLCopy) { - contextWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + contextWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(contextWrapper, NS_ERROR_FAILURE); - infoWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + infoWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(infoWrapper, NS_ERROR_FAILURE); } diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index c33e5c39900..f3f5a1ba90e 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -6257,7 +6257,7 @@ DocumentViewerImpl::CheckForPrinters(nsIPrintOptions* aPrintOptions, aPrintSettings->GetPrinterName(&defPrinterName); if (!defPrinterName || (defPrinterName && !*defPrinterName)) { if (defPrinterName) nsMemory::Free(defPrinterName); - nsCOMPtr<nsISupportsWString> wStr = do_QueryInterface(supps); + nsCOMPtr<nsISupportsString> wStr = do_QueryInterface(supps); if (wStr) { PRUnichar* defPrinterName; wStr->ToString(&defPrinterName); diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index c7687bc443f..7ae810f2c5f 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -1133,10 +1133,10 @@ nsDOMClassInfo::RegisterExternalClasses() nsCOMPtr<nsISupports> entry; while (NS_SUCCEEDED(e->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category(do_QueryInterface(entry)); + nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry)); if (!category) { - NS_WARNING("Category entry not an nsISupportsString!"); + NS_WARNING("Category entry not an nsISupportsCString!"); continue; } diff --git a/dom/src/base/nsScriptNameSpaceManager.cpp b/dom/src/base/nsScriptNameSpaceManager.cpp index f291117b7f1..315927a3799 100644 --- a/dom/src/base/nsScriptNameSpaceManager.cpp +++ b/dom/src/base/nsScriptNameSpaceManager.cpp @@ -176,10 +176,10 @@ nsScriptNameSpaceManager::FillHash(nsICategoryManager *aCategoryManager, nsCOMPtr<nsISupports> entry; while (NS_SUCCEEDED(e->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category(do_QueryInterface(entry)); + nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry)); if (!category) { - NS_WARNING("Category entry not an nsISupportsString!"); + NS_WARNING("Category entry not an nsISupportsCString!"); continue; } @@ -302,10 +302,10 @@ nsScriptNameSpaceManager::RegisterExternalInterfaces(PRBool aAsProto) PRBool found_old, dom_prefix; while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category(do_QueryInterface(entry)); + nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry)); if (!category) { - NS_WARNING("Category entry not an nsISupportsString!"); + NS_WARNING("Category entry not an nsISupportsCString!"); continue; } diff --git a/dom/src/build/nsScriptNameSpaceManager.cpp b/dom/src/build/nsScriptNameSpaceManager.cpp index f291117b7f1..315927a3799 100644 --- a/dom/src/build/nsScriptNameSpaceManager.cpp +++ b/dom/src/build/nsScriptNameSpaceManager.cpp @@ -176,10 +176,10 @@ nsScriptNameSpaceManager::FillHash(nsICategoryManager *aCategoryManager, nsCOMPtr<nsISupports> entry; while (NS_SUCCEEDED(e->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category(do_QueryInterface(entry)); + nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry)); if (!category) { - NS_WARNING("Category entry not an nsISupportsString!"); + NS_WARNING("Category entry not an nsISupportsCString!"); continue; } @@ -302,10 +302,10 @@ nsScriptNameSpaceManager::RegisterExternalInterfaces(PRBool aAsProto) PRBool found_old, dom_prefix; while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category(do_QueryInterface(entry)); + nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry)); if (!category) { - NS_WARNING("Category entry not an nsISupportsString!"); + NS_WARNING("Category entry not an nsISupportsCString!"); continue; } diff --git a/editor/libeditor/html/nsHTMLDataTransfer.cpp b/editor/libeditor/html/nsHTMLDataTransfer.cpp index 404f5c0f673..58ba47a6a10 100644 --- a/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -805,7 +805,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable #endif if (flavor.Equals(NS_LITERAL_STRING(kHTMLMime))) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && len > 0) { PRUnichar* text = nsnull; @@ -821,7 +821,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable } else if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime))) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && len > 0) { PRUnichar* text = nsnull; @@ -943,7 +943,7 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent) nsAutoString contextStr, infoStr; nsCOMPtr<nsISupports> contextDataObj, infoDataObj; PRUint32 contextLen, infoLen; - nsCOMPtr<nsISupportsWString> textDataObj; + nsCOMPtr<nsISupportsString> textDataObj; nsCOMPtr<nsITransferable> contextTrans = do_CreateInstance(kCTransferableCID); NS_ENSURE_TRUE(contextTrans, NS_ERROR_NULL_POINTER); @@ -1264,9 +1264,9 @@ NS_IMETHODIMP nsHTMLEditor::DoDrag(nsIDOMEvent *aDragEvent) // if we have an empty string, we're done; otherwise continue if ( !buffer.IsEmpty() ) { - nsCOMPtr<nsISupportsWString> dataWrapper, contextWrapper, infoWrapper; + nsCOMPtr<nsISupportsString> dataWrapper, contextWrapper, infoWrapper; - dataWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + dataWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(dataWrapper, NS_ERROR_FAILURE); rv = dataWrapper->SetData( NS_CONST_CAST(PRUnichar*, buffer.get()) ); if (NS_FAILED(rv)) return rv; @@ -1285,9 +1285,9 @@ NS_IMETHODIMP nsHTMLEditor::DoDrag(nsIDOMEvent *aDragEvent) } else { - contextWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + contextWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(contextWrapper, NS_ERROR_FAILURE); - infoWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + infoWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(infoWrapper, NS_ERROR_FAILURE); contextWrapper->SetData ( NS_CONST_CAST(PRUnichar*,parents.get()) ); @@ -1367,7 +1367,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType) nsAutoString contextStr, infoStr; nsCOMPtr<nsISupports> contextDataObj, infoDataObj; PRUint32 contextLen, infoLen; - nsCOMPtr<nsISupportsWString> textDataObj; + nsCOMPtr<nsISupportsString> textDataObj; nsCOMPtr<nsITransferable> contextTrans = do_CreateInstance(kCTransferableCID); NS_ENSURE_TRUE(contextTrans, NS_ERROR_NULL_POINTER); @@ -1437,9 +1437,9 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste) // add the flavors for all editors for (const char* const* flavor = textEditorFlavors; *flavor; flavor++) { - nsCOMPtr<nsISupportsString> flavorString; - nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(flavorString)); + nsCOMPtr<nsISupportsCString> flavorString; + nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(flavorString)); if (flavorString) { flavorString->SetData(*flavor); @@ -1454,9 +1454,9 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste) *htmlFlavor; htmlFlavor++) { - nsCOMPtr<nsISupportsString> flavorString; - nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(flavorString)); + nsCOMPtr<nsISupportsCString> flavorString; + nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(flavorString)); if (flavorString) { flavorString->SetData(*htmlFlavor); @@ -1578,7 +1578,7 @@ NS_IMETHODIMP nsHTMLEditor::PasteAsPlaintextQuotation(PRInt32 aSelectionType) nsAutoString stuffToPaste; if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime))) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && len > 0) { PRUnichar* text = nsnull; diff --git a/editor/libeditor/text/nsPlaintextDataTransfer.cpp b/editor/libeditor/text/nsPlaintextDataTransfer.cpp index 5a09cb2a28b..fed12548912 100644 --- a/editor/libeditor/text/nsPlaintextDataTransfer.cpp +++ b/editor/libeditor/text/nsPlaintextDataTransfer.cpp @@ -165,7 +165,7 @@ NS_IMETHODIMP nsPlaintextEditor::InsertTextFromTransferable(nsITransferable *tra flavor.AssignWithConversion( bestFlavor ); // just so we can use flavor.Equals() if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime))) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && len > 0) { PRUnichar* text = nsnull; @@ -493,7 +493,7 @@ NS_IMETHODIMP nsPlaintextEditor::DoDrag(nsIDOMEvent *aDragEvent) // if we have an empty string, we're done; otherwise continue if ( !buffer.IsEmpty() ) { - nsCOMPtr<nsISupportsWString> dataWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + nsCOMPtr<nsISupportsString> dataWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(dataWrapper, NS_ERROR_FAILURE); rv = dataWrapper->SetData( NS_CONST_CAST(PRUnichar*, buffer.get()) ); @@ -601,9 +601,9 @@ NS_IMETHODIMP nsPlaintextEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPa // add the flavors for text editors for (const char* const* flavor = textEditorFlavors; *flavor; flavor++) { - nsCOMPtr<nsISupportsString> flavorString; - nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(flavorString)); + nsCOMPtr<nsISupportsCString> flavorString; + nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(flavorString)); if (flavorString) { flavorString->SetData(*flavor); diff --git a/editor/libeditor/text/nsPlaintextEditor.cpp b/editor/libeditor/text/nsPlaintextEditor.cpp index 9d38d6dae12..feacf1694b9 100644 --- a/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1624,7 +1624,7 @@ nsPlaintextEditor::PasteAsQuotation(PRInt32 aSelectionType) nsAutoString stuffToPaste; if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime))) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && len > 0) { PRUnichar* text = nsnull; diff --git a/editor/ui/composer/content/editor.js b/editor/ui/composer/content/editor.js index 0a1c06f3f76..4f6123db52a 100644 --- a/editor/ui/composer/content/editor.js +++ b/editor/ui/composer/content/editor.js @@ -2280,7 +2280,7 @@ function EditorSetDefaultPrefsAndDoctype() try { prefAuthorString = gPrefs.getComplexValue("editor.author", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) {} if ( prefAuthorString && prefAuthorString != 0) diff --git a/editor/ui/composer/content/editorUtilities.js b/editor/ui/composer/content/editorUtilities.js index db8234d06b6..3496d769157 100644 --- a/editor/ui/composer/content/editorUtilities.js +++ b/editor/ui/composer/content/editorUtilities.js @@ -260,10 +260,10 @@ function SetUnicharPref(aPrefName, aPrefValue) if (prefs) { try { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = aPrefValue; - prefs.setComplexValue(aPrefName, Components.interfaces.nsISupportsWString, str); + prefs.setComplexValue(aPrefName, Components.interfaces.nsISupportsString, str); } catch(e) {} } @@ -275,7 +275,7 @@ function GetUnicharPref(aPrefName, aDefVal) if (prefs) { try { - return prefs.getComplexValue(aPrefName, Components.interfaces.nsISupportsWString).data; + return prefs.getComplexValue(aPrefName, Components.interfaces.nsISupportsString).data; } catch(e) {} } diff --git a/editor/ui/composer/content/publishprefs.js b/editor/ui/composer/content/publishprefs.js index 042ed68d1a4..f558e196b56 100644 --- a/editor/ui/composer/content/publishprefs.js +++ b/editor/ui/composer/content/publishprefs.js @@ -764,7 +764,7 @@ function GetPublishStringPref(prefBranch, name) if (prefBranch && name) { try { - return prefBranch.getComplexValue(name, Components.interfaces.nsISupportsWString).data; + return prefBranch.getComplexValue(name, Components.interfaces.nsISupportsString).data; } catch (e) {} } return ""; @@ -775,10 +775,10 @@ function SetPublishStringPref(prefBranch, name, value) if (prefBranch && name) { try { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = value; - prefBranch.setComplexValue(name, Components.interfaces.nsISupportsWString, str); + prefBranch.setComplexValue(name, Components.interfaces.nsISupportsString, str); } catch (e) {} } } diff --git a/embedding/components/appstartup/src/nsAppStartupNotifier.cpp b/embedding/components/appstartup/src/nsAppStartupNotifier.cpp index b909bad8972..64c2091db05 100644 --- a/embedding/components/appstartup/src/nsAppStartupNotifier.cpp +++ b/embedding/components/appstartup/src/nsAppStartupNotifier.cpp @@ -72,7 +72,7 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a nsCOMPtr<nsISupports> entry; while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) { - nsCOMPtr<nsISupportsString> category = do_QueryInterface(entry, &rv); + nsCOMPtr<nsISupportsCString> category = do_QueryInterface(entry, &rv); if (NS_SUCCEEDED(rv)) { nsXPIDLCString categoryEntry; diff --git a/embedding/components/commandhandler/src/nsCommandGroup.cpp b/embedding/components/commandhandler/src/nsCommandGroup.cpp index 71c57eef144..312bb7a0262 100644 --- a/embedding/components/commandhandler/src/nsCommandGroup.cpp +++ b/embedding/components/commandhandler/src/nsCommandGroup.cpp @@ -126,7 +126,7 @@ nsGroupsEnumerator::GetNext(nsISupports **_retval) char *thisGroupName = mGroupNames[mIndex]; - nsCOMPtr<nsISupportsString> supportsString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsCString> supportsString = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; supportsString->SetData(thisGroupName); @@ -222,7 +222,7 @@ nsNamedGroupEnumerator::GetNext(nsISupports **_retval) PRUnichar *thisGroupName = (PRUnichar *)mGroupArray->ElementAt(mIndex); nsresult rv; - nsCOMPtr<nsISupportsWString> supportsString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsString> supportsString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; supportsString->SetData(thisGroupName); diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index 2855b070252..311ec271ee0 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -1736,8 +1736,8 @@ nsWindowWatcher::AddSupportsTojsvals(nsISupports *aArg, argPrimitive->GetType(&type); switch(type) { - case nsISupportsPrimitive::TYPE_STRING : { - nsCOMPtr<nsISupportsString> p(do_QueryInterface(argPrimitive)); + case nsISupportsPrimitive::TYPE_CSTRING : { + nsCOMPtr<nsISupportsCString> p(do_QueryInterface(argPrimitive)); NS_ENSURE_TRUE(p, NS_ERROR_UNEXPECTED); char *data; @@ -1751,8 +1751,8 @@ nsWindowWatcher::AddSupportsTojsvals(nsISupports *aArg, break; } - case nsISupportsPrimitive::TYPE_WSTRING : { - nsCOMPtr<nsISupportsWString> p(do_QueryInterface(argPrimitive)); + case nsISupportsPrimitive::TYPE_STRING : { + nsCOMPtr<nsISupportsString> p(do_QueryInterface(argPrimitive)); NS_ENSURE_TRUE(p, NS_ERROR_UNEXPECTED); PRUnichar *data; diff --git a/embedding/qa/jstests/nsIFontListTest.txt b/embedding/qa/jstests/nsIFontListTest.txt index 8d409e7cd4c..d94b5c842d6 100644 --- a/embedding/qa/jstests/nsIFontListTest.txt +++ b/embedding/qa/jstests/nsIFontListTest.txt @@ -154,7 +154,7 @@ function constructFontList(fontList) while (fontEnumerator.hasMoreElements()) { var fontName = fontEnumerator.getNext(); - fontName = fontName.QueryInterface(Components.interfaces.nsISupportsWString); + fontName = fontName.QueryInterface(Components.interfaces.nsISupportsString); var fontNameStr = fontName.toString(); if (fontEnumerator.hasMoreElements()) tempres = tempres + fontNameStr + ", "; diff --git a/extensions/inspector/resources/content/inspector.xml b/extensions/inspector/resources/content/inspector.xml index dd93ace0509..f80b001cc95 100644 --- a/extensions/inspector/resources/content/inspector.xml +++ b/extensions/inspector/resources/content/inspector.xml @@ -307,8 +307,8 @@ <parameter name="aFlavor"/> <body><![CDATA[ if (aFlavor == "text/unicode") { - var iid = Components.interfaces.nsISupportsWString; - var cid = "@mozilla.org/supports-wstring;1"; + var iid = Components.interfaces.nsISupportsString; + var cid = "@mozilla.org/supports-string;1"; data = Components.classes[cid].createInstance(iid); data.data = aObject; diff --git a/extensions/inspector/resources/content/jsutil/system/PrefUtils.js b/extensions/inspector/resources/content/jsutil/system/PrefUtils.js index 353b05479d0..099ab25d683 100644 --- a/extensions/inspector/resources/content/jsutil/system/PrefUtils.js +++ b/extensions/inspector/resources/content/jsutil/system/PrefUtils.js @@ -87,10 +87,10 @@ var PrefUtils = var type = this.mPrefs.getPrefType(aName); try { if (type == nsIPrefBranch.PREF_STRING) { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = aValue; - this.mPrefs.setComplexValue(aName, Components.interfaces.nsISupportsWString, str); + this.mPrefs.setComplexValue(aName, Components.interfaces.nsISupportsString, str); } else if (type == nsIPrefBranch.PREF_BOOL) { this.mPrefs.setBoolPref(aName, aValue); } else if (type == nsIPrefBranch.PREF_INT) { @@ -108,7 +108,7 @@ var PrefUtils = var type = this.mPrefs.getPrefType(aName); try { if (type == nsIPrefBranch.PREF_STRING) { - return this.mPrefs.getComplexValue(aName, Components.interfaces.nsISupportsWString).data; + return this.mPrefs.getComplexValue(aName, Components.interfaces.nsISupportsString).data; } else if (type == nsIPrefBranch.PREF_BOOL) { return this.mPrefs.getBoolPref(aName); } else if (type == nsIPrefBranch.PREF_INT) { diff --git a/extensions/inspector/resources/content/jsutil/xul/DNDUtils.js b/extensions/inspector/resources/content/jsutil/xul/DNDUtils.js index cb25bce3bc2..e6df5e66307 100644 --- a/extensions/inspector/resources/content/jsutil/xul/DNDUtils.js +++ b/extensions/inspector/resources/content/jsutil/xul/DNDUtils.js @@ -76,7 +76,7 @@ var DNDUtils = { var obj = {}; if (typeof(aValue) == "string") { - obj.data = XPCU.createInstance("@mozilla.org/supports-wstring;1", "nsISupportsWString"); + obj.data = XPCU.createInstance("@mozilla.org/supports-string;1", "nsISupportsString"); obj.data.data = aValue; obj.size = aValue.length*2; } else if (false) { diff --git a/extensions/inspector/resources/content/jsutil/xul/inTreeBuilder.js b/extensions/inspector/resources/content/jsutil/xul/inTreeBuilder.js index 9f77640b6ed..2b58138b1f1 100644 --- a/extensions/inspector/resources/content/jsutil/xul/inTreeBuilder.js +++ b/extensions/inspector/resources/content/jsutil/xul/inTreeBuilder.js @@ -326,7 +326,7 @@ inTreeBuilder.prototype = var data = {}; trans.getAnyTransferData ({}, data, {}); - var string = XPCU.QI(data.value, "nsISupportsWString"); + var string = XPCU.QI(data.value, "nsISupportsString"); this.insertColumn(this.mColumnInsertIndex, { diff --git a/extensions/inspector/resources/content/viewers/dom/columnsDialog.js b/extensions/inspector/resources/content/viewers/dom/columnsDialog.js index 4dd4555bc50..5a9e3e894d9 100644 --- a/extensions/inspector/resources/content/viewers/dom/columnsDialog.js +++ b/extensions/inspector/resources/content/viewers/dom/columnsDialog.js @@ -211,7 +211,7 @@ ColumnsDialog.prototype = onDragDropIn: function(aEvent) { var data = DNDUtils.getData("TreeBuilder/column-remove", 0); - var string = XPCU.QI(data, "nsISupportsWString"); + var string = XPCU.QI(data, "nsISupportsString"); this.addItem(string.data); }, diff --git a/extensions/python/xpcom/client/__init__.py b/extensions/python/xpcom/client/__init__.py index 648d575ad1d..9f1dca29c0e 100644 --- a/extensions/python/xpcom/client/__init__.py +++ b/extensions/python/xpcom/client/__init__.py @@ -20,7 +20,7 @@ import new from xpcom import xpt, COMException, nsError # Suck in stuff from _xpcom we use regularly to prevent a module lookup -from xpcom._xpcom import IID_nsISupports, IID_nsIClassInfo, IID_nsISupportsString, IID_nsISupportsWeakReference, \ +from xpcom._xpcom import IID_nsISupports, IID_nsIClassInfo, IID_nsISupportsCString, IID_nsISupportsWeakReference, \ IID_nsIWeakReference, XPTI_GetInterfaceInfoManager, NS_GetGlobalComponentManager, XPTC_InvokeByIndex # Attribute names we may be __getattr__'d for, but know we don't want to delegate @@ -159,7 +159,7 @@ class _XPCOMBase: # See if the object support strings. def __str__(self): try: - self._comobj_.QueryInterface(IID_nsISupportsString, 0) + self._comobj_.QueryInterface(IID_nsISupportsCString, 0) return str(self._comobj_) except COMException: return self.__repr__() diff --git a/extensions/python/xpcom/doc/advanced.html b/extensions/python/xpcom/doc/advanced.html index 81b9f87c2e4..8f5f6f09ba2 100644 --- a/extensions/python/xpcom/doc/advanced.html +++ b/extensions/python/xpcom/doc/advanced.html @@ -40,7 +40,7 @@ object, thereby allowing explicit control over the type of variant created.</p> term collectively the <i>nsISupports Primitives Interfaces</i>.  These are a set of interfaces a component can support to allow automatic conversion to and from many basic types.  For example, an interface can define that it -supports the <i>nsISupportsString</i> interface, and this could be used by any +supports the <i>nsISupportsCString</i> interface, and this could be used by any program that wishes to get a string representation of the object.  If an interface wishes to expose itself as a "boolean value", it may choose to support the <i>nsISupportsPRBool</i> interface.</p> @@ -48,8 +48,8 @@ to support the <i>nsISupportsPRBool</i> interface.</p> calling), you can use the builtin functions <i>str()</i>, <i>int()</i>, <i>long()</i> etc., on the object<i>.</i>  In the -case of <i>str()</i>, if the object does not support the <i>nsISupportsString</i> -or <i>nsISupportsWString</i> interfaces, the default string <i>str()</i> for the +case of <i>str()</i>, if the object does not support the <i>nsISupportsCString</i> +or <i>nsISupportsString</i> interfaces, the default string <i>str()</i> for the object will be returned (i.e., what is normally returned for most XPCOM objects - support for these interface is not very common!).  In the case of the numeric functions, a <i>ValueError</i> exception will be raised if the objects do not support any interface that can be @@ -71,8 +71,8 @@ of these interfaces:</p> </li> <li>If your class does not define support for these interfaces, the framework will use standard Python class semantics to implement them - i.e., if your - class provides a <i>__str__</i> method, it will be used to implement <i>nsISupportsString</i> - and <i>nsISupportsWString</i>, if you provide <i>__int__</i>, <i>__long__</i>, + class provides a <i>__str__</i> method, it will be used to implement <i>nsISupportsCString</i> + and <i>nsISupportsString</i>, if you provide <i>__int__</i>, <i>__long__</i>, <i>__float__</i> etc., methods, they will be used to implement the numeric interfaces.  If your class defines no such special methods, then the <i> QueryInterface()</i> for those interfaces fails (rather than the QI succeeding @@ -83,7 +83,7 @@ of these interfaces:</p> possible.  Consider Python code that does a <i>str()</i> on an  XPCOM interface, and where the XPCOM interface itself is implemented in Python and provides a <i>__str__</i> method.  The <i>str()</i> on the original -interface queries for the <i>nsISupportsString</i> interface.  The +interface queries for the <i>nsISupportsCString</i> interface.  The Python implemented object responds to this interface and delegates to the <i>__str__</i> method. At the end of all this, <i>str()</i> returns the same result as if the objects were native Python objects with no XPCOM layer in between.</p> diff --git a/extensions/python/xpcom/server/policy.py b/extensions/python/xpcom/server/policy.py index 15892984c15..12fb4ff24fd 100644 --- a/extensions/python/xpcom/server/policy.py +++ b/extensions/python/xpcom/server/policy.py @@ -294,8 +294,8 @@ class DefaultPolicy: return self._doHandleException(name, exc_info) _supports_primitives_data_ = [ + ("nsISupportsCString", "__str__", str), ("nsISupportsString", "__str__", str), - ("nsISupportsWString", "__str__", str), ("nsISupportsPRUint64", "__long__", long), ("nsISupportsPRInt64", "__long__", long), ("nsISupportsPRUint32", "__int__", int), diff --git a/extensions/python/xpcom/src/TypeObject.cpp b/extensions/python/xpcom/src/TypeObject.cpp index 53016e88123..a710e788950 100644 --- a/extensions/python/xpcom/src/TypeObject.cpp +++ b/extensions/python/xpcom/src/TypeObject.cpp @@ -143,7 +143,7 @@ PyXPCOM_TypeObject::Py_str(PyObject *self) char *val = NULL; Py_BEGIN_ALLOW_THREADS; { // scope to kill pointer while thread-lock released. - nsCOMPtr<nsISupportsString> ss( do_QueryInterface(pis->m_obj, &rv )); + nsCOMPtr<nsISupportsCString> ss( do_QueryInterface(pis->m_obj, &rv )); if (NS_SUCCEEDED(rv)) rv = ss->ToString(&val); } // end-scope diff --git a/extensions/python/xpcom/src/xpcom.cpp b/extensions/python/xpcom/src/xpcom.cpp index 48f9143d8af..244fc42f7e3 100644 --- a/extensions/python/xpcom/src/xpcom.cpp +++ b/extensions/python/xpcom/src/xpcom.cpp @@ -579,7 +579,7 @@ init_xpcom() { Py_XDECREF(obFuncPtr); REGISTER_IID(nsISupports); - REGISTER_IID(nsISupportsString); + REGISTER_IID(nsISupportsCString); REGISTER_IID(nsIModule); REGISTER_IID(nsIFactory); REGISTER_IID(nsIWeakReference); diff --git a/extensions/python/xpcom/test/test_isupports_primitives.py b/extensions/python/xpcom/test/test_isupports_primitives.py index 3eff19e49c0..6d609d76bf6 100644 --- a/extensions/python/xpcom/test/test_isupports_primitives.py +++ b/extensions/python/xpcom/test/test_isupports_primitives.py @@ -17,7 +17,7 @@ # Test our support for the interfaces defined in nsISupportsPrimitives.idl # -# The framework supports nsISupportsString and nsISupportsWString, but +# The framework supports nsISupportsCString and nsISupportsString, but # only if our class doesnt provide explicit support. from xpcom import components @@ -32,7 +32,7 @@ class ImplicitSupportsString: return "<MyImplicitStrObject>" class ExplicitSupportsString: - _com_interfaces_ = [components.interfaces.nsISupports, components.interfaces.nsISupportsString] + _com_interfaces_ = [components.interfaces.nsISupports, components.interfaces.nsISupportsCString] # __str__ will be ignored by XPCOM, as we have _explicit_ support. def __str__(self): return "<MyImplicitStrObject>" diff --git a/extensions/xml-rpc/idl/nsIXmlRpcClient.idl b/extensions/xml-rpc/idl/nsIXmlRpcClient.idl index efcc00d8282..30c90d1d9d2 100644 --- a/extensions/xml-rpc/idl/nsIXmlRpcClient.idl +++ b/extensions/xml-rpc/idl/nsIXmlRpcClient.idl @@ -18,9 +18,9 @@ /* * XPCOM XML-RPC Client, interface definition. - * Version: $Revision: 1.4 $ + * Version: $Revision: 1.5 $ * - * $Id: nsIXmlRpcClient.idl,v 1.4 2002-02-12 23:57:08 samuel%sieb.net Exp $ + * $Id: nsIXmlRpcClient.idl,v 1.5 2002-08-06 00:52:08 alecf%netscape.com Exp $ */ #include "nsISupports.idl" @@ -69,7 +69,7 @@ interface nsIXmlRpcClient: nsISupports { * nsISupportsPRUint8, nsISupportsPRUint16, * nsISupportsPRInt16, nsISupportsPRInt32: <i4> * nsISupportsPRBool: <boolean> - * nsISupportsChar, nsISupportsString: <string> + * nsISupportsChar, nsISupportsCString: <string> * nsISupportsFloat, nsISupportsDouble: <double> * nsISupportsPRTime: <dateTime.iso8601> * nsIInputStream: <base64> @@ -82,10 +82,10 @@ interface nsIXmlRpcClient: nsISupports { * Return value will be converted as follows: * <i4> or <int>: nsISupportsPRInt32 * <boolean>: nsISupportsPRBool - * <string>: nsISupportsString + * <string>: nsISupportsCString * <double>: nsISupportsDouble * <dateTime.iso8601>: nsISupportsPRTime - * <base64>: nsISupportsString + * <base64>: nsISupportsCString * <array>: nsISupportsArray * <struct>: nsIDictionary * @@ -144,7 +144,7 @@ interface nsIXmlRpcClient: nsISupports { [iid_is(uuid),retval] out nsQIResult result); const unsigned long INT = 1; // nsISupportsPRInt32 const unsigned long BOOLEAN = 2; // nsISupportsPRBool - const unsigned long STRING = 3; // nsISupportsString + const unsigned long STRING = 3; // nsISupportsCString const unsigned long DOUBLE = 4; // nsISupportsDouble const unsigned long DATETIME = 5; // nsISupportsPRTime const unsigned long ARRAY = 6; // nsISupportsArray diff --git a/extensions/xml-rpc/src/nsXmlRpcClient.js b/extensions/xml-rpc/src/nsXmlRpcClient.js index 09766cb099c..6336304ff9f 100644 --- a/extensions/xml-rpc/src/nsXmlRpcClient.js +++ b/extensions/xml-rpc/src/nsXmlRpcClient.js @@ -20,9 +20,9 @@ /* * nsXmlRpcClient XPCOM component - * Version: $Revision: 1.26 $ + * Version: $Revision: 1.27 $ * - * $Id: nsXmlRpcClient.js,v 1.26 2002-06-16 06:17:54 samuel%sieb.net Exp $ + * $Id: nsXmlRpcClient.js,v 1.27 2002-08-06 00:52:09 alecf%netscape.com Exp $ */ /* @@ -360,9 +360,9 @@ nsXmlRpcClient.prototype = { 'nsISupportsPRBool'); case this.STRING: - uuid.value = Components.interfaces.nsISupportsString + uuid.value = Components.interfaces.nsISupportsCString return createInstance(SUPPORTSID + 'string;1', - 'nsISupportsString'); + 'nsISupportsCString'); case this.DOUBLE: uuid.value = Components.interfaces.nsISupportsDouble @@ -585,7 +585,7 @@ nsXmlRpcClient.prototype = { } catch(e) {} try { - obj.QueryInterface(Components.interfaces.nsISupportsString); + obj.QueryInterface(Components.interfaces.nsISupportsCString); return 'String'; } catch(e) {} diff --git a/extensions/xml-rpc/test/xml-rpc.xul b/extensions/xml-rpc/test/xml-rpc.xul index 9b327b9c98b..6d3db53c02c 100644 --- a/extensions/xml-rpc/test/xml-rpc.xul +++ b/extensions/xml-rpc/test/xml-rpc.xul @@ -30,7 +30,7 @@ function callAsync() { var Listener = { onResult: function(client, ctxt, result) { - result = result.QueryInterface(Components.interfaces.nsISupportsString); + result = result.QueryInterface(Components.interfaces.nsISupportsCString); document.getElementById('statename').setAttribute('value', result.data); }, diff --git a/extensions/xmlextras/base/public/nsIXMLHttpRequest.idl b/extensions/xmlextras/base/public/nsIXMLHttpRequest.idl index e43a22a6271..ea5fb98ec9b 100644 --- a/extensions/xmlextras/base/public/nsIXMLHttpRequest.idl +++ b/extensions/xmlextras/base/public/nsIXMLHttpRequest.idl @@ -194,7 +194,7 @@ interface nsIXMLHttpRequest : nsISupports { * returns only after the response has been received. * * @param body Either an instance of nsIDOMDocument, nsIInputStream - * or a string (nsISupportsWString in the native calling + * or a string (nsISupportsString in the native calling * case). This is used to populate the body of the * HTTP request if the HTTP request method is "POST". * If the parameter is a nsIDOMDocument, it is serialized. diff --git a/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp b/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp index 943f7f9d89b..8ce58571789 100644 --- a/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp +++ b/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp @@ -1057,8 +1057,8 @@ nsXMLHttpRequest::Send(nsIVariant *aBody) if (NS_FAILED(rv)) return NS_ERROR_FAILURE; } else { - // nsISupportsWString? - nsCOMPtr<nsISupportsWString> wstr(do_QueryInterface(supports)); + // nsISupportsString? + nsCOMPtr<nsISupportsString> wstr(do_QueryInterface(supports)); if (wstr) { wstr->GetData(getter_Copies(serial)); } else { diff --git a/extensions/xmlextras/tests/404post.html b/extensions/xmlextras/tests/404post.html index b889b0c33b7..4912ff9c4db 100644 --- a/extensions/xmlextras/tests/404post.html +++ b/extensions/xmlextras/tests/404post.html @@ -15,7 +15,7 @@ pre { } </style> <script type="text/javascript"> -const WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1"; +const WSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; // You can only create the text string if you can bybass security, like in chrome var sendPlainTextData = false; @@ -59,7 +59,7 @@ p.open("POST", "http://green/cgi-bin/this.handler.does.not.exist.xgfrsjfrsgdfr.c if (!sendPlainTextData) { p.send(x); } else { - var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsWString); + var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsString); mystr.data = "Heikki's data"; p.send(mystr); } diff --git a/extensions/xmlextras/tests/post.html b/extensions/xmlextras/tests/post.html index 7318bf1f54e..b1703164649 100644 --- a/extensions/xmlextras/tests/post.html +++ b/extensions/xmlextras/tests/post.html @@ -15,7 +15,7 @@ pre { } </style> <script type="text/javascript"> -const WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1"; +const WSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; // You can only create the text string if you can bybass security, like in chrome var sendPlainTextData = false; @@ -59,7 +59,7 @@ p.open("POST", "http://green/cgi-bin/echo_xml.cgi"); if (!sendPlainTextData) { p.send(x); } else { - var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsWString); + var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsString); mystr.data = "Heikki's data"; p.send(mystr); } diff --git a/extensions/xmlextras/tests/post.xhtml b/extensions/xmlextras/tests/post.xhtml index 2a0c1e5f33b..d23ada604ea 100644 --- a/extensions/xmlextras/tests/post.xhtml +++ b/extensions/xmlextras/tests/post.xhtml @@ -3,7 +3,7 @@ <h1>Posting test</h1> <script> <![CDATA[ -const WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1"; +const WSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; var sendPlainTextData = false; // you can only create the text string if you can bybass security @@ -38,7 +38,7 @@ p.open("POST", "http://green/cgi-bin/echo_xml.cgi"); if (!sendPlainTextData) { p.send(x); } else { - var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsWString); + var mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsString); mystr.data = "Heikki's data"; p.send(mystr); } diff --git a/extensions/xmlextras/tests/xpost.html b/extensions/xmlextras/tests/xpost.html index 49e74dd0262..1ab0f12e7de 100644 --- a/extensions/xmlextras/tests/xpost.html +++ b/extensions/xmlextras/tests/xpost.html @@ -104,8 +104,8 @@ if (!sendPlainTextData) { } else { var mystr; try { - var WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1"; - mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsWString); + var WSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; + mystr = Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.nsISupportsString); mystr.data = "Heikki's data"; } catch (e) { mystr = "Heikki's data"; diff --git a/extensions/xmlterm/base/mozXMLTerminal.cpp b/extensions/xmlterm/base/mozXMLTerminal.cpp index a0006e24038..66685712a6f 100644 --- a/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -790,7 +790,7 @@ NS_IMETHODIMP mozXMLTerminal::Paste() nsMemory::Free(temCStr); if (flavor.EqualsWithConversion(kHTMLMime) || flavor.EqualsWithConversion(kUnicodeMime)) { - nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) ); + nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) ); if (textDataObj && objLen > 0) { PRUnichar* text = nsnull; textDataObj->ToString ( &text ); diff --git a/gfx/src/nsFontList.cpp b/gfx/src/nsFontList.cpp index ef68f99a95c..a482366bc55 100644 --- a/gfx/src/nsFontList.cpp +++ b/gfx/src/nsFontList.cpp @@ -128,10 +128,10 @@ nsFontListEnumerator::GetNext(nsISupports **aFont) return NS_ERROR_UNEXPECTED; } PRUnichar *fontName = mFonts[mIndex++]; - nsCOMPtr<nsISupportsWString> fontNameWrapper; + nsCOMPtr<nsISupportsString> fontNameWrapper; nsresult rv; - rv = nsComponentManager::CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsWString), getter_AddRefs(fontNameWrapper)); + rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsString), getter_AddRefs(fontNameWrapper)); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(fontNameWrapper, NS_ERROR_OUT_OF_MEMORY); fontNameWrapper->SetData(NS_CONST_CAST(PRUnichar*, fontName)); diff --git a/gfx/src/nsPrintOptionsImpl.cpp b/gfx/src/nsPrintOptionsImpl.cpp index 799ce1b88ff..bc45047dab1 100644 --- a/gfx/src/nsPrintOptionsImpl.cpp +++ b/gfx/src/nsPrintOptionsImpl.cpp @@ -206,11 +206,11 @@ NS_IMETHODIMP nsPrinterListEnumerator::GetNext(nsISupports **aPrinter) } PRUnichar *printerName = mPrinters[mIndex++]; - nsCOMPtr<nsISupportsWString> printerNameWrapper; + nsCOMPtr<nsISupportsString> printerNameWrapper; nsresult rv; - rv = nsComponentManager::CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsWString), getter_AddRefs(printerNameWrapper)); + rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsString), getter_AddRefs(printerNameWrapper)); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(printerNameWrapper, NS_ERROR_OUT_OF_MEMORY); printerNameWrapper->SetData(NS_CONST_CAST(PRUnichar*, printerName)); diff --git a/intl/strres/src/nsStringBundle.cpp b/intl/strres/src/nsStringBundle.cpp index fffc907e3ad..8a82b030f1a 100644 --- a/intl/strres/src/nsStringBundle.cpp +++ b/intl/strres/src/nsStringBundle.cpp @@ -503,7 +503,7 @@ nsExtensibleStringBundle::Init(const char * aCategory, if (NS_FAILED(rv)) continue; - nsCOMPtr<nsISupportsString> supStr = do_QueryInterface(supports, &rv); + nsCOMPtr<nsISupportsCString> supStr = do_QueryInterface(supports, &rv); if (NS_FAILED(rv)) continue; diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index eb736735618..51a7770c6e0 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -297,7 +297,7 @@ nsCharsetConverterManager::GetList(const nsACString& aCategory, if (NS_FAILED(enumerator->GetNext(getter_AddRefs(supports)))) continue; - nsCOMPtr<nsISupportsString> supStr = do_QueryInterface(supports); + nsCOMPtr<nsISupportsCString> supStr = do_QueryInterface(supports); if (!supStr) continue; diff --git a/js/src/xpconnect/src/xpccomponents.cpp b/js/src/xpconnect/src/xpccomponents.cpp index 9f3be9316e9..472c0036cae 100644 --- a/js/src/xpconnect/src/xpccomponents.cpp +++ b/js/src/xpconnect/src/xpccomponents.cpp @@ -389,7 +389,7 @@ nsXPCComponents_Classes::NewEnumerate(nsIXPConnectWrappedNative *wrapper, if(NS_SUCCEEDED(e->HasMoreElements(&hasMore)) && hasMore && NS_SUCCEEDED(e->GetNext(getter_AddRefs(isup))) && isup) { - nsCOMPtr<nsISupportsString> holder(do_QueryInterface(isup)); + nsCOMPtr<nsISupportsCString> holder(do_QueryInterface(isup)); if(holder) { char* name; diff --git a/js/src/xpconnect/tests/js/old/xpctest_primitives.js b/js/src/xpconnect/tests/js/old/xpctest_primitives.js index 44b6b756787..56408beef69 100644 --- a/js/src/xpconnect/tests/js/old/xpctest_primitives.js +++ b/js/src/xpconnect/tests/js/old/xpctest_primitives.js @@ -33,8 +33,8 @@ var same = Object; // 6) function to use for comparing strings (null means use default compare) var data = [ ["supports-id" ,"nsISupportsID" ,iface_test,i_str ,eqfn , null], - ["supports-string" ,"nsISupportsString" ,"foo" ,same ,null , null], - ["supports-wstring" ,"nsISupportsWString" ,"bar" ,same ,null , null], + ["supports-cstring" ,"nsISupportsCString" ,"foo" ,same ,null , null], + ["supports-string" ,"nsISupportsString" ,"bar" ,same ,null , null], ["supports-PRBool" ,"nsISupportsPRBool" ,true ,same ,null , null], ["supports-PRBool" ,"nsISupportsPRBool" ,false ,same ,null , null], ["supports-PRUint8" ,"nsISupportsPRUint8" ,7 ,same ,null , null], diff --git a/js/src/xpconnect/tests/js/xpctest_primitives.js b/js/src/xpconnect/tests/js/xpctest_primitives.js index 099c90766f7..dd7273cb2c9 100644 --- a/js/src/xpconnect/tests/js/xpctest_primitives.js +++ b/js/src/xpconnect/tests/js/xpctest_primitives.js @@ -70,8 +70,8 @@ var same = Object; var data = [ ["supports-id" ,"nsISupportsID" ,iface_test,i_str ,eqfn , null], - ["supports-string" ,"nsISupportsString" ,"foo" ,same ,null , null], - ["supports-wstring" ,"nsISupportsWString" ,"bar" ,same ,null , null], + ["supports-cstring" ,"nsISupportsCString" ,"foo" ,same ,null , null], + ["supports-string" ,"nsISupportsString" ,"bar" ,same ,null , null], ["supports-PRBool" ,"nsISupportsPRBool" ,true ,same ,null , null], ["supports-PRBool" ,"nsISupportsPRBool" ,false ,same ,null , null], ["supports-PRUint8" ,"nsISupportsPRUint8" ,7 ,same ,null , null], diff --git a/layout/base/nsAutoCopy.cpp b/layout/base/nsAutoCopy.cpp index ed071081aec..30bbe6507a6 100644 --- a/layout/base/nsAutoCopy.cpp +++ b/layout/base/nsAutoCopy.cpp @@ -100,7 +100,7 @@ nsAutoCopyService::Listen(nsISelection *aDomSelection) /* * What we do now: * On every selection change, we copy to the clipboard anew, creating a - * HTML buffer, a transferable, an nsISupportsWString and + * HTML buffer, a transferable, an nsISupportsString and * a huge mess every time. This is basically what nsPresShell::DoCopy does * to move the selection into the clipboard for Edit->Copy. * diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index c33e5c39900..f3f5a1ba90e 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -6257,7 +6257,7 @@ DocumentViewerImpl::CheckForPrinters(nsIPrintOptions* aPrintOptions, aPrintSettings->GetPrinterName(&defPrinterName); if (!defPrinterName || (defPrinterName && !*defPrinterName)) { if (defPrinterName) nsMemory::Free(defPrinterName); - nsCOMPtr<nsISupportsWString> wStr = do_QueryInterface(supps); + nsCOMPtr<nsISupportsString> wStr = do_QueryInterface(supps); if (wStr) { PRUnichar* defPrinterName; wStr->ToString(&defPrinterName); diff --git a/layout/base/nsPresState.cpp b/layout/base/nsPresState.cpp index c701e16a862..92fcd9e1fff 100644 --- a/layout/base/nsPresState.cpp +++ b/layout/base/nsPresState.cpp @@ -69,8 +69,8 @@ nsPresState::GetStateProperty(const nsAString& aName, const nsPromiseFlatString& flatString = PromiseFlatString(aName); nsStringKey key(flatString); - nsCOMPtr<nsISupportsString> supportsStr = - dont_AddRef(NS_STATIC_CAST(nsISupportsString*, + nsCOMPtr<nsISupportsCString> supportsStr = + dont_AddRef(NS_STATIC_CAST(nsISupportsCString*, mPropertyTable->Get(&key))); if (supportsStr) { @@ -96,7 +96,7 @@ nsPresState::SetStateProperty(const nsAString& aName, const nsAString& aValue) const nsPromiseFlatString& flatString = PromiseFlatString(aName); nsStringKey key(flatString); - nsCOMPtr<nsISupportsString> supportsStr(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> supportsStr(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); NS_ENSURE_TRUE(supportsStr, NS_ERROR_OUT_OF_MEMORY); supportsStr->SetData(NS_ConvertUCS2toUTF8(aValue).get()); diff --git a/layout/base/src/nsAutoCopy.cpp b/layout/base/src/nsAutoCopy.cpp index ed071081aec..30bbe6507a6 100644 --- a/layout/base/src/nsAutoCopy.cpp +++ b/layout/base/src/nsAutoCopy.cpp @@ -100,7 +100,7 @@ nsAutoCopyService::Listen(nsISelection *aDomSelection) /* * What we do now: * On every selection change, we copy to the clipboard anew, creating a - * HTML buffer, a transferable, an nsISupportsWString and + * HTML buffer, a transferable, an nsISupportsString and * a huge mess every time. This is basically what nsPresShell::DoCopy does * to move the selection into the clipboard for Edit->Copy. * diff --git a/layout/base/src/nsCopySupport.cpp b/layout/base/src/nsCopySupport.cpp index 746d192325a..a0fa4545d9b 100644 --- a/layout/base/src/nsCopySupport.cpp +++ b/layout/base/src/nsCopySupport.cpp @@ -195,14 +195,14 @@ nsresult nsCopySupport::HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, PRInt16 } // get wStrings to hold clip data - nsCOMPtr<nsISupportsWString> dataWrapper, contextWrapper, infoWrapper; - dataWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + nsCOMPtr<nsISupportsString> dataWrapper, contextWrapper, infoWrapper; + dataWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(dataWrapper, NS_ERROR_FAILURE); if (bIsHTMLCopy) { - contextWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + contextWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(contextWrapper, NS_ERROR_FAILURE); - infoWrapper = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + infoWrapper = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); NS_ENSURE_TRUE(infoWrapper, NS_ERROR_FAILURE); } diff --git a/layout/base/src/nsPresState.cpp b/layout/base/src/nsPresState.cpp index c701e16a862..92fcd9e1fff 100644 --- a/layout/base/src/nsPresState.cpp +++ b/layout/base/src/nsPresState.cpp @@ -69,8 +69,8 @@ nsPresState::GetStateProperty(const nsAString& aName, const nsPromiseFlatString& flatString = PromiseFlatString(aName); nsStringKey key(flatString); - nsCOMPtr<nsISupportsString> supportsStr = - dont_AddRef(NS_STATIC_CAST(nsISupportsString*, + nsCOMPtr<nsISupportsCString> supportsStr = + dont_AddRef(NS_STATIC_CAST(nsISupportsCString*, mPropertyTable->Get(&key))); if (supportsStr) { @@ -96,7 +96,7 @@ nsPresState::SetStateProperty(const nsAString& aName, const nsAString& aValue) const nsPromiseFlatString& flatString = PromiseFlatString(aName); nsStringKey key(flatString); - nsCOMPtr<nsISupportsString> supportsStr(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> supportsStr(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); NS_ENSURE_TRUE(supportsStr, NS_ERROR_OUT_OF_MEMORY); supportsStr->SetData(NS_ConvertUCS2toUTF8(aValue).get()); diff --git a/mailnews/addrbook/prefs/resources/content/pref-directory-add.js b/mailnews/addrbook/prefs/resources/content/pref-directory-add.js index 61e090e66fc..29a481a196c 100644 --- a/mailnews/addrbook/prefs/resources/content/pref-directory-add.js +++ b/mailnews/addrbook/prefs/resources/content/pref-directory-add.js @@ -49,7 +49,7 @@ function fillSettings() try { var prefValue = gPrefInt.getComplexValue(gCurrentDirectoryString + ".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex) { prefValue=""; } @@ -57,7 +57,7 @@ function fillSettings() document.getElementById("description").value = prefValue; ldapUrl.spec = gPrefInt.getComplexValue(gCurrentDirectoryString +".uri", Components.interfaces. - nsISupportsWString).data; + nsISupportsString).data; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; @@ -91,7 +91,7 @@ function fillSettings() try { prefValue = gPrefInt.getComplexValue(gCurrentDirectoryString + ".auth.dn", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex) { prefValue=""; } @@ -180,7 +180,7 @@ function createUniqueServername() temp = ""; try{ temp = gPrefInt.getComplexValue(gPrefstring+gPref_string_desc+".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(e){} if (temp) gPref_string_desc += str[0]; @@ -252,11 +252,11 @@ function onAccept() } pref_string_title = gPref_string_desc + "." + "description"; - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = pref_string_content; gPrefInt.setComplexValue(pref_string_title, - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); ldapUrl.host = hostname; pref_string_content = gLdapService. @@ -282,11 +282,11 @@ function onAccept() ldapUrl.options |= ldapUrl.OPT_SECURE; pref_string_title = gPref_string_desc + ".uri"; - var uri = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var uri = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); uri.data = ldapUrl.spec; gPrefInt.setComplexValue(pref_string_title, - Components.interfaces.nsISupportsWString, uri); + Components.interfaces.nsISupportsString, uri); pref_string_content = results; pref_string_title = gPref_string_desc + ".maxHits"; @@ -300,11 +300,11 @@ function onAccept() } pref_string_title = gPref_string_desc + ".auth.dn"; - var dnWString = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var dnWString = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); dnWString.data = dn; gPrefInt.setComplexValue(pref_string_title, - Components.interfaces.nsISupportsWString, + Components.interfaces.nsISupportsString, dnWString); // We don't actually allow the password to be saved in the preferences; diff --git a/mailnews/addrbook/prefs/resources/content/pref-directory.js b/mailnews/addrbook/prefs/resources/content/pref-directory.js index f589384d741..17a2cb5810b 100644 --- a/mailnews/addrbook/prefs/resources/content/pref-directory.js +++ b/mailnews/addrbook/prefs/resources/content/pref-directory.js @@ -89,7 +89,7 @@ function setupDirectoriesList() document.getElementById("identity.directoryServer").getAttribute('value'); try { var directoryServerString = gPrefInt.getComplexValue(directoryServer + ".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex) {} if (directoryServerFlag || !directoryServerString) { @@ -163,7 +163,7 @@ function LoadDirectories(popup) if ((position != 0) && (dirType == 1)) { try{ description = gPrefInt.getComplexValue(arrayOfDirectories[i]+".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex){ description=""; @@ -199,7 +199,7 @@ function LoadDirectories(popup) try { directoryDescription = gPrefInt. getComplexValue(directoriesList.value + ".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) {} } @@ -227,7 +227,7 @@ function LoadDirectories(popup) try { directoryDescription = gPrefInt. getComplexValue(directoriesList.value + ".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) {} } @@ -266,7 +266,7 @@ function LoadDirectories(popup) pref_string_title = directoryServer + ".description"; try { description = gPrefInt.getComplexValue(pref_string_title, - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { description = ""; diff --git a/mailnews/addrbook/resources/content/abMailListDialog.js b/mailnews/addrbook/resources/content/abMailListDialog.js index 120f5d8074e..c093755b5d9 100644 --- a/mailnews/addrbook/resources/content/abMailListDialog.js +++ b/mailnews/addrbook/resources/content/abMailListDialog.js @@ -545,7 +545,7 @@ function DropOnAddressListTree(event) var bestFlavor = new Object(); var len = new Object(); trans.getAnyTransferData ( bestFlavor, dataObj, len ); - if ( dataObj ) dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + if ( dataObj ) dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if ( !dataObj ) continue; // pull the URL out of the data object diff --git a/mailnews/addrbook/resources/content/abSelectAddressesDialog.js b/mailnews/addrbook/resources/content/abSelectAddressesDialog.js index c43e6e24f72..368c8027380 100644 --- a/mailnews/addrbook/resources/content/abSelectAddressesDialog.js +++ b/mailnews/addrbook/resources/content/abSelectAddressesDialog.js @@ -365,7 +365,7 @@ function DropOnBucketPane(event) var len = new Object(); trans.getAnyTransferData ( bestFlavor, dataObj, len ); if ( dataObj ) - dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if ( !dataObj ) continue; diff --git a/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp b/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp index 51750055116..ab3ea3ec347 100644 --- a/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp +++ b/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp @@ -320,12 +320,12 @@ nsAbLDAPAutoCompFormatter::FormatException(PRInt32 aState, // pass the alert message in as the param; if that fails, proceed anyway // - nsCOMPtr<nsISupportsWString> alert(do_CreateInstance( - NS_SUPPORTS_WSTRING_CONTRACTID, + nsCOMPtr<nsISupportsString> alert(do_CreateInstance( + NS_SUPPORTS_STRING_CONTRACTID, &rv)); if (NS_FAILED(rv)) { NS_WARNING("nsAbLDAPAutoCompFormatter::FormatException(): " - "could not create nsISupportsWString"); + "could not create nsISupportsString"); } else { rv = alert->SetData(alertMsg.get()); if (NS_FAILED(rv)) { diff --git a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp index 0897d0c9ca0..56e3558ea7a 100644 --- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp +++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp @@ -149,13 +149,13 @@ nsresult nsAbLDAPDirectory::InitiateConnection () // get the login information, if there is any // - nsCOMPtr<nsISupportsWString> login; + nsCOMPtr<nsISupportsString> login; rv = prefs->GetComplexValue( PromiseFlatCString( Substring(mURINoQuery, kLDAPDirectoryRootLen, mURINoQuery.Length() - kLDAPDirectoryRootLen) + NS_LITERAL_CSTRING(".auth.dn")).get(), - NS_GET_IID(nsISupportsWString), getter_AddRefs(login)); + NS_GET_IID(nsISupportsString), getter_AddRefs(login)); if (NS_SUCCEEDED(rv)) { rv = login->ToString(getter_Copies(mLogin)); if (NS_FAILED(rv)) { diff --git a/mailnews/addrbook/src/nsAbView.cpp b/mailnews/addrbook/src/nsAbView.cpp index 9b7ee25641e..ee35b246802 100644 --- a/mailnews/addrbook/src/nsAbView.cpp +++ b/mailnews/addrbook/src/nsAbView.cpp @@ -1206,7 +1206,7 @@ NS_IMETHODIMP nsAbView::GetSelectedAddresses(nsISupportsArray **_retval) NS_ENSURE_SUCCESS(rv,rv); if (!primaryEmail.IsEmpty()) { - nsCOMPtr<nsISupportsString> supportsEmail(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> supportsEmail(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); supportsEmail->SetDataWithLength(primaryEmail.Length(), ToNewCString(primaryEmail)); addresses->AppendElement(supportsEmail); } @@ -1217,7 +1217,7 @@ NS_IMETHODIMP nsAbView::GetSelectedAddresses(nsISupportsArray **_retval) NS_ENSURE_SUCCESS(rv,rv); if (!primaryEmail.IsEmpty()) { - nsCOMPtr<nsISupportsString> supportsEmail(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> supportsEmail(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); supportsEmail->SetDataWithLength(primaryEmail.Length(), ToNewCString(primaryEmail)); addresses->AppendElement(supportsEmail); } diff --git a/mailnews/addrbook/src/nsLDAPPrefsService.js b/mailnews/addrbook/src/nsLDAPPrefsService.js index 9d989872104..cc19d09366d 100644 --- a/mailnews/addrbook/src/nsLDAPPrefsService.js +++ b/mailnews/addrbook/src/nsLDAPPrefsService.js @@ -80,7 +80,7 @@ function nsLDAPPrefsService() { if ((position != 0) && (dirType == 1)) { try{ description = gPrefInt.getComplexValue(arrayOfDirectories[i]+".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex){ description = null; @@ -219,7 +219,7 @@ function () { ldapUrl.host = host; try{ dn = gPrefInt.getComplexValue(pref_string + ".searchBase", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { dn = null; @@ -248,10 +248,10 @@ function () { ldapUrl.port = port; ldapUrl.scope = 2; - var uri = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var uri = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); uri.data = ldapUrl.spec; - gPrefInt.setComplexValue(pref_string + ".uri", Components.interfaces.nsISupportsWString, uri); + gPrefInt.setComplexValue(pref_string + ".uri", Components.interfaces.nsISupportsString, uri); /* is this server selected for autocompletion? if yes, convert the preference to mozilla format. diff --git a/mailnews/base/resources/content/mailCommands.js b/mailnews/base/resources/content/mailCommands.js index 2a1b45396d7..96c4e44e384 100644 --- a/mailnews/base/resources/content/mailCommands.js +++ b/mailnews/base/resources/content/mailCommands.js @@ -223,7 +223,7 @@ function NewMessageToSelectedAddresses(type, format, identity) { if (composeFields) { var addressList = ""; for (var i = 0; i < addresses.Count(); i++) { - addressList = addressList + (i > 0 ? ",":"") + addresses.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsString).data; + addressList = addressList + (i > 0 ? ",":"") + addresses.GetElementAt(i).QueryInterface(Components.interfaces.nsISupportsCString).data; } composeFields.to = addressList; params.composeFields = composeFields; diff --git a/mailnews/base/resources/content/messengerdnd.js b/mailnews/base/resources/content/messengerdnd.js index 80010668d40..45012eb235c 100644 --- a/mailnews/base/resources/content/messengerdnd.js +++ b/mailnews/base/resources/content/messengerdnd.js @@ -91,7 +91,7 @@ function CanDropOnFolderTree(index) continue; //no data so continue; } if (dataObj) - dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if (! dataObj) continue; @@ -235,7 +235,7 @@ function DropOnFolderTree(row, orientation) var len = new Object(); trans.getAnyTransferData(bestFlavor, dataObj, len); if (dataObj) - dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if (! dataObj) continue; @@ -420,7 +420,7 @@ function BeginDragTree(event, tree, selArray, flavor) if (!trans) return false; - var genTextData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(Components.interfaces.nsISupportsWString); + var genTextData = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); if (!genTextData) return false; diff --git a/mailnews/base/src/nsMessengerBootstrap.cpp b/mailnews/base/src/nsMessengerBootstrap.cpp index 03178371821..3455774f538 100644 --- a/mailnews/base/src/nsMessengerBootstrap.cpp +++ b/mailnews/base/src/nsMessengerBootstrap.cpp @@ -112,7 +112,7 @@ NS_IMETHODIMP nsMessengerBootstrap::OpenMessengerWindowWithUri(const char *windo // create scriptable versions of our strings that we can store in our nsISupportsArray.... if (aFolderURI) { - nsCOMPtr<nsISupportsString> scriptableFolderURI (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> scriptableFolderURI (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); NS_ENSURE_TRUE(scriptableFolderURI, NS_ERROR_FAILURE); scriptableFolderURI->SetData(aFolderURI); diff --git a/mailnews/base/src/nsMsgAccountManagerDS.cpp b/mailnews/base/src/nsMsgAccountManagerDS.cpp index 17c4e2820b8..8ca57b2d657 100644 --- a/mailnews/base/src/nsMsgAccountManagerDS.cpp +++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp @@ -655,7 +655,7 @@ nsMsgAccountManagerDataSource::appendGenericSettingsResources(nsIMsgIncomingServ rv = catman->EnumerateCategory(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, getter_AddRefs(e)); if(NS_SUCCEEDED(rv) && e) { while (PR_TRUE) { - nsCOMPtr<nsISupportsString> catEntry; + nsCOMPtr<nsISupportsCString> catEntry; rv = e->GetNext(getter_AddRefs(catEntry)); if (NS_FAILED(rv) || !catEntry) break; diff --git a/mailnews/compose/resources/content/MsgComposeCommands.js b/mailnews/compose/resources/content/MsgComposeCommands.js index 48781359ca0..1cf9f55413f 100644 --- a/mailnews/compose/resources/content/MsgComposeCommands.js +++ b/mailnews/compose/resources/content/MsgComposeCommands.js @@ -885,7 +885,7 @@ function setupLdapAutocompleteSession() try { serverURL.spec = sPrefs.getComplexValue(autocompleteDirectory +".uri", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { dump("ERROR: " + ex + "\n"); } @@ -897,7 +897,7 @@ function setupLdapAutocompleteSession() try { login = sPrefs.getComplexValue( autocompleteDirectory + ".auth.dn", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { // if we don't have this pref, no big deal } @@ -952,7 +952,7 @@ function setupLdapAutocompleteSession() ldapFormatter.nameFormat = sPrefs.getComplexValue(autocompleteDirectory + ".autoComplete.nameFormat", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { // if this pref isn't there, no big deal. just let // nsAbLDAPAutoCompFormatter use its default. @@ -964,7 +964,7 @@ function setupLdapAutocompleteSession() ldapFormatter.addressFormat = sPrefs.getComplexValue(autocompleteDirectory + ".autoComplete.addressFormat", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { // if this pref isn't there, no big deal. just let // nsAbLDAPAutoCompFormatter use its default. @@ -988,7 +988,7 @@ function setupLdapAutocompleteSession() // ldapFormatter.commentFormat = sPrefs.getComplexValue( autocompleteDirectory + ".description", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; break; case 2: @@ -998,7 +998,7 @@ function setupLdapAutocompleteSession() ldapFormatter.commentFormat = sPrefs.getComplexValue(autocompleteDirectory + ".autoComplete.commentFormat", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (innerException) { // if nothing has been specified, use the ldap // organization field @@ -1028,7 +1028,7 @@ function setupLdapAutocompleteSession() LDAPSession.outputFormat = sPrefs.getComplexValue(autocompleteDirectory + ".autoComplete.outputFormat", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { // if this pref isn't there, no big deal. just let @@ -1040,7 +1040,7 @@ function setupLdapAutocompleteSession() try { LDAPSession.filterTemplate = sPrefs.getComplexValue( autocompleteDirectory + ".autoComplete.filterTemplate", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (ex) { // if this pref isn't there, no big deal. just let diff --git a/mailnews/compose/resources/content/addressingWidgetOverlay.js b/mailnews/compose/resources/content/addressingWidgetOverlay.js index af631aabc3c..f81e82fee42 100644 --- a/mailnews/compose/resources/content/addressingWidgetOverlay.js +++ b/mailnews/compose/resources/content/addressingWidgetOverlay.js @@ -770,7 +770,7 @@ function DropOnAddressingWidget(event) var len = new Object(); trans.getAnyTransferData ( bestFlavor, dataObj, len ); if ( dataObj ) - dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if ( !dataObj ) continue; @@ -834,14 +834,14 @@ function awRecipientErrorCommand(errItem, element) // try and get the string of the specific error to contruct the complete // err msg, otherwise fall back to something generic. This message is - // handed to us as an nsISupportsWString in the param slot of the + // handed to us as an nsISupportsString in the param slot of the // autocomplete error item, by agreement documented in // nsILDAPAutoCompFormatter.idl // var specificErrString = ""; try { var specificError = errItem.param.QueryInterface( - Components.interfaces.nsISupportsWString); + Components.interfaces.nsISupportsString); specificErrString = specificError.data; } catch (ex) { } diff --git a/mailnews/compose/src/nsMsgComposeProgress.cpp b/mailnews/compose/src/nsMsgComposeProgress.cpp index c1fc17ac3cc..51abe3a5549 100644 --- a/mailnews/compose/src/nsMsgComposeProgress.cpp +++ b/mailnews/compose/src/nsMsgComposeProgress.cpp @@ -81,8 +81,8 @@ nsMsgComposeProgress::OpenProgress(nsIDOMWindowInternal *parent, rv = NS_NewISupportsArray(getter_AddRefs(array)); NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr<nsISupportsWString> strptr = - do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsString> strptr = + do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); strptr->SetData(subject); diff --git a/mailnews/import/comm4x/src/nsComm4xMailImport.cpp b/mailnews/import/comm4x/src/nsComm4xMailImport.cpp index 128de291fce..256cfd34e76 100644 --- a/mailnews/import/comm4x/src/nsComm4xMailImport.cpp +++ b/mailnews/import/comm4x/src/nsComm4xMailImport.cpp @@ -160,7 +160,7 @@ NS_IMETHODIMP nsComm4xMailImport::GetImportInterface(const char *pImportType, ns nsXPIDLString name; rv = m_pBundle->GetStringFromID( COMM4XMAILIMPORT_NAME, getter_Copies(name)); - nsCOMPtr<nsISupportsWString> nameString (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv)); + nsCOMPtr<nsISupportsString> nameString (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv)); NS_ENSURE_SUCCESS(rv,rv); nameString->SetData(name.get()); pGeneric->SetData("name", nameString); diff --git a/mailnews/import/eudora/src/nsEudoraImport.cpp b/mailnews/import/eudora/src/nsEudoraImport.cpp index 14536f477af..7fccf60bde1 100644 --- a/mailnews/import/eudora/src/nsEudoraImport.cpp +++ b/mailnews/import/eudora/src/nsEudoraImport.cpp @@ -287,7 +287,7 @@ NS_IMETHODIMP nsEudoraImport::GetImportInterface( const char *pImportType, nsISu pGeneric->SetData( "mailInterface", pMail); nsString name; nsEudoraStringBundle::GetStringByID( EUDORAIMPORT_NAME, name); - nsCOMPtr<nsISupportsWString> nameString (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv)); + nsCOMPtr<nsISupportsString> nameString (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { nameString->SetData(name.get()); pGeneric->SetData( "name", nameString); diff --git a/mailnews/import/oexpress/nsOEImport.cpp b/mailnews/import/oexpress/nsOEImport.cpp index fb7e102705f..b9efafdf868 100644 --- a/mailnews/import/oexpress/nsOEImport.cpp +++ b/mailnews/import/oexpress/nsOEImport.cpp @@ -267,7 +267,7 @@ NS_IMETHODIMP nsOEImport::GetImportInterface( const char *pImportType, nsISuppor pGeneric->SetData( "mailInterface", pMail); nsString name; nsOEStringBundle::GetStringByID( OEIMPORT_NAME, name); - nsCOMPtr<nsISupportsWString> nameString (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv)); + nsCOMPtr<nsISupportsString> nameString (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { nameString->SetData(name.get()); pGeneric->SetData( "name", nameString); diff --git a/mailnews/import/outlook/src/nsOutlookImport.cpp b/mailnews/import/outlook/src/nsOutlookImport.cpp index 66219406e9c..01f5d3e0bc2 100644 --- a/mailnews/import/outlook/src/nsOutlookImport.cpp +++ b/mailnews/import/outlook/src/nsOutlookImport.cpp @@ -267,7 +267,7 @@ NS_IMETHODIMP nsOutlookImport::GetImportInterface( const char *pImportType, nsIS pGeneric->SetData( "mailInterface", pMail); nsString name; nsOutlookStringBundle::GetStringByID( OUTLOOKIMPORT_NAME, name); - nsCOMPtr<nsISupportsWString> nameString (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv)); + nsCOMPtr<nsISupportsString> nameString (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { nameString->SetData(name.get()); pGeneric->SetData( "name", nameString); diff --git a/mailnews/import/public/nsIImportGeneric.idl b/mailnews/import/public/nsIImportGeneric.idl index b289cd5ed1f..b41f208bea2 100644 --- a/mailnews/import/public/nsIImportGeneric.idl +++ b/mailnews/import/public/nsIImportGeneric.idl @@ -44,7 +44,7 @@ #include "nsISupports.idl" interface nsIDOMWindowInternal; -interface nsISupportsWString; +interface nsISupportsString; [scriptable, uuid(9b5c20c0-2348-11d3-a206-00a0cc26da63)] interface nsIImportGeneric : nsISupports @@ -95,7 +95,7 @@ interface nsIImportGeneric : nsISupports failure of the import. Failure can be reported even if WantsProgress returned TRUE. */ - boolean BeginImport( in nsISupportsWString successLog, in nsISupportsWString errorLog, in boolean isAddrLocHome); + boolean BeginImport( in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome); /* If WantsProgress returned TRUE then this will indicate if the import should continue. If this returns FALSE then no other methods should be called diff --git a/mailnews/import/resources/content/fieldMapImport.js b/mailnews/import/resources/content/fieldMapImport.js index 66b7f87e7b7..ad161f3ef3f 100644 --- a/mailnews/import/resources/content/fieldMapImport.js +++ b/mailnews/import/resources/content/fieldMapImport.js @@ -220,7 +220,7 @@ function FetchSampleData() var data = top.addInterface.GetData( "sampleData-"+num); var result = false; if (data != null) { - data = data.QueryInterface( Components.interfaces.nsISupportsWString); + data = data.QueryInterface( Components.interfaces.nsISupportsString); if (data != null) { ShowSampleData( data.data); result = true; diff --git a/mailnews/import/resources/content/importDialog.js b/mailnews/import/resources/content/importDialog.js index 74961606f69..9e2d82afce2 100644 --- a/mailnews/import/resources/content/importDialog.js +++ b/mailnews/import/resources/content/importDialog.js @@ -164,13 +164,13 @@ function ImportDialogOKButton() { case "mail": - top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); + top.successStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(); if (top.successStr) { - top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); + top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsString); } - top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); + top.errorStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(); if (top.errorStr) - top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); + top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsString); if (ImportMail( module, top.successStr, top.errorStr) == true) { @@ -206,15 +206,15 @@ function ImportDialogOKButton() break; case "addressbook": - top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); + top.successStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(); if (top.successStr) - top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); - top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); + top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsString); + top.errorStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(); if (top.errorStr) - top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); - top.inputStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); + top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsString); + top.inputStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(); if (top.inputStr) - top.inputStr = top.inputStr.QueryInterface( Components.interfaces.nsISupportsWString); + top.inputStr = top.inputStr.QueryInterface( Components.interfaces.nsISupportsString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to @@ -376,7 +376,7 @@ function ContinueImport( info) { if (isMail) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName) { - mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); + mailName = mailName.QueryInterface( Components.interfaces.nsISupportsString); if (mailName) SetStatusText( mailName.data); } diff --git a/mailnews/import/src/nsImportAddressBooks.cpp b/mailnews/import/src/nsImportAddressBooks.cpp index d9793b902c7..80bef6749b3 100644 --- a/mailnews/import/src/nsImportAddressBooks.cpp +++ b/mailnews/import/src/nsImportAddressBooks.cpp @@ -72,7 +72,7 @@ static NS_DEFINE_CID(kAbDirectoryCID, NS_ABDIRECTORY_CID); static NS_DEFINE_CID(kStandardUrlCID, NS_STANDARDURL_CID); static NS_DEFINE_CID(kAddrBookSessionCID, NS_ADDRBOOKSESSION_CID); static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); -static NS_DEFINE_CID(kSupportsWStringCID, NS_SUPPORTS_WSTRING_CID); +static NS_DEFINE_CID(kSupportsWStringCID, NS_SUPPORTS_STRING_CID); static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID); @@ -102,8 +102,8 @@ public: /* boolean WantsProgress (); */ NS_IMETHOD WantsProgress(PRBool *_retval); - /* boolean BeginImport (in nsISupportsWString successLog, in nsISupportsWString errorLog, in boolean isAddrLocHome); */ - NS_IMETHOD BeginImport(nsISupportsWString *successLog, nsISupportsWString *errorLog, PRBool isAddrLocHome, PRBool *_retval) ; + /* boolean BeginImport (in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome); */ + NS_IMETHOD BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, PRBool isAddrLocHome, PRBool *_retval) ; /* boolean ContinueImport (); */ NS_IMETHOD ContinueImport(PRBool *_retval); @@ -120,7 +120,7 @@ private: void GetDefaultFieldMap( void); public: - static void SetLogs( nsString& success, nsString& error, nsISupportsWString *pSuccess, nsISupportsWString *pError); + static void SetLogs( nsString& success, nsString& error, nsISupportsString *pSuccess, nsISupportsString *pError); static void ReportError( PRUnichar *pName, nsString *pStream); private: @@ -133,8 +133,8 @@ private: PRBool m_gotLocation; PRBool m_found; PRBool m_userVerify; - nsISupportsWString * m_pSuccessLog; - nsISupportsWString * m_pErrorLog; + nsISupportsString * m_pSuccessLog; + nsISupportsString * m_pErrorLog; PRUint32 m_totalSize; PRBool m_doImport; AddressThreadData * m_pThreadData; @@ -152,8 +152,8 @@ public: nsISupportsArray * books; nsIImportAddressBooks * addressImport; nsIImportFieldMap * fieldMap; - nsISupportsWString * successLog; - nsISupportsWString * errorLog; + nsISupportsString * successLog; + nsISupportsString * errorLog; char * pDestinationUri; PRBool bAddrLocInput ; @@ -303,8 +303,8 @@ NS_IMETHODIMP nsImportGenericAddressBooks::GetData(const char *dataId, nsISuppor } IMPORT_LOG1( "Requesting sample data #: %ld\n", (long)rNum); if (m_pInterface) { - nsCOMPtr<nsISupportsWString> data; - rv = nsComponentManager::CreateInstance( kSupportsWStringCID, nsnull, NS_GET_IID(nsISupportsWString), getter_AddRefs( data)); + nsCOMPtr<nsISupportsString> data; + rv = nsComponentManager::CreateInstance( kSupportsWStringCID, nsnull, NS_GET_IID(nsISupportsString), getter_AddRefs( data)); if (NS_FAILED( rv)) return( rv); PRUnichar * pData = nsnull; @@ -541,7 +541,7 @@ NS_IMETHODIMP nsImportGenericAddressBooks::WantsProgress(PRBool *_retval) return( NS_OK); } -void nsImportGenericAddressBooks::SetLogs( nsString& success, nsString& error, nsISupportsWString *pSuccess, nsISupportsWString *pError) +void nsImportGenericAddressBooks::SetLogs( nsString& success, nsString& error, nsISupportsString *pSuccess, nsISupportsString *pError) { nsString str; PRUnichar * pStr = nsnull; @@ -572,7 +572,7 @@ void nsImportGenericAddressBooks::SetLogs( nsString& success, nsString& error, n } } -NS_IMETHODIMP nsImportGenericAddressBooks::BeginImport(nsISupportsWString *successLog, nsISupportsWString *errorLog, PRBool isAddrLocHome, PRBool *_retval) +NS_IMETHODIMP nsImportGenericAddressBooks::BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, PRBool isAddrLocHome, PRBool *_retval) { NS_PRECONDITION(_retval != nsnull, "null ptr"); if (!_retval) diff --git a/mailnews/import/src/nsImportMail.cpp b/mailnews/import/src/nsImportMail.cpp index f09261bd141..e314ae55617 100644 --- a/mailnews/import/src/nsImportMail.cpp +++ b/mailnews/import/src/nsImportMail.cpp @@ -77,7 +77,7 @@ static NS_DEFINE_CID(kMsgAccountCID, NS_MSGACCOUNT_CID); static NS_DEFINE_CID(kMsgIdentityCID, NS_MSGIDENTITY_CID); static NS_DEFINE_CID(kMsgBiffManagerCID, NS_MSGBIFFMANAGER_CID); static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID); -static NS_DEFINE_CID(kSupportsWStringCID, NS_SUPPORTS_WSTRING_CID); +static NS_DEFINE_CID(kSupportsWStringCID, NS_SUPPORTS_STRING_CID); //////////////////////////////////////////////////////////////////////// @@ -106,8 +106,8 @@ public: /* boolean WantsProgress (); */ NS_IMETHOD WantsProgress(PRBool *_retval); - /* boolean BeginImport (in nsISupportsWString successLog, in nsISupportsWString errorLog, in boolean isAddrLocHome); */ - NS_IMETHODIMP BeginImport(nsISupportsWString *successLog, nsISupportsWString *errorLog, PRBool isAddrLocHome, PRBool *_retval) ; + /* boolean BeginImport (in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome); */ + NS_IMETHODIMP BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, PRBool isAddrLocHome, PRBool *_retval) ; /* boolean ContinueImport (); */ NS_IMETHOD ContinueImport(PRBool *_retval); @@ -123,10 +123,10 @@ private: void GetDefaultMailboxes( void); void GetDefaultLocation( void); void GetDefaultDestination( void); - void GetMailboxName( PRUint32 index, nsISupportsWString *pStr); + void GetMailboxName( PRUint32 index, nsISupportsString *pStr); public: - static void SetLogs( nsString& success, nsString& error, nsISupportsWString *pSuccess, nsISupportsWString *pError); + static void SetLogs( nsString& success, nsString& error, nsISupportsString *pSuccess, nsISupportsString *pError); static void ReportError( PRInt32 id, const PRUnichar *pName, nsString *pStream); private: @@ -140,8 +140,8 @@ private: PRBool m_userVerify; nsIImportMail * m_pInterface; nsISupportsArray * m_pMailboxes; - nsISupportsWString *m_pSuccessLog; - nsISupportsWString *m_pErrorLog; + nsISupportsString *m_pSuccessLog; + nsISupportsString *m_pErrorLog; PRUint32 m_totalSize; PRBool m_doImport; ImportThreadData * m_pThreadData; @@ -159,8 +159,8 @@ public: PRBool ownsDestRoot; nsISupportsArray * boxes; nsIImportMail * mailImport; - nsISupportsWString * successLog; - nsISupportsWString * errorLog; + nsISupportsString * successLog; + nsISupportsString * errorLog; PRUint32 currentMailbox; ImportThreadData(); @@ -271,10 +271,10 @@ NS_IMETHODIMP nsImportGenericMail::GetData(const char *dataId, nsISupports **_re } if (!nsCRT::strcasecmp( dataId, "currentMailbox")) { - // create an nsISupportsWString, get the current mailbox + // create an nsISupportsString, get the current mailbox // name being imported and put it in the string - nsCOMPtr<nsISupportsWString> data; - rv = nsComponentManager::CreateInstance( kSupportsWStringCID, nsnull, NS_GET_IID(nsISupportsWString), getter_AddRefs( data)); + nsCOMPtr<nsISupportsString> data; + rv = nsComponentManager::CreateInstance( kSupportsWStringCID, nsnull, NS_GET_IID(nsISupportsString), getter_AddRefs( data)); if (NS_FAILED( rv)) return( rv); if (m_pThreadData) { @@ -323,9 +323,9 @@ NS_IMETHODIMP nsImportGenericMail::SetData( const char *dataId, nsISupports *ite if (m_pName) nsCRT::free( m_pName); m_pName = nsnull; - nsCOMPtr<nsISupportsWString> nameString; + nsCOMPtr<nsISupportsString> nameString; if (item) { - item->QueryInterface( NS_GET_IID(nsISupportsWString), getter_AddRefs(nameString)); + item->QueryInterface( NS_GET_IID(nsISupportsString), getter_AddRefs(nameString)); rv = nameString->GetData(&m_pName); } } @@ -463,7 +463,7 @@ NS_IMETHODIMP nsImportGenericMail::WantsProgress(PRBool *_retval) return( NS_OK); } -void nsImportGenericMail::GetMailboxName( PRUint32 index, nsISupportsWString *pStr) +void nsImportGenericMail::GetMailboxName( PRUint32 index, nsISupportsString *pStr) { if (m_pMailboxes) { nsISupports *pSupports = m_pMailboxes->ElementAt( index); @@ -482,7 +482,7 @@ void nsImportGenericMail::GetMailboxName( PRUint32 index, nsISupportsWString *pS } } -NS_IMETHODIMP nsImportGenericMail::BeginImport(nsISupportsWString *successLog, nsISupportsWString *errorLog, PRBool isAddrLocHome, PRBool *_retval) +NS_IMETHODIMP nsImportGenericMail::BeginImport(nsISupportsString *successLog, nsISupportsString *errorLog, PRBool isAddrLocHome, PRBool *_retval) { NS_PRECONDITION(_retval != nsnull, "null ptr"); if (!_retval) @@ -639,7 +639,7 @@ void nsImportGenericMail::ReportError( PRInt32 id, const PRUnichar *pName, nsStr } -void nsImportGenericMail::SetLogs( nsString& success, nsString& error, nsISupportsWString *pSuccess, nsISupportsWString *pError) +void nsImportGenericMail::SetLogs( nsString& success, nsString& error, nsISupportsString *pSuccess, nsISupportsString *pError) { nsString str; PRUnichar * pStr = nsnull; diff --git a/mailnews/import/src/nsImportService.cpp b/mailnews/import/src/nsImportService.cpp index 3896cdaf917..fef968d81da 100644 --- a/mailnews/import/src/nsImportService.cpp +++ b/mailnews/import/src/nsImportService.cpp @@ -615,7 +615,7 @@ nsresult nsImportService::DoDiscover( void) nsCOMPtr<nsISimpleEnumerator> e; rv = catMan->EnumerateCategory( "mailnewsimport", getter_AddRefs( e)); if (NS_FAILED( rv)) return( rv); - nsCOMPtr<nsISupportsString> contractid; + nsCOMPtr<nsISupportsCString> contractid; rv = e->GetNext( getter_AddRefs( contractid)); while (NS_SUCCEEDED( rv) && contractid) { nsXPIDLCString contractIdStr; diff --git a/modules/libpr0n/src/imgLoader.cpp b/modules/libpr0n/src/imgLoader.cpp index fbb49c05f91..7a04194fbad 100644 --- a/modules/libpr0n/src/imgLoader.cpp +++ b/modules/libpr0n/src/imgLoader.cpp @@ -64,7 +64,7 @@ static void PrintImageDecoders() do { enumer->CurrentItem(getter_AddRefs(s)); if (s) { - nsCOMPtr<nsISupportsString> ss(do_QueryInterface(s)); + nsCOMPtr<nsISupportsCString> ss(do_QueryInterface(s)); nsXPIDLCString xcs; ss->GetData(getter_Copies(xcs)); diff --git a/modules/libpref/public/nsIPrefBranch.idl b/modules/libpref/public/nsIPrefBranch.idl index 90ec3c71746..b609117fd58 100644 --- a/modules/libpref/public/nsIPrefBranch.idl +++ b/modules/libpref/public/nsIPrefBranch.idl @@ -168,7 +168,7 @@ interface nsIPrefBranch : nsISupports * @param aType The XPCOM interface that this complex preference * represents. Interfaces currently supported are: * - nsILocalFile - * - nsISupportsWString (UniChar) + * - nsISupportsString (UniChar) * - nsIPrefLocalizedString (Localized UniChar) * - nsIFileSpec (deprecated - to be removed eventually) * @param aValue The XPCOM object into which to the complex preference @@ -191,7 +191,7 @@ interface nsIPrefBranch : nsISupports * @param aType The XPCOM interface that this complex preference * represents. Interfaces currently supported are: * - nsILocalFile - * - nsISupportsWString (UniChar) + * - nsISupportsString (UniChar) * - nsIPrefLocalizedString (Localized UniChar) * - nsIFileSpec (deprecated - to be removed eventually) * @param aValue The XPCOM object from which to set the complex preference diff --git a/modules/libpref/public/nsIPrefLocalizedString.idl b/modules/libpref/public/nsIPrefLocalizedString.idl index cd3a687d898..3ae485b5096 100644 --- a/modules/libpref/public/nsIPrefLocalizedString.idl +++ b/modules/libpref/public/nsIPrefLocalizedString.idl @@ -41,13 +41,13 @@ /** * The nsIPrefLocalizedString interface is simply a wrapper interface for - * nsISupportsWString so the preferences service can have a unique identifier - * to distinguish between requests for normal wide strings (nsISupportsWString) + * nsISupportsString so the preferences service can have a unique identifier + * to distinguish between requests for normal wide strings (nsISupportsString) * and "localized" wide strings, which get their default values from properites * files. * * @see nsIPrefBranch - * @see nsISupportsWString + * @see nsISupportsString * * @status FROZEN */ diff --git a/modules/libpref/src/nsPref.cpp b/modules/libpref/src/nsPref.cpp index bf2f4e7975a..8a88d502230 100644 --- a/modules/libpref/src/nsPref.cpp +++ b/modules/libpref/src/nsPref.cpp @@ -390,8 +390,8 @@ NS_IMETHODIMP nsPref::CopyUnicharPref(const char *pref, PRUnichar **_retval) nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(mPrefService, &rv); if (NS_SUCCEEDED(rv)) { - nsCOMPtr<nsISupportsWString> theString; - rv = prefBranch->GetComplexValue(pref, NS_GET_IID(nsISupportsWString), + nsCOMPtr<nsISupportsString> theString; + rv = prefBranch->GetComplexValue(pref, NS_GET_IID(nsISupportsString), getter_AddRefs(theString)); if (NS_SUCCEEDED(rv)) { rv = theString->GetData(_retval); @@ -403,9 +403,9 @@ NS_IMETHODIMP nsPref::CopyUnicharPref(const char *pref, PRUnichar **_retval) NS_IMETHODIMP nsPref::CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval) { nsresult rv; - nsCOMPtr<nsISupportsWString> theString; + nsCOMPtr<nsISupportsString> theString; - rv = mDefaultBranch->GetComplexValue(pref, NS_GET_IID(nsISupportsWString), + rv = mDefaultBranch->GetComplexValue(pref, NS_GET_IID(nsISupportsString), getter_AddRefs(theString)); if (NS_SUCCEEDED(rv)) { rv = theString->GetData(_retval); @@ -419,10 +419,10 @@ NS_IMETHODIMP nsPref::SetUnicharPref(const char *pref, const PRUnichar *value) nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(mPrefService, &rv); if (NS_SUCCEEDED(rv)) { - nsCOMPtr<nsISupportsWString> theString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsString> theString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { theString->SetData(value); - rv = prefBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsWString), theString); + rv = prefBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsString), theString); } } return rv; @@ -432,10 +432,10 @@ NS_IMETHODIMP nsPref::SetDefaultUnicharPref(const char *pref, const PRUnichar *v { nsresult rv; - nsCOMPtr<nsISupportsWString> theString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsString> theString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { theString->SetData(value); - rv = mDefaultBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsWString), theString); + rv = mDefaultBranch->SetComplexValue(pref, NS_GET_IID(nsISupportsString), theString); } return rv; } diff --git a/modules/libpref/src/nsPrefBranch.cpp b/modules/libpref/src/nsPrefBranch.cpp index d5ce182ebc5..64e34db662f 100644 --- a/modules/libpref/src/nsPrefBranch.cpp +++ b/modules/libpref/src/nsPrefBranch.cpp @@ -373,13 +373,13 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID & return NS_OK; } - if (aType.Equals(NS_GET_IID(nsISupportsWString))) { - nsCOMPtr<nsISupportsWString> theString(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv)); + if (aType.Equals(NS_GET_IID(nsISupportsString))) { + nsCOMPtr<nsISupportsString> theString(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { rv = theString->SetData(NS_ConvertUTF8toUCS2(utf8String).get()); if (NS_SUCCEEDED(rv)) { - nsISupportsWString *temp = theString; + nsISupportsString *temp = theString; NS_ADDREF(temp); *_retval = (void *)temp; @@ -462,8 +462,8 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID & return SetCharPref(aPrefName, descriptorString.get()); } - if (aType.Equals(NS_GET_IID(nsISupportsWString))) { - nsCOMPtr<nsISupportsWString> theString = do_QueryInterface(aValue); + if (aType.Equals(NS_GET_IID(nsISupportsString))) { + nsCOMPtr<nsISupportsString> theString = do_QueryInterface(aValue); if (theString) { nsXPIDLString wideString; @@ -969,7 +969,7 @@ nsPrefLocalizedString::nsPrefLocalizedString() NS_INIT_REFCNT(); - mUnicodeString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + mUnicodeString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); } nsPrefLocalizedString::~nsPrefLocalizedString() @@ -987,13 +987,13 @@ NS_IMPL_THREADSAFE_RELEASE(nsPrefLocalizedString) NS_INTERFACE_MAP_BEGIN(nsPrefLocalizedString) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrefLocalizedString) NS_INTERFACE_MAP_ENTRY(nsIPrefLocalizedString) - NS_INTERFACE_MAP_ENTRY(nsISupportsWString) + NS_INTERFACE_MAP_ENTRY(nsISupportsString) NS_INTERFACE_MAP_END nsresult nsPrefLocalizedString::Init() { nsresult rv; - mUnicodeString = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, &rv); + mUnicodeString = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); return rv; } diff --git a/modules/libpref/src/nsPrefBranch.h b/modules/libpref/src/nsPrefBranch.h index 1f4b9a3e391..5a997e4ba61 100644 --- a/modules/libpref/src/nsPrefBranch.h +++ b/modules/libpref/src/nsPrefBranch.h @@ -89,20 +89,20 @@ private: class nsPrefLocalizedString : public nsIPrefLocalizedString, - public nsISupportsWString + public nsISupportsString { public: nsPrefLocalizedString(); virtual ~nsPrefLocalizedString(); NS_DECL_ISUPPORTS - NS_FORWARD_NSISUPPORTSWSTRING(mUnicodeString->) + NS_FORWARD_NSISUPPORTSSTRING(mUnicodeString->) NS_FORWARD_NSISUPPORTSPRIMITIVE(mUnicodeString->) nsresult Init(); private: - nsCOMPtr<nsISupportsWString> mUnicodeString; + nsCOMPtr<nsISupportsString> mUnicodeString; }; diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp index 99cfa2fb181..73ee8528d11 100644 --- a/netwerk/base/src/nsIOService.cpp +++ b/netwerk/base/src/nsIOService.cpp @@ -509,7 +509,7 @@ nsIOService::GetParserForScheme(const char *scheme, nsIURLParser **_retval) rv = catmgr->EnumerateCategory(NS_IURLPARSER_KEY, getter_AddRefs(parserList)); if (NS_FAILED(rv)) return rv; - nsCOMPtr<nsISupportsString> entry; + nsCOMPtr<nsISupportsCString> entry; // Walk the list of parsers... while (1) { diff --git a/netwerk/protocol/http/public/nsIHttpChannel.idl b/netwerk/protocol/http/public/nsIHttpChannel.idl index 7aff9570b91..92db7b0cdb7 100644 --- a/netwerk/protocol/http/public/nsIHttpChannel.idl +++ b/netwerk/protocol/http/public/nsIHttpChannel.idl @@ -100,7 +100,7 @@ interface nsIHttpChannel : nsIChannel /** * This attribute holds the MIME types corresponding to the content - * encodings on the channel. The enumerator returns nsISupportsString + * encodings on the channel. The enumerator returns nsISupportsCString * objects. The first one corresponds to the outermost encoding on the * channel and then we work our way inward. "identity" is skipped and not * represented on the list. Unknown encodings make the enumeration stop. diff --git a/netwerk/protocol/http/src/nsHttpChannel.cpp b/netwerk/protocol/http/src/nsHttpChannel.cpp index 34ca16f9b9b..3126b240d39 100644 --- a/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -3271,8 +3271,8 @@ nsHttpChannel::nsContentEncodings::GetNext(nsISupports** aNextEncoding) encoding.BeginReading(start); encoding.EndReading(end); - nsCOMPtr<nsISupportsString> str; - str = do_CreateInstance("@mozilla.org/supports-string;1"); + nsCOMPtr<nsISupportsCString> str; + str = do_CreateInstance("@mozilla.org/supports-cstring;1"); if (!str) return NS_ERROR_FAILURE; diff --git a/netwerk/streamconv/src/nsStreamConverterService.cpp b/netwerk/streamconv/src/nsStreamConverterService.cpp index 9ca1826d557..9f9ef7d9a05 100644 --- a/netwerk/streamconv/src/nsStreamConverterService.cpp +++ b/netwerk/streamconv/src/nsStreamConverterService.cpp @@ -111,7 +111,7 @@ nsStreamConverterService::BuildGraph() { if (NS_FAILED(rv)) return rv; // go through each entry to build the graph - nsCOMPtr<nsISupportsString> entry; + nsCOMPtr<nsISupportsCString> entry; rv = entries->GetNext(getter_AddRefs(entry)); while (NS_SUCCEEDED(rv)) { diff --git a/netwerk/test/TestCacheService.cpp b/netwerk/test/TestCacheService.cpp index 1ccb47ac289..99691ea96a8 100644 --- a/netwerk/test/TestCacheService.cpp +++ b/netwerk/test/TestCacheService.cpp @@ -113,8 +113,8 @@ TestMemoryObjectCache() goto error_exit; } - nsCOMPtr<nsISupportsString> foo = - do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv); + nsCOMPtr<nsISupportsCString> foo = + do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv); foo->SetData("hello world"); @@ -134,7 +134,7 @@ TestMemoryObjectCache() goto error_exit; } - nsCOMPtr<nsISupportsString> bar; + nsCOMPtr<nsISupportsCString> bar; descriptor->GetCacheElement(getter_AddRefs(bar)); if (foo.get() != bar.get()) { printf("cache elements not the same\n"); diff --git a/netwerk/test/TestObjectCache.js b/netwerk/test/TestObjectCache.js index 54a3d8fcfe0..4e5a7100cc6 100644 --- a/netwerk/test/TestObjectCache.js +++ b/netwerk/test/TestObjectCache.js @@ -29,9 +29,9 @@ function openCacheEntry(clientID, url) function wrapString(str) { - var nsISupportsString = Components.interfaces.nsISupportsString; - var factory = Components.classes["@mozilla.org/supports-string;1"]; - var wrapper = factory.createInstance(nsISupportsString); + var nsISupportsCString = Components.interfaces.nsISupportsCString; + var factory = Components.classes["@mozilla.org/supports-cstring;1"]; + var wrapper = factory.createInstance(nsISupportsCString); wrapper.data = str; return wrapper; } diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index 30e4fb1d1d6..c4265c1a23b 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -613,7 +613,7 @@ nsProfile::LoadDefaultProfileDir(nsCString & profileURLStr, PRBool canInteract) { while (PR_TRUE) { - nsCOMPtr<nsISupportsString> contractid; + nsCOMPtr<nsISupportsCString> contractid; rv = enumItem->GetNext(getter_AddRefs(contractid)); if (NS_FAILED(rv) || !contractid) break; diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp index 8b4ade84eae..f1d91fbd814 100644 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp @@ -316,12 +316,12 @@ GetFileLocation(const char* aPrefName, If we have an env var we should check whether the pref is a user pref. If we do not, we don't care. */ - nsCOMPtr<nsISupportsWString> prefFileName; + nsCOMPtr<nsISupportsString> prefFileName; PRBool isUserPref = PR_FALSE; prefBranch->PrefHasUserValue(aPrefName, &isUserPref); if (isUserPref) { rv = prefBranch->GetComplexValue(aPrefName, - NS_GET_IID(nsISupportsWString), + NS_GET_IID(nsISupportsString), getter_AddRefs(prefFileName)); if (NS_SUCCEEDED(rv)) { return prefFileName->GetData(aFileLocation); @@ -353,7 +353,7 @@ GetFileLocation(const char* aPrefName, } rv = prefBranch->GetComplexValue(aPrefName, - NS_GET_IID(nsISupportsWString), + NS_GET_IID(nsISupportsString), getter_AddRefs(prefFileName)); if (NS_SUCCEEDED(rv)) { return prefFileName->GetData(aFileLocation); diff --git a/widget/public/nsIClipboard.idl b/widget/public/nsIClipboard.idl index 9675275ece1..fd28043d60d 100644 --- a/widget/public/nsIClipboard.idl +++ b/widget/public/nsIClipboard.idl @@ -82,7 +82,7 @@ interface nsIClipboard : nsISupports * inexpensive call. All it does is check if there is data on the clipboard matching * any of the flavors in the given list. * - * @aFlavorList - nsISupportsString's in a nsISupportsArray (for JavaScript). + * @aFlavorList - nsISupportsCString's in a nsISupportsArray (for JavaScript). * @param aWhichClipboard Specifies the clipboard to which this operation applies. * @outResult - if data is present matching one of * @result NS_OK if successful. diff --git a/widget/public/nsIFormatConverter.idl b/widget/public/nsIFormatConverter.idl index 4a44a2dd42e..f7ca1516c86 100644 --- a/widget/public/nsIFormatConverter.idl +++ b/widget/public/nsIFormatConverter.idl @@ -43,14 +43,14 @@ interface nsIFormatConverter : nsISupports { /** - * Get the list of the "input" data flavors (mime types as nsISupportsString), + * Get the list of the "input" data flavors (mime types as nsISupportsCString), * in otherwords, the flavors that this converter can convert "from" (the * incoming data to the converter). */ nsISupportsArray getInputDataFlavors ( ) ; /** - * Get the list of the "output" data flavors (mime types as nsISupportsString), + * Get the list of the "output" data flavors (mime types as nsISupportsCString), * in otherwords, the flavors that this converter can convert "to" (the * outgoing data to the converter). * diff --git a/widget/public/nsITransferable.idl b/widget/public/nsITransferable.idl index ed27ddc34d0..79a77846adc 100644 --- a/widget/public/nsITransferable.idl +++ b/widget/public/nsITransferable.idl @@ -48,7 +48,7 @@ interface nsITransferable : nsISupports { /** - * Computes a list of flavors (mime types as nsISupportsString) that the transferable + * Computes a list of flavors (mime types as nsISupportsCString) that the transferable * can export, either through intrinsic knowledge or output data converters. * * @param aDataFlavorList fills list with supported flavors. This is a copy of @@ -86,7 +86,7 @@ interface nsITransferable : nsISupports /////////////////////////////// /** - * Computes a list of flavors (mime types as nsISupportsString) that the transferable can + * Computes a list of flavors (mime types as nsISupportsCString) that the transferable can * accept into it, either through intrinsic knowledge or input data converters. * * @param outFlavorList fills list with supported flavors. This is a copy of diff --git a/widget/src/beos/nsClipboard.cpp b/widget/src/beos/nsClipboard.cpp index d9e24f3353a..682451a92e5 100644 --- a/widget/src/beos/nsClipboard.cpp +++ b/widget/src/beos/nsClipboard.cpp @@ -150,7 +150,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) for (i = 0; i < cnt && rv == NS_OK; i++) { nsCOMPtr<nsISupports> genericFlavor; dfList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor (do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor (do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -277,7 +277,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, PRInt32 aWh for (PRUint32 i = 0; i < cnt; i++) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); diff --git a/widget/src/cocoa/nsClipboard.cpp b/widget/src/cocoa/nsClipboard.cpp index 6e6e267b7e2..0f76daa03ee 100644 --- a/widget/src/cocoa/nsClipboard.cpp +++ b/widget/src/cocoa/nsClipboard.cpp @@ -129,7 +129,7 @@ nsClipboard :: SetNativeClipboardData ( PRInt32 aWhichClipboard ) for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString( getter_Copies(flavorStr) ); @@ -272,7 +272,7 @@ nsClipboard :: GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString ( getter_Copies(flavorStr) ); @@ -426,7 +426,7 @@ nsClipboard :: GetDataOffClipboard ( ResType inMacFlavor, void** outData, PRInt3 // HasDataMatchingFlavors // // Check the clipboard to see if we have any data that matches the given flavors. This -// does NOT actually fetch the data. The items in the flavor list are nsISupportsString's. +// does NOT actually fetch the data. The items in the flavor list are nsISupportsCString's. // // Handle the case where we ask for unicode and it's not there, but plain text is. We // say "yes" in that case, knowing that we will have to perform a conversion when we actually @@ -452,7 +452,7 @@ nsClipboard :: HasDataMatchingFlavors ( nsISupportsArray* aFlavorList, PRInt32 a for ( PRUint32 i = 0; i < length; ++i ) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> flavorWrapper ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> flavorWrapper ( do_QueryInterface(genericFlavor) ); if ( flavorWrapper ) { nsXPIDLCString flavor; flavorWrapper->ToString ( getter_Copies(flavor) ); diff --git a/widget/src/cocoa/nsDragService.cpp b/widget/src/cocoa/nsDragService.cpp index 22652cc121a..7ecf74273b9 100644 --- a/widget/src/cocoa/nsDragService.cpp +++ b/widget/src/cocoa/nsDragService.cpp @@ -391,7 +391,7 @@ nsDragService :: RegisterDragItemsAndFlavors ( nsISupportsArray * inArray ) nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt ( flavorIndex, getter_AddRefs(genericWrapper) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericWrapper) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericWrapper) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString ( getter_Copies(flavorStr) ); @@ -444,7 +444,7 @@ nsDragService :: GetData ( nsITransferable * aTransferable, PRUint32 aItemIndex return NS_ERROR_INVALID_ARG; // get flavor list that includes all acceptable flavors (including ones obtained through - // conversion). Flavors are nsISupportsStrings so that they can be seen from JS. + // conversion). Flavors are nsISupportsCStrings so that they can be seen from JS. nsCOMPtr<nsISupportsArray> flavorList; errCode = aTransferable->FlavorsTransferableCanImport ( getter_AddRefs(flavorList) ); if ( NS_FAILED(errCode) ) @@ -468,7 +468,7 @@ nsDragService :: GetData ( nsITransferable * aTransferable, PRUint32 aItemIndex for ( int i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt ( i, getter_AddRefs(genericWrapper) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericWrapper) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericWrapper) ); if ( currentFlavor ) { // find MacOS flavor (but don't add it if it's not there) nsXPIDLCString flavorStr; diff --git a/widget/src/gtk/nsClipboard.cpp b/widget/src/gtk/nsClipboard.cpp index 39aa18e59c5..75f63711f9d 100644 --- a/widget/src/gtk/nsClipboard.cpp +++ b/widget/src/gtk/nsClipboard.cpp @@ -338,7 +338,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -440,7 +440,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString ( getter_Copies(flavorStr) ); @@ -768,7 +768,7 @@ nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList, for ( PRUint32 i = 0; i < length; ++i ) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> flavorWrapper ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> flavorWrapper ( do_QueryInterface(genericFlavor) ); if ( flavorWrapper ) { nsCAutoString flavorStr; nsXPIDLCString myStr; diff --git a/widget/src/gtk/nsDragService.cpp b/widget/src/gtk/nsDragService.cpp index 689808d573c..56150252e10 100644 --- a/widget/src/gtk/nsDragService.cpp +++ b/widget/src/gtk/nsDragService.cpp @@ -320,7 +320,7 @@ nsDragService::GetData (nsITransferable * aTransferable, return NS_ERROR_INVALID_ARG; // get flavor list that includes all acceptable flavors (including - // ones obtained through conversion). Flavors are nsISupportsStrings + // ones obtained through conversion). Flavors are nsISupportsCStrings // so that they can be seen from JS. nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsISupportsArray> flavorList; @@ -341,7 +341,7 @@ nsDragService::GetData (nsITransferable * aTransferable, nsCOMPtr<nsISupports> genericWrapper; // there is always one element if it's a list flavorList->GetElementAt(0, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -381,7 +381,7 @@ nsDragService::GetData (nsITransferable * aTransferable, for ( i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt(i,getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { // find our gtk flavor @@ -557,7 +557,7 @@ nsDragService::IsDataFlavorSupported (const char *aDataFlavor, for ( PRUint32 flavorIndex = 0; flavorIndex < numFlavors ; ++flavorIndex ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt (flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -811,7 +811,7 @@ nsDragService::GetSourceList(void) ++flavorIndex ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt(flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -848,7 +848,7 @@ nsDragService::GetSourceList(void) ++flavorIndex ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt(flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; diff --git a/widget/src/gtk2/nsClipboard.cpp b/widget/src/gtk2/nsClipboard.cpp index 7785b3eefb4..4ed82fc2e19 100644 --- a/widget/src/gtk2/nsClipboard.cpp +++ b/widget/src/gtk2/nsClipboard.cpp @@ -141,7 +141,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, for (PRUint32 i=0; i < count; i++) { nsCOMPtr<nsISupports> tastesLike; flavors->GetElementAt(i, getter_AddRefs(tastesLike)); - nsCOMPtr<nsISupportsString> flavor = do_QueryInterface(tastesLike); + nsCOMPtr<nsISupportsCString> flavor = do_QueryInterface(tastesLike); if (flavor) { nsXPIDLCString flavorStr; @@ -196,7 +196,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, PRInt32 aWhichClipboard) nsCOMPtr<nsISupports> genericFlavor; flavors->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericFlavor); if (currentFlavor) { @@ -316,7 +316,7 @@ nsClipboard::HasDataMatchingFlavors(nsISupportsArray *aFlavorList, for (PRUint32 i = 0; i < length && !*_retval; i++) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> flavorWrapper; + nsCOMPtr<nsISupportsCString> flavorWrapper; flavorWrapper = do_QueryInterface(genericFlavor); if (flavorWrapper) { @@ -436,7 +436,7 @@ nsClipboard::SelectionGetEvent (GtkWidget *aWidget, if (!item || NS_FAILED(rv)) return; - nsCOMPtr<nsISupportsWString> wideString; + nsCOMPtr<nsISupportsString> wideString; wideString = do_QueryInterface(item); if (!wideString) return; diff --git a/widget/src/mac/nsClipboard.cpp b/widget/src/mac/nsClipboard.cpp index c5e3da250eb..ef5d57fb688 100644 --- a/widget/src/mac/nsClipboard.cpp +++ b/widget/src/mac/nsClipboard.cpp @@ -133,7 +133,7 @@ nsClipboard :: SetNativeClipboardData ( PRInt32 aWhichClipboard ) for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString( getter_Copies(flavorStr) ); @@ -290,7 +290,7 @@ nsClipboard :: GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString ( getter_Copies(flavorStr) ); @@ -478,7 +478,7 @@ nsClipboard :: GetDataOffClipboard ( ResType inMacFlavor, void** outData, PRInt3 // HasDataMatchingFlavors // // Check the clipboard to see if we have any data that matches the given flavors. This -// does NOT actually fetch the data. The items in the flavor list are nsISupportsString's. +// does NOT actually fetch the data. The items in the flavor list are nsISupportsCString's. // // Handle the case where we ask for unicode and it's not there, but plain text is. We // say "yes" in that case, knowing that we will have to perform a conversion when we actually @@ -504,7 +504,7 @@ nsClipboard :: HasDataMatchingFlavors ( nsISupportsArray* aFlavorList, PRInt32 a for ( PRUint32 i = 0; i < length; ++i ) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> flavorWrapper ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> flavorWrapper ( do_QueryInterface(genericFlavor) ); if ( flavorWrapper ) { nsXPIDLCString flavor; flavorWrapper->ToString ( getter_Copies(flavor) ); diff --git a/widget/src/mac/nsDragService.cpp b/widget/src/mac/nsDragService.cpp index 9ff8e0464f4..2695862dfd8 100644 --- a/widget/src/mac/nsDragService.cpp +++ b/widget/src/mac/nsDragService.cpp @@ -396,7 +396,7 @@ nsDragService :: RegisterDragItemsAndFlavors ( nsISupportsArray * inArray ) nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt ( flavorIndex, getter_AddRefs(genericWrapper) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericWrapper) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericWrapper) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString ( getter_Copies(flavorStr) ); @@ -449,7 +449,7 @@ nsDragService :: GetData ( nsITransferable * aTransferable, PRUint32 aItemIndex return NS_ERROR_INVALID_ARG; // get flavor list that includes all acceptable flavors (including ones obtained through - // conversion). Flavors are nsISupportsStrings so that they can be seen from JS. + // conversion). Flavors are nsISupportsCStrings so that they can be seen from JS. nsCOMPtr<nsISupportsArray> flavorList; errCode = aTransferable->FlavorsTransferableCanImport ( getter_AddRefs(flavorList) ); if ( NS_FAILED(errCode) ) @@ -473,7 +473,7 @@ nsDragService :: GetData ( nsITransferable * aTransferable, PRUint32 aItemIndex for ( int i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt ( i, getter_AddRefs(genericWrapper) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericWrapper) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericWrapper) ); if ( currentFlavor ) { // find MacOS flavor (but don't add it if it's not there) nsXPIDLCString flavorStr; diff --git a/widget/src/os2/nsClipboard.cpp b/widget/src/os2/nsClipboard.cpp index 0c0bcfba4a8..aa10191748d 100644 --- a/widget/src/os2/nsClipboard.cpp +++ b/widget/src/os2/nsClipboard.cpp @@ -326,7 +326,7 @@ nsresult nsClipboard::DoClipboardAction(ClipboardAction aAction) nsCOMPtr<nsISupports> genericFlavor; pFormats->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -383,7 +383,7 @@ NS_IMETHODIMP nsClipboard::ForceDataToClipboard(PRInt32 aWhichClipboard) for (i = 0; i < cnt; i++) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -407,7 +407,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(nsISupportsArray *aFlavorList, for (PRUint32 i = 0; i < cnt; ++i) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt(i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); diff --git a/widget/src/os2/nsDragService.cpp b/widget/src/os2/nsDragService.cpp index a6b1609e51e..1df63b94588 100644 --- a/widget/src/os2/nsDragService.cpp +++ b/widget/src/os2/nsDragService.cpp @@ -121,7 +121,7 @@ NS_IMETHODIMP nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode, nsISupports nsCOMPtr<nsISupports> genericURL; if ( NS_SUCCEEDED(item->GetTransferData(kURLMime, getter_AddRefs(genericURL), &len)) ) { - nsCOMPtr<nsISupportsWString> urlObject ( do_QueryInterface(genericURL) ); + nsCOMPtr<nsISupportsString> urlObject ( do_QueryInterface(genericURL) ); if( urlObject ) { nsXPIDLString urlInfo; @@ -186,7 +186,7 @@ NS_IMETHODIMP nsDragService::GetData(nsITransferable *aTransferable, PRUint32 aI return NS_ERROR_INVALID_ARG; // get flavor list that includes all acceptable flavors (including - // ones obtained through conversion). Flavors are nsISupportsStrings + // ones obtained through conversion). Flavors are nsISupportsCStrings // so that they can be seen from JS. nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsISupportsArray> flavorList; @@ -201,7 +201,7 @@ NS_IMETHODIMP nsDragService::GetData(nsITransferable *aTransferable, PRUint32 aI for (unsigned int i= 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt(i, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -252,7 +252,7 @@ NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBo for ( PRUint32 flavorIndex = 0; flavorIndex < numFlavors ; ++flavorIndex ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt (flavorIndex, getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { nsXPIDLCString flavorStr; diff --git a/widget/src/photon/nsClipboard.cpp b/widget/src/photon/nsClipboard.cpp index a17100097c4..f6a65410aff 100644 --- a/widget/src/photon/nsClipboard.cpp +++ b/widget/src/photon/nsClipboard.cpp @@ -228,7 +228,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; @@ -324,7 +324,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; @@ -450,7 +450,7 @@ nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList, for ( PRUint32 i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { diff --git a/widget/src/photon/nsDragService.cpp b/widget/src/photon/nsDragService.cpp index 3cb731f31e9..38f45e8bc68 100644 --- a/widget/src/photon/nsDragService.cpp +++ b/widget/src/photon/nsDragService.cpp @@ -173,7 +173,7 @@ NS_IMETHODIMP nsDragService::GetRawData( nsISupportsArray* aArrayTransferables, nsCOMPtr<nsITransferable> aTransferable (do_QueryInterface(genericItem)); // get flavor list that includes all acceptable flavors (including - // ones obtained through conversion). Flavors are nsISupportsStrings + // ones obtained through conversion). Flavors are nsISupportsCStrings // so that they can be seen from JS. nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsISupportsArray> flavorList; @@ -192,7 +192,7 @@ NS_IMETHODIMP nsDragService::GetRawData( nsISupportsArray* aArrayTransferables, for ( i = 0; i < cnt; ++i ) { nsCOMPtr<nsISupports> genericWrapper; flavorList->GetElementAt(i,getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { // find our gtk flavor diff --git a/widget/src/qt/nsClipboard.cpp b/widget/src/qt/nsClipboard.cpp index f9e2be2a644..2c9796ca2df 100644 --- a/widget/src/qt/nsClipboard.cpp +++ b/widget/src/qt/nsClipboard.cpp @@ -120,7 +120,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) flavorList->GetElementAt(i,getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -179,7 +179,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable *aTransferable, nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt(i,getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -249,7 +249,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(nsISupportsArray *aFlavorList, aFlavorList->GetElementAt(i,getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; diff --git a/widget/src/qt/nsDragService.cpp b/widget/src/qt/nsDragService.cpp index 51813fe3502..fc6dd32fdf4 100644 --- a/widget/src/qt/nsDragService.cpp +++ b/widget/src/qt/nsDragService.cpp @@ -149,7 +149,7 @@ QDragObject *nsDragService::RegisterDragFlavors(nsITransferable *transferable) flavorList->GetElementAt(flavorIndex,getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor(do_QueryInterface(genericWrapper)); + nsCOMPtr<nsISupportsCString> currentFlavor(do_QueryInterface(genericWrapper)); if (currentFlavor) { nsXPIDLCString flavorStr; @@ -237,7 +237,7 @@ NS_IMETHODIMP nsDragService::GetData(nsITransferable *aTransferable, flavorList->GetElementAt(i,getter_AddRefs(genericWrapper)); - nsCOMPtr<nsISupportsString> currentFlavor; + nsCOMPtr<nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { diff --git a/widget/src/windows/nsClipboard.cpp b/widget/src/windows/nsClipboard.cpp index 87976bd7787..a7ffa2778e4 100644 --- a/widget/src/windows/nsClipboard.cpp +++ b/widget/src/windows/nsClipboard.cpp @@ -162,7 +162,7 @@ nsresult nsClipboard::SetupNativeDataObject(nsITransferable * aTransferable, IDa for (i=0;i<cnt;i++) { nsCOMPtr<nsISupports> genericFlavor; dfList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -550,7 +550,7 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject, for (i=0;i<cnt;i++) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -885,7 +885,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(nsISupportsArray *aFlavorList, for ( PRUint32 i = 0;i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; aFlavorList->GetElementAt (i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor (do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor (do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); diff --git a/widget/src/windows/nsDataObj.cpp b/widget/src/windows/nsDataObj.cpp index 1c3840a1426..875a42fa39a 100644 --- a/widget/src/windows/nsDataObj.cpp +++ b/widget/src/windows/nsDataObj.cpp @@ -600,7 +600,7 @@ nsDataObj :: IsInternetShortcut ( ) for ( PRUint32 i = 0;i < cnt; ++i ) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt (i, getter_AddRefs(genericFlavor)); - nsCOMPtr<nsISupportsString> currentFlavor (do_QueryInterface(genericFlavor)); + nsCOMPtr<nsISupportsCString> currentFlavor (do_QueryInterface(genericFlavor)); if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); @@ -814,7 +814,7 @@ nsDataObj :: ExtractShortcutURL ( nsString & outURL ) PRUint32 len = 0; nsCOMPtr<nsISupports> genericURL; if ( NS_SUCCEEDED(mTransferable->GetTransferData(kURLMime, getter_AddRefs(genericURL), &len)) ) { - nsCOMPtr<nsISupportsWString> urlObject ( do_QueryInterface(genericURL) ); + nsCOMPtr<nsISupportsString> urlObject ( do_QueryInterface(genericURL) ); if ( urlObject ) { nsXPIDLString url; urlObject->GetData ( getter_Copies(url) ); @@ -854,7 +854,7 @@ nsDataObj :: ExtractShortcutTitle ( nsString & outTitle ) PRUint32 len = 0; nsCOMPtr<nsISupports> genericURL; if ( NS_SUCCEEDED(mTransferable->GetTransferData(kURLMime, getter_AddRefs(genericURL), &len)) ) { - nsCOMPtr<nsISupportsWString> urlObject ( do_QueryInterface(genericURL) ); + nsCOMPtr<nsISupportsString> urlObject ( do_QueryInterface(genericURL) ); if ( urlObject ) { nsXPIDLString url; nsAutoString holder; diff --git a/widget/src/xlib/nsClipboard.cpp b/widget/src/xlib/nsClipboard.cpp index 380df8e3560..3193a0271ea 100644 --- a/widget/src/xlib/nsClipboard.cpp +++ b/widget/src/xlib/nsClipboard.cpp @@ -247,7 +247,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard) { nsCOMPtr<nsISupports> genericFlavor; flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) ); + nsCOMPtr<nsISupportsCString> currentFlavor ( do_QueryInterface(genericFlavor) ); if ( currentFlavor ) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); diff --git a/widget/src/xlib/nsDragService.cpp b/widget/src/xlib/nsDragService.cpp index 61c89136ca7..6dcaaf3f6d6 100644 --- a/widget/src/xlib/nsDragService.cpp +++ b/widget/src/xlib/nsDragService.cpp @@ -188,7 +188,7 @@ NS_IMETHODIMP nsDragService::GetData(nsITransferable *aTransferable, PRUint32 an nsCOMPtr <nsISupports> genericWrapper; flavorList->GetElementAt(i, getter_AddRefs(genericWrapper)); - nsCOMPtr <nsISupportsString> currentFlavor; + nsCOMPtr <nsISupportsCString> currentFlavor; currentFlavor = do_QueryInterface(genericWrapper); if (currentFlavor) { diff --git a/widget/src/xpwidgets/nsClipboardHelper.cpp b/widget/src/xpwidgets/nsClipboardHelper.cpp index b15df99019b..c19ced81b73 100644 --- a/widget/src/xpwidgets/nsClipboardHelper.cpp +++ b/widget/src/xpwidgets/nsClipboardHelper.cpp @@ -88,8 +88,8 @@ nsClipboardHelper::CopyStringToClipboard(const nsAString& aString, NS_ENSURE_SUCCESS(rv, rv); // get wStrings to hold clip data - nsCOMPtr<nsISupportsWString> - data(do_CreateInstance("@mozilla.org/supports-wstring;1", &rv)); + nsCOMPtr<nsISupportsString> + data(do_CreateInstance("@mozilla.org/supports-string;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(data, NS_ERROR_FAILURE); diff --git a/widget/src/xpwidgets/nsHTMLFormatConverter.cpp b/widget/src/xpwidgets/nsHTMLFormatConverter.cpp index 3b4c79044a9..f5a726bd77a 100644 --- a/widget/src/xpwidgets/nsHTMLFormatConverter.cpp +++ b/widget/src/xpwidgets/nsHTMLFormatConverter.cpp @@ -150,15 +150,15 @@ nsHTMLFormatConverter::GetOutputDataFlavors(nsISupportsArray **_retval) // // AddFlavorToList // -// Convenience routine for adding a flavor wrapped in an nsISupportsString object +// Convenience routine for adding a flavor wrapped in an nsISupportsCString object // to a list // nsresult nsHTMLFormatConverter :: AddFlavorToList ( nsISupportsArray* inList, const char* inFlavor ) { - nsCOMPtr<nsISupportsString> dataFlavor; - nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(dataFlavor)); + nsCOMPtr<nsISupportsCString> dataFlavor; + nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(dataFlavor)); if ( dataFlavor ) { dataFlavor->SetData ( NS_CONST_CAST(char*, inFlavor) ); // add to list as an nsISupports so the correct interface gets the addref @@ -230,9 +230,9 @@ nsHTMLFormatConverter::Convert(const char *aFromDataFlavor, nsISupports *aFromDa nsCAutoString toFlavor ( aToDataFlavor ); // HTML on clipboard is going to always be double byte so it will be in a primitive - // class of nsISupportsWString. Also, since the data is in two byte chunks the + // class of nsISupportsString. Also, since the data is in two byte chunks the // length represents the length in 1-byte chars, so we need to divide by two. - nsCOMPtr<nsISupportsWString> dataWrapper0 ( do_QueryInterface(aFromData) ); + nsCOMPtr<nsISupportsString> dataWrapper0 ( do_QueryInterface(aFromData) ); if ( dataWrapper0 ) { nsXPIDLString data; dataWrapper0->ToString ( getter_Copies(data) ); //¥¥¥ COPY #1 diff --git a/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index a3ac3c66424..aa6b2ee2e93 100644 --- a/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -55,7 +55,7 @@ // // Given some data and the flavor it corresponds to, creates the appropriate // nsISupports* wrapper for passing across IDL boundaries. Right now, everything -// creates a two-byte |nsISupportsWString|, except for "text/plain" and native +// creates a two-byte |nsISupportsString|, except for "text/plain" and native // platform HTML (CF_HTML on win32) // void @@ -66,9 +66,9 @@ nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, void* aDataB return; if ( strcmp(aFlavor,kTextMime) == 0 || strcmp(aFlavor,kNativeHTMLMime) == 0 ) { - nsCOMPtr<nsISupportsString> primitive; - nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(primitive)); + nsCOMPtr<nsISupportsCString> primitive; + nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(primitive)); if ( primitive ) { primitive->SetDataWithLength ( aDataLen, NS_STATIC_CAST(char*, aDataBuff) ); nsCOMPtr<nsISupports> genericPrimitive ( do_QueryInterface(primitive) ); @@ -77,9 +77,9 @@ nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, void* aDataB } } else { - nsCOMPtr<nsISupportsWString> primitive; - nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsWString), getter_AddRefs(primitive)); + nsCOMPtr<nsISupportsString> primitive; + nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsString), getter_AddRefs(primitive)); if (NS_SUCCEEDED(rv) && primitive ) { // recall that SetDataWithLength() takes length as characters, not bytes primitive->SetDataWithLength ( aDataLen / 2, NS_STATIC_CAST(PRUnichar*, aDataBuff) ); @@ -107,12 +107,12 @@ nsPrimitiveHelpers :: CreateDataFromPrimitive ( const char* aFlavor, nsISupports return; if ( strcmp(aFlavor,kTextMime) == 0 ) { - nsCOMPtr<nsISupportsString> plainText ( do_QueryInterface(aPrimitive) ); + nsCOMPtr<nsISupportsCString> plainText ( do_QueryInterface(aPrimitive) ); if ( plainText ) plainText->GetData ( NS_REINTERPRET_CAST(char**, aDataBuff) ); } else { - nsCOMPtr<nsISupportsWString> doubleByteText ( do_QueryInterface(aPrimitive) ); + nsCOMPtr<nsISupportsString> doubleByteText ( do_QueryInterface(aPrimitive) ); if ( doubleByteText ) doubleByteText->GetData ( NS_REINTERPRET_CAST(PRUnichar**, aDataBuff) ); } diff --git a/widget/src/xpwidgets/nsTransferable.cpp b/widget/src/xpwidgets/nsTransferable.cpp index 392dd7abd78..e0b93c492cb 100644 --- a/widget/src/xpwidgets/nsTransferable.cpp +++ b/widget/src/xpwidgets/nsTransferable.cpp @@ -41,7 +41,7 @@ Notes to self: - at some point, strings will be accessible from JS, so we won't have to wrap - flavors in an nsISupportsString. Until then, we're kinda stuck with + flavors in an nsISupportsCString. Until then, we're kinda stuck with this crappy API of nsISupportsArrays. */ @@ -312,7 +312,7 @@ nsTransferable::~nsTransferable() // // Returns a copy of the internal list of flavors. This does NOT take into // account any converter that may be registered. This list consists of -// nsISupportsString objects so that the flavor list can be accessed from JS. +// nsISupportsCString objects so that the flavor list can be accessed from JS. // NS_IMETHODIMP nsTransferable :: GetTransferDataFlavors(nsISupportsArray ** aDataFlavorList) @@ -326,9 +326,9 @@ nsTransferable :: GetTransferDataFlavors(nsISupportsArray ** aDataFlavorList) if ( *aDataFlavorList ) { for ( PRInt32 i=0; i<mDataArray->Count(); ++i ) { DataStruct * data = (DataStruct *)mDataArray->ElementAt(i); - nsCOMPtr<nsISupportsString> flavorWrapper; - rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(flavorWrapper)); + nsCOMPtr<nsISupportsCString> flavorWrapper; + rv = nsComponentManager::CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(flavorWrapper)); if ( flavorWrapper ) { flavorWrapper->SetData ( NS_CONST_CAST(char*, data->GetFlavor().get()) ); nsCOMPtr<nsISupports> genericWrapper ( do_QueryInterface(flavorWrapper) ); @@ -577,7 +577,7 @@ nsTransferable :: FlavorsTransferableCanImport(nsISupportsArray **_retval) nsCOMPtr<nsISupports> genericFlavor; convertedList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> flavorWrapper ( do_QueryInterface (genericFlavor) ); + nsCOMPtr<nsISupportsCString> flavorWrapper ( do_QueryInterface (genericFlavor) ); nsXPIDLCString flavorStr; flavorWrapper->ToString( getter_Copies(flavorStr) ); @@ -621,7 +621,7 @@ nsTransferable :: FlavorsTransferableCanExport(nsISupportsArray **_retval) nsCOMPtr<nsISupports> genericFlavor; convertedList->GetElementAt ( i, getter_AddRefs(genericFlavor) ); - nsCOMPtr<nsISupportsString> flavorWrapper ( do_QueryInterface (genericFlavor) ); + nsCOMPtr<nsISupportsCString> flavorWrapper ( do_QueryInterface (genericFlavor) ); nsXPIDLCString flavorStr; flavorWrapper->ToString( getter_Copies(flavorStr) ); diff --git a/xpcom/components/nsCategoryManager.cpp b/xpcom/components/nsCategoryManager.cpp index a5129f681e6..c57ce4d9c61 100644 --- a/xpcom/components/nsCategoryManager.cpp +++ b/xpcom/components/nsCategoryManager.cpp @@ -72,7 +72,7 @@ ExtractKeyString( nsHashKey* key, void*, void*, nsISupports** _retval ) { nsresult status = NS_ERROR_FAILURE; - nsCOMPtr<nsISupportsString> obj = new nsSupportsStringImpl(); + nsCOMPtr<nsISupportsCString> obj = new nsSupportsCStringImpl(); if ( obj ) { nsCStringKey* strkey = NS_STATIC_CAST(nsCStringKey*, key); status = obj->SetDataWithLength(strkey->GetStringLength(), strkey->GetString()); @@ -471,7 +471,7 @@ NS_CreateServicesFromCategory(const char *category, nsCOMPtr<nsISupports> entry; while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) { // From here on just skip any error we get. - nsCOMPtr<nsISupportsString> catEntry = do_QueryInterface(entry, &rv); + nsCOMPtr<nsISupportsCString> catEntry = do_QueryInterface(entry, &rv); if (NS_FAILED(rv)) { nFailed++; continue; diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 8ff265f4414..eb2093ce30d 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -653,12 +653,12 @@ ConvertContractIDKeyToString(PLDHashTable *table, void *data, nsISupports **retval) { nsresult rv; - nsCOMPtr<nsISupportsString> wrapper; + nsCOMPtr<nsISupportsCString> wrapper; nsComponentManagerImpl *cm = NS_STATIC_CAST(nsComponentManagerImpl *, data); - rv = cm->CreateInstanceByContractID(NS_SUPPORTS_STRING_CONTRACTID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(wrapper)); + rv = cm->CreateInstanceByContractID(NS_SUPPORTS_CSTRING_CONTRACTID, nsnull, + NS_GET_IID(nsISupportsCString), getter_AddRefs(wrapper)); NS_ENSURE_SUCCESS(rv, rv); @@ -1303,7 +1303,7 @@ nsComponentManagerImpl::WriteCategoryManagerToRegistry(PRFileDesc* fd) nsCOMPtr<nsISimpleEnumerator> outerEnum; nsCOMPtr<nsISimpleEnumerator> innerEnum; nsCOMPtr<nsISupports> supports; - nsCOMPtr<nsISupportsString> supStr; + nsCOMPtr<nsISupportsCString> supStr; if (!mCategoryManager) return NS_OK; @@ -3063,7 +3063,7 @@ nsComponentManagerImpl::AutoRegisterImpl(PRInt32 when, if (NS_FAILED(loaderEnum->GetNext(getter_AddRefs(supports)))) continue; - nsCOMPtr<nsISupportsString> supStr = do_QueryInterface(supports); + nsCOMPtr<nsISupportsCString> supStr = do_QueryInterface(supports); if (!supStr) continue; diff --git a/xpcom/ds/nsISupportsPrimitives.idl b/xpcom/ds/nsISupportsPrimitives.idl index 11a33234179..e4757d977b5 100644 --- a/xpcom/ds/nsISupportsPrimitives.idl +++ b/xpcom/ds/nsISupportsPrimitives.idl @@ -49,8 +49,8 @@ interface nsISupportsPrimitive : nsISupports { const unsigned short TYPE_ID = 1; - const unsigned short TYPE_STRING = 2; - const unsigned short TYPE_WSTRING = 3; + const unsigned short TYPE_CSTRING = 2; + const unsigned short TYPE_STRING = 3; const unsigned short TYPE_PRBOOL = 4; const unsigned short TYPE_PRUINT8 = 5; const unsigned short TYPE_PRUINT16 = 6; @@ -77,7 +77,7 @@ interface nsISupportsID : nsISupportsPrimitive }; [scriptable, uuid(d65ff270-4a1c-11d3-9890-006008962422)] -interface nsISupportsString : nsISupportsPrimitive +interface nsISupportsCString : nsISupportsPrimitive { attribute string data; string toString(); @@ -103,7 +103,7 @@ interface nsISupportsString : nsISupportsPrimitive }; [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] -interface nsISupportsWString : nsISupportsPrimitive +interface nsISupportsString : nsISupportsPrimitive { attribute wstring data; wstring toString(); @@ -243,18 +243,18 @@ interface nsISupportsInterfacePointer : nsISupportsPrimitive #define NS_SUPPORTS_ID_CLASSNAME "Supports ID" // {ACF8DC41-4A25-11d3-9890-006008962422} -#define NS_SUPPORTS_STRING_CID \ +#define NS_SUPPORTS_CSTRING_CID \ { 0xacf8dc41, 0x4a25, 0x11d3, \ { 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } } -#define NS_SUPPORTS_STRING_CONTRACTID "@mozilla.org/supports-string;1" -#define NS_SUPPORTS_STRING_CLASSNAME "Supports String" +#define NS_SUPPORTS_CSTRING_CONTRACTID "@mozilla.org/supports-cstring;1" +#define NS_SUPPORTS_CSTRING_CLASSNAME "Supports String" // {ACF8DC42-4A25-11d3-9890-006008962422} -#define NS_SUPPORTS_WSTRING_CID \ +#define NS_SUPPORTS_STRING_CID \ { 0xacf8dc42, 0x4a25, 0x11d3, \ { 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } } -#define NS_SUPPORTS_WSTRING_CONTRACTID "@mozilla.org/supports-wstring;1" -#define NS_SUPPORTS_WSTRING_CLASSNAME "Supports WString" +#define NS_SUPPORTS_STRING_CONTRACTID "@mozilla.org/supports-string;1" +#define NS_SUPPORTS_STRING_CLASSNAME "Supports WString" // {ACF8DC43-4A25-11d3-9890-006008962422} #define NS_SUPPORTS_PRBOOL_CID \ diff --git a/xpcom/ds/nsSupportsPrimitives.cpp b/xpcom/ds/nsSupportsPrimitives.cpp index fb065f8de77..2ff4313e361 100644 --- a/xpcom/ds/nsSupportsPrimitives.cpp +++ b/xpcom/ds/nsSupportsPrimitives.cpp @@ -108,33 +108,33 @@ NS_IMETHODIMP nsSupportsIDImpl::ToString(char **_retval) } /***************************************************************************** - * nsSupportsStringImpl + * nsSupportsCStringImpl *****************************************************************************/ -NS_IMPL_ISUPPORTS2(nsSupportsStringImpl, nsISupportsString, +NS_IMPL_ISUPPORTS2(nsSupportsCStringImpl, nsISupportsCString, nsISupportsPrimitive) -nsSupportsStringImpl::nsSupportsStringImpl() +nsSupportsCStringImpl::nsSupportsCStringImpl() : mData(0), mLength(0) { NS_INIT_ISUPPORTS(); } -nsSupportsStringImpl::~nsSupportsStringImpl() +nsSupportsCStringImpl::~nsSupportsCStringImpl() { if (mData) nsMemory::Free(mData); } -NS_IMETHODIMP nsSupportsStringImpl::GetType(PRUint16 *aType) +NS_IMETHODIMP nsSupportsCStringImpl::GetType(PRUint16 *aType) { NS_ASSERTION(aType, "Bad pointer"); - *aType = TYPE_STRING; + *aType = TYPE_CSTRING; return NS_OK; } -NS_IMETHODIMP nsSupportsStringImpl::GetData(char **aData) +NS_IMETHODIMP nsSupportsCStringImpl::GetData(char **aData) { nsresult rv = NS_OK; // copy the buffer @@ -150,17 +150,17 @@ NS_IMETHODIMP nsSupportsStringImpl::GetData(char **aData) return rv; } -NS_IMETHODIMP nsSupportsStringImpl::SetData(const char *aData) +NS_IMETHODIMP nsSupportsCStringImpl::SetData(const char *aData) { return SetDataWithLength(aData ? strlen(aData) : 0, aData); } -NS_IMETHODIMP nsSupportsStringImpl::ToString(char **_retval) +NS_IMETHODIMP nsSupportsCStringImpl::ToString(char **_retval) { return GetData(_retval); } -NS_IMETHODIMP nsSupportsStringImpl::SetDataWithLength(PRUint32 aLength, +NS_IMETHODIMP nsSupportsCStringImpl::SetDataWithLength(PRUint32 aLength, const char *aData) { // if the new string length is the same as the old, @@ -191,12 +191,12 @@ NS_IMETHODIMP nsSupportsStringImpl::SetDataWithLength(PRUint32 aLength, return AdoptDataWithLength(aLength, newData); } -NS_IMETHODIMP nsSupportsStringImpl::AdoptData(char *aData) +NS_IMETHODIMP nsSupportsCStringImpl::AdoptData(char *aData) { return AdoptDataWithLength(aData ? strlen(aData) : 0, aData); } -NS_IMETHODIMP nsSupportsStringImpl::AdoptDataWithLength(PRUint32 aLength, +NS_IMETHODIMP nsSupportsCStringImpl::AdoptDataWithLength(PRUint32 aLength, char *aData) { // free current buffer @@ -219,33 +219,33 @@ NS_IMETHODIMP nsSupportsStringImpl::AdoptDataWithLength(PRUint32 aLength, } /***************************************************************************** - * nsSupportsWStringImpl + * nsSupportsStringImpl *****************************************************************************/ -NS_IMPL_ISUPPORTS2(nsSupportsWStringImpl, nsISupportsWString, +NS_IMPL_ISUPPORTS2(nsSupportsStringImpl, nsISupportsString, nsISupportsPrimitive) -nsSupportsWStringImpl::nsSupportsWStringImpl() +nsSupportsStringImpl::nsSupportsStringImpl() : mData(0), mLength(0) { NS_INIT_ISUPPORTS(); } -nsSupportsWStringImpl::~nsSupportsWStringImpl() +nsSupportsStringImpl::~nsSupportsStringImpl() { if (mData) nsMemory::Free(mData); } -NS_IMETHODIMP nsSupportsWStringImpl::GetType(PRUint16 *aType) +NS_IMETHODIMP nsSupportsStringImpl::GetType(PRUint16 *aType) { NS_ASSERTION(aType, "Bad pointer"); - *aType = TYPE_WSTRING; + *aType = TYPE_STRING; return NS_OK; } -NS_IMETHODIMP nsSupportsWStringImpl::GetData(PRUnichar **aData) +NS_IMETHODIMP nsSupportsStringImpl::GetData(PRUnichar **aData) { nsresult rv = NS_OK; // copy the buffer @@ -261,17 +261,17 @@ NS_IMETHODIMP nsSupportsWStringImpl::GetData(PRUnichar **aData) return rv; } -NS_IMETHODIMP nsSupportsWStringImpl::SetData(const PRUnichar *aData) +NS_IMETHODIMP nsSupportsStringImpl::SetData(const PRUnichar *aData) { return SetDataWithLength(aData ? nsCRT::strlen(aData) : 0, aData); } -NS_IMETHODIMP nsSupportsWStringImpl::ToString(PRUnichar **_retval) +NS_IMETHODIMP nsSupportsStringImpl::ToString(PRUnichar **_retval) { return GetData(_retval); } -NS_IMETHODIMP nsSupportsWStringImpl::SetDataWithLength(PRUint32 aLength, +NS_IMETHODIMP nsSupportsStringImpl::SetDataWithLength(PRUint32 aLength, const PRUnichar *aData) { // if the new string length is the same as the old, @@ -302,12 +302,12 @@ NS_IMETHODIMP nsSupportsWStringImpl::SetDataWithLength(PRUint32 aLength, return AdoptDataWithLength(aLength, newData); } -NS_IMETHODIMP nsSupportsWStringImpl::AdoptData(PRUnichar *aData) +NS_IMETHODIMP nsSupportsStringImpl::AdoptData(PRUnichar *aData) { return AdoptDataWithLength(aData ? nsCRT::strlen(aData) : 0, aData); } -NS_IMETHODIMP nsSupportsWStringImpl::AdoptDataWithLength(PRUint32 aLength, +NS_IMETHODIMP nsSupportsStringImpl::AdoptDataWithLength(PRUint32 aLength, PRUnichar *aData) { // free current buffer diff --git a/xpcom/ds/nsSupportsPrimitives.h b/xpcom/ds/nsSupportsPrimitives.h index a8034707eef..5f7370995fa 100644 --- a/xpcom/ds/nsSupportsPrimitives.h +++ b/xpcom/ds/nsSupportsPrimitives.h @@ -58,6 +58,23 @@ private: /***************************************************************************/ +class nsSupportsCStringImpl : public nsISupportsCString +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSISUPPORTSPRIMITIVE + NS_DECL_NSISUPPORTSCSTRING + + nsSupportsCStringImpl(); + virtual ~nsSupportsCStringImpl(); + +private: + char *mData; + PRUint32 mLength; +}; + +/***************************************************************************/ + class nsSupportsStringImpl : public nsISupportsString { public: @@ -68,23 +85,6 @@ public: nsSupportsStringImpl(); virtual ~nsSupportsStringImpl(); -private: - char *mData; - PRUint32 mLength; -}; - -/***************************************************************************/ - -class nsSupportsWStringImpl : public nsISupportsWString -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSISUPPORTSPRIMITIVE - NS_DECL_NSISUPPORTSWSTRING - - nsSupportsWStringImpl(); - virtual ~nsSupportsWStringImpl(); - private: PRUnichar *mData; PRUint32 mLength; diff --git a/xpfe/appshell/src/nsCommandLineServiceMac.cpp b/xpfe/appshell/src/nsCommandLineServiceMac.cpp index 34013a77f9b..acabe1deee4 100644 --- a/xpfe/appshell/src/nsCommandLineServiceMac.cpp +++ b/xpfe/appshell/src/nsCommandLineServiceMac.cpp @@ -322,7 +322,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) //---------------------------------------------------------------------------------------- { nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsWString> urlWrapper(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> urlWrapper(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if (!wwatch || !urlWrapper) return NS_ERROR_FAILURE; diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 716b3c5baeb..643a3ba0f4f 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -457,7 +457,7 @@ static nsresult OpenWindow(const nsAFlatCString& aChromeURL, #endif /* DEBUG_CMD_LINE */ nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsWString> sarg(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> sarg(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if (!wwatch || !sarg) return NS_ERROR_FAILURE; @@ -517,7 +517,7 @@ static void DumpArbitraryHelp() rv = catman->EnumerateCategory(COMMAND_LINE_ARGUMENT_HANDLERS, getter_AddRefs(e)); if(NS_SUCCEEDED(rv) && e) { while (PR_TRUE) { - nsCOMPtr<nsISupportsString> catEntry; + nsCOMPtr<nsISupportsCString> catEntry; rv = e->GetNext(getter_AddRefs(catEntry)); if (NS_FAILED(rv) || !catEntry) break; diff --git a/xpfe/bootstrap/nsNativeAppSupportOS2.cpp b/xpfe/bootstrap/nsNativeAppSupportOS2.cpp index 00120607d7a..6e89bc82076 100644 --- a/xpfe/bootstrap/nsNativeAppSupportOS2.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportOS2.cpp @@ -1910,7 +1910,7 @@ nsNativeAppSupportOS2::OpenWindow( const char*urlstr, const char *args ) { nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsString> sarg(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> sarg(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); if (sarg) sarg->SetData(args); @@ -2189,8 +2189,8 @@ nsNativeAppSupportOS2::StartServerMode() { // Create some of the objects we'll need. nsCOMPtr<nsIWindowWatcher> ww(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsWString> arg1(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); - nsCOMPtr<nsISupportsWString> arg2(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> arg1(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> arg2(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if ( !ww || !arg1 || !arg2 ) { return NS_OK; } diff --git a/xpfe/bootstrap/nsNativeAppSupportWin.cpp b/xpfe/bootstrap/nsNativeAppSupportWin.cpp index 588a02bcf52..c19fb3f136e 100644 --- a/xpfe/bootstrap/nsNativeAppSupportWin.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportWin.cpp @@ -2089,7 +2089,7 @@ nsNativeAppSupportWin::OpenWindow( const char*urlstr, const char *args ) { nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsString> sarg(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> sarg(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); if (sarg) sarg->SetData(args); @@ -2450,8 +2450,8 @@ nsNativeAppSupportWin::StartServerMode() { // Create some of the objects we'll need. nsCOMPtr<nsIWindowWatcher> ww(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsWString> arg1(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); - nsCOMPtr<nsISupportsWString> arg2(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> arg1(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> arg2(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if ( !ww || !arg1 || !arg2 ) { return NS_OK; } diff --git a/xpfe/browser/resources/content/fastnav.js b/xpfe/browser/resources/content/fastnav.js index 62512bdab15..e69de29bb2d 100644 --- a/xpfe/browser/resources/content/fastnav.js +++ b/xpfe/browser/resources/content/fastnav.js @@ -1,1371 +0,0 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Blake Ross <blakeross@telocity.com> - * Peter Annema <disttsc@bart.nl> - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -const nsIWebNavigation = Components.interfaces.nsIWebNavigation; - -var gURLBar = null; -var gProxyButton = null; -var gNavigatorBundle; -var gBrandBundle; -var gNavigatorRegionBundle; -var gBrandRegionBundle; -var gLastValidURL = ""; - -var pref = null; - -var appCore = null; - -//cached elements -var gBrowser = null; - -// focused frame URL -var gFocusedURL = null; - - -/** - -* We can avoid adding multiple load event listeners and save some time by adding -* one listener that calls all real handlers. -*/ - -function loadEventHandlers(event) -{ - // Filter out events that are not about the document load we are interested in - if (event.target == _content.document) { - UpdateBookmarksLastVisitedDate(event); - UpdateInternetSearchResults(event); - checkForDirectoryListing(); - getContentAreaFrameCount(); - postURLToNativeWidget(); - } -} - -/** - * Determine whether or not the content area is displaying a page with frames, - * and if so, toggle the display of the 'save frame as' menu item. - **/ -function getContentAreaFrameCount() -{ - var saveFrameItem = document.getElementById("savepage"); - if (!_content.frames.length || !isDocumentFrame(document.commandDispatcher.focusedWindow)) - saveFrameItem.setAttribute("hidden", "true"); - else - saveFrameItem.removeAttribute("hidden"); -} - -// When a content area frame is focused, update the focused frame URL -function contentAreaFrameFocus() -{ - var focusedWindow = document.commandDispatcher.focusedWindow; - if (isDocumentFrame(focusedWindow)) { - gFocusedURL = focusedWindow.location.href; - var saveFrameItem = document.getElementById("savepage"); - saveFrameItem.removeAttribute("hidden"); - } -} - -//////////////////////////////// BOOKMARKS //////////////////////////////////// - -function UpdateBookmarksLastVisitedDate(event) -{ - // XXX This somehow causes a big leak, back to the old way - // till we figure out why. See bug 61886. - // var url = getWebNavigation().currentURI.spec; - var url = _content.location.href; - if (url) { - // if the URL is bookmarked, update its "Last Visited" date - var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"] - .getService(Components.interfaces.nsIBookmarksService); - - bmks.updateLastVisitedDate(url, _content.document.characterSet); - } -} - -function UpdateInternetSearchResults(event) -{ - // XXX This somehow causes a big leak, back to the old way - // till we figure out why. See bug 61886. - // var url = getWebNavigation().currentURI.spec; - var url = _content.location.href; - if (url) { - try { - var search = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"] - .getService(Components.interfaces.nsIInternetSearchService); - - var searchInProgressFlag = search.FindInternetSearchResults(url); - - if (searchInProgressFlag) { - var autoOpenSearchPanel = pref.getBoolPref("browser.search.opensidebarsearchpanel"); - - if (autoOpenSearchPanel) - RevealSearchPanel(); - } - } catch (ex) { - } - } -} - -function getBrowser() -{ - if (!gBrowser) - gBrowser = document.getElementById("content"); - return gBrowser; -} - -function getWebNavigation() -{ - try { - return getBrowser().webNavigation; - } catch (e) { - return null; - } -} - -function getMarkupDocumentViewer() -{ - return getBrowser().markupDocumentViewer; -} - -function getHomePage() -{ - var url; - try { - url = pref.getComplexValue("browser.startup.homepage", - Components.interfaces.nsIPrefLocalizedString).data; - } catch (e) { - } - - // use this if we can't find the pref - if (!url) - url = gNavigatorRegionBundle.getString("homePageDefault"); - - return url; -} - -function UpdateBackForwardButtons() -{ - var backBroadcaster = document.getElementById("canGoBack"); - var forwardBroadcaster = document.getElementById("canGoForward"); - var webNavigation = getWebNavigation(); - - // Avoid setting attributes on broadcasters if the value hasn't changed! - // Remember, guys, setting attributes on elements is expensive! They - // get inherited into anonymous content, broadcast to other widgets, etc.! - // Don't do it if the value hasn't changed! - dwh - - var backDisabled = (backBroadcaster.getAttribute("disabled") == "true"); - var forwardDisabled = (forwardBroadcaster.getAttribute("disabled") == "true"); - - if (backDisabled == webNavigation.canGoBack) - backBroadcaster.setAttribute("disabled", !backDisabled); - - if (forwardDisabled == webNavigation.canGoForward) - forwardBroadcaster.setAttribute("disabled", !forwardDisabled); -} - - -function nsButtonPrefListener() -{ - try { - var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal); - pbi.addObserver(this.domain, this, false); - } catch(ex) { - dump("Failed to observe prefs: " + ex + "\n"); - } -} - -// implements nsIObserver -nsButtonPrefListener.prototype = -{ - domain: "browser.toolbars.showbutton", - observe: function(subject, topic, prefName) - { - // verify that we're changing a button pref - if (topic != "nsPref:changed") return; - if (prefName.substr(0, this.domain.length) != this.domain) return; - - var buttonName = prefName.substr(this.domain.length+1); - var buttonId = buttonName + "-button"; - var button = document.getElementById(buttonId); - - var show = pref.getBoolPref(prefName); - if (show) - button.setAttribute("hidden","false"); - else - button.setAttribute("hidden", "true"); - } -} - -function Startup() -{ - // init globals - gNavigatorBundle = document.getElementById("bundle_navigator"); - gBrandBundle = document.getElementById("bundle_brand"); - gNavigatorRegionBundle = document.getElementById("bundle_navigator_region"); - gBrandRegionBundle = document.getElementById("bundle_brand_region"); - - gBrowser = document.getElementById("content"); - gURLBar = document.getElementById("urlbar"); - - SetPageProxyState("invalid"); - - var webNavigation; - try { - // Create the browser instance component. - appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] - .createInstance(Components.interfaces.nsIBrowserInstance); - if (!appCore) - throw Components.results.NS_ERROR_FAILURE; - - // Get the preferences service - var prefService = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - if (!prefService) - throw Components.results.NS_ERROR_FAILURE; - pref = prefService.getBranch(null); - - webNavigation = getWebNavigation(); - if (!webNavigation) - throw Components.results.NS_ERROR_FAILURE; - } catch (e) { - alert("Error creating browser instance"); - window.close(); // Give up. - return; - } - - // Do all UI building here: - - //setOfflineStatus(); - - // set home button tooltip text - var homePage = getHomePage(); - if (homePage) - document.getElementById("home-button").setAttribute("tooltiptext", homePage); - - // initialize observers and listeners - window.XULBrowserWindow = new nsBrowserStatusHandler(); - window.buttonPrefListener = new nsButtonPrefListener(); - - window.browserContentListener = - new nsBrowserContentListener(window, getBrowser()); - - // XXXjag hack for directory.xul/js - _content.appCore = appCore; - - // Initialize browser instance.. - appCore.setWebShellWindow(window); - - // Add a capturing event listener to the content area - // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!) - // so we'll be notified when onloads complete. - var contentArea = document.getElementById("appcontent"); - contentArea.addEventListener("load", loadEventHandlers, true); - contentArea.addEventListener("focus", contentAreaFrameFocus, true); - - // set default character set if provided - if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { - if (window.arguments[1].indexOf("charset=") != -1) { - var arrayArgComponents = window.arguments[1].split("="); - if (arrayArgComponents) { - //we should "inherit" the charset menu setting in a new window - appCore.setDefaultCharacterSet(arrayArgComponents[1]); //XXXjag see bug 67442 - } - } - } - - //initConsoleListener(); - - // wire up session history before any possible progress notifications for back/forward button updating - webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] - .createInstance(Components.interfaces.nsISHistory); - - // hook up UI through progress listener - var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); - var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); - webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); - - // XXXjag see bug 68662 (needed to hook up web progress listener) - getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", window.XULBrowserWindow); - - // load appropriate initial page from commandline - var isPageCycling = false; - - // page cycling for tinderbox tests - if (!appCore.cmdLineURLUsed) - isPageCycling = appCore.startPageCycler(); - - // only load url passed in when we're not page cycling - if (!isPageCycling) { - var uriToLoad; - - if (!appCore.cmdLineURLUsed) { - var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] - .getService(Components.interfaces.nsICmdLineService); - uriToLoad = cmdLineService.URLToLoad; - if (!uriToLoad) { - var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] - .getService(Components.interfaces.nsICmdLineHandler); - uriToLoad = cmdLineHandler.defaultArgs; - } - appCore.cmdLineURLUsed = true; - } - - if (!uriToLoad) { - // Check for window.arguments[0]. If present, use that for uriToLoad. - if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) - uriToLoad = window.arguments[0]; - } - - if (uriToLoad && uriToLoad != "about:blank") { - gURLBar.value = uriToLoad; - loadURI(uriToLoad); - } - - // Focus the content area if the caller instructed us to. - if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) - _content.focus(); - else - gURLBar.focus(); - - // Perform default browser checking. - checkForDefaultBrowser(); - } -} - -function Shutdown() -{ - var browser = getBrowser(); - - browser.boxObject.removeProperty("listenerkungfu"); - - try { - var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); - var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); - webProgress.removeProgressListener(window.XULBrowserWindow); - } catch (ex) { - } - - window.XULBrowserWindow.destroy(); - window.XULBrowserWindow = null; - - try { - // If bookmarks are dirty, flush 'em to disk - var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"] - .getService(Components.interfaces.nsIRDFRemoteDataSource); - bmks.Flush(); - } catch (ex) { - } - - try { - // give history a chance at flushing to disk also - var history = Components.classes["@mozilla.org/browser/global-history;1"] - .getService(Components.interfaces.nsIRDFRemoteDataSource); - history.Flush(); - } catch (ex) { - } - - // unregister us as a pref listener - var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal); - pbi.removeObserver(window.buttonPrefListener.domain, - window.buttonPrefListener); - - window.browserContentListener.close(); - // Close the app core. - if (appCore) - appCore.close(); -} - -function Translate() -{ - var service = "http://cgi.netscape.com/cgi-bin/translate.cgi?AlisUI=simple_frames/ns_home"; - - // if we're already viewing a translated page, then just get the - // last argument (which we expect to always be "AlisTargetURI") - // XXX This somehow causes a big leak, back to the old way - // till we figure out why. See bug 61886. - // var targetURI = getWebNavigation().currentURI.spec; - var targetURI = _content.location.href; - var targetURIIndex = targetURI.indexOf("AlisTargetURI="); - - if (targetURIIndex >= 0) - targetURI = targetURI.substring(targetURIIndex + 14); - - service += "&AlisTargetURI=" + escape(targetURI); - - loadURI(service); -} - -function gotoHistoryIndex(aEvent) -{ - var index = aEvent.target.getAttribute("index"); - if (!index) - return false; - try { - getWebNavigation().gotoIndex(index); - } - catch(ex) { - return false; - } - return true; - -} - -function BrowserBack() -{ - try { - getWebNavigation().goBack(); - } - catch(ex) { - } - UpdateBackForwardButtons(); -} - -function BrowserForward() -{ - try { - getWebNavigation().goForward(); - } - catch(ex) { - } - UpdateBackForwardButtons(); -} - -function BrowserBackMenu(event) -{ - FillHistoryMenu(event.target, "back"); -} - -function BrowserForwardMenu(event) -{ - FillHistoryMenu(event.target, "forward"); -} - -function BrowserStop() -{ - try { - const stopFlags = nsIWebNavigation.STOP_ALL; - getWebNavigation().stop(stopFlags); - } - catch(ex) { - } -} - -function BrowserReload() -{ - const reloadFlags = nsIWebNavigation.LOAD_FLAGS_NONE; - return BrowserReloadWithFlags(reloadFlags); -} - -function BrowserReloadSkipCache() -{ - // Bypass proxy and cache. - const reloadFlags = nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE; - return BrowserReloadWithFlags(reloadFlags); -} - -function BrowserReloadWithFlags(reloadFlags) -{ - try { - /* Need to get SessionHistory from docshell so that - * reload on framed pages will work right. This - * method should not be used for the context menu item "Reload frame". - * "Reload frame" should directly call into docshell as it does right now - */ - var sh = getWebNavigation().sessionHistory; - var webNav = sh.QueryInterface(Components.interfaces.nsIWebNavigation); - webNav.reload(reloadFlags); - } - catch(ex) { - } - } - -function BrowserHome() -{ - var homePage = getHomePage(); - loadURI(homePage); -} - -function OpenBookmarkURL(node, datasources) -{ - if (node.getAttribute("container") == "true") - return; - - var url = node.getAttribute("id"); - try { - // add support for IE favorites under Win32, and NetPositive URLs under BeOS - if (datasources) { - var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"] - .getService(Components.interfaces.nsIRDFService); - var src = rdf.GetResource(url, true); - var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); - var target = datasources.GetTarget(src, prop, true); - if (target) { - target = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; - if (target) - url = target; - } - } - } catch (ex) { - return; - } - - // Ignore "NC:" urls. - if (url.substring(0, 3) == "NC:") - return; - - // Check if we have a browser window - if (_content) - loadURI(url); - else - openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url); -} - -function readRDFString(aDS,aRes,aProp) { - var n = aDS.GetTarget(aRes, aProp, true); - if (n) - return n.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; -} - - -function ensureDefaultEnginePrefs(aRDF,aDS) - { - - mPrefs = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - var defaultName = mPrefs.getComplexValue("browser.search.defaultenginename", Components.interfaces.nsIPrefLocalizedString).data; - kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); - kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); - kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); - - var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); - while (arcs.hasMoreElements()) { - var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); - var name = readRDFString(aDS, engineRes, kNC_Name); - if (name == defaultName) - mPrefs.setCharPref("browser.search.defaultengine", engineRes.Value); - } - } - - -function ensureSearchPref() { - - var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); - var ds = rdf.GetDataSource("rdf:internetsearch"); - kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); - try { - defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); - } catch(ex) { - ensureDefaultEnginePrefs(rdf, ds); - defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); - } - } - -function OpenSearch(tabName, forceDialogFlag, searchStr) -{ - - //This function needs to be split up someday. - - var autoOpenSearchPanel = false; - var defaultSearchURL = null; - var fallbackDefaultSearchURL = gNavigatorRegionBundle.getString("fallbackDefaultSearchURL"); - // XXX This somehow causes a big leak, back to the old way - // till we figure out why. See bug 61886. - // var url = getWebNavigation().currentURI.spec; - var url = _content.location.href; - ensureSearchPref() - //Check to see if search string contains "://" or "ftp." or white space. - //If it does treat as url and match for pattern - - var urlmatch= /(:\/\/|^ftp\.)[^ \S]+$/ - var forceAsURL = urlmatch.test(searchStr); - - try { - autoOpenSearchPanel = pref.getBoolPref("browser.search.opensidebarsearchpanel"); - defaultSearchURL = pref.getComplexValue("browser.search.defaulturl", - Components.interfaces.nsIPrefLocalizedString).data; - } catch (ex) { - } - - // Fallback to a default url (one that we can get sidebar search results for) - if (!defaultSearchURL) - defaultSearchURL = fallbackDefaultSearchURL; - - //Check to see if content url equals url in location bar. - //If they match then go to default search URL engine - - if ((!searchStr || searchStr == url)) { - loadURI(gNavigatorRegionBundle.getString("otherSearchURL")); - - } else { - - //Check to see if location bar field is a url - //If it is a url go to URL. A Url is "://" or "." as commented above - //Otherwise search on entry - if (forceAsURL) { - BrowserLoadURL() - } else { - var searchMode = 0; - try { - searchMode = pref.getIntPref("browser.search.powermode"); - } catch(ex) { - } - if (forceDialogFlag || searchMode == 1) { - // Use a single search dialog - var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - - var searchWindow = windowManager.getMostRecentWindow("search:window"); - if (!searchWindow) { - openDialog("chrome://communicator/content/search/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr); - } else { - // Already had one, focus it and load the page - searchWindow.focus(); - - if ("loadPage" in searchWindow) - searchWindow.loadPage(tabName, searchStr); - } - } else { - if (searchStr) { - var escapedSearchStr = escape(searchStr); - defaultSearchURL += escapedSearchStr; - - var searchDS = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"] - .getService(Components.interfaces.nsIInternetSearchService); - - searchDS.RememberLastSearchText(escapedSearchStr); - try { - var searchEngineURI = pref.getCharPref("browser.search.defaultengine"); - if (searchEngineURI) { - var searchURL = searchDS.GetInternetSearchURL(searchEngineURI, escapedSearchStr, 0, 0, {value:0}); - if (searchURL) - defaultSearchURL = searchURL; - } - } catch (ex) { - } - loadURI(defaultSearchURL); - } - } - } - } - - // should we try and open up the sidebar to show the "Search Results" panel? - if (autoOpenSearchPanel) - RevealSearchPanel(); -} - -function RevealSearchPanel() -{ - var searchPanel = document.getElementById("urn:sidebar:panel:search"); - if (searchPanel) - SidebarSelectPanel(searchPanel, true, true); // lives in sidebarOverlay.js -} - -//Note: BrowserNewEditorWindow() was moved to globalOverlay.xul and renamed to NewEditorWindow() - -function BrowserOpenWindow() -{ - //opens a window where users can select a web location to open - openDialog("chrome://communicator/content/openLocation.xul", "_blank", "chrome,modal,titlebar", window); -} - -/* Called from the openLocation dialog. This allows that dialog to instruct - its opener to open a new window and then step completely out of the way. - Anything less byzantine is causing horrible crashes, rather believably, - though oddly only on Linux. */ -function delayedOpenWindow(chrome,flags,url) -{ - setTimeout("openDialog('"+chrome+"','_blank','"+flags+"','"+url+"')", 10); -} - -function BrowserOpenFileWindow() -{ - // Get filepicker component. - try { - const nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); - fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen); - fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText | nsIFilePicker.filterImages | - nsIFilePicker.filterXML | nsIFilePicker.filterHTML); - - if (fp.show() == nsIFilePicker.returnOK) - openTopWin(fp.fileURL.spec); - } catch (ex) { - } -} - -// Set up a lame hack to avoid opening two bookmarks. -// Could otherwise happen with two Ctrl-B's in a row. -var gDisableBookmarks = false; -function enableBookmarks() -{ - gDisableBookmarks = false; -} - -function BrowserEditBookmarks() -{ - // Use a single sidebar bookmarks dialog - var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - - var bookmarksWindow = windowManager.getMostRecentWindow("bookmarks:manager"); - - if (bookmarksWindow) { - bookmarksWindow.focus(); - } else { - // while disabled, don't open new bookmarks window - if (!gDisableBookmarks) { - gDisableBookmarks = true; - - open("chrome://communicator/content/bookmarks/bookmarks.xul", "_blank", "chrome,menubar,resizable,scrollbars"); - setTimeout(enableBookmarks, 2000); - } - } -} - -function BrowserPrintPreview() -{ - // implement me -} - -function BrowserPrint() -{ - // using _content.print() until printing becomes scriptable on docShell - try { - _content.print(); - } catch (e) { - // Pressing cancel is expressed as an NS_ERROR_FAILURE return value, - // causing an exception to be thrown which we catch here. - // Unfortunately this will also consume helpful failures, so add a - // dump(e); // if you need to debug - } -} - -function BrowserSetDefaultCharacterSet(aCharset) -{ - appCore.setDefaultCharacterSet(aCharset); //XXXjag see bug 67442 - BrowserReload(); -} - -function BrowserSetForcedCharacterSet(aCharset) -{ - var charsetConverterManager = Components.classes["@mozilla.org/charset-converter-manager;1"] - .getService(Components.interfaces.nsICharsetConverterManager2); - var characterSet = charsetConverterManager.GetCharsetAtom(aCharset); - getBrowser().documentCharsetInfo.forcedCharset = characterSet; -} - -function BrowserSetForcedDetector() -{ - getBrowser().documentCharsetInfo.forcedDetector = true; -} - -function BrowserClose() -{ - // This code replicates stuff in Shutdown(). It is here because - // window.screenX and window.screenY have real values. We need - // to fix this eventually but by replicating the code here, we - // provide a means of saving position (it just requires that the - // user close the window via File->Close (vs. close box). - - // Get the current window position/size. - var x = window.screenX; - var y = window.screenY; - var h = window.outerHeight; - var w = window.outerWidth; - - // Store these into the window attributes (for persistence). - var win = document.getElementById( "main-window" ); - win.setAttribute( "x", x ); - win.setAttribute( "y", y ); - win.setAttribute( "height", h ); - win.setAttribute( "width", w ); - - window.close(); -} - -function BrowserFind() -{ - var focusedWindow = document.commandDispatcher.focusedWindow; - if (!focusedWindow || focusedWindow == window) - focusedWindow = window._content; - - findInPage(getBrowser(), window._content, focusedWindow) -} - -function BrowserFindAgain() -{ - var focusedWindow = document.commandDispatcher.focusedWindow; - if (!focusedWindow || focusedWindow == window) - focusedWindow = window._content; - - findAgainInPage(getBrowser(), window._content, focusedWindow) -} - -function BrowserCanFindAgain() -{ - return canFindAgainInPage(); -} - -function loadURI(uri) -{ - try { - getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); - } catch (e) { - } -} - -function BrowserLoadURL() -{ - var url = gURLBar.value; - if (url.match(/^view-source:/)) { - BrowserViewSourceOfURL(url.replace(/^view-source:/, ""), null); - } else { - loadURI(getShortcutOrURI(url)); - _content.focus(); - } -} - -function getShortcutOrURI(url) -{ - // rjc: added support for URL shortcuts (3/30/1999) - try { - var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"] - .getService(Components.interfaces.nsIBookmarksService); - - var shortcutURL = bmks.resolveKeyword(url); - if (!shortcutURL) { - // rjc: add support for string substitution with shortcuts (4/4/2000) - // (see bug # 29871 for details) - var aOffset = url.indexOf(" "); - if (aOffset > 0) { - var cmd = url.substr(0, aOffset); - var text = url.substr(aOffset+1); - shortcutURL = bmks.resolveKeyword(cmd); - if (shortcutURL && text) { - aOffset = shortcutURL.indexOf("%s"); - if (aOffset >= 0) - shortcutURL = shortcutURL.substr(0, aOffset) + text + shortcutURL.substr(aOffset+2); - else - shortcutURL = null; - } - } - } - - if (shortcutURL) - url = shortcutURL; - - } catch (ex) { - } - return url; -} - -function readFromClipboard() -{ - var url; - - try { - // Get clipboard. - var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"] - .getService(Components.interfaces.nsIClipboard); - - // Create tranferable that will transfer the text. - var trans = Components.classes["@mozilla.org/widget/transferable;1"] - .createInstance(Components.interfaces.nsITransferable); - - trans.addDataFlavor("text/unicode"); - clipboard.getData(trans, clipboard.kSelectionClipboard); - - var data = {}; - var dataLen = {}; - trans.getTransferData("text/unicode", data, dataLen); - - if (data) { - data = data.value.QueryInterface(Components.interfaces.nsISupportsWString); - url = data.data.substring(0, dataLen.value / 2); - } - } catch (ex) { - } - - return url; -} - -function OpenMessenger() -{ - open("chrome://messenger/content/messenger.xul", "_blank", "chrome,menubar,toolbar,resizable"); -} - -function OpenAddressbook() -{ - open("chrome://messenger/content/addressbook/addressbook.xul", "_blank", "chrome,menubar,toolbar,resizable"); -} - -function BrowserViewSource() -{ - var focusedWindow = document.commandDispatcher.focusedWindow; - if (focusedWindow == window) - focusedWindow = _content; - - dump("focusedWindow = " + focusedWindow + "\n"); - if (focusedWindow) - var docCharset = "charset=" + focusedWindow.document.characterSet; - - BrowserViewSourceOfURL(_content.location, docCharset); -} - -function BrowserViewSourceOfURL(url, charset) -{ - // try to open a view-source window while inheriting the charset (if any) - openDialog("chrome://navigator/content/viewSource.xul", - "_blank", - "scrollbars,resizable,chrome,dialog=no", - url, charset); -} - -// doc=null for regular page, doc=owner document for frame. -function BrowserPageInfo(doc) -{ - window.openDialog("chrome://navigator/content/pageInfo.xul", - "_blank", - "chrome,dialog=no", - doc); -} - -function hiddenWindowStartup() -{ - // Disable menus which are not appropriate - var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', /*'Browser:PrintSetup', 'Browser:PrintPreview',*/ - 'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo', - 'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll']; - for (id in disabledItems) { - var broadcaster = document.getElementById(disabledItems[id]); - if (broadcaster) - broadcaster.setAttribute("disabled", "true"); - } -} - -// Initialize the LeakDetector class. -function LeakDetector(verbose) -{ - this.verbose = verbose; -} - -try { - LeakDetector.prototype = Components.classes["@mozilla.org/xpcom/leakdetector;1"] - .createInstance(Components.interfaces.nsILeakDetector); -} catch (err) { - LeakDetector.prototype = Object.prototype; -} - -var leakDetector = new LeakDetector(false); - -// Dumps current set of memory leaks. -function dumpMemoryLeaks() -{ - leakDetector.dumpLeaks(); -} - -// Traces all objects reachable from the chrome document. -function traceChrome() -{ - leakDetector.traceObject(document, leakDetector.verbose); -} - -// Traces all objects reachable from the content document. -function traceDocument() -{ - // keep the chrome document out of the dump. - leakDetector.markObject(document, true); - leakDetector.traceObject(_content, leakDetector.verbose); - leakDetector.markObject(document, false); -} - -// Controls whether or not we do verbose tracing. -function traceVerbose(verbose) -{ - leakDetector.verbose = (verbose == "true"); -} - -var consoleListener = { - observe: function (aMsgObject) - { - const nsIScriptError = Components.interfaces.nsIScriptError; - var scriptError = aMsgObject.QueryInterface(nsIScriptError); - var isWarning = scriptError.flags & nsIScriptError.warningFlag != 0; - if (!isWarning) { - var statusbarDisplay = document.getElementById("statusbar-display"); - statusbarDisplay.setAttribute("error", "true"); - statusbarDisplay.addEventListener("click", loadErrorConsole, true); - statusbarDisplay.label = gNavigatorBundle.getString("jserror"); - this.isShowingError = true; - } - }, - - // whether or not an error alert is being displayed - isShowingError: false -}; - -function initConsoleListener() -{ - /** - * XXX - console launch hookup requires some work that I'm not sure - * how to do. - * - * 1) ideally, the notification would disappear when the - * document that had the error was flushed. how do I know when - * this happens? All the nsIScriptError object I get tells me - * is the URL. Where is it located in the content area? - * 2) the notification service should not display chrome - * script errors. web developers and users are not interested - * in the failings of our shitty, exception unsafe js. One - * could argue that this should also extend to the console by - * default (although toggle-able via setting for chrome - * authors) At any rate, no status indication should be given - * for chrome script errors. - * - * As a result I am commenting out this for the moment. - * - - var consoleService = Components.classes["@mozilla.org/consoleservice;1"] - .getService(Components.interfaces.nsIConsoleService); - - if (consoleService) - consoleService.registerListener(consoleListener); - */ -} - -function loadErrorConsole(aEvent) -{ - if (aEvent.detail == 2) - toJavaScriptConsole(); -} - -function clearErrorNotification() -{ - var statusbarDisplay = document.getElementById("statusbar-display"); - statusbarDisplay.removeAttribute("error"); - statusbarDisplay.removeEventListener("click", loadErrorConsole, true); - consoleListener.isShowingError = false; -} - -var urlWidgetService = null; -try { - urlWidgetService = Components.classes["@mozilla.org/urlwidget;1"] - .getService(Components.interfaces.nsIUrlWidget); -} catch (ex) { -} - -//Posts the currently displayed url to a native widget so third-party apps can observe it. -function postURLToNativeWidget() -{ - if (urlWidgetService) { - // XXX This somehow causes a big leak, back to the old way - // till we figure out why. See bug 61886. - // var url = getWebNavigation().currentURI.spec; - var url = _content.location.href; - try { - urlWidgetService.SetURLToHiddenControl(url, window); - } catch(ex) { - } - } -} - -function checkForDirectoryListing() -{ - if ( "HTTPIndex" in _content && - _content.HTTPIndex instanceof Components.interfaces.nsIHTTPIndex ) { - _content.defaultCharacterset = getMarkupDocumentViewer().defaultCharacterSet; - } -} - -/** - * Content area tooltip. - * XXX - this must move into XBL binding/equiv! Do not want to pollute - * navigator.js with functionality that can be encapsulated into - * browser widget. TEMPORARY! - * - * NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText() - * (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp) - * which performs the same function, but for embedded clients that - * don't use a XUL/JS layer. It is important that the logic of - * these two routines be kept more or less in sync. - * (pinkerton) - **/ -function FillInHTMLTooltip(tipElement) -{ - const XLinkNS = "http://www.w3.org/1999/xlink"; - - var retVal = false; - - var titleText = null; - var XLinkTitleText = null; - - while (!titleText && !XLinkTitleText && tipElement) { - if (tipElement.nodeType == Node.ELEMENT_NODE) { - titleText = tipElement.getAttribute("title"); - XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); - } - tipElement = tipElement.parentNode; - } - - var texts = [titleText, XLinkTitleText]; - var tipNode = document.getElementById("aHTMLTooltip"); - - for (var i = 0; i < texts.length; ++i) { - var t = texts[i]; - if (t && t.search(/\S/) >= 0) { - tipNode.setAttribute("label", t); - retVal = true; - } - } - - return retVal; -} - -/** - * Use Stylesheet functions. - * Written by Tim Hill (bug 6782) - * Frameset handling by Neil Rashbrook <neil@parkwaycc.co.uk> - **/ -function getStyleSheetArray(frame) -{ - var styleSheets = frame.document.styleSheets; - var styleSheetsArray = new Array(styleSheets.length); - for (var i = 0; i < styleSheets.length; i++) { - styleSheetsArray[i] = styleSheets[i]; - } - return styleSheetsArray; -} - -function getAllStyleSheets(frameset) -{ - var styleSheetsArray = getStyleSheetArray(frameset); - for (var i = 0; i < frameset.frames.length; i++) { - var frameSheets = getAllStyleSheets(frameset.frames[i]); - styleSheetsArray = styleSheetsArray.concat(frameSheets); - } - return styleSheetsArray; -} - -function stylesheetFillPopup(menuPopup) -{ - var itemNoOptStyles = menuPopup.firstChild; - while (itemNoOptStyles.nextSibling) - menuPopup.removeChild(itemNoOptStyles.nextSibling); - - var noOptionalStyles = true; - var styleSheets = getAllStyleSheets(window._content); - var currentStyleSheets = []; - - for (var i = 0; i < styleSheets.length; ++i) { - var currentStyleSheet = styleSheets[i]; - - if (currentStyleSheet.title) { - if (!currentStyleSheet.disabled) - noOptionalStyles = false; - - var lastWithSameTitle = null; - if (currentStyleSheet.title in currentStyleSheets) - lastWithSameTitle = currentStyleSheets[currentStyleSheet.title]; - - if (!lastWithSameTitle) { - var menuItem = itemNoOptStyles.cloneNode(false); - menuItem.setAttribute("label", currentStyleSheet.title); - menuItem.setAttribute("data", currentStyleSheet.title); - menuItem.setAttribute("checked", !currentStyleSheet.disabled); - menuPopup.appendChild(menuItem); - currentStyleSheets[currentStyleSheet.title] = menuItem; - } else { - if (currentStyleSheet.disabled) - lastWithSameTitle.removeAttribute("checked"); - } - } - } - itemNoOptStyles.setAttribute("checked", noOptionalStyles); -} - -function stylesheetInFrame(frame, title) { - var docStyleSheets = frame.document.styleSheets; - - for (var i = 0; i < docStyleSheets.length; ++i) { - if (docStyleSheets[i].title == title) - return true; - } - return false; -} - -function stylesheetSwitchFrame(frame, title) { - var docStyleSheets = frame.document.styleSheets; - - for (var i = 0; i < docStyleSheets.length; ++i) { - var docStyleSheet = docStyleSheets[i]; - - if (docStyleSheet.title) - docStyleSheet.disabled = (docStyleSheet.title != title); - else if (docStyleSheet.disabled) - docStyleSheet.disabled = false; - } -} - -function stylesheetSwitchAll(frameset, title) { - if (!title || stylesheetInFrame(frameset, title)) { - stylesheetSwitchFrame(frameset, title); - } - for (var i = 0; i < frameset.frames.length; i++) { - stylesheetSwitchAll(frameset.frames[i], title); - } -} - -function applyTheme(themeName) -{ - var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry); - - chromeRegistry.selectSkin(themeName.getAttribute("name"), true); - chromeRegistry.refreshSkins(); -} - -function getNewThemes() -{ - loadURI(gBrandRegionBundle.getString("getNewThemesURL")); -} - -function URLBarMouseupHandler(aEvent) -{ - if (aEvent.button == 0 && pref.getBoolPref("browser.urlbar.clickSelectsAll")) { - var selectionLen = gURLBar.selectionEnd - gURLBar.selectionStart; - if (selectionLen == 0) - gURLBar.setSelectionRange(0, gURLBar.textLength); - } -} - -function URLBarBlurHandler(aEvent) -{ - if (pref.getBoolPref("browser.urlbar.clickSelectsAll")) - gURLBar.setSelectionRange(0, 0); -} - -// This function gets the "windows hooks" service and has it check its setting -// This will do nothing on platforms other than Windows. -function checkForDefaultBrowser() -{ - try { - Components.classes["@mozilla.org/winhooks;1"] - .getService(Components.interfaces.nsIWindowsHooks) - .checkSettings(window); - } catch(e) { - } -} - -function ShowAndSelectContentsOfURLBar() -{ - var navBar = document.getElementById("nav-bar"); - - // If it's hidden, show it. - if (navBar.getAttribute("hidden") == "true") - goToggleToolbar('nav-bar','cmd_viewnavbar'); - - if (gURLBar.value) - gURLBar.select(); - else - gURLBar.focus(); -} - -// If "ESC" is pressed in the url bar, we replace the urlbar's value with the url of the page -// and highlight it, unless it is about:blank, where we reset it to "". -function handleURLBarRevert() -{ - var url = _content.location.href; - var throbberElement = document.getElementById("navigator-throbber"); - - var isScrolling = gURLBar.userAction == "scrolling"; - - // don't revert to last valid url unless page is NOT loading - // and user is NOT key-scrolling through autocomplete list - if (!throbberElement.getAttribute("busy") && !isScrolling) { - if (url != "about:blank") { - gURLBar.value = url; - gURLBar.select(); - } else { //if about:blank, urlbar becomes "" - gURLBar.value = ""; - } - SetPageProxyState("valid"); - } - - // tell widget to revert to last typed text only if the user - // was scrolling when they hit escape - return isScrolling; -} - -function handleURLBarCommand(aUserAction) -{ -// if (aUserAction == "typing") -// addToUrlbarHistory(); - - BrowserLoadURL(); -} - -function UpdatePageProxyState() -{ - if (gURLBar.value != gLastValidURL) - SetPageProxyState("invalid"); -} - -function SetPageProxyState(aState) -{ - if (!gProxyButton) - gProxyButton = document.getElementById("page-proxy-button"); - - gProxyButton.setAttribute("pageproxystate", aState); - - if (aState == "valid") { - gLastValidURL = gURLBar.value; - gURLBar.addEventListener("input", UpdatePageProxyState, false); - } else if (aState == "invalid") - gURLBar.removeEventListener("input", UpdatePageProxyState, false); - -} - -function PageProxyDragGesture(aEvent) -{ - if (gProxyButton.getAttribute("pageproxystate") == "valid") - nsDragAndDrop.startDrag(aEvent, proxyIconDNDObserver); - else - return false; -} - diff --git a/xpfe/browser/resources/content/navigator-toolbars.js b/xpfe/browser/resources/content/navigator-toolbars.js index 2f4d25ff218..e69de29bb2d 100644 --- a/xpfe/browser/resources/content/navigator-toolbars.js +++ b/xpfe/browser/resources/content/navigator-toolbars.js @@ -1,373 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Ben Goodger <ben@netscape.com> (Original Author) - */ - -var gR_NC_child = null; - -const kNC_NS = "http://home.netscape.com/NC-rdf#"; - -const kToolboxID = "navigator-toolbox"; - -var ToolbarShell = { - - RDFSvc : Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService), - RDFC : Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer), - - initToolbars: function () - { - var toolbox = document.getElementById(kToolboxID); - - var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); - rdfService = rdfService.QueryInterface(Components.interfaces.nsIRDFService); - - // Add Datasources to toolbox - // NOTE: This is for navigator toolbar datasource hookup ONLY. Datasources - // from other components must add themselves separately. - - var toolbars = rdfService.GetDataSource("chrome://navigator/content/navigator-toolbars.rdf"); - toolbox.database.AddDataSource(toolbars); - - var commands = rdfService.GetDataSource("chrome://navigator/content/navigator-commands.rdf"); - toolbox.database.AddDataSource(commands); - - // XXX - shift to applicable component overlays - var bmds = rdfService.GetDataSource("rdf:bookmarks"); - toolbox.database.AddDataSource(bmds); - - var sidebarDS = rdfService.GetDataSource(get_sidebar_datasource_uri()); - toolbox.database.AddDataSource(sidebarDS); - - toolbox.builder.rebuild(); - - // globals - gR_NC_child = rdfService.GetResource(kNC_NS + "child", true); - - }, - - ///////////////////////////////////////////////////////////////////////////// - // @param aNode wstring Node URI being inserted - // @param aRelativeNode wstring Node URI being inserted into/adjacent to - // @param aParentNode wstring Node URI of parent - // @param aPosition boolean true = before, false = after - insertNode: function (aNode, aRelativeNode, aParentNode, aPosition) - { - var toolbox = document.getElementById(kToolboxID); - var db = toolbox.database; - - var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); - rdfService = rdfService.QueryInterface(Components.interfaces.nsIRDFService); - - // Obtain RDF Resources for the node URIs - var rNode = rdfService.GetResource(aNode, true); - var rRelNode = rdfService.GetResource(aRelativeNode, true); - - const cUtilsContractID = "@mozilla.org/rdf/container-utils;1"; - const cUtilsIID = Components.interfaces.nsIRDFContainerUtils; - var cUtils = Components.classes[cUtilsContractID].getService(); - cUtils = cUtils.QueryInterface(cUtilsIID); - - const cContractID = "@mozilla.org/rdf/container;1"; - const cIID = Components.interfaces.nsIRDFContainer; - var container = Components.classes[cContractID].getService(); - container = container.QueryInterface(cIID); - - // If the relative and parent nodes are the same, the node is a container - // and we want to append to it. - if (aRelativeNode == aParentNode) { - try { - // Relative Node is a bona fide container, init container and append. - container.Init(db, rRelNode); - container.AppendElement(rNode); - } - catch (e) { - // No container, just assert a child relationship - this.conditionalAssert(rRelNode, gR_NC_child, rNode, true); - } - } - else { - // Insert relative to a given node and its parent. - try { - var rParentNode = rdfService.GetResource(aParentNode, true); - - // See if our parent is a container, if it is, we can just append directly - // to it. - if (cUtils.IsContainer(db, rParentNode)) { - container.Init(db, rParentNode); - var ix = container.IndexOf(rRelNode); - container.InsertElementAt(rNode, ix + (aPosition ? 0 : 1), true); - } - else { - // Otherwise, we're higher up in the graph and need to navigate down - // into our children looking for sequences... - var childSeqs = db.GetTargets(rParentNode, gR_NC_child, true); - while (childSeqs.hasMoreElements()) { - var currSeq = childSeqs.getNext(); - currSeq = currSeq.QueryInterface(Components.interfaces.nsIRDFResource); - - if (cUtils.IsContainer(db, currSeq)) { - container.Init(db, currSeq); - var ix = container.IndexOf(rRelNode); - dump("*** index of relative node is " + ix + "\n"); - DUMP_seq(rdfService, container, db, currSeq, rRelNode); - if (ix >= 1) { - // This is the right container. It has the node we care about. - // Append to it. - container.InsertElementAt(rNode, ix + (aPosition ? 0 : 1), true); - DUMP_seq(rdfService, container, db, currSeq, rRelNode); - return; - } - // Otherwise, continue to inspect child containers. - } - } - } - } - catch (e) { throw e } - } - }, - - removeNode: function (aNode, aParent) - { - var toolbox = document.getElementById(kToolboxID); - var db = toolbox.database; - - // If we want to append aNode to aRelativeNode, a shortcut is to assert a - // child property - const cUtilsContractID = "@mozilla.org/rdf/container-utils;1"; - const cUtilsIID = Components.interfaces.nsIRDFContainerUtils; - var containerUtils = Components.classes[cUtilsContractID].getService(); - containerUtils = containerUtils.QueryInterface(cUtilsIID); - - const cContractID = "@mozilla.org/rdf/container;1"; - const cIID = Components.interfaces.nsIRDFContainer; - var container = Components.classes[cContractID].getService(); - container = container.QueryInterface(cIID); - - var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); - rdfService = rdfService.QueryInterface(Components.interfaces.nsIRDFService); - - var rParent = rdfService.GetResource(aParent, true); - var rNode = rdfService.GetResource(aNode, true); - - if (containerUtils.IsContainer(db, rParent)) { - // If the parent is a container, remove aNode from it. - container.Init(db, rParent); - container.RemoveElement(rNode, true); - } - else { - // Otherwise (the likely case) the parent is not itself a container, but - // a resource with a series of child arcs out to containers. Iterate over - // these child arcs, and compare their URIs with the aParentURI. When we - // find that, we can remove aNodeURI from it safely. - var childSeqs = db.GetTargets(rParent, gR_NC_child, true); - while (childSeqs.hasMoreElements()) { - var currSeq = childSeqs.getNext(); - currSeq = currSeq.QueryInterface(Components.interfaces.nsIRDFResource); - - if (containerUtils.IsContainer(db, currSeq)) { - container.Init(db, currSeq); - var ix = container.IndexOf(rNode); - if (ix >= 0) { - container.RemoveElement(rNode, true); - return; - } - } - } - } - }, - - copy: function (aNode, aIID) - { - this._copy(aNode, aIID); - }, - - conditionalAssert: function (aSource, aProperty, aTarget, aTruthValue) - { - var toolbox = document.getElementById(kToolboxID); - var db = toolbox.database; - if (!db) return; - - if (db.HasAssertion(aSource, aProperty, aTarget, aTruthValue)) { - var currValue = db.GetTarget(aSource, aProperty, true); - db.Change(aSource, aProperty, currValue, aTarget); - } - else - db.Assert(aSource, aProperty, aTarget, aTruthValue); - }, - - getProperty: function (aSourceURI, aPropertyURI) - { - var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); - rdfService = rdfService.QueryInterface(Components.interfaces.nsIRDFService); - - var toolbox = document.getElementById(kToolboxID); - var db = toolbox.database; - - var rSource = rdfService.GetResource(aSourceURI, true); - var rURL = rdfService.GetResource(aPropertyURI, true); - - var URL = db.GetTarget(rSource, rURL, true); - if (!URL) return null; - try { - URL = URL.QueryInterface(Components.interfaces.nsIRDFResource); - } - catch (e) { - URL = URL.QueryInterface(Components.interfaces.nsIRDFLiteral); - } - return URL.Value; - }, - - ///////////////////////////////////////////////////////////////////////////// - // Drag And Drop Observer Implementation - onDragStart: function (aEvent) - { - // targetURI is the unique identifier of this node in the RDF graph. - // targetURL is its URL property, which we will want for creation of HTML - // links, etc. - // targetName is the short descriptive label. - // targetDesc is the longer descriptive label - var targetURI = aEvent.target.id; - var targetURL = this.getProperty(targetURI, kNC_NS + "URL"); - var targetDesc = this.getProperty(targetURI, kNC_NS + "Description"); - var targetName = this.getProperty(targetURI, kNC_NS + "Name"); - - var flavourList = { }; - - if (targetURI) { - // For moz/toolbaritem, transferring the URI is enough as we always remain - // in the context of the graph, and we can always figure out what we need. - flavourList["moz/toolbaritem"] = { width: 2, data: targetURI }; - // For simple URLs, transport the Name and the Location - flavourList["text/x-moz-url"] = { width: 2, data: targetURL + "\n" + targetName }; - // For HTML Links, take the Name, Location and descriptive text for - // the TITLE tooltip. - var htmlString = ""; - if (targetDesc) - htmlString = "<a href=\"" + targetURL + "\" title=\"" + targetDesc + "\">" + targetName + "</a>"; - else - htmlString = "<a href=\"" + targetURL + "\">" + targetName + "</a>"; - flavourList["text/html"] = { width: 2, data: htmlString }; - // For the most basic case, simply take the URL. - flavourList["text/unicode"] = { width: 2, data: targetURL }; - } - - DUMP_flavours(flavourList); - - return flavourList; - }, - - onDragOver: function (aEvent, aFlavourList, aDragSession) - { - // Handle Drag & Drop Feedback - }, - - onDragExit: function (aEvent, aDragSession) - { - // Handle Drag & Drop Feedback - }, - - onDrop: function (aEvent, aDragData, aDragSession) - { - // Find the node dropped on - var dropNode = aEvent.target; - - // Get Client Coords and Widget Bounds - var cX = aEvent.clientX; - var wX = dropNode.boxObject.x; - var wW = dropNode.boxObject.width; - - var relNodeURI = dropNode.id; - var parentNodeURI = aEvent.target.parentNode.id; - - // bounds check - if (cX > wX && cX < (wX + wW)) { - // XXX - need to handle containers here, which will mean creating three - // dropzones rather than 2. - if (cX > wX && cX < (wX + (wW/2))) { - // Drop to the left - if (aDragData.flavour == "moz/toolbaritem") { - try { - this.insertNode(aDragData.data.data, relNodeURI, parentNodeURI, true); - // if insertNode fails, it will throw, and we won't remove the node - // from the destination - this.removeNode(aDragData.data.data, parentNodeURI); - } - catch (e) { - dump("*** ToolbarShell::insertNode failed for some reason\n"); - dump("*** Reason: " + e + "\n"); - } - } - } - else if (cX > (wX + (wW/2)) && cX < (wX + wW)) { - // Drop to the right - if (aDragData.flavour == "moz/toolbaritem") { - try { - this.insertNode(aDragData.data.data, relNodeURI, parentNodeURI, false); - // if insertNode fails, it will throw, and we won't remove the node - // from the destination - this.removeNode(aDragData.data.data, parentNodeURI); - } - catch (e) { - dump("*** ToolbarShell::insertNode failed for some reason\n"); - dump("*** Reason: " + e + "\n"); - } - } - } - else if (0) { - // Drop On - } - } - }, - - getSupportedFlavours: function () - { - var flavourList = { }; - flavourList["moz/toolbaritem"] = { width: 2, iid: "nsISupportsWString" }; - flavourList["text/x-moz-url"] = { width: 2, iid: "nsISupportsWString" }; - flavourList["text/html"] = { width: 2, iid: "nsISupportsWString" }; - flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" }; - return flavourList; - } - - -}; - -function DUMP_flavours(aFlavourList) -{ - for (var flavour in aFlavourList) - dump("*** Flavour " + flavour + " has data : " + aFlavourList[flavour].data + "\n"); -} - -function DUMP_seq(aRDFS, aContainer, aDB, aSequence, aRelNode) -{ - var res = aContainer.GetElements(); - var count = 1; - while (res.hasMoreElements()) { - var currRes = res.getNext().QueryInterface(Components.interfaces.nsIRDFResource); - if (currRes.Value == aRelNode.Value) - dump("[[ #" + count++ + " * " + currRes.Value + "\n"); - else - dump("[[ #" + count++ + " " + currRes.Value + "\n"); - } -} - -addEventListener("load", ToolbarShell.initToolbars, false); - diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 965fc79cb2a..18abf0d562d 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -1149,7 +1149,7 @@ function readFromClipboard() trans.getTransferData("text/unicode", data, dataLen); if (data) { - data = data.value.QueryInterface(Components.interfaces.nsISupportsWString); + data = data.value.QueryInterface(Components.interfaces.nsISupportsString); url = data.data.substring(0, dataLen.value / 2); } } catch (ex) { @@ -1499,8 +1499,8 @@ function applyTheme(themeName) catch(e) { } - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { @@ -1518,7 +1518,7 @@ function applyTheme(themeName) str.data = true; pref.setComplexValue("general.skins.removelist." + name, - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); if (inUse) chromeRegistry.refreshSkins(); @@ -1532,7 +1532,7 @@ function applyTheme(themeName) // hacking around it yet again str.data = name; - pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); + pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); diff --git a/xpfe/browser/resources/content/urlbarBindings.xml b/xpfe/browser/resources/content/urlbarBindings.xml index e93a36ae4eb..e00f8cc04d5 100644 --- a/xpfe/browser/resources/content/urlbarBindings.xml +++ b/xpfe/browser/resources/content/urlbarBindings.xml @@ -215,11 +215,11 @@ var defaultEngine = null; try { defaultEngine = this.mPrefs.getComplexValue("browser.search.defaultengine", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex) { this.ensureDefaultEnginePrefs(rdf, ds); defaultEngine = this.mPrefs.getComplexValue("browser.search.defaultengine", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } if (defaultEngine) { @@ -258,11 +258,11 @@ var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = this.readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = engineRes.Value; this.mPrefs.setComplexValue("browser.search.defaultengine", - Components.interfaces.nsISupportsWString, + Components.interfaces.nsISupportsString, str); } } diff --git a/xpfe/communicator/resources/content/contentAreaUtils.js b/xpfe/communicator/resources/content/contentAreaUtils.js index d3d4ec2ca71..ab4a3422bf3 100644 --- a/xpfe/communicator/resources/content/contentAreaUtils.js +++ b/xpfe/communicator/resources/content/contentAreaUtils.js @@ -420,7 +420,7 @@ nsHeaderSniffer.prototype = { try { this.contentEncodingType = encodingEnumerator.getNext(). - QueryInterface(Components.interfaces.nsISupportsString).data; + QueryInterface(Components.interfaces.nsISupportsCString).data; } catch (e) { } } diff --git a/xpfe/communicator/resources/content/openLocation.js b/xpfe/communicator/resources/content/openLocation.js index 35deec3cc51..68db655fd8c 100644 --- a/xpfe/communicator/resources/content/openLocation.js +++ b/xpfe/communicator/resources/content/openLocation.js @@ -75,7 +75,7 @@ function onLoad() if (element) dialog.openAppList.selectedItem = element; dialog.input.value = pref.getComplexValue("general.open_location.last_url", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(ex) { } @@ -125,11 +125,11 @@ function open() } if (pref) { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = dialog.input.value; pref.setComplexValue("general.open_location.last_url", - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); pref.setIntPref("general.open_location.last_window_choice", dialog.openAppList.value); } diff --git a/xpfe/components/alerts/src/nsAlertsService.cpp b/xpfe/components/alerts/src/nsAlertsService.cpp index 6301c4d41bc..8981d61be55 100644 --- a/xpfe/components/alerts/src/nsAlertsService.cpp +++ b/xpfe/components/alerts/src/nsAlertsService.cpp @@ -75,19 +75,19 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con NS_ENSURE_SUCCESS(rv, rv); // create scriptable versions of our strings that we can store in our nsISupportsArray.... - nsCOMPtr<nsISupportsString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); + nsCOMPtr<nsISupportsCString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); NS_ENSURE_TRUE(scriptableImageUrl, NS_ERROR_FAILURE); scriptableImageUrl->SetData(aImageUrl); argsArray->AppendElement(scriptableImageUrl); - nsCOMPtr<nsISupportsWString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); NS_ENSURE_TRUE(scriptableAlertTitle, NS_ERROR_FAILURE); scriptableAlertTitle->SetData(aAlertTitle); argsArray->AppendElement(scriptableAlertTitle); - nsCOMPtr<nsISupportsWString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); NS_ENSURE_TRUE(scriptableAlertText, NS_ERROR_FAILURE); scriptableAlertText->SetData(aAlertText); @@ -99,7 +99,7 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con scriptableIsClickable->SetData(aAlertTextClickable); argsArray->AppendElement(scriptableIsClickable); - nsCOMPtr<nsISupportsWString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE); scriptableAlertCookie->SetData(aAlertCookie); diff --git a/xpfe/components/autocomplete/public/nsILDAPAutoCompFormatter.idl b/xpfe/components/autocomplete/public/nsILDAPAutoCompFormatter.idl index 2e4c72bfbc3..b8988d1dd08 100644 --- a/xpfe/components/autocomplete/public/nsILDAPAutoCompFormatter.idl +++ b/xpfe/components/autocomplete/public/nsILDAPAutoCompFormatter.idl @@ -69,7 +69,7 @@ interface nsILDAPAutoCompFormatter : nsISupports { * was in when the error occured (aState) is formatted into a general * error message which is put in the value attribute of the item, * and the specific error (aErrorCode) is formatted into another message - * which is put in an nsISupportsWString in the param attribute of the + * which is put in an nsISupportsString in the param attribute of the * item. * * @param aState state of autocomplete session when error occurred diff --git a/xpfe/components/bookmarks/resources/bookmarks-temp.js b/xpfe/components/bookmarks/resources/bookmarks-temp.js index bd2a15dd5da..e69de29bb2d 100644 --- a/xpfe/components/bookmarks/resources/bookmarks-temp.js +++ b/xpfe/components/bookmarks/resources/bookmarks-temp.js @@ -1,854 +0,0 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - This is the old bookmarks code, included here for the sake of the bookmarks sidebar panel, - which will be fixed to use my new code in .9. In the mean time, this file provides a - life line to various functionality. - */ - - - -var NC_NS = "http://home.netscape.com/NC-rdf#"; -var RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; - -function Init() { - var tree = document.getElementById("bookmarksTree"); - tree.controllers.appendController(BookmarksController); - var children = document.getElementById('treechildren-bookmarks'); - tree.selectItem(children.firstChild); - tree.focus(); - - RefreshSort(); -} - -var BookmarksController = { - supportsCommand: function(command) - { - switch(command) - { - case "cmd_undo": - case "cmd_redo": - return false; - case "cmd_cut": - case "cmd_copy": - case "cmd_paste": - case "cmd_delete": - case "cmd_selectAll": - return true; - default: - return false; - } - }, - isCommandEnabled: function(command) - { - switch(command) - { - case "cmd_undo": - case "cmd_redo": - return false; - case "cmd_cut": - case "cmd_copy": - case "cmd_paste": - case "cmd_delete": - case "cmd_selectAll": - return true; - default: - return false; - } - }, - doCommand: function(command) - { - switch(command) - { - case "cmd_undo": - case "cmd_redo": - break; - case "cmd_cut": - doCut(); - break; - case "cmd_copy": - doCopy(); - break; - case "cmd_paste": - doPaste(); - break; - case "cmd_delete": - doDelete(); - break; - case "cmd_selectAll": - doSelectAll(); - break; - } - }, - onEvent: function(event) - { - // On blur events set the menu item texts back to the normal values - /*if (event == 'blur' ) - { - goSetMenuValue('cmd_undo', 'valueDefault'); - goSetMenuValue('cmd_redo', 'valueDefault'); - }*/ - } -}; - -function CommandUpdate_Bookmarks() -{ - //goUpdateCommand('button_delete'); - // get selection info from dir pane - /* - var oneAddressBookSelected = false; - if ( dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1) ) - oneAddressBookSelected = true; - - // get selection info from results pane - var selectedCards = GetSelectedAddresses(); - var oneOrMoreCardsSelected = false; - if ( selectedCards ) - oneOrMoreCardsSelected = true; - */ - // set commands to enabled / disabled - //goSetCommandEnabled('cmd_PrintCard', oneAddressBookSelected); - goSetCommandEnabled('bm_cmd_find', true/*oneAddressBookSelected*/); -} - -function copySelectionToClipboard() -{ - var treeNode = document.getElementById("bookmarksTree"); - if (!treeNode) return false; - var select_list = treeNode.selectedItems; - if (!select_list) return false; - if (select_list.length < 1) return false; - - var rdf_uri = "@mozilla.org/rdf/rdf-service;1" - var RDF = Components.classes[rdf_uri].getService(); - RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); - if (!RDF) return false; - - var Bookmarks = RDF.GetDataSource("rdf:bookmarks"); - if (!Bookmarks) return false; - - var nameRes = RDF.GetResource(NC_NS + "Name"); - if (!nameRes) return false; - - // Build a url that encodes all the select nodes - // as well as their parent nodes - var url = ""; - var text = ""; - var html = ""; - - for (var nodeIndex = 0; nodeIndex < select_list.length; nodeIndex++) - { - var node = select_list[nodeIndex]; - if (!node) continue; - - var ID = getAbsoluteID("bookmarksTree", node); - if (!ID) continue; - - var IDRes = RDF.GetResource(ID); - if (!IDRes) continue; - var nameNode = Bookmarks.GetTarget(IDRes, nameRes, true); - var theName = ""; - if (nameNode) - nameNode = - nameNode.QueryInterface(Components.interfaces.nsIRDFLiteral); - if (nameNode) theName = nameNode.Value; - - url += "ID:{" + ID + "};"; - url += "NAME:{" + theName + "};"; - - if (node.getAttribute("container") == "true") - { - var type = node.getAttribute("type"); - if (type == NC_NS + "BookmarkSeparator") - { - // Note: can't encode separators in text, just html - html += "<hr><p>"; - } - else - { - text += ID + "\r"; - - html += "<a href='" + ID + "'>"; - if (theName != "") - { - html += theName; - } - html += "</a><p>"; - } - } - } - - if (url == "") return false; - - // get some useful components - var trans_uri = "@mozilla.org/widget/transferable;1"; - var trans = Components.classes[trans_uri].createInstance(); - if (trans) trans = trans.QueryInterface(Components.interfaces.nsITransferable); - if (!trans) return false; - - var clip_uri = "@mozilla.org/widget/clipboard;1"; - var clip = Components.classes[clip_uri].getService(); - if (clip) clip = clip.QueryInterface(Components.interfaces.nsIClipboard); - if (!clip) return false; - clip.emptyClipboard(Components.interfaces.nsIClipboard.kGlobalClipboard); - - // save bookmark's ID - trans.addDataFlavor("moz/bookmarkclipboarditem"); - var data_uri = "@mozilla.org/supports-wstring;1"; - var data = Components.classes[data_uri].createInstance(); - if (data) { - data = data.QueryInterface(Components.interfaces.nsISupportsWString); - } - if (!data) return false; - data.data = url; - // double byte data - trans.setTransferData("moz/bookmarkclipboarditem", data, url.length*2); - - if (text != "") - { - trans.addDataFlavor("text/unicode"); - - var textData_uri = "@mozilla.org/supports-wstring;1"; - var textData = Components.classes[textData_uri].createInstance(); - if (textData) textData = textData.QueryInterface(Components.interfaces.nsISupportsWString); - if (!textData) return false; - textData.data = text; - // double byte data - trans.setTransferData("text/unicode", textData, text.length*2); - } - if (html != "") - { - trans.addDataFlavor("text/html"); - - var wstring_uri = "@mozilla.org/supports-wstring;1"; - var htmlData = Components.classes[wstring_uri].createInstance(); - if (htmlData) { - var wstring_interface = Components.interfaces.nsISupportsWString; - htmlData = htmlData.QueryInterface(wstring_interface); - } - if (!htmlData) return false; - htmlData.data = html; - // double byte data - trans.setTransferData("text/html", htmlData, html.length*2); - } - clip.setData(trans, null, - Components.interfaces.nsIClipboard.kGlobalClipboard); - return true; -} - -function doCut() -{ - if (copySelectionToClipboard() == true) { - doDelete(false); - } - return true; -} - -function doCopy() -{ - copySelectionToClipboard(); - return true; -} - -function doPaste() -{ - var treeNode = document.getElementById("bookmarksTree"); - if (!treeNode) return false; - var select_list = treeNode.selectedItems; - if (!select_list) return false; - if (select_list.length != 1) return false; - - var pasteNodeID = select_list[0].getAttribute("id"); - var isContainerFlag = (select_list[0].getAttribute("container") == "true"); - - var clip_uri = "@mozilla.org/widget/clipboard;1"; - var clip = Components.classes[clip_uri].getService(); - if (clip) clip = clip.QueryInterface(Components.interfaces.nsIClipboard); - if (!clip) return false; - - var trans_uri = "@mozilla.org/widget/transferable;1"; - var trans = Components.classes[trans_uri].createInstance(); - if (trans) { - trans = trans.QueryInterface(Components.interfaces.nsITransferable); - } - if (!trans) return false; - trans.addDataFlavor("moz/bookmarkclipboarditem"); - - clip.getData(trans, Components.interfaces.nsIClipboard.kGlobalClipboard); - var data = new Object(); - var dataLen = new Object(); - trans.getTransferData("moz/bookmarkclipboarditem", data, dataLen); - if (data) { - var data_interface = Components.interfaces.nsISupportsWString - data = data.value.QueryInterface(data_interface); - } - var url = null; - // double byte data - if (data) url = data.data.substring(0, dataLen.value / 2); - if (!url) return false; - - var strings = url.split(";"); - if (!strings) return false; - - var rdf_uri = "@mozilla.org/rdf/rdf-service;1"; - var RDF = Components.classes[rdf_uri].getService(); - RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); - if (!RDF) return false; - var rdfc_uri = "@mozilla.org/rdf/container;1"; - var RDFC = Components.classes[rdfc_uri].getService(); - RDFC = RDFC.QueryInterface(Components.interfaces.nsIRDFContainer); - if (!RDFC) return false; - var Bookmarks = RDF.GetDataSource("rdf:bookmarks"); - if (!Bookmarks) return false; - - var nameRes = RDF.GetResource(NC_NS + "Name"); - if (!nameRes) return false; - - pasteNodeRes = RDF.GetResource(pasteNodeID); - if (!pasteNodeRes) return false; - var pasteContainerRes = null; - var pasteNodeIndex = -1; - if (isContainerFlag == true) - { - pasteContainerRes = pasteNodeRes; - } - else - { - var parID = select_list[0].parentNode.parentNode.getAttribute("ref"); - if (!parID) { - parID = select_list[0].parentNode.parentNode.getAttribute("id"); - } - if (!parID) return false; - pasteContainerRes = RDF.GetResource(parID); - if (!pasteContainerRes) return false; - } - RDFC.Init(Bookmarks, pasteContainerRes); - - if (isContainerFlag == false) - { - pasteNodeIndex = RDFC.IndexOf(pasteNodeRes); - if (pasteNodeIndex < 0) return false; // how did that happen? - } - - var typeRes = RDF.GetResource(RDF_NS + "type"); - if (!typeRes) return false; - var bmTypeRes = RDF.GetResource(NC_NS + "Bookmark"); - if (!bmTypeRes) return false; - - var dirty = false; - for (var x=0; x<strings.length; x=x+2) - { - var theID = strings[x]; - var theName = strings[x+1]; - if ((theID.indexOf("ID:{") == 0) && (theName.indexOf("NAME:{") == 0)) - { - theID = theID.substr(4, theID.length-5); - theName = theName.substr(6, theName.length-7); - - var IDRes = RDF.GetResource(theID); - if (!IDRes) continue; - - if (RDFC.IndexOf(IDRes) > 0) - continue; - - if (theName != "") - { - var NameLiteral = RDF.GetLiteral(theName); - if (NameLiteral) - { - Bookmarks.Assert(IDRes, nameRes, NameLiteral, true); - dirty = true; - } - } - if (isContainerFlag == true) - RDFC.AppendElement(IDRes); - else - RDFC.InsertElementAt(IDRes, pasteNodeIndex++, true); - dirty = true; - - // make sure appropriate bookmark type is set - var bmTypeNode = Bookmarks.GetTarget( IDRes, typeRes, true ); - if (!bmTypeNode) - { - // set default bookmark type - Bookmarks.Assert(IDRes, typeRes, bmTypeRes, true); - } - } - } - if (dirty == true) - { - var rdf_ds_interface = Components.interfaces.nsIRDFRemoteDataSource; - var remote = Bookmarks.QueryInterface(rdf_ds_interface); - if (remote) - remote.Flush(); - } - return true; -} - -function doDelete(promptFlag) -{ - var treeNode = document.getElementById("bookmarksTree"); - if (!treeNode) return false; - var select_list = treeNode.selectedItems; - if (!select_list) return false; - if (select_list.length < 1) return false; - - if (promptFlag == true) - { - var deleteStr = ''; - if (select_list.length == 1) { - deleteStr = get_localized_string("DeleteItem"); - } else { - deleteStr = get_localized_string("DeleteItems"); - } - var ok = confirm(deleteStr); - if (!ok) return false; - } - - var RDF_uri = "@mozilla.org/rdf/rdf-service;1"; - var RDF = Components.classes[RDF_uri].getService(); - RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); - if (!RDF) return false; - - var RDFC_uri = "@mozilla.org/rdf/container;1"; - var RDFC = Components.classes[RDFC_uri].getService(); - RDFC = RDFC.QueryInterface(Components.interfaces.nsIRDFContainer); - if (!RDFC) return false; - - var Bookmarks = RDF.GetDataSource("rdf:bookmarks"); - if (!Bookmarks) return false; - - var dirty = false; - - // note: backwards delete so that we handle odd deletion cases such as - // deleting a child of a folder as well as the folder itself - for (var nodeIndex=select_list.length-1; nodeIndex>=0; nodeIndex--) - { - var node = select_list[nodeIndex]; - if (!node) continue; - var ID = node.getAttribute("id"); - if (!ID) continue; - - // don't allow deletion of various "special" folders - if ((ID == "NC:BookmarksRoot") || (ID == "NC:IEFavoritesRoot")) - { - continue; - } - - var parentID = node.parentNode.parentNode.getAttribute("ref"); - if (!parentID) parentID = node.parentNode.parentNode.getAttribute("id"); - if (!parentID) continue; - - var IDRes = RDF.GetResource(ID); - if (!IDRes) continue; - var parentIDRes = RDF.GetResource(parentID); - if (!parentIDRes) continue; - - RDFC.Init(Bookmarks, parentIDRes); - RDFC.RemoveElement(IDRes, true); - dirty = true; - } - - if (dirty == true) - { - var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - if (remote) - remote.Flush(); - } - - return true; -} - -function doSelectAll() -{ - var treeNode = document.getElementById("bookmarksTree"); - if (!treeNode) return false; - treeNode.selectAll(); - return true; -} - -function doUnload() -{ - // Get the current window position/size. - var x = window.screenX; - var y = window.screenY; - var h = window.outerHeight; - var w = window.outerWidth; - - // Store these into the window attributes (for persistence). - var win = document.getElementById("bookmark-window"); - win.setAttribute("x", x); - win.setAttribute("y", y); - win.setAttribute("height", h); - win.setAttribute("width", w); -} - -function BookmarkProperties() -{ - var treeNode = document.getElementById('bookmarksTree'); - var select_list = treeNode.selectedItems; - - if (select_list.length >= 1) { - // don't bother showing properties on bookmark separators - var type = select_list[0].getAttribute('type'); - if (type != NC_NS + "BookmarkSeparator") { - window.openDialog("chrome://communicator/content/bookmarks/bm-props.xul", - "_blank", "centerscreen,chrome,menubar", - select_list[0].getAttribute("id")); - } - } - return true; -} - - - -function OpenBookmarksFind() -{ - window.openDialog("chrome://communicator/content/bookmarks/bm-find.xul", - "FindBookmarksWindow", - "dialog=no,close,chrome,resizable", "bookmarks"); - return true; -} - - - -function getAbsoluteID(root, node) -{ - var url = node.getAttribute("ref"); - if ((url == null) || (url == "")) - { - url = node.getAttribute("id"); - } - try - { - var rootNode = document.getElementById(root); - var ds = null; - if (rootNode) - { - ds = rootNode.database; - } - - // add support for anonymous resources such as Internet Search results, - // IE favorites under Win32, and NetPositive URLs under BeOS - var rdf_uri = "@mozilla.org/rdf/rdf-service;1"; - var rdf = Components.classes[rdf_uri].getService(); - if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); - if (rdf && ds) - { - var src = rdf.GetResource(url, true); - var prop = rdf.GetResource(NC_NS + "URL", - true); - var target = ds.GetTarget(src, prop, true); - if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); - if (target) target = target.Value; - if (target) url = target; - } - } - catch(ex) - { - } - return url; -} - -function OpenURL(event, node, root) -{ - if ((event.button != 0) || (event.detail != 2) - || (node.nodeName != "treeitem")) - return false; - - if (node.getAttribute("container") == "true") - return false; - - var url = getAbsoluteID(root, node); - - // Ignore "NC:" urls. - if (url.substring(0, 3) == "NC:") - return false; - - if (event.altKey) - { - BookmarkProperties(); - } - else - { - // get right sized window - window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url); - } - return true; -} - -const nsIFilePicker = Components.interfaces.nsIFilePicker; - -function doContextCmd(cmdName) -{ - // Do some prompting/confirmation for various bookmark - // commands that we know about. - // If we have values to pass it, they are added to the arguments array - - var nameVal = ""; - var urlVal = ""; - var promptStr; - - var picker_uri; - var filePicker; - - if (cmdName == NC_NS + "command?cmd=newbookmark") - { - while (true) - { - promptStr = get_localized_string("NewBookmarkURLPrompt"); - urlVal = prompt(promptStr, ""); - if (!urlVal || urlVal=="") return false; - - // ensure we get a fully qualified URL (protocol colon address) - var colonOffset = urlVal.indexOf(":"); - if (colonOffset > 0) break; - alert(get_localized_string("NeedValidURL")); - } - - promptStr = get_localized_string("NewBookmarkNamePrompt"); - nameVal = prompt(promptStr, ""); - if (!nameVal || nameVal=="") return false; - } - else if (cmdName == NC_NS + "command?cmd=newfolder") - { - promptStr = get_localized_string("NewFolderNamePrompt"); - nameVal = prompt(promptStr, ""); - if (!nameVal || nameVal=="") return false; - } - else if ((cmdName == NC_NS + "command?cmd=deletebookmark") || - (cmdName == NC_NS + "command?cmd=deletebookmarkfolder") || - (cmdName == NC_NS + "command?cmd=deletebookmarkseparator")) - { - return doDelete(true); - //var promptStr = get_localized_string("DeleteItems"); - //if (!confirm(promptStr)) return false; - } - else if (cmdName == NC_NS + "command?cmd=import") - { - try - { - picker_uri = "@mozilla.org/filepicker;1"; - filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker); - if (!filePicker) return false; - - promptStr = get_localized_string("SelectImport"); - filePicker.init(window, promptStr, nsIFilePicker.modeOpen); - filePicker.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterAll); - if (filePicker.show() != nsIFilePicker.returnCancel) - var filename = filePicker.fileURL.spec; - if ((!filename) || (filename == "")) return false; - - urlVal = filename; - } - catch(ex) - { - return false; - } - } - else if (cmdName == NC_NS + "command?cmd=export") - { - try - { - picker_uri = "@mozilla.org/filepicker;1"; - filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker); - if (!filePicker) return false; - - promptStr = get_localized_string("EnterExport"); - filePicker.init(window, promptStr, nsIFilePicker.modeSave); - filePicker.defaultString = "bookmarks.html"; - filePicker.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterAll); - if (filePicker.show() != nsIFilePicker.returnCancel && - filePicker.fileURL.spec && - filePicker.fileURL.spec.length > 0) { - urlVal = filePicker.fileURL.spec; - } else { - return false; - } - } - catch(ex) - { - return false; - } - } - - var treeNode = document.getElementById("bookmarksTree"); - if (!treeNode) return false; - var db = treeNode.database; - if (!db) return false; - - var compositeDB = db.QueryInterface(Components.interfaces.nsIRDFDataSource); - if (!compositeDB) return false; - - var isupports_uri = "@mozilla.org/rdf/rdf-service;1"; - var isupports = Components.classes[isupports_uri].getService(); - if (!isupports) return false; - var rdf = isupports.QueryInterface(Components.interfaces.nsIRDFService); - if (!rdf) return false; - - // need a resource for the command - var cmdResource = rdf.GetResource(cmdName); - if (!cmdResource) return false; - cmdResource = cmdResource.QueryInterface(Components.interfaces.nsIRDFResource); - if (!cmdResource) return false; - - // set up selection nsISupportsArray - var selection_uri = "@mozilla.org/supports-array;1"; - var selectionInstance = Components.classes[selection_uri].createInstance(); - var selectionArray = selectionInstance.QueryInterface(Components.interfaces.nsISupportsArray); - - // set up arguments nsISupportsArray - var arguments_uri = "@mozilla.org/supports-array;1"; - var argumentsInstance = Components.classes[arguments_uri].createInstance(); - var argumentsArray = argumentsInstance.QueryInterface(Components.interfaces.nsISupportsArray); - - // get various arguments (parent, name) - var parentArc = rdf.GetResource(NC_NS + "parent"); - if (!parentArc) return false; - var nameArc = rdf.GetResource(NC_NS + "Name"); - if (!nameArc) return false; - var urlArc = rdf.GetResource(NC_NS + "URL"); - if (!urlArc) return false; - - var select_list = treeNode.selectedItems; - - var uri; - var rdfNode; - - if (select_list.length < 1) - { - // if nothing is selected, default to using the "ref" - // on the root of the tree - uri = treeNode.getAttribute("ref"); - if (!uri || uri=="") return false; - rdfNode = rdf.GetResource(uri); - // add node into selection array - if (rdfNode) - { - selectionArray.AppendElement(rdfNode); - } - - // add singular arguments into arguments array - if ((nameVal) && (nameVal != "")) - { - var nameLiteral = rdf.GetLiteral(nameVal); - if (!nameLiteral) return false; - argumentsArray.AppendElement(nameArc); - argumentsArray.AppendElement(nameLiteral); - } - if ((urlVal) && (urlVal != "")) - { - var urlLiteral = rdf.GetLiteral(urlVal); - if (!urlLiteral) return false; - argumentsArray.AppendElement(urlArc); - argumentsArray.AppendElement(urlLiteral); - } - } - else for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++) - { - var node = select_list[nodeIndex]; - if (!node) break; - uri = node.getAttribute("ref"); - if ((uri) || (uri == "")) - { - uri = node.getAttribute("id"); - } - if (!uri) return false; - - rdfNode = rdf.GetResource(uri); - if (!rdfNode) break; - - // add node into selection array - selectionArray.AppendElement(rdfNode); - - // get the parent's URI - var parentURI = ""; - var theParent = node.parentNode.parentNode; - parentURI = theParent.getAttribute("ref"); - if ((!parentURI) || (parentURI == "")) - { - parentURI = theParent.getAttribute("id"); - } - if (parentURI == "") return false; - - var parentNode = rdf.GetResource(parentURI, true); - if (!parentNode) return false; - - // add multiple arguments into arguments array - argumentsArray.AppendElement(parentArc); - argumentsArray.AppendElement(parentNode); - - if ((nameVal) && (nameVal != "")) - { - var nameLiteral2 = rdf.GetLiteral(nameVal); - if (!nameLiteral2) return false; - argumentsArray.AppendElement(nameArc); - argumentsArray.AppendElement(nameLiteral2); - } - if ((urlVal) && (urlVal != "")) - { - var urlLiteral2 = rdf.GetLiteral(urlVal); - if (!urlLiteral2) return false; - argumentsArray.AppendElement(urlArc); - argumentsArray.AppendElement(urlLiteral2); - } - } - - // do the command - compositeDB.DoCommand(selectionArray, cmdResource, argumentsArray); - return true; -} - -function bookmarkSelect() -{ - var tree = document.getElementById("bookmarksTree"); - var status = document.getElementById("statusbar-text"); - var val = ""; - if (tree.selectedItems.length == 1) - { - val = getAbsoluteID("bookmarksTree", tree.selectedItems[0]); - - // Ignore "NC:" urls. - if (val.substring(0, 3) == "NC:") - { - val = ""; - } - } - status.label = val; - return true; -} diff --git a/xpfe/components/bookmarks/resources/bookmarks.xml b/xpfe/components/bookmarks/resources/bookmarks.xml index 79cdebb95a7..084a4e1ef59 100644 --- a/xpfe/components/bookmarks/resources/bookmarks.xml +++ b/xpfe/components/bookmarks/resources/bookmarks.xml @@ -788,7 +788,7 @@ var len = {}; trans.getAnyTransferData(bestFlavor, dataObj, len); if (dataObj) - dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); + dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); if (!dataObj) continue; sourceUri = dataObj.data.substring(0, len.value); @@ -1046,7 +1046,7 @@ var length = { }; xferable.getAnyTransferData(flavour, data, length); var nodes = []; var names = []; - data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data; + data = data.value.QueryInterface(Components.interfaces.nsISupportsString).data; switch (flavour.value) { case "moz/bookmarkclipboarditem": nodes = data.split("\n"); @@ -1130,8 +1130,8 @@ const kRDFContractID = "@mozilla.org/rdf/rdf-service;1"; const kRDFIID = Components.interfaces.nsIRDFService; const ksRDF = Components.classes[kRDFContractID].getService(kRDFIID); - const kSuppWStringContractID = "@mozilla.org/supports-wstring;1"; - const kSuppWStringIID = Components.interfaces.nsISupportsWString; + const kSuppWStringContractID = "@mozilla.org/supports-string;1"; + const kSuppWStringIID = Components.interfaces.nsISupportsString; var bmstring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); var unicodestring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); var htmlstring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); diff --git a/xpfe/components/bookmarks/resources/bookmarksDD-temp.js b/xpfe/components/bookmarks/resources/bookmarksDD-temp.js index 5d6ec7b10a8..e69de29bb2d 100644 --- a/xpfe/components/bookmarks/resources/bookmarksDD-temp.js +++ b/xpfe/components/bookmarks/resources/bookmarksDD-temp.js @@ -1,508 +0,0 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - This is the old bookmarks code, included here for the sake of the bookmarks sidebar panel, - which will be fixed to use my new code in .9. In the mean time, this file provides a - life line to various functionality. - */ - - -var NC_NS = "http://home.netscape.com/NC-rdf#"; -var RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; - - - -function TopLevelDrag ( event ) -{ - return(true); -} - - -function BeginDragTree ( event ) -{ - //XXX we rely on a capturer to already have determined which item the mouse was over - //XXX and have set an attribute. - - // if the click is on the tree proper, ignore it. We only care about clicks on items. - - var tree = document.getElementById("bookmarksTree"); - if ( event.target == tree || event.target.localName == "treechildren" ) - return(true); // continue propagating the event - - var childWithDatabase = tree; - if ( ! childWithDatabase ) - return(false); - - var dragStarted = false; - - var trans = - Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); - if ( !trans ) return(false); - - var genData = - Components.classes["@mozilla.org/supports-wstring;1"].createInstance(Components.interfaces.nsISupportsWString); - if (!genData) return(false); - - var genDataURL = - Components.classes["@mozilla.org/supports-wstring;1"].createInstance(Components.interfaces.nsISupportsWString); - if (!genDataURL) return(false); - - trans.addDataFlavor("text/unicode"); - trans.addDataFlavor("moz/rdfitem"); - - // ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is - // the target of the event. - var id = event.target.parentNode.parentNode.getAttribute("ref"); - if (!id || id=="") - { - id = event.target.parentNode.parentNode.getAttribute("id"); - } - - var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref"); - if (!parentID || parentID == "") - { - parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id"); - } - - var trueID = id; - if (parentID != null) - { - trueID += "\n" + parentID; - } - genData.data = trueID; - genDataURL.data = id; - - var database = childWithDatabase.database; - var rdf = - Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); - if ((!rdf) || (!database)) { dump("CAN'T GET DATABASE\n"); return(false); } - - // make sure its a bookmark, bookmark separator, or bookmark folder - var src = rdf.GetResource(id, true); - var prop = rdf.GetResource(RDF_NS + "type", true); - var target = database.GetTarget(src, prop, true); - - if (target) target = target.QueryInterface(Components.interfaces.nsIRDFResource); - if (target) target = target.Value; - if ((!target) || (target == "")) {dump("BAD\n"); return(false);} - - if ((target != NC_NS + "BookmarkSeparator") && - (target != NC_NS + "Bookmark") && - (target != NC_NS + "Folder")) return(false); - - trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data - trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data - - var transArray = - Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); - if ( !transArray ) return(false); - - // put it into the transferable as an |nsISupports| - var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); - transArray.AppendElement(genTrans); - - var dragService = - Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService); - if ( !dragService ) return(false); - - var nsIDragService = Components.interfaces.nsIDragService; - dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + - nsIDragService.DRAGDROP_ACTION_MOVE ); - dragStarted = true; - - return(!dragStarted); -} - - - -function DragOverTree ( event ) -{ - var validFlavor = false; - var dragSession = null; - var retVal = true; - - var dragService = - Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService); - if ( !dragService ) return(false); - - dragSession = dragService.getCurrentSession(); - if ( !dragSession ) return(false); - - if ( dragSession.isDataFlavorSupported("moz/rdfitem") ) validFlavor = true; - else if ( dragSession.isDataFlavorSupported("text/unicode") ) validFlavor = true; - //XXX other flavors here... - - // touch the attribute on the rowgroup to trigger the repaint with the drop feedback. - if ( validFlavor ) - { - var treeRoot = document.getElementById("bookmarksTree"); - if (!treeRoot) return(false); - var treeDatabase = treeRoot.database; - if (!treeDatabase) return(false); - - //XXX this is really slow and likes to refresh N times per second. - var rowGroup = event.target.parentNode.parentNode; - var sortActive = treeRoot.getAttribute("sortActive"); - if (sortActive == "true") - rowGroup.setAttribute ( "dd-triggerrepaintsorted", 0 ); - else - rowGroup.setAttribute ( "dd-triggerrepaint", 0 ); - - dragSession.canDrop = true; - // necessary?? - retVal = false; - } - return(retVal); -} - - - -function DropOnTree ( event ) -{ - var treeRoot = document.getElementById("bookmarksTree"); - if (!treeRoot) return(false); - var treeDatabase = treeRoot.database; - if (!treeDatabase) return(false); - - // for beta1, don't allow D&D if sorting is active - var sortActive = treeRoot.getAttribute("sortActive"); - if (sortActive == "true") - { - dump("Sorry, drag&drop is currently disabled when sorting is active.\n"); - return(false); - } - - var RDF = - Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); - if (!RDF) return(false); - var RDFC = - Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); - if (!RDFC) return(false); - - var Bookmarks = RDF.GetDataSource("rdf:bookmarks"); - if (!Bookmarks) return(false); - - // target is the <treecell>, and "ref/id" is on the <treeitem> two levels above - var treeItem = event.target.parentNode.parentNode; - if (!treeItem) return(false); - - // get drop hint attributes - var dropBefore = treeItem.getAttribute("dd-droplocation"); - var dropOn = treeItem.getAttribute("dd-dropon"); - - // calculate drop action - var dropAction; - if (dropBefore == "true") dropAction = "before"; - else if (dropOn == "true") dropAction = "on"; - else dropAction = "after"; - - // calculate parent container node - var containerItem = treeItem; - if (dropAction != "on") - { - containerItem = treeItem.parentNode.parentNode; - } - - // magical fix for bug # 33546: handle dropping after open container - if (treeItem.getAttribute("container") == "true") - { - if (treeItem.getAttribute("open") == "true") - { - if (dropAction == "after") - { - dropAction = "before"; - containerItem = treeItem; - - // find <treechildren>, drop before first child - var treeChildren = treeItem; - treeItem = null; - for (var x = 0; x < treeChildren.childNodes.length; x++) - { - if (treeChildren.childNodes[x].tagName == "treechildren") - { - treeItem = treeChildren.childNodes[x].childNodes[0]; - break; - } - } - - if (!treeItem) - { - dropAction = "on"; - containerItem = treeItem.parentNode.parentNode; - } - } - } - } - - var targetID = getAbsoluteID("bookmarksTree", treeItem); - if (!targetID) return(false); - var targetNode = RDF.GetResource(targetID, true); - if (!targetNode) return(false); - - var containerID = getAbsoluteID("bookmarksTree", containerItem); - if (!containerID) return(false); - var containerNode = RDF.GetResource(containerID); - if (!containerNode) return(false); - - var dragService = - Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService); - if ( !dragService ) return(false); - - var dragSession = dragService.getCurrentSession(); - if ( !dragSession ) return(false); - - var trans = - Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); - if ( !trans ) return(false); - trans.addDataFlavor("moz/rdfitem"); - trans.addDataFlavor("text/x-moz-url"); - trans.addDataFlavor("text/unicode"); - - var typeRes = RDF.GetResource(RDF_NS + "type"); - if (!typeRes) return false; - var bmTypeRes = RDF.GetResource(NC_NS + "Bookmark"); - if (!bmTypeRes) return false; - - var dirty = false; - - for ( var i = 0; i < dragSession.numDropItems; ++i ) - { - dragSession.getData ( trans, i ); - var dataObj = new Object(); - var bestFlavor = new Object(); - var len = new Object(); - trans.getAnyTransferData ( bestFlavor, dataObj, len ); - if ( dataObj ) dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString); - if ( !dataObj ) continue; - - var sourceID = null; - var parentID = null; - var checkNameHack = false; - var name=null; - - if (bestFlavor.value == "moz/rdfitem") - { - // pull the URL out of the data object - var data = dataObj.data.substring(0, len.value / 2); - - // moz/rdfitem allows parent ID specified on next line; check for it - var cr = data.indexOf("\n"); - if (cr >= 0) - { - sourceID = data.substr(0, cr); - parentID = data.substr(cr+1); - } - else - { - sourceID = data; - } - } - else if (bestFlavor.value == "text/x-moz-url") - { - // pull the URL out of the data object - data = dataObj.data.substring(0, len.value / 2); - sourceID = data; - - // we may need to synthesize a name (just use the URL) - checkNameHack = true; - } - else if (bestFlavor.value == "text/unicode") - { - sourceID = dataObj.data; - - // we may need to synthesize a name (just use the URL) - checkNameHack = true; - } - else - { - // unknown flavor, skip - continue; - } - - // pull the (optional) name out of the URL - var separator = sourceID.indexOf("\n"); - if (separator >= 0) - { - name = sourceID.substr(separator+1); - sourceID = sourceID.substr(0, separator); - } - - var sourceNode = RDF.GetResource(sourceID, true); - if (!sourceNode) continue; - - var parentNode = null; - if (parentID != null) - { - parentNode = RDF.GetResource(parentID, true); - } - - // Prevent dropping of a node before, after, or on itself - if (sourceNode == targetNode) continue; - // Prevent dropping of a node onto its parent container - if ((dropAction == "on") && (containerID) && (containerID == parentID)) continue; - - RDFC.Init(Bookmarks, containerNode); - - // make sure appropriate bookmark type is set - var bmTypeNode = Bookmarks.GetTarget( sourceNode, typeRes, true ); - if (!bmTypeNode) - { - // set default bookmark type - Bookmarks.Assert(sourceNode, typeRes, bmTypeRes, true); - } - - if ((dropAction == "before") || (dropAction == "after")) - { - // drop before or after - var nodeIndex; - - nodeIndex = RDFC.IndexOf(sourceNode); - - if (nodeIndex >= 1) - { - // moving a node around inside of the container - // so remove, then re-add the node - RDFC.RemoveElementAt(nodeIndex, true, sourceNode); - } - - nodeIndex = RDFC.IndexOf(targetNode); - - if (nodeIndex < 1) return(false); - if (dropAction == "after") ++nodeIndex; - - RDFC.InsertElementAt(sourceNode, nodeIndex, true); - - // select the newly added node - if (parentID) - { - selectDroppedItems(treeRoot, containerID, sourceID); - } - - dirty = true; - } - else - { - // drop on - RDFC.AppendElement(sourceNode); - - // select the newly added node - if (parentID) - { - selectDroppedItems(treeRoot, containerID, sourceID); - } - - dirty = true; - } - - if ((checkNameHack == true) || (name != null)) - { - var srcArc = RDF.GetResource(sourceID, true); - var propArc = RDF.GetResource(NC_NS + "Name", true); - if (srcArc && propArc && Bookmarks) - { - var targetArc = Bookmarks.GetTarget(srcArc, propArc, true); - if (!targetArc) - { - // if no name, fallback to using the URL as the name - var defaultNameArc = RDF.GetLiteral((name != null && name != "") ? name : sourceID); - if (defaultNameArc) - { - Bookmarks.Assert(srcArc, propArc, defaultNameArc, true); - } - } - } - } - } - - // should we move the node? (i.e. take it out of the source container?) - if ((parentNode != null) && (containerNode != parentNode)) - { - try - { - RDFC.Init(Bookmarks, parentNode); - nodeIndex = RDFC.IndexOf(sourceNode); - - if (nodeIndex >= 1) - { - RDFC.RemoveElementAt(nodeIndex, true, sourceNode); - } - } - catch(ex) - { - } - } - - if (dirty == true) - { - var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - if (remote) - { - remote.Flush(); - } - } - - return(false); -} - - - -function selectDroppedItems(treeRoot, containerID, targetID) -{ - var select_list = treeRoot.getElementsByAttribute("id", targetID); - for (var x=0; x<select_list.length; x++) - { - var node = select_list[x]; - if (!node) continue; - - var parent = node.parentNode.parentNode; - if (!parent) continue; - - var id = parent.getAttribute("ref"); - if (!id || id=="") - { - id = parent.getAttribute("id"); - } - if (!id || id=="") continue; - - if (id == containerID) - { - treeRoot.selectItem(node); - break; - } - } -} diff --git a/xpfe/components/bookmarks/resources/bookmarksOverlay.js b/xpfe/components/bookmarks/resources/bookmarksOverlay.js index 83fb800cc66..0294b345496 100644 --- a/xpfe/components/bookmarks/resources/bookmarksOverlay.js +++ b/xpfe/components/bookmarks/resources/bookmarksOverlay.js @@ -429,8 +429,8 @@ BookmarksUIElement.prototype = { const kSuppArrayIID = Components.interfaces.nsISupportsArray; var itemArray = Components.classes[kSuppArrayContractID].createInstance(kSuppArrayIID); - const kSuppWStringContractID = "@mozilla.org/supports-wstring;1"; - const kSuppWStringIID = Components.interfaces.nsISupportsWString; + const kSuppWStringContractID = "@mozilla.org/supports-string;1"; + const kSuppWStringIID = Components.interfaces.nsISupportsString; var bmstring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); var unicodestring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); var htmlstring = Components.classes[kSuppWStringContractID].createInstance(kSuppWStringIID); @@ -485,7 +485,7 @@ BookmarksUIElement.prototype = { var length = { }; xferable.getAnyTransferData(flavour, data, length); var nodes = []; var names = []; - data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data; + data = data.value.QueryInterface(Components.interfaces.nsISupportsString).data; switch (flavour.value) { case "moz/bookmarkclipboarditem": nodes = data.split("\n"); @@ -581,8 +581,8 @@ BookmarksUIElement.prototype = { const kSuppArrayContractID = "@mozilla.org/supports-array;1"; const kSuppArrayIID = Components.interfaces.nsISupportsArray; var flavourArray = Components.classes[kSuppArrayContractID].createInstance(kSuppArrayIID); - const kSuppStringContractID = "@mozilla.org/supports-string;1"; - const kSuppStringIID = Components.interfaces.nsISupportsString; + const kSuppStringContractID = "@mozilla.org/supports-cstring;1"; + const kSuppStringIID = Components.interfaces.nsISupportsCString; var flavours = ["moz/bookmarkclipboarditem", "text/x-moz-url"]; for (var i = 0; i < flavours.length; ++i) { diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index 35ff01538e7..67a8f152319 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -2518,7 +2518,7 @@ nsBookmarksService::OnStopRequest(nsIRequest* request, nsISupports *ctxt, nsCOMPtr<nsISupportsArray> suppArray; rv = NS_NewISupportsArray(getter_AddRefs(suppArray)); if (NS_FAILED(rv)) return rv; - nsCOMPtr<nsISupportsString> suppString(do_CreateInstance("@mozilla.org/supports-string;1", &rv)); + nsCOMPtr<nsISupportsCString> suppString(do_CreateInstance("@mozilla.org/supports-cstring;1", &rv)); if (!suppString) return rv; rv = suppString->SetData(uri); if (NS_FAILED(rv)) return rv; diff --git a/xpfe/components/console/resources/content/consoleBindings.xml b/xpfe/components/console/resources/content/consoleBindings.xml index 3e0e4e34bba..8209b8a5d23 100644 --- a/xpfe/components/console/resources/content/consoleBindings.xml +++ b/xpfe/components/console/resources/content/consoleBindings.xml @@ -288,8 +288,8 @@ transferable.addDataFlavor("text/unicode"); - const strURI = "@mozilla.org/supports-wstring;1"; - var wstring = Components.classes[strURI].createInstance(Components.interfaces.nsISupportsWString); + const strURI = "@mozilla.org/supports-string;1"; + var wstring = Components.classes[strURI].createInstance(Components.interfaces.nsISupportsString); wstring.data = aString; transferable.setTransferData("text/unicode", wstring, aString.length * 2); diff --git a/xpfe/components/directory/directory.js b/xpfe/components/directory/directory.js index 0c0ab48d0fc..fd118101e77 100644 --- a/xpfe/components/directory/directory.js +++ b/xpfe/components/directory/directory.js @@ -46,7 +46,7 @@ const DRAGSERVICE_CONTRACTID = "@mozilla.org/widget/dragservice;1"; const TRANSFERABLE_CONTRACTID = "@mozilla.org/widget/transferable;1"; const XULSORTSERVICE_CONTRACTID = "@mozilla.org/xul/xul-sort-service;1"; const ARRAY_CONTRACTID = "@mozilla.org/supports-array;1"; -const WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1"; +const WSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; const NC_NS = "http://home.netscape.com/NC-rdf#"; const NC_NAME = NC_NS + "Name"; @@ -60,7 +60,7 @@ const nsIXULSortService = Components.interfaces.nsIXULSortService; const nsIRDFService = Components.interfaces.nsIRDFService; const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral; const nsISupportsArray = Components.interfaces.nsISupportsArray; -const nsISupportsWString = Components.interfaces.nsISupportsWString; +const nsISupportsString = Components.interfaces.nsISupportsString; // By the time this runs, The 'HTTPIndex' variable will have been // magically set on the global object by the native code. @@ -259,13 +259,13 @@ function BeginDragTree (event) var transferable = Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable); var genDataURL = - Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); + Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString); var genDataHTML = - Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); + Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString); var genData = - Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); + Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString); var genDataURL = - Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); + Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsString); transferable.addDataFlavor("text/x-moz-url"); transferable.addDataFlavor("text/html"); diff --git a/xpfe/components/prefwindow/resources/content/pref-fonts.js b/xpfe/components/prefwindow/resources/content/pref-fonts.js index b1f6033e4c1..2b4b1c1662f 100644 --- a/xpfe/components/prefwindow/resources/content/pref-fonts.js +++ b/xpfe/components/prefwindow/resources/content/pref-fonts.js @@ -247,7 +247,7 @@ listElement.prototype = var fontName; while (aDataObject.hasMoreElements()) { fontName = aDataObject.getNext(); - fontName = fontName.QueryInterface(Components.interfaces.nsISupportsWString); + fontName = fontName.QueryInterface(Components.interfaces.nsISupportsString); var fontNameStr = fontName.toString(); if (strDefaultFontFace == "") strDefaultFontFace = fontNameStr; diff --git a/xpfe/components/prefwindow/resources/content/pref-history.xul b/xpfe/components/prefwindow/resources/content/pref-history.xul index a24ad034f20..2a01a65c395 100644 --- a/xpfe/components/prefwindow/resources/content/pref-history.xul +++ b/xpfe/components/prefwindow/resources/content/pref-history.xul @@ -45,7 +45,7 @@ var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var lastUrl = pref.getComplexValue("general.open_location.last_url", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; urlbarHistButton.disabled = ( urlBarHist.count == 0 && !lastUrl ) || isBtnLocked ; } catch(ex) { @@ -74,11 +74,11 @@ urlBarHistory.clearHistory(); var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = ""; pref.setComplexValue("general.open_location.last_url", - Components.interfaces.nsISupportsWString, + Components.interfaces.nsISupportsString, str); } ]]> diff --git a/xpfe/components/prefwindow/resources/content/pref-themes.js b/xpfe/components/prefwindow/resources/content/pref-themes.js index 9566ff4e7f1..e65cbbe26a2 100644 --- a/xpfe/components/prefwindow/resources/content/pref-themes.js +++ b/xpfe/components/prefwindow/resources/content/pref-themes.js @@ -65,7 +65,7 @@ function Startup() var theme = null; try { theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (e) { } var matches; @@ -106,7 +106,7 @@ function applySkin() var theme = null; try { theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch (e) { } @@ -122,11 +122,11 @@ function applySkin() var inUse = reg.isSkinSelected(data.name, true); if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return; - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = data.name; - kPrefSvc.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); + kPrefSvc.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); diff --git a/xpfe/components/startup/src/nsCommandLineServiceMac.cpp b/xpfe/components/startup/src/nsCommandLineServiceMac.cpp index 34013a77f9b..acabe1deee4 100644 --- a/xpfe/components/startup/src/nsCommandLineServiceMac.cpp +++ b/xpfe/components/startup/src/nsCommandLineServiceMac.cpp @@ -322,7 +322,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) //---------------------------------------------------------------------------------------- { nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1")); - nsCOMPtr<nsISupportsWString> urlWrapper(do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID)); + nsCOMPtr<nsISupportsString> urlWrapper(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID)); if (!wwatch || !urlWrapper) return NS_ERROR_FAILURE; diff --git a/xpfe/components/xremote/src/XRemoteService.cpp b/xpfe/components/xremote/src/XRemoteService.cpp index 01681c5b1e3..841357f0ccc 100644 --- a/xpfe/components/xremote/src/XRemoteService.cpp +++ b/xpfe/components/xremote/src/XRemoteService.cpp @@ -646,8 +646,8 @@ XRemoteService::OpenURL(nsCString &aArgument, if (!urlString) return NS_ERROR_FAILURE; - nsCOMPtr<nsISupportsWString> arg; - arg = do_CreateInstance(NS_SUPPORTS_WSTRING_CONTRACTID); + nsCOMPtr<nsISupportsString> arg; + arg = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID); if (!arg) return NS_ERROR_FAILURE; diff --git a/xpfe/global/resources/content/charsetOverlay.js b/xpfe/global/resources/content/charsetOverlay.js index ee819ed6b36..66381bb4455 100644 --- a/xpfe/global/resources/content/charsetOverlay.js +++ b/xpfe/global/resources/content/charsetOverlay.js @@ -74,12 +74,12 @@ function SelectDetector(event, doReload) try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = prefvalue; pref.setComplexValue("intl.charset.detector", - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); if (doReload) window._content.location.reload(); } catch (ex) { @@ -100,12 +100,12 @@ function ComposerSelectDetector(event) try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = prefvalue; pref.setComplexValue("intl.charset.detector", - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); editorShell.LoadUrl(editorShell.editorDocument.location); } catch (ex) { diff --git a/xpfe/global/resources/content/nsJSSupportsUtils.js b/xpfe/global/resources/content/nsJSSupportsUtils.js index cf838af16ca..e69de29bb2d 100644 --- a/xpfe/global/resources/content/nsJSSupportsUtils.js +++ b/xpfe/global/resources/content/nsJSSupportsUtils.js @@ -1,59 +0,0 @@ -/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Ben Matthew Goodger <ben@netscape.com> - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var nsJSSupportsUtils = { - - createSupportsArray: function () - { - return Components.classes["@mozilla.org/supports-array;1"] - .createInstance(Components.interfaces.nsISupportsArray); - }, - - createSupportsWString: function () - { - return Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); - }, - - createSupportsString: function () - { - return Components.classes["@mozilla.org/supports-string;1"] - .createInstance(Components.interfaces.nsISupportsString); - } - -}; diff --git a/xpfe/global/resources/content/nsTransferable.js b/xpfe/global/resources/content/nsTransferable.js index 76de360f780..e50147ccc5c 100644 --- a/xpfe/global/resources/content/nsTransferable.js +++ b/xpfe/global/resources/content/nsTransferable.js @@ -68,10 +68,10 @@ var nsTransferable = { trans.addDataFlavor(currFlavour); var supports = null; // nsISupports data var length = 0; - if (currData.flavour.dataIIDKey == "nsISupportsWString") + if (currData.flavour.dataIIDKey == "nsISupportsString") { - supports = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + supports = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); supports.data = currData.supports; length = supports.data.length; @@ -199,7 +199,7 @@ FlavourSet.prototype = { function Flavour(aContentType, aDataIIDKey) { this.contentType = aContentType; - this.dataIIDKey = aDataIIDKey || "nsISupportsWString"; + this.dataIIDKey = aDataIIDKey || "nsISupportsString"; this._XferID = "Flavour"; } @@ -271,10 +271,10 @@ FlavourData.prototype = { get data () { if (this.flavour && - this.flavour.dataIIDKey != "nsISupportsWString" ) + this.flavour.dataIIDKey != "nsISupportsString" ) return this.supports.QueryInterface(Components.interfaces[this.flavour.dataIIDKey]); else { - var unicode = this.supports.QueryInterface(Components.interfaces.nsISupportsWString); + var unicode = this.supports.QueryInterface(Components.interfaces.nsISupportsString); if (unicode) return unicode.data.substring(0, this.contentLength/2); diff --git a/xpfe/global/resources/content/nsTreeController.js b/xpfe/global/resources/content/nsTreeController.js index 4e7a7c4475e..06b8b0d3410 100644 --- a/xpfe/global/resources/content/nsTreeController.js +++ b/xpfe/global/resources/content/nsTreeController.js @@ -42,10 +42,10 @@ const nsTransferable_contractid = "@mozilla.org/widget/transferable;1"; const clipboard_contractid = "@mozilla.org/widget/clipboard;1"; const rdf_contractid = "@mozilla.org/rdf/rdf-service;1"; -const supportswstring_contractid = "@mozilla.org/supports-wstring;1"; +const supportswstring_contractid = "@mozilla.org/supports-string;1"; const rdfc_contractid = "@mozilla.org/rdf/container;1"; -const nsISupportsWString = Components.interfaces.nsISupportsWString; +const nsISupportsString = Components.interfaces.nsISupportsString; const nsIClipboard = Components.interfaces.nsIClipboard; const nsITransferable = Components.interfaces.nsITransferable; const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral; @@ -68,7 +68,7 @@ function nsTreeController_SetTransferData(transferable, flavor, text) { if (!text) return; - var textData = Components.classes[supportswstring_contractid].createInstance(nsISupportsWString); + var textData = Components.classes[supportswstring_contractid].createInstance(nsISupportsString); textData.data = text; transferable.addDataFlavor(flavor); diff --git a/xpfe/global/resources/content/nsUserSettings.js b/xpfe/global/resources/content/nsUserSettings.js index b1bc3135177..5297a00447f 100644 --- a/xpfe/global/resources/content/nsUserSettings.js +++ b/xpfe/global/resources/content/nsUserSettings.js @@ -38,11 +38,11 @@ var nsPreferences = { { try { - var str = Components.classes["@mozilla.org/supports-wstring;1"] - .createInstance(Components.interfaces.nsISupportsWString); + var str = Components.classes["@mozilla.org/supports-string;1"] + .createInstance(Components.interfaces.nsISupportsString); str.data = aPrefValue; this.mPrefService.setComplexValue(aPrefName, - Components.interfaces.nsISupportsWString, str); + Components.interfaces.nsISupportsString, str); } catch(e) { @@ -54,7 +54,7 @@ var nsPreferences = { try { return this.mPrefService.getComplexValue(aPrefName, - Components.interfaces.nsISupportsWString).data; + Components.interfaces.nsISupportsString).data; } catch(e) { diff --git a/xpfe/global/resources/content/printdialog.js b/xpfe/global/resources/content/printdialog.js index 8060af505b0..40cc6ea893e 100644 --- a/xpfe/global/resources/content/printdialog.js +++ b/xpfe/global/resources/content/printdialog.js @@ -143,7 +143,7 @@ listElement.prototype = // build popup menu from printer names while (aDataObject.hasMoreElements()) { printerName = aDataObject.getNext(); - printerName = printerName.QueryInterface(Components.interfaces.nsISupportsWString); + printerName = printerName.QueryInterface(Components.interfaces.nsISupportsString); var printerNameStr = printerName.toString(); if (strDefaultPrinterName == "") strDefaultPrinterName = printerNameStr;