From 436d43f211110fa3bb42310d0525bb8773d6de42 Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Sun, 16 Dec 2001 11:58:03 +0000 Subject: [PATCH] Bug 104158: Use NS_LITERAL_STRING instead of XXXWithConversion("..."). r=bryner, rs=alecf git-svn-id: svn://10.0.0.236/trunk@110579 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/xul/nsXULMenuAccessible.cpp | 4 +- mozilla/caps/src/nsScriptSecurityManager.cpp | 4 +- mozilla/caps/src/nsSystemPrincipal.cpp | 2 +- mozilla/chrome/src/nsChromeRegistry.cpp | 6 +- .../content/base/src/nsDocumentEncoder.cpp | 8 +- mozilla/content/base/src/nsDocumentViewer.cpp | 2 +- mozilla/content/base/src/nsGenericElement.cpp | 31 +-- .../base/src/nsHTMLContentSerializer.cpp | 6 +- .../base/src/nsPlainTextSerializer.cpp | 10 +- .../base/src/nsXMLContentSerializer.cpp | 2 +- .../events/src/nsEventListenerManager.cpp | 22 +- .../events/src/nsEventStateManager.cpp | 2 +- .../html/content/src/nsFormSubmitter.cpp | 6 +- .../html/content/src/nsGenericHTMLElement.cpp | 2 +- .../html/content/src/nsHTMLButtonElement.cpp | 3 +- .../html/content/src/nsHTMLInputElement.cpp | 4 +- .../html/document/src/nsHTMLContentSink.cpp | 8 +- .../html/document/src/nsHTMLDocument.cpp | 16 +- .../html/document/src/nsImageDocument.cpp | 4 +- .../html/style/src/nsCSSDeclaration.cpp | 10 +- .../content/html/style/src/nsCSSParser.cpp | 18 +- .../content/html/style/src/nsCSSScanner.cpp | 39 +-- .../content/html/style/src/nsCSSStruct.cpp | 10 +- .../content/html/style/src/nsCSSStyleRule.cpp | 4 +- .../html/style/src/nsCSSStyleSheet.cpp | 2 +- .../html/style/src/nsHTMLAttributes.cpp | 10 +- .../html/style/src/nsHTMLCSSStyleSheet.cpp | 4 +- .../html/style/src/nsHTMLStyleSheet.cpp | 2 +- .../html/style/src/nsROCSSPrimitiveValue.cpp | 10 +- mozilla/content/shared/src/nsStyleCoord.cpp | 36 +-- mozilla/content/xbl/src/nsXBLBinding.cpp | 2 +- .../content/xbl/src/nsXBLPrototypeHandler.cpp | 2 +- .../content/xml/content/src/nsXMLElement.cpp | 18 +- .../content/xml/content/src/nsXMLEntity.cpp | 10 +- .../content/xml/content/src/nsXMLNotation.cpp | 8 +- .../xml/document/src/nsXMLContentSink.cpp | 5 +- .../xul/content/src/nsXULPopupListener.cpp | 40 +-- .../xul/content/src/nsXULTreeElement.cpp | 10 +- .../xul/document/src/nsXULContentSink.cpp | 4 +- .../xul/document/src/nsXULDocument.cpp | 2 +- .../xul/templates/src/nsXULContentBuilder.cpp | 2 +- .../xul/templates/src/nsXULContentUtils.cpp | 2 +- .../templates/src/nsXULTemplateBuilder.cpp | 8 +- mozilla/docshell/base/nsDefaultURIFixup.cpp | 6 +- mozilla/docshell/base/nsDocShell.cpp | 8 +- mozilla/docshell/base/nsWebShell.cpp | 4 +- mozilla/dom/src/base/nsGlobalWindow.cpp | 4 +- mozilla/dom/src/base/nsJSEnvironment.cpp | 30 +-- mozilla/dom/src/events/nsJSEventListener.cpp | 4 +- .../composer/src/nsComposerCommands.cpp | 4 +- mozilla/editor/composer/src/nsEditorShell.cpp | 12 +- .../editor/libeditor/html/nsHTMLEditor.cpp | 2 +- .../activex/src/control/MozillaBrowser.cpp | 6 +- mozilla/embedding/browser/build/makefile.win | 1 + .../embedding/browser/macbuild/webBrowser.xml | 58 +++++ .../photon/src/nsPrintSettingsImpl.cpp | 8 +- .../powerplant/source/CBrowserShell.cpp | 2 +- .../embedding/browser/webBrowser/Makefile.in | 1 + .../embedding/browser/webBrowser/makefile.win | 1 + .../webBrowser/nsDocShellTreeOwner.cpp | 11 +- .../src/nsWebBrowserPersist.cpp | 14 +- .../windowwatcher/src/nsWindowWatcher.cpp | 2 +- .../tests/mfcembed/nsPrintSettingsImpl.cpp | 8 +- .../accessproxy/nsAccessProxy.cpp | 2 +- mozilla/extensions/cookie/nsCookies.cpp | 4 +- mozilla/extensions/cookie/nsPermissions.cpp | 2 +- mozilla/extensions/finger/nsFingerChannel.cpp | 6 +- .../extensions/p3p/src/nsP3PDataStruct.cpp | 2 +- .../extensions/p3p/src/nsP3PObserverHTML.cpp | 2 +- .../extensions/p3p/src/nsP3PObserverXML.cpp | 2 +- mozilla/extensions/p3p/src/nsP3PPolicy.cpp | 24 +- .../extensions/p3p/src/nsP3PPolicyRefFile.cpp | 10 +- .../extensions/p3p/src/nsP3PPrivacyResult.cpp | 10 +- mozilla/extensions/p3p/src/nsP3PService.cpp | 20 +- mozilla/extensions/p3p/src/nsP3PTags.cpp | 2 +- .../extensions/p3p/src/nsP3PXMLProcessor.cpp | 2 +- .../extensions/wallet/src/nsWalletService.cpp | 7 +- mozilla/extensions/wallet/src/singsign.cpp | 2 +- mozilla/extensions/wallet/src/wallet.cpp | 10 +- .../xmlextras/base/src/nsDOMParser.cpp | 2 +- .../xmlextras/base/src/nsXMLHttpRequest.cpp | 2 +- .../xmlterm/base/mozXMLTermListeners.cpp | 32 +-- .../xmlterm/base/mozXMLTermSession.cpp | 234 +++++++++--------- .../xmlterm/base/mozXMLTermStream.cpp | 12 +- .../xmlterm/base/mozXMLTerminal.cpp | 2 +- mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp | 2 +- mozilla/gfx/src/mac/nsDeviceContextMac.cpp | 22 +- mozilla/gfx/src/mac/nsFontMetricsMac.cpp | 18 +- .../gfx/src/mac/nsUnicodeFontMappingMac.cpp | 4 +- mozilla/gfx/src/nsDeviceContext.cpp | 14 +- mozilla/gfx/src/nsPrintOptionsImpl.cpp | 8 +- mozilla/gfx/src/nsRect.cpp | 10 +- mozilla/gfx/src/os2/nsDeviceContextOS2.cpp | 22 +- mozilla/gfx/src/os2/nsFontMetricsOS2.cpp | 6 +- mozilla/gfx/src/photon/nsDeviceContextPh.cpp | 8 +- mozilla/gfx/src/ps/nsPostScriptObj.cpp | 2 +- mozilla/htmlparser/robot/nsDebugRobot.cpp | 8 +- mozilla/htmlparser/robot/nsRobotSink.cpp | 4 +- mozilla/htmlparser/src/CNavDTD.cpp | 9 +- mozilla/htmlparser/src/COtherDTD.cpp | 7 +- mozilla/htmlparser/src/nsDTDUtils.cpp | 15 +- mozilla/htmlparser/src/nsExpatTokenizer.cpp | 14 +- .../src/nsHTMLContentSinkStream.cpp | 24 +- mozilla/htmlparser/src/nsHTMLTokenizer.cpp | 8 +- mozilla/htmlparser/src/nsHTMLTokens.cpp | 34 +-- mozilla/htmlparser/src/nsLoggingSink.cpp | 8 +- mozilla/htmlparser/src/nsParser.cpp | 18 +- mozilla/htmlparser/src/nsScanner.cpp | 2 +- mozilla/htmlparser/src/nsViewSourceHTML.cpp | 11 +- mozilla/htmlparser/tests/outsinks/Convert.cpp | 6 +- .../intl/locale/src/mac/nsCollationMac.cpp | 4 +- .../locale/src/mac/nsDateTimeFormatMac.cpp | 4 +- mozilla/intl/locale/src/mac/nsMacLocale.cpp | 2 +- .../intl/locale/src/nsLanguageAtomService.cpp | 4 +- mozilla/intl/locale/src/nsLocaleService.cpp | 2 +- .../intl/locale/src/os2/nsCollationOS2.cpp | 8 +- mozilla/intl/locale/src/os2/nsOS2Locale.cpp | 2 +- .../intl/locale/src/unix/nsCollationUnix.cpp | 6 +- .../locale/src/unix/nsDateTimeFormatUnix.cpp | 2 +- .../locale/src/unix/nsDateTimeFormatUnix.h | 2 +- .../intl/locale/src/unix/nsPosixLocale.cpp | 2 +- .../locale/src/windows/nsCollationWin.cpp | 4 +- .../src/windows/nsDateTimeFormatWin.cpp | 2 +- mozilla/intl/lwbrk/src/nsLWBreakerFImp.cpp | 8 +- mozilla/intl/lwbrk/tests/TestLineBreak.cpp | 4 +- .../intl/strres/tests/StringBundleTest.cpp | 6 +- .../uconv/src/nsCharsetConverterManager.cpp | 4 +- mozilla/intl/uconv/src/nsOS2Charset.cpp | 2 +- mozilla/intl/uconv/tests/TestUConv.cpp | 16 +- mozilla/intl/uconv/tests/plattest.cpp | 4 +- .../intl/uconv/ucvja/nsJapaneseToUnicode.cpp | 6 +- .../intl/uconv/ucvko/nsISO2022KRToUnicode.cpp | 2 +- .../unicharutil/src/nsEntityConverter.cpp | 12 +- .../unicharutil/tests/UnicharSelfTest.cpp | 4 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 2 +- mozilla/layout/base/nsDocumentViewer.cpp | 2 +- mozilla/layout/base/src/nsFrameUtil.cpp | 4 +- .../layout/forms/nsComboboxControlFrame.cpp | 2 +- .../layout/forms/nsGfxButtonControlFrame.cpp | 4 +- .../layout/forms/nsHTMLButtonControlFrame.cpp | 6 +- mozilla/layout/forms/nsIsIndexFrame.cpp | 6 +- mozilla/layout/generic/nsBulletFrame.cpp | 6 +- mozilla/layout/generic/nsFrame.cpp | 6 +- mozilla/layout/generic/nsFrameFrame.cpp | 2 +- mozilla/layout/generic/nsFrameUtil.cpp | 4 +- mozilla/layout/generic/nsImageMap.cpp | 30 +-- mozilla/layout/generic/nsObjectFrame.cpp | 2 +- mozilla/layout/generic/nsPageFrame.cpp | 2 +- .../layout/generic/nsSimplePageSequence.cpp | 2 +- mozilla/layout/generic/nsTextFrame.cpp | 8 +- .../layout/html/base/src/nsBulletFrame.cpp | 6 +- mozilla/layout/html/base/src/nsFrame.cpp | 6 +- .../html/base/src/nsHTMLImageLoader.cpp | 5 +- mozilla/layout/html/base/src/nsImageMap.cpp | 30 +-- .../layout/html/base/src/nsObjectFrame.cpp | 2 +- mozilla/layout/html/base/src/nsPageFrame.cpp | 2 +- .../html/base/src/nsSimplePageSequence.cpp | 2 +- mozilla/layout/html/base/src/nsTextFrame.cpp | 8 +- .../layout/html/document/src/nsFrameFrame.cpp | 2 +- .../html/forms/src/nsComboboxControlFrame.cpp | 2 +- .../forms/src/nsGfxButtonControlFrame.cpp | 4 +- .../html/forms/src/nsGfxTextControlFrame2.cpp | 2 +- .../forms/src/nsHTMLButtonControlFrame.cpp | 6 +- .../layout/html/forms/src/nsIsIndexFrame.cpp | 6 +- .../html/style/src/nsCSSFrameConstructor.cpp | 2 +- mozilla/layout/html/tests/TestAttributes.cpp | 10 +- .../base/src/nsMathMLContainerFrame.cpp | 38 +-- .../mathml/base/src/nsMathMLmfracFrame.cpp | 14 +- .../mathml/base/src/nsMathMLmoverFrame.cpp | 6 +- .../mathml/base/src/nsMathMLmpaddedFrame.cpp | 8 +- .../mathml/base/src/nsMathMLmstyleFrame.cpp | 4 +- .../mathml/base/src/nsMathMLmunderFrame.cpp | 6 +- .../base/src/nsMathMLmunderoverFrame.cpp | 10 +- .../mathml/content/src/nsMathMLOperators.cpp | 42 ++-- mozilla/layout/style/nsCSSDeclaration.cpp | 10 +- mozilla/layout/style/nsCSSParser.cpp | 18 +- mozilla/layout/style/nsCSSScanner.cpp | 39 +-- mozilla/layout/style/nsCSSStruct.cpp | 10 +- mozilla/layout/style/nsCSSStyleRule.cpp | 4 +- mozilla/layout/style/nsCSSStyleSheet.cpp | 2 +- mozilla/layout/style/nsHTMLCSSStyleSheet.cpp | 4 +- mozilla/layout/style/nsHTMLStyleSheet.cpp | 2 +- .../layout/style/nsROCSSPrimitiveValue.cpp | 10 +- mozilla/layout/style/nsStyleCoord.cpp | 36 +-- mozilla/layout/xul/base/src/nsBox.cpp | 14 +- .../layout/xul/base/src/nsButtonBoxFrame.cpp | 2 +- .../layout/xul/base/src/nsContainerBox.cpp | 2 +- mozilla/layout/xul/base/src/nsGrippyFrame.cpp | 6 +- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 44 ++-- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 16 +- .../xul/base/src/nsScrollbarButtonFrame.cpp | 4 +- .../layout/xul/base/src/nsTextBoxFrame.cpp | 4 +- .../xul/base/src/nsTreeItemDragCapturer.cpp | 2 +- .../xul/base/src/nsXULTreeCellFrame.cpp | 4 +- .../xul/base/src/nsXULTreeGroupFrame.cpp | 2 +- .../xul/base/src/nsXULTreeOuterGroupFrame.cpp | 8 +- .../src/outliner/src/nsOutlinerBodyFrame.cpp | 18 +- .../src/outliner/src/nsOutlinerBoxObject.cpp | 4 +- .../src/outliner/src/nsOutlinerColFrame.cpp | 2 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 18 +- .../xul/base/src/tree/src/nsTreeBoxObject.cpp | 4 +- .../xul/base/src/tree/src/nsTreeColFrame.cpp | 2 +- mozilla/mailnews/absync/build/makefile.win | 1 + mozilla/mailnews/absync/macbuild/AbSync.xml | 58 +++++ mozilla/mailnews/absync/src/Makefile.in | 1 + mozilla/mailnews/absync/src/makefile.win | 1 + mozilla/mailnews/absync/src/nsAbSync.cpp | 39 +-- .../addrbook/src/nsAbCardProperty.cpp | 19 +- .../addrbook/src/nsAbDirectoryQuery.cpp | 4 +- .../addrbook/src/nsAbLDAPDirectoryQuery.cpp | 8 +- .../mailnews/addrbook/src/nsAbOutlookCard.cpp | 2 +- .../addrbook/src/nsAbOutlookDirectory.cpp | 23 +- .../mailnews/addrbook/src/nsAbWinHelper.cpp | 4 +- .../addrbook/src/nsAddbookProtocolHandler.cpp | 60 ++--- .../addrbook/src/nsDirectoryDataSource.cpp | 4 +- .../base/search/src/nsMsgImapSearch.cpp | 2 +- .../base/search/src/nsMsgSearchAdapter.cpp | 2 +- .../base/search/src/nsMsgSearchValue.cpp | 6 +- mozilla/mailnews/base/src/nsMsgAccount.cpp | 4 +- .../base/src/nsMsgNotificationManager.cpp | 10 +- .../mailnews/base/src/nsMsgPrintEngine.cpp | 2 +- .../base/util/nsLocalFolderSummarySpec.cpp | 2 +- mozilla/mailnews/base/util/nsMsgDBFolder.cpp | 2 +- mozilla/mailnews/base/util/nsMsgI18N.cpp | 6 +- mozilla/mailnews/base/util/nsMsgIdentity.cpp | 8 +- .../base/util/nsMsgIncomingServer.cpp | 2 +- mozilla/mailnews/base/util/nsMsgUtf7Utils.cpp | 10 +- mozilla/mailnews/base/util/nsMsgUtils.cpp | 12 +- .../mailnews/compose/src/nsMsgCompUtils.cpp | 2 +- mozilla/mailnews/compose/src/nsMsgCompose.cpp | 6 +- mozilla/mailnews/compose/src/nsMsgPrompts.cpp | 4 +- mozilla/mailnews/compose/src/nsMsgSend.cpp | 5 +- .../mailnews/compose/src/nsMsgSendReport.cpp | 2 +- .../mailnews/compose/src/nsSmtpDataSource.cpp | 2 +- .../imap/src/nsIMAPHostSessionList.cpp | 2 +- .../imap/src/nsImapIncomingServer.cpp | 12 +- .../mailnews/imap/src/nsImapMailFolder.cpp | 2 +- mozilla/mailnews/imap/src/nsImapProtocol.cpp | 2 +- .../eudora/macbuild/msgImportEudora.xml | 58 +++++ .../import/eudora/src/nsEudoraCompose.cpp | 5 +- .../import/eudora/src/nsEudoraMac.cpp | 5 +- .../eudora/src/nsEudoraStringBundle.cpp | 4 +- .../import/eudora/src/nsEudoraWin32.cpp | 14 +- .../import/oexpress/nsOEAddressIterator.cpp | 4 +- .../import/oexpress/nsOEStringBundle.cpp | 4 +- .../mailnews/import/outlook/src/MapiApi.cpp | 8 +- .../import/outlook/src/MapiMessage.cpp | 18 +- .../import/outlook/src/nsOutlookCompose.cpp | 5 +- .../import/outlook/src/nsOutlookMail.cpp | 12 +- .../outlook/src/nsOutlookStringBundle.cpp | 4 +- mozilla/mailnews/import/src/nsImportMail.cpp | 6 +- .../mailnews/import/src/nsImportService.cpp | 8 +- .../import/src/nsImportStringBundle.cpp | 4 +- .../mailnews/import/text/src/nsTextImport.cpp | 2 +- .../import/text/src/nsTextStringBundle.cpp | 4 +- .../mailnews/local/src/nsNoIncomingServer.cpp | 2 +- mozilla/mailnews/mime/src/comi18n.cpp | 8 +- mozilla/mailnews/mime/src/mimemoz2.cpp | 4 +- mozilla/mailnews/mime/src/mimetpfl.cpp | 4 +- mozilla/mailnews/mime/src/mimetpla.cpp | 2 +- mozilla/modules/libjar/nsJAR.cpp | 26 +- mozilla/modules/oji/src/nsJVMManager.cpp | 5 +- .../plugin/base/src/nsPluginHostImpl.cpp | 4 +- mozilla/netwerk/base/src/nsSimpleURI.cpp | 2 +- .../netwerk/base/src/nsSocketTransport.cpp | 2 +- .../base/src/nsSocketTransportService.cpp | 4 +- .../protocol/finger/src/nsFingerChannel.cpp | 6 +- .../ftp/src/nsFtpConnectionThread.cpp | 2 +- .../protocol/gopher/src/nsGopherChannel.cpp | 2 +- .../converters/mozTXTToHTMLConv.cpp | 50 ++-- .../streamconv/converters/nsIndexedToHTML.cpp | 2 +- .../streamconv/converters/nsTXTToHTMLConv.cpp | 24 +- .../converters/nsUnknownDecoder.cpp | 8 +- .../streamconv/test/TestStreamConv.cpp | 4 +- mozilla/netwerk/test/TestPageLoad.cpp | 2 +- .../parser/htmlparser/robot/nsDebugRobot.cpp | 8 +- .../parser/htmlparser/robot/nsRobotSink.cpp | 4 +- mozilla/parser/htmlparser/src/CNavDTD.cpp | 9 +- mozilla/parser/htmlparser/src/COtherDTD.cpp | 7 +- mozilla/parser/htmlparser/src/nsDTDUtils.cpp | 15 +- .../htmlparser/src/nsExpatTokenizer.cpp | 14 +- .../src/nsHTMLContentSinkStream.cpp | 24 +- .../parser/htmlparser/src/nsHTMLTokenizer.cpp | 8 +- .../parser/htmlparser/src/nsHTMLTokens.cpp | 34 +-- .../parser/htmlparser/src/nsLoggingSink.cpp | 8 +- mozilla/parser/htmlparser/src/nsParser.cpp | 18 +- mozilla/parser/htmlparser/src/nsScanner.cpp | 2 +- .../htmlparser/src/nsViewSourceHTML.cpp | 11 +- .../htmlparser/tests/outsinks/Convert.cpp | 6 +- .../pref-migrator/src/nsPrefMigration.cpp | 6 +- mozilla/profile/src/nsProfileAccess.cpp | 2 +- mozilla/rdf/base/src/nsRDFXMLSerializer.cpp | 4 +- mozilla/rdf/chrome/src/nsChromeRegistry.cpp | 6 +- .../manager/ssl/src/nsKeygenHandler.cpp | 8 +- .../manager/ssl/src/nsNSSCertificate.cpp | 4 +- .../manager/ssl/src/nsPK11TokenDB.cpp | 4 +- .../security/manager/ssl/src/nsPKCS11Slot.cpp | 4 +- .../security/manager/ssl/src/nsPKCS12Blob.cpp | 4 +- .../webshell/tests/viewer/nsBrowserWindow.cpp | 38 +-- .../webshell/tests/viewer/nsEditorMode.cpp | 4 +- mozilla/webshell/tests/viewer/nsViewerApp.cpp | 6 +- .../tests/viewer/nsWebBrowserChrome.cpp | 28 +-- .../webshell/tests/viewer/nsWebCrawler.cpp | 2 +- .../tests/viewer/windows/nsTextWidget.cpp | 2 +- mozilla/widget/src/beos/nsFilePicker.cpp | 6 +- mozilla/widget/src/beos/nsTextWidget.cpp | 2 +- mozilla/widget/src/cocoa/nsFilePicker.cpp | 2 +- mozilla/widget/src/cocoa/nsMenuItemX.cpp | 2 +- mozilla/widget/src/cocoa/nsMenuX.cpp | 2 +- mozilla/widget/src/gtk/nsClipboard.cpp | 6 +- mozilla/widget/src/gtk/nsGtkIMEHelper.cpp | 4 +- mozilla/widget/src/gtk/nsWindow.cpp | 2 +- mozilla/widget/src/mac/nsMacControl.cpp | 2 +- mozilla/widget/src/mac/nsMacEventHandler.cpp | 2 +- mozilla/widget/src/mac/nsMenu.cpp | 4 +- mozilla/widget/src/mac/nsMenuItem.cpp | 2 +- mozilla/widget/src/mac/nsMenuItemX.cpp | 2 +- mozilla/widget/src/mac/nsMenuX.cpp | 2 +- mozilla/widget/src/os2/nsFilePicker.cpp | 6 +- mozilla/widget/src/photon/nsWidget.cpp | 4 +- mozilla/widget/src/windows/nsFilePicker.cpp | 6 +- mozilla/widget/src/xlib/nsButton.cpp | 2 +- mozilla/widget/src/xlib/nsTextWidget.cpp | 2 +- mozilla/widget/src/xlib/nsWidget.cpp | 2 +- mozilla/widget/src/xlib/nsWindow.cpp | 6 +- mozilla/widget/src/xpwidgets/nsBaseWidget.cpp | 2 +- .../src/xpwidgets/nsHTMLFormatConverter.cpp | 4 +- .../src/xpwidgets/nsPrimitiveHelpers.cpp | 4 +- mozilla/xpcom/ds/nsPersistentProperties.cpp | 6 +- mozilla/xpcom/ds/nsTextFormatter.cpp | 9 +- .../xpfe/appshell/src/nsContentTreeOwner.cpp | 14 +- .../xpfe/appshell/src/nsWebShellWindow.cpp | 38 +-- .../xpfe/components/bookmarks/src/Makefile.in | 1 + .../components/bookmarks/src/makefile.win | 1 + .../bookmarks/src/nsBookmarksService.cpp | 21 +- .../src/nsDownloadManager.cpp | 2 +- .../xpfe/components/intl/nsCharsetMenu.cpp | 4 +- .../xpfe/components/related/src/Makefile.in | 1 + .../xpfe/components/related/src/makefile.win | 1 + .../related/src/nsRelatedLinksHandler.cpp | 17 +- .../search/src/nsInternetSearchService.cpp | 63 +++-- .../search/src/nsLocalSearchService.cpp | 4 +- mozilla/xpinstall/src/nsInstall.cpp | 20 +- mozilla/xpinstall/src/nsInstallFile.cpp | 2 +- mozilla/xpinstall/src/nsInstallFileOpItem.cpp | 4 +- mozilla/xpinstall/src/nsInstallPatch.cpp | 4 +- mozilla/xpinstall/src/nsJSFile.cpp | 2 +- mozilla/xpinstall/src/nsJSInstallVersion.cpp | 2 +- mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp | 4 +- mozilla/xpinstall/src/nsWinProfile.cpp | 2 +- mozilla/xpinstall/src/nsWinProfileItem.cpp | 8 +- mozilla/xpinstall/src/nsWinRegItem.cpp | 16 +- mozilla/xpinstall/src/nsXPITriggerInfo.h | 2 +- mozilla/xpinstall/src/nsXPInstallManager.cpp | 2 +- 354 files changed, 1703 insertions(+), 1549 deletions(-) diff --git a/mozilla/accessible/src/xul/nsXULMenuAccessible.cpp b/mozilla/accessible/src/xul/nsXULMenuAccessible.cpp index a999719cc67..54eb3a13bb9 100644 --- a/mozilla/accessible/src/xul/nsXULMenuAccessible.cpp +++ b/mozilla/accessible/src/xul/nsXULMenuAccessible.cpp @@ -66,7 +66,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetAccState(PRUint32 *_retval) // Has Popup? nsAutoString tagName; element->GetLocalName(tagName); - if (tagName.EqualsWithConversion("menu")) + if (tagName.Equals(NS_LITERAL_STRING("menu"))) *_retval |= STATE_HASPOPUP; nsAutoString menuItemType; @@ -74,7 +74,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetAccState(PRUint32 *_retval) if (!menuItemType.IsEmpty()) { // Selectable? - if (menuItemType.EqualsWithConversion("radio")) + if (menuItemType.Equals(NS_LITERAL_STRING("radio"))) *_retval |= STATE_SELECTABLE; // Checked? diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index 0538b652ce1..0a4de858dc5 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -969,9 +969,9 @@ nsScriptSecurityManager::ReportErrorToConsole(nsIURI* aTarget) if (NS_FAILED(rv)) return rv; nsAutoString msg; - msg.AssignWithConversion("The link to "); + msg.Assign(NS_LITERAL_STRING("The link to ")); msg.AppendWithConversion(spec); - msg.AppendWithConversion(" was blocked by the security manager.\nRemote content may not link to local content."); + msg.Append(NS_LITERAL_STRING(" was blocked by the security manager.\nRemote content may not link to local content.")); // Report error in JS console nsCOMPtr console(do_GetService("@mozilla.org/consoleservice;1")); if (console) diff --git a/mozilla/caps/src/nsSystemPrincipal.cpp b/mozilla/caps/src/nsSystemPrincipal.cpp index b08f9fc9ef9..1e9933e4e36 100644 --- a/mozilla/caps/src/nsSystemPrincipal.cpp +++ b/mozilla/caps/src/nsSystemPrincipal.cpp @@ -63,7 +63,7 @@ NS_IMETHODIMP nsSystemPrincipal::ToString(char **result) { nsAutoString buf; - buf.AssignWithConversion("[System]"); + buf.Assign(NS_LITERAL_STRING("[System]")); *result = ToNewCString(buf); return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 760be31cd02..140f0f389b1 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -2071,15 +2071,15 @@ NS_IMETHODIMP nsChromeRegistry::InstallProvider(const nsCString& aProviderType, // Get the literal for our loc type. nsAutoString locstr; if (aUseProfile) - locstr.AssignWithConversion("profile"); - else locstr.AssignWithConversion("install"); + locstr.Assign(NS_LITERAL_STRING("profile")); + else locstr.Assign(NS_LITERAL_STRING("install")); nsCOMPtr locLiteral; rv = mRDFService->GetLiteral(locstr.get(), getter_AddRefs(locLiteral)); if (NS_FAILED(rv)) return rv; // Get the literal for our script access. nsAutoString scriptstr; - scriptstr.AssignWithConversion("false"); + scriptstr.Assign(NS_LITERAL_STRING("false")); nsCOMPtr scriptLiteral; rv = mRDFService->GetLiteral(scriptstr.get(), getter_AddRefs(scriptLiteral)); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/content/base/src/nsDocumentEncoder.cpp b/mozilla/content/base/src/nsDocumentEncoder.cpp index 1af7acbeab3..bdfe4eb9659 100644 --- a/mozilla/content/base/src/nsDocumentEncoder.cpp +++ b/mozilla/content/base/src/nsDocumentEncoder.cpp @@ -185,7 +185,7 @@ nsDocumentEncoder::nsDocumentEncoder() { NS_INIT_REFCNT(); - mMimeType.AssignWithConversion("text/plain"); + mMimeType.Assign(NS_LITERAL_STRING("text/plain")); mFlags = 0; mWrapColumn = 72; @@ -1255,7 +1255,7 @@ nsHTMLCopyEncoder::EncodeToStringWithContext(nsAWritableString& aEncodedString, // whitespace info to this. nsAutoString infoString; infoString.AppendInt(mStartDepth); - infoString.AppendWithConversion(','); + infoString.Append(PRUnichar(',')); infoString.AppendInt(mEndDepth); aInfoString = infoString; @@ -1550,11 +1550,11 @@ nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode) nsCOMPtr elem = do_QueryInterface(aNode); if (elem) { - nsAutoString typeAttrName; typeAttrName.AssignWithConversion("type"); + nsAutoString typeAttrName(NS_LITERAL_STRING("type")); nsAutoString typeAttrVal; nsresult rv = elem->GetAttribute(typeAttrName, typeAttrVal); typeAttrVal.ToLowerCase(); - if (NS_SUCCEEDED(rv) && (typeAttrVal.EqualsWithConversion("_moz"))) + if (NS_SUCCEEDED(rv) && (typeAttrVal.Equals(NS_LITERAL_STRING("_moz")))) return PR_TRUE; } return PR_FALSE; diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index ad695ea98c0..e62fcaf677e 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -5866,7 +5866,7 @@ DocumentViewerImpl::GetPopupLinkNode(nsIDOMNode** aNode) } } } - if (anchor || area || link || xlinkType.EqualsWithConversion("simple")) { + if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) { *aNode = node; NS_IF_ADDREF(*aNode); // addref return NS_OK; diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 2fa64fefd22..bb23378ff39 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -62,6 +62,7 @@ #include "nsIView.h" #include "nsIViewManager.h" #include "nsString.h" +#include "nsUnicharUtils.h" #include "nsIEventStateManager.h" #include "nsIDOMEvent.h" #include "nsIPrivateDOMEvent.h" @@ -1055,24 +1056,24 @@ nsGenericElement::InternalIsSupported(const nsAReadableString& aFeature, *aReturn = PR_FALSE; nsAutoString feature(aFeature); - if (feature.EqualsWithConversion("XML", PR_TRUE) || - feature.EqualsWithConversion("HTML", PR_TRUE)) { - if (!aVersion.Length() || + if (!Compare(feature, NS_LITERAL_STRING("XML"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("HTML"), nsCaseInsensitiveStringComparator())) { + if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("1.0")) || aVersion.Equals(NS_LITERAL_STRING("2.0"))) { *aReturn = PR_TRUE; } - } else if (feature.EqualsWithConversion("Views", PR_TRUE) || - feature.EqualsWithConversion("StyleSheets", PR_TRUE) || - feature.EqualsWithConversion("CSS", PR_TRUE) || -// feature.EqualsWithConversion("CSS2", PR_TRUE) || - feature.EqualsWithConversion("Events", PR_TRUE) || -// feature.EqualsWithConversion("UIEvents", PR_TRUE) || - feature.EqualsWithConversion("MouseEvents", PR_TRUE) || - feature.EqualsWithConversion("MouseScrollEvents", PR_TRUE) || - feature.EqualsWithConversion("HTMLEvents", PR_TRUE) || - feature.EqualsWithConversion("Range", PR_TRUE)) { - if (!aVersion.Length() || aVersion.Equals(NS_LITERAL_STRING("2.0"))) { + } else if (!Compare(feature, NS_LITERAL_STRING("Views"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("StyleSheets"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("CSS"), nsCaseInsensitiveStringComparator()) || +// !Compare(feature, NS_LITERAL_STRING("CSS2"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("Events"), nsCaseInsensitiveStringComparator()) || +// !Compare(feature, NS_LITERAL_STRING("UIEvents"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("MouseEvents"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("MouseScrollEvents"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("HTMLEvents"), nsCaseInsensitiveStringComparator()) || + !Compare(feature, NS_LITERAL_STRING("Range"), nsCaseInsensitiveStringComparator())) { + if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("2.0"))) { *aReturn = PR_TRUE; } } @@ -3496,7 +3497,7 @@ nsGenericContainerElement::ListAttributes(FILE* out) const buffer.Append(name); // value - buffer.AppendWithConversion("="); + buffer.Append(NS_LITERAL_STRING("=")); buffer.Append(attr->mValue); fputs(" ", out); diff --git a/mozilla/content/base/src/nsHTMLContentSerializer.cpp b/mozilla/content/base/src/nsHTMLContentSerializer.cpp index 0ef62fc7f0d..8869563c588 100644 --- a/mozilla/content/base/src/nsHTMLContentSerializer.cpp +++ b/mozilla/content/base/src/nsHTMLContentSerializer.cpp @@ -118,13 +118,13 @@ nsHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn, // Set the line break character: if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak) && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) { // Windows - mLineBreak.AssignWithConversion("\r\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\r\n")); } else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) { // Mac - mLineBreak.AssignWithConversion("\r"); + mLineBreak.Assign(NS_LITERAL_STRING("\r")); } else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) { // Unix/DOM - mLineBreak.AssignWithConversion("\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\n")); } else { mLineBreak.AssignWithConversion(NS_LINEBREAK); // Platform/default diff --git a/mozilla/content/base/src/nsPlainTextSerializer.cpp b/mozilla/content/base/src/nsPlainTextSerializer.cpp index 85a33547d5f..fb7968604ca 100644 --- a/mozilla/content/base/src/nsPlainTextSerializer.cpp +++ b/mozilla/content/base/src/nsPlainTextSerializer.cpp @@ -183,7 +183,7 @@ nsPlainTextSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn, // Set the line break character: if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak) && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) // Windows - mLineBreak.AssignWithConversion("\r\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\r\n")); else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) // Mac mLineBreak.Assign(PRUnichar('\r')); else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) // Unix/DOM @@ -881,7 +881,7 @@ nsPlainTextSerializer::DoCloseContainer(PRInt32 aTag) } else if (type == eHTMLTag_a && !IsCurrentNodeConverted() && !mURL.IsEmpty()) { nsAutoString temp; - temp.AssignWithConversion(" <"); + temp.Assign(NS_LITERAL_STRING(" <")); temp += mURL; temp.Append(PRUnichar('>')); Write(temp); @@ -961,7 +961,7 @@ nsPlainTextSerializer::DoAddLeaf(PRInt32 aTag, // ignore the bogus br tags that the editor sticks here and there. nsAutoString typeAttr; if (NS_FAILED(GetAttributeValue(nsHTMLAtoms::type, typeAttr)) - || !typeAttr.EqualsWithConversion("_moz")) { + || !typeAttr.Equals(NS_LITERAL_STRING("_moz"))) { EnsureVerticalSpace(mEmptyLines+1); } } @@ -1272,7 +1272,7 @@ nsPlainTextSerializer::AddToLine(const PRUnichar * aLineFragment, ( restOfLine[0] == '>' || restOfLine[0] == ' ' || - restOfLine.EqualsWithConversion("From ",PR_FALSE,5) + Substring(restOfLine, 0, 5).Equals(NS_LITERAL_STRING("From ")) ) && mCiteQuoteLevel == 0 // We space-stuff quoted lines anyway ) @@ -1323,7 +1323,7 @@ nsPlainTextSerializer::EndLine(PRBool aSoftlinebreak) // (see RFC 2646). We only check for "-- " when it's a hard line // break for obvious reasons. if(!(mFlags & nsIDocumentEncoder::OutputPreformatted) && - (aSoftlinebreak || !mCurrentLine.EqualsWithConversion("-- "))) { + (aSoftlinebreak || !mCurrentLine.Equals(NS_LITERAL_STRING("-- ")))) { // Remove SPACE:s from the end of the line. while(currentlinelength > 0 && mCurrentLine[currentlinelength-1] == ' ') { diff --git a/mozilla/content/base/src/nsXMLContentSerializer.cpp b/mozilla/content/base/src/nsXMLContentSerializer.cpp index 4aa74604f9d..057c3242412 100644 --- a/mozilla/content/base/src/nsXMLContentSerializer.cpp +++ b/mozilla/content/base/src/nsXMLContentSerializer.cpp @@ -444,7 +444,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, attrName->ToString(nameStr); // XXX We shouldn't need this hack if (elementNamespaceID == kNameSpaceID_HTML) { - if (nameStr.EqualsWithConversion("xmlns:",PR_FALSE,6)) { + if (Substring(nameStr, 0, 6).Equals(NS_LITERAL_STRING("xmlns:"))) { nameStr.Cut(0,6); hasPrefix = PR_TRUE; } else if (!nameStr.Equals(kXMLNS)) { diff --git a/mozilla/content/events/src/nsEventListenerManager.cpp b/mozilla/content/events/src/nsEventListenerManager.cpp index 99e67e27ab3..a9ea7d2bba5 100644 --- a/mozilla/content/events/src/nsEventListenerManager.cpp +++ b/mozilla/content/events/src/nsEventListenerManager.cpp @@ -756,11 +756,8 @@ nsEventListenerManager::AddEventListenerByType(nsIDOMEventListener *aListener, { PRInt32 subType; EventArrayType arrayType; - nsAutoString str; str.AssignWithConversion("on"); - nsIAtom* atom; - - str.Append(aType); - atom = NS_NewAtom(str); + nsCOMPtr atom = + dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("on") + aType)); if (NS_OK == GetIdentifiersForType(atom, &arrayType, &subType)) { AddEventListener(aListener, arrayType, subType, nsnull, aFlags); @@ -770,9 +767,6 @@ nsEventListenerManager::AddEventListenerByType(nsIDOMEventListener *aListener, AddEventListener(aListener, eEventArrayType_Hash, NS_EVENT_BITS_NONE, &key, aFlags); } - - NS_IF_RELEASE(atom); - return NS_OK; } @@ -783,11 +777,8 @@ nsEventListenerManager::RemoveEventListenerByType(nsIDOMEventListener *aListener { PRInt32 subType; EventArrayType arrayType; - nsAutoString str; str.AssignWithConversion("on"); - nsIAtom* atom; - - str.Append(aType); - atom = NS_NewAtom(str); + nsCOMPtr atom = + dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("on") + aType)); if (NS_OK == GetIdentifiersForType(atom, &arrayType, &subType)) { RemoveEventListener(aListener, arrayType, subType, nsnull, aFlags); @@ -797,8 +788,6 @@ nsEventListenerManager::RemoveEventListenerByType(nsIDOMEventListener *aListener RemoveEventListener(aListener, eEventArrayType_Hash, NS_EVENT_BITS_NONE, &key, aFlags); } - NS_IF_RELEASE(atom); - return NS_OK; } @@ -1155,8 +1144,7 @@ nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct, if (NS_SUCCEEDED(result)) { nsAutoString eventString; if (NS_SUCCEEDED(aDOMEvent->GetType(eventString))) { - eventString.InsertWithConversion("on", 0, 2); - nsCOMPtr atom = getter_AddRefs(NS_NewAtom(eventString)); + nsCOMPtr atom = dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("on") + eventString)); result = CompileEventHandlerInternal(scriptCX, target, atom, aListenerStruct, aSubType); diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index f6a104d43e0..c3f35863e12 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -3004,7 +3004,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* PRInt32 errorCode; tabIndex = tabStr.ToInteger(&errorCode); } - if (!value.EqualsWithConversion("true")) + if (!value.Equals(NS_LITERAL_STRING("true"))) disabled = PR_FALSE; } diff --git a/mozilla/content/html/content/src/nsFormSubmitter.cpp b/mozilla/content/html/content/src/nsFormSubmitter.cpp index 2ac11fdc489..b8119aae683 100644 --- a/mozilla/content/html/content/src/nsFormSubmitter.cpp +++ b/mozilla/content/html/content/src/nsFormSubmitter.cpp @@ -549,7 +549,7 @@ nsFormSubmitter::ProcessAsURLEncoded(nsIForm* form, if (PR_TRUE == firstTime) { firstTime = PR_FALSE; } else { - buf.AppendWithConversion("&"); + buf.Append(NS_LITERAL_STRING("&")); } nsString* convName = URLEncode(names[valueX], encoder, @@ -558,7 +558,7 @@ nsFormSubmitter::ProcessAsURLEncoded(nsIForm* form, charset); buf += *convName; delete convName; - buf.AppendWithConversion("="); + buf.Append(NS_LITERAL_STRING("=")); nsAutoString newValue; newValue.Append(values[valueX]); if (aFormProcessor) { @@ -1400,7 +1400,7 @@ nsFormSubmitter::GetPlatformEncoder(nsIUnicodeEncoder** encoder) if (NS_FAILED(rv)) { NS_ASSERTION(0, "error getting locale charset, using ISO-8859-1"); - localeCharset.AssignWithConversion("ISO-8859-1"); + localeCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); rv = NS_OK; } diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 5503244fcd7..c870b840831 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -2238,7 +2238,7 @@ nsGenericHTMLElement::ListAttributes(FILE* out) const // value nsAutoString value; GetAttr(nameSpaceID, attr, value); - buffer.AppendWithConversion("="); + buffer.Append(NS_LITERAL_STRING("=")); buffer.Append(value); fputs(" ", out); diff --git a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp index a947d8cda84..637231f9907 100644 --- a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp @@ -58,6 +58,7 @@ #include "nsISizeOfHandler.h" #include "nsIDocument.h" #include "nsGUIEvent.h" +#include "nsUnicharUtils.h" class nsHTMLButtonElement : public nsGenericHTMLContainerFormElement, @@ -211,7 +212,7 @@ nsHTMLButtonElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAutoString value(aValue); if (aName == nsHTMLAtoms::disabled && - value.EqualsWithConversion("false", PR_TRUE)) { + !Compare(value, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) { return UnsetAttr(aNameSpaceID, aName, aNotify); } diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 725ad29f48a..fef443f3166 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -562,7 +562,7 @@ nsHTMLInputElement::SetValueChanged(PRBool aValueChanged) NS_IMETHODIMP nsHTMLInputElement::GetChecked(PRBool* aValue) { - nsAutoString value; value.AssignWithConversion("0"); + nsAutoString value(NS_LITERAL_STRING("0")); // No need to flush here, if there's no frame created for this input // yet, we know our own checked state. @@ -582,7 +582,7 @@ nsHTMLInputElement::GetChecked(PRBool* aValue) } } - if (value.EqualsWithConversion("1")) { + if (value.Equals(NS_LITERAL_STRING("1"))) { *aValue = PR_TRUE; } else { *aValue = PR_FALSE; diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 8dba7dbb81e..19d0f01c034 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -3617,7 +3617,7 @@ HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode) docTypeStr.Length() - systemStart); // Strip off 'SYSTEM' if we have it. - if (systemId.EqualsWithConversion("SYSTEM", PR_TRUE, 6)) + if (Substring(systemId, 0, 6).Equals(NS_LITERAL_STRING("SYSTEM"))) systemId.Cut(0, 6); systemId.Trim(" \t\n\r"); @@ -3657,9 +3657,9 @@ HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode) /* * Cut out "DOCTYPE" or "CreateDocumentType(name, publicId, systemId, diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index ae21fe73937..a8273a7955e 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -427,9 +427,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, PRBool needsParser=PR_TRUE; if (aCommand) { - nsAutoString command; command.AssignWithConversion(aCommand); - nsAutoString delayedView; delayedView.AssignWithConversion("view delayedContentLoad"); - if (command.Equals(delayedView)) { + if (nsDependentCString(aCommand) == NS_LITERAL_CSTRING("view delayedContentLoad")) { needsParser = PR_FALSE; } } @@ -443,7 +441,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, return rv; } - nsAutoString charset; charset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // fallback value in case webShell return error + nsAutoString charset(NS_LITERAL_STRING("ISO-8859-1")); // fallback value in case webShell return error nsCOMPtr prefs(do_GetService(NS_PREF_CONTRACTID)); if (prefs) { nsXPIDLString defCharset; @@ -804,7 +802,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, #ifdef IBMBIDI // Check if 864 but in Implicit mode ! if( (mTexttype == IBMBIDI_TEXTTYPE_LOGICAL)&&(charset.EqualsIgnoreCase("ibm864")) ) - charset.AssignWithConversion("IBM864i"); + charset.Assign(NS_LITERAL_STRING("IBM864i")); #endif // IBMBIDI rv = this->SetDocumentCharacterSet(charset); @@ -1738,7 +1736,7 @@ nsHTMLDocument::SetDomain(const nsAReadableString& aDomain) if (NS_FAILED(uri->GetPath(getter_Copies(path)))) return NS_ERROR_FAILURE; nsAutoString newURIString; newURIString.AssignWithConversion( NS_STATIC_CAST(const char*, scheme) ); - newURIString.AppendWithConversion("://"); + newURIString.Append(NS_LITERAL_STRING("://")); newURIString += aDomain; newURIString.AppendWithConversion(path); nsIURI *newURI; @@ -1842,7 +1840,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody) } nsAutoString bodyStr; - bodyStr.AssignWithConversion("BODY"); + bodyStr.Assign(NS_LITERAL_STRING("BODY")); nsCOMPtr child; root->GetFirstChild(getter_AddRefs(child)); @@ -2283,7 +2281,7 @@ nsHTMLDocument::Close() nsresult result = NS_OK; if (mParser && mIsWriting) { - nsAutoString emptyStr; emptyStr.AssignWithConversion(""); + nsAutoString emptyStr(NS_LITERAL_STRING("")); mWriteLevel++; result = mParser->Parse(emptyStr, NS_GENERATE_PARSER_KEY(), NS_LITERAL_STRING("text/html"), PR_FALSE, @@ -3559,7 +3557,7 @@ nsHTMLDocument::GetBodyContent() return PR_FALSE; } - nsAutoString bodyStr; bodyStr.AssignWithConversion("BODY"); + nsAutoString bodyStr(NS_LITERAL_STRING("BODY")); nsCOMPtr child; root->GetFirstChild(getter_AddRefs(child)); diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index 411c7ad6953..78f4a097c12 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -511,7 +511,7 @@ nsresult nsImageDocument::UpdateTitle( void ) #endif // if we got a valid size (sometimes we do not) then display it if (width != 0 && height != 0){ - key.AssignWithConversion("ImageTitleWithDimensions"); + key.Assign(NS_LITERAL_STRING("ImageTitleWithDimensions")); nsAutoString widthStr; widthStr.AppendInt(width); nsAutoString heightStr; heightStr.AppendInt(height); const PRUnichar *formatStrings[2] = {widthStr.get(), heightStr.get()}; @@ -519,7 +519,7 @@ nsresult nsImageDocument::UpdateTitle( void ) } } if (!valUni || !valUni[0]) { - key.AssignWithConversion("ImageTitleWithoutDimensions"); + key.Assign(NS_LITERAL_STRING("ImageTitleWithoutDimensions")); rv = bundle->GetStringFromName(key.get(), getter_Copies(valUni)); } if (NS_SUCCEEDED(rv) && valUni) { diff --git a/mozilla/content/html/style/src/nsCSSDeclaration.cpp b/mozilla/content/html/style/src/nsCSSDeclaration.cpp index 5cea645e101..19641726642 100644 --- a/mozilla/content/html/style/src/nsCSSDeclaration.cpp +++ b/mozilla/content/html/style/src/nsCSSDeclaration.cpp @@ -320,7 +320,7 @@ void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const if (eCSSProperty_UNKNOWN < aPropID) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); } mTop.AppendToString(buffer); @@ -338,22 +338,22 @@ void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) co if (eCSSUnit_Null != mTop.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mTop.AppendToString(buffer); } if (eCSSUnit_Null != mRight.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mRight.AppendToString(buffer); } if (eCSSUnit_Null != mBottom.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mBottom.AppendToString(buffer); } if (eCSSUnit_Null != mLeft.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mLeft.AppendToString(buffer); } diff --git a/mozilla/content/html/style/src/nsCSSParser.cpp b/mozilla/content/html/style/src/nsCSSParser.cpp index 36b7a314d3c..17d17e6e5e2 100644 --- a/mozilla/content/html/style/src/nsCSSParser.cpp +++ b/mozilla/content/html/style/src/nsCSSParser.cpp @@ -436,7 +436,7 @@ CSSParserImpl::CSSParserImpl() NS_INIT_REFCNT(); // set the default charset - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } NS_IMETHODIMP @@ -1053,7 +1053,7 @@ PRBool CSSParserImpl::GatherMedia(PRInt32& aErrorCode, nsString& aMedia, else if (eCSSToken_Ident == mToken.mType) { if (expectIdent) { if (! first) { - aMedia.AppendWithConversion(','); + aMedia.Append(PRUnichar(',')); } ToLowerCase(mToken.mIdent); // case insensitive from CSS - must be lower cased if (aMediaAtoms) { @@ -1572,14 +1572,14 @@ static PRBool IsSinglePseudoClass(const nsCSSSelector& aSelector) #ifdef INCLUDE_XUL static PRBool IsOutlinerPseudoElement(const nsString& aPseudo) { - return !(aPseudo.CompareWithConversion("-moz-outliner-", PR_FALSE, 14)); + return Substring(aPseudo, 0, 14).Equals(NS_LITERAL_STRING("-moz-outliner-")); } static PRBool IsOutlinerPseudoElement(nsIAtom* aPseudo) { nsAutoString str; aPseudo->ToString(str); - return !(str.CompareWithConversion(":-moz-outliner-", PR_FALSE, 15)); + return Substring(str, 0, 15).Equals(NS_LITERAL_STRING(":-moz-outliner-")); } #endif @@ -2164,7 +2164,7 @@ void CSSParserImpl::ParsePseudoSelector(PRInt32& aDataMask, } buffer.Truncate(); - buffer.AppendWithConversion(':'); + buffer.Append(PRUnichar(':')); buffer.Append(mToken.mIdent); ToLowerCase(buffer); nsIAtom* pseudo = NS_NewAtom(buffer); @@ -3086,7 +3086,7 @@ PRBool CSSParserImpl::ParseCounter(PRInt32& aErrorCode, nsCSSValue& aValue) return PR_FALSE; } if (GetToken(aErrorCode, PR_TRUE) && (eCSSToken_String == mToken.mType)) { - counter.AppendWithConversion(','); + counter.Append(PRUnichar(',')); counter.Append(mToken.mSymbol); // quote too counter.Append(mToken.mIdent); counter.Append(mToken.mSymbol); // quote too @@ -3102,7 +3102,7 @@ PRBool CSSParserImpl::ParseCounter(PRInt32& aErrorCode, nsCSSValue& aValue) nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent); if ((eCSSKeyword_UNKNOWN < keyword) && (0 < SearchKeywordTable(keyword, nsCSSProps::kListStyleKTable))) { - counter.AppendWithConversion(','); + counter.Append(PRUnichar(',')); counter.Append(mToken.mIdent); } else { @@ -3148,7 +3148,7 @@ PRBool CSSParserImpl::ParseAttr(PRInt32& aErrorCode, nsCSSValue& aValue) return PR_FALSE; } attr.AppendInt(nameSpaceID, 10); - attr.AppendWithConversion('|'); + attr.Append(PRUnichar('|')); if (! GetToken(aErrorCode, PR_FALSE)) { return PR_FALSE; } @@ -3178,7 +3178,7 @@ PRBool CSSParserImpl::ParseAttr(PRInt32& aErrorCode, nsCSSValue& aValue) else if (mToken.IsSymbol('*')) { // namespace wildcard if (ExpectSymbol(aErrorCode, '|', PR_FALSE)) { attr.AppendInt(kNameSpaceID_Unknown, 10); - attr.AppendWithConversion('|'); + attr.Append(PRUnichar('|')); if (! GetToken(aErrorCode, PR_FALSE)) { return PR_FALSE; } diff --git a/mozilla/content/html/style/src/nsCSSScanner.cpp b/mozilla/content/html/style/src/nsCSSScanner.cpp index ccc3ab84f22..dcd8e59c8df 100644 --- a/mozilla/content/html/style/src/nsCSSScanner.cpp +++ b/mozilla/content/html/style/src/nsCSSScanner.cpp @@ -162,12 +162,10 @@ nsCSSToken::AppendToString(nsString& aBuffer) aBuffer.Append(mIdent); break; case eCSSToken_Includes: - aBuffer.Append(PRUnichar('~')); - aBuffer.Append(PRUnichar('=')); + aBuffer.Append(NS_LITERAL_STRING("~=")); break; case eCSSToken_Dashmatch: - aBuffer.Append(PRUnichar('|')); - aBuffer.Append(PRUnichar('=')); + aBuffer.Append(NS_LITERAL_STRING("|=")); break; default: @@ -236,9 +234,7 @@ void nsCSSScanner::AddToError(const nsAReadableString& aErrorText) mErrorColNumber = mColNumber; mError = aErrorText; } else { - //mError.Append(NS_LITERAL_STRING(" ") + aErrorText); - mError.AppendWithConversion(" "); - mError.Append(aErrorText); + mError.Append(NS_LITERAL_STRING(" ") + aErrorText); } } @@ -494,8 +490,7 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) // WS if ((lexTable[ch] & IS_WHITESPACE) != 0) { aToken.mType = eCSSToken_WhiteSpace; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.Assign(PRUnichar(ch)); (void) EatWhiteSpace(aErrorCode); return PR_TRUE; } @@ -503,8 +498,8 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) PRInt32 nextChar = Peek(aErrorCode); if (nextChar == '*') { (void) Read(aErrorCode); - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.SetCapacity(2); + aToken.mIdent.Assign(PRUnichar(ch)); aToken.mIdent.Append(PRUnichar(nextChar)); return ParseCComment(aErrorCode, aToken); } @@ -514,11 +509,7 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) if (LookAhead(aErrorCode, '-')) { if (LookAhead(aErrorCode, '-')) { aToken.mType = eCSSToken_HTMLComment; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar('<')); - aToken.mIdent.Append(PRUnichar('!')); - aToken.mIdent.Append(PRUnichar('-')); - aToken.mIdent.Append(PRUnichar('-')); + aToken.mIdent.Assign(NS_LITERAL_STRING("")); return PR_TRUE; } Pushback('-'); @@ -590,8 +578,7 @@ PRBool nsCSSScanner::NextURL(PRInt32& aErrorCode, nsCSSToken& aToken) // WS if ((lexTable[ch] & IS_WHITESPACE) != 0) { aToken.mType = eCSSToken_WhiteSpace; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.Assign(PRUnichar(ch)); (void) EatWhiteSpace(aErrorCode); return PR_TRUE; } @@ -599,8 +586,8 @@ PRBool nsCSSScanner::NextURL(PRInt32& aErrorCode, nsCSSToken& aToken) PRInt32 nextChar = Peek(aErrorCode); if (nextChar == '*') { (void) Read(aErrorCode); - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.SetCapacity(2); + aToken.mIdent.Assign(PRUnichar(ch)); aToken.mIdent.Append(PRUnichar(nextChar)); return ParseCComment(aErrorCode, aToken); } @@ -880,8 +867,8 @@ PRBool nsCSSScanner::ParseCComment(PRInt32& aErrorCode, nsCSSToken& aToken) if (ch < 0) break; if (ch == '*') { if (LookAhead(aErrorCode, '/')) { - ident.Append(PRUnichar(ch)); // STRING USE WARNING: technically, this should be |AppendWithConversion| - ident.AppendWithConversion('/'); + ident.Append(PRUnichar(ch)); + ident.Append(PRUnichar('/')); break; } } diff --git a/mozilla/content/html/style/src/nsCSSStruct.cpp b/mozilla/content/html/style/src/nsCSSStruct.cpp index 5cea645e101..19641726642 100644 --- a/mozilla/content/html/style/src/nsCSSStruct.cpp +++ b/mozilla/content/html/style/src/nsCSSStruct.cpp @@ -320,7 +320,7 @@ void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const if (eCSSProperty_UNKNOWN < aPropID) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); } mTop.AppendToString(buffer); @@ -338,22 +338,22 @@ void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) co if (eCSSUnit_Null != mTop.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mTop.AppendToString(buffer); } if (eCSSUnit_Null != mRight.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mRight.AppendToString(buffer); } if (eCSSUnit_Null != mBottom.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mBottom.AppendToString(buffer); } if (eCSSUnit_Null != mLeft.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mLeft.AppendToString(buffer); } diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 15ad7073de4..d36b99804e5 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -2389,9 +2389,9 @@ CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const nsAutoString buffer; mSelector.ToString(buffer, mSheet, PR_FALSE, 0); - buffer.AppendWithConversion(" weight: "); + buffer.Append(NS_LITERAL_STRING(" weight: ")); buffer.AppendInt(mWeight, 10); - buffer.AppendWithConversion(" "); + buffer.Append(NS_LITERAL_STRING(" ")); fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out); if (nsnull != mDeclaration) { mDeclaration->List(out); diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index 08d5d204dc1..2a8dfca3dd6 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -1936,7 +1936,7 @@ CSSStyleSheetImpl::SetTitle(const nsString& aTitle) NS_IMETHODIMP CSSStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/css"); + aType.Assign(NS_LITERAL_STRING("text/css")); return NS_OK; } diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.cpp b/mozilla/content/html/style/src/nsHTMLAttributes.cpp index 6bb0085358c..c07b97a4062 100644 --- a/mozilla/content/html/style/src/nsHTMLAttributes.cpp +++ b/mozilla/content/html/style/src/nsHTMLAttributes.cpp @@ -153,12 +153,12 @@ struct HTMLAttribute { mAttribute->ToString(temp); aBuffer.Append(temp); if (eHTMLUnit_Null != mValue.GetUnit()) { - aBuffer.AppendWithConversion(" = "); + aBuffer.Append(NS_LITERAL_STRING(" = ")); mValue.AppendToString(aBuffer); } } else { - aBuffer.AppendWithConversion("null"); + aBuffer.Append(NS_LITERAL_STRING("null")); } } @@ -167,12 +167,12 @@ struct HTMLAttribute { if (nsnull != mAttribute) { mAttribute->ToString(aBuffer); if (eHTMLUnit_Null != mValue.GetUnit()) { - aBuffer.AppendWithConversion(" = "); + aBuffer.Append(NS_LITERAL_STRING(" = ")); mValue.AppendToString(aBuffer); } } else { - aBuffer.AssignWithConversion("null"); + aBuffer.Assign(NS_LITERAL_STRING("null")); } } #endif // DEBUG @@ -1556,7 +1556,7 @@ HTMLAttributesImpl::List(FILE* out, PRInt32 aIndent) const nsAutoString buffer; mAttrNames[index]->ToString(buffer); if (eHTMLUnit_Null != value.GetUnit()) { - buffer.AppendWithConversion(" = "); + buffer.Append(NS_LITERAL_STRING(" = ")); value.AppendToString(buffer); } fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out); diff --git a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp index 8b525a3968d..98c1e60bdbf 100644 --- a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp @@ -457,14 +457,14 @@ HTMLCSSStyleSheetImpl::GetURL(nsIURI*& aURL) const NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetTitle(nsString& aTitle) const { - aTitle.AssignWithConversion("Internal HTML/CSS Style Sheet"); + aTitle.Assign(NS_LITERAL_STRING("Internal HTML/CSS Style Sheet")); return NS_OK; } NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/html"); + aType.Assign(NS_LITERAL_STRING("text/html")); return NS_OK; } diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index ab4f3fe6364..b9ffa283797 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -894,7 +894,7 @@ HTMLStyleSheetImpl::GetTitle(nsString& aTitle) const NS_IMETHODIMP HTMLStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/html"); + aType.Assign(NS_LITERAL_STRING("text/html")); return NS_OK; } diff --git a/mozilla/content/html/style/src/nsROCSSPrimitiveValue.cpp b/mozilla/content/html/style/src/nsROCSSPrimitiveValue.cpp index a6a1c2cb4fe..f6608dea5a6 100644 --- a/mozilla/content/html/style/src/nsROCSSPrimitiveValue.cpp +++ b/mozilla/content/html/style/src/nsROCSSPrimitiveValue.cpp @@ -83,7 +83,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) { PRInt32 px = NSTwipsToIntPixels(mTwips, mT2P); tmpStr.AppendInt(px); - tmpStr.AppendWithConversion("px"); + tmpStr.Append(NS_LITERAL_STRING("px")); break; } @@ -92,7 +92,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_CENTIMETERS(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("cm"); + tmpStr.Append(NS_LITERAL_STRING("cm")); break; } case CSS_MM : @@ -100,7 +100,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_MILLIMETERS(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("mm"); + tmpStr.Append(NS_LITERAL_STRING("mm")); break; } case CSS_IN : @@ -108,7 +108,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_INCHES(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("in"); + tmpStr.Append(NS_LITERAL_STRING("in")); break; } case CSS_PT : @@ -116,7 +116,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NSTwipsToFloatPoints(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("pt"); + tmpStr.Append(NS_LITERAL_STRING("pt")); break; } case CSS_STRING : diff --git a/mozilla/content/shared/src/nsStyleCoord.cpp b/mozilla/content/shared/src/nsStyleCoord.cpp index a1f5425db33..bfc924e0fd7 100644 --- a/mozilla/content/shared/src/nsStyleCoord.cpp +++ b/mozilla/content/shared/src/nsStyleCoord.cpp @@ -206,25 +206,25 @@ void nsStyleCoord::AppendToString(nsString& aBuffer) const (eStyleUnit_Enumerated == mUnit) || (eStyleUnit_Integer == mUnit)) { aBuffer.AppendInt(mValue.mInt, 10); - aBuffer.AppendWithConversion("[0x"); + aBuffer.Append(NS_LITERAL_STRING("[0x")); aBuffer.AppendInt(mValue.mInt, 16); - aBuffer.AppendWithConversion(']'); + aBuffer.Append(PRUnichar(']')); } switch (mUnit) { - case eStyleUnit_Null: aBuffer.AppendWithConversion("Null"); break; - case eStyleUnit_Coord: aBuffer.AppendWithConversion("tw"); break; - case eStyleUnit_Percent: aBuffer.AppendWithConversion("%"); break; - case eStyleUnit_Factor: aBuffer.AppendWithConversion("f"); break; - case eStyleUnit_Normal: aBuffer.AppendWithConversion("Normal"); break; - case eStyleUnit_Auto: aBuffer.AppendWithConversion("Auto"); break; - case eStyleUnit_Inherit: aBuffer.AppendWithConversion("Inherit"); break; - case eStyleUnit_Proportional: aBuffer.AppendWithConversion("*"); break; - case eStyleUnit_Enumerated: aBuffer.AppendWithConversion("enum"); break; - case eStyleUnit_Integer: aBuffer.AppendWithConversion("int"); break; - case eStyleUnit_Chars: aBuffer.AppendWithConversion("chars"); break; + case eStyleUnit_Null: aBuffer.Append(NS_LITERAL_STRING("Null")); break; + case eStyleUnit_Coord: aBuffer.Append(NS_LITERAL_STRING("tw")); break; + case eStyleUnit_Percent: aBuffer.Append(NS_LITERAL_STRING("%")); break; + case eStyleUnit_Factor: aBuffer.Append(NS_LITERAL_STRING("f")); break; + case eStyleUnit_Normal: aBuffer.Append(NS_LITERAL_STRING("Normal")); break; + case eStyleUnit_Auto: aBuffer.Append(NS_LITERAL_STRING("Auto")); break; + case eStyleUnit_Inherit: aBuffer.Append(NS_LITERAL_STRING("Inherit")); break; + case eStyleUnit_Proportional: aBuffer.Append(NS_LITERAL_STRING("*")); break; + case eStyleUnit_Enumerated: aBuffer.Append(NS_LITERAL_STRING("enum")); break; + case eStyleUnit_Integer: aBuffer.Append(NS_LITERAL_STRING("int")); break; + case eStyleUnit_Chars: aBuffer.Append(NS_LITERAL_STRING("chars")); break; } - aBuffer.AppendWithConversion(' '); + aBuffer.Append(PRUnichar(' ')); } void nsStyleCoord::ToString(nsString& aBuffer) const @@ -276,19 +276,19 @@ void nsStyleSides::AppendToString(nsString& aBuffer) const nsStyleCoord temp; GetLeft(temp); - aBuffer.AppendWithConversion("left: "); + aBuffer.Append(NS_LITERAL_STRING("left: ")); temp.AppendToString(aBuffer); GetTop(temp); - aBuffer.AppendWithConversion("top: "); + aBuffer.Append(NS_LITERAL_STRING("top: ")); temp.AppendToString(aBuffer); GetRight(temp); - aBuffer.AppendWithConversion("right: "); + aBuffer.Append(NS_LITERAL_STRING("right: ")); temp.AppendToString(aBuffer); GetBottom(temp); - aBuffer.AppendWithConversion("bottom: "); + aBuffer.Append(NS_LITERAL_STRING("bottom: ")); temp.AppendToString(aBuffer); } diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index 3c499bcf395..c7166edb517 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -1434,7 +1434,7 @@ nsXBLBinding::AddScriptEventListener(nsIContent* aElement, nsIAtom* aName, nsAutoString val; aName->ToString(val); - nsAutoString eventStr; eventStr.AssignWithConversion("on"); + nsAutoString eventStr(NS_LITERAL_STRING("on")); eventStr += val; nsCOMPtr eventName = getter_AddRefs(NS_NewAtom(eventStr)); diff --git a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp index 098161361f9..531939c8c9f 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -320,7 +320,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, // Look for a compiled handler on the element. // Should be compiled and bound with "on" in front of the name. - nsAutoString onEvent; onEvent.AssignWithConversion("onxbl"); + nsAutoString onEvent(NS_LITERAL_STRING("onxbl")); nsAutoString str; mEventName->ToString(str); onEvent += str; diff --git a/mozilla/content/xml/content/src/nsXMLElement.cpp b/mozilla/content/xml/content/src/nsXMLElement.cpp index 1bc0e553fd4..cfe795bde9c 100644 --- a/mozilla/content/xml/content/src/nsXMLElement.cpp +++ b/mozilla/content/xml/content/src/nsXMLElement.cpp @@ -226,12 +226,12 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI) } else { // We do not want to add double / delimiters (although the user is free to do so) if (value[value_len - 1] != '/') - value.AppendWithConversion('/'); + value.Append(PRUnichar('/')); base.Insert(value, 0); } } else { if (value[value_len - 1] != '/') - value.AppendWithConversion('/'); // Add delimiter/make sure we treat this as dir + value.Append(PRUnichar('/')); // Add delimiter/make sure we treat this as dir base = value; } } @@ -391,14 +391,14 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell) break; // XXX Should probably do this using atoms - if (value.EqualsWithConversion("new")) { + if (value.Equals(NS_LITERAL_STRING("new"))) { verb = eLinkVerb_New; - } else if (value.EqualsWithConversion("replace")) { + } else if (value.Equals(NS_LITERAL_STRING("replace"))) { // We want to actually stop processing the current document now. // We do this by returning the correct value so that the one // that called us knows to stop processing. verb = eLinkVerb_Replace; - } else if (value.EqualsWithConversion("embed")) { + } else if (value.Equals(NS_LITERAL_STRING("embed"))) { // XXX TODO break; } @@ -486,11 +486,11 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext, show); // XXX Should probably do this using atoms - if (show.EqualsWithConversion("new")) { + if (show.Equals(NS_LITERAL_STRING("new"))) { verb = eLinkVerb_New; - } else if (show.EqualsWithConversion("replace")) { + } else if (show.Equals(NS_LITERAL_STRING("replace"))) { verb = eLinkVerb_Replace; - } else if (show.EqualsWithConversion("embed")) { + } else if (show.Equals(NS_LITERAL_STRING("embed"))) { verb = eLinkVerb_Embed; } @@ -659,7 +659,7 @@ nsXMLElement::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject) viewCSS->GetComputedStyle(elt, empty, getter_AddRefs(cssDecl)); if (cssDecl) { nsAutoString behavior; - behavior.AssignWithConversion("-moz-binding"); + behavior.Assign(NS_LITERAL_STRING("-moz-binding")); nsAutoString value; cssDecl->GetPropertyValue(behavior, value); diff --git a/mozilla/content/xml/content/src/nsXMLEntity.cpp b/mozilla/content/xml/content/src/nsXMLEntity.cpp index 785efdeabb8..e7874aeb9b0 100644 --- a/mozilla/content/xml/content/src/nsXMLEntity.cpp +++ b/mozilla/content/xml/content/src/nsXMLEntity.cpp @@ -193,19 +193,19 @@ nsXMLEntity::List(FILE* out, PRInt32 aIndent) const nsAutoString tmp(mName); if (mPublicId.Length()) { - tmp.AppendWithConversion(" PUBLIC \""); + tmp.Append(NS_LITERAL_STRING(" PUBLIC \"")); tmp.Append(mPublicId); - tmp.AppendWithConversion("\""); + tmp.Append(NS_LITERAL_STRING("\"")); } if (mSystemId.Length()) { - tmp.AppendWithConversion(" SYSTEM \""); + tmp.Append(NS_LITERAL_STRING(" SYSTEM \"")); tmp.Append(mSystemId); - tmp.AppendWithConversion("\""); + tmp.Append(NS_LITERAL_STRING("\"")); } if (mNotationName.Length()) { - tmp.AppendWithConversion(" NDATA "); + tmp.Append(NS_LITERAL_STRING(" NDATA ")); tmp.Append(mNotationName); } diff --git a/mozilla/content/xml/content/src/nsXMLNotation.cpp b/mozilla/content/xml/content/src/nsXMLNotation.cpp index d9a8cc6cc52..5c6602dee78 100644 --- a/mozilla/content/xml/content/src/nsXMLNotation.cpp +++ b/mozilla/content/xml/content/src/nsXMLNotation.cpp @@ -182,15 +182,15 @@ nsXMLNotation::List(FILE* out, PRInt32 aIndent) const nsAutoString tmp(mName); if (mPublicId.Length()) { - tmp.AppendWithConversion(" PUBLIC \""); + tmp.Append(NS_LITERAL_STRING(" PUBLIC \"")); tmp.Append(mPublicId); - tmp.AppendWithConversion("\""); + tmp.Append(NS_LITERAL_STRING("\"")); } if (mSystemId.Length()) { - tmp.AppendWithConversion(" SYSTEM \""); + tmp.Append(NS_LITERAL_STRING(" SYSTEM \"")); tmp.Append(mSystemId); - tmp.AppendWithConversion("\""); + tmp.Append(NS_LITERAL_STRING("\"")); } fputs(NS_LossyConvertUCS2toASCII(tmp).get(), out); diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index c9c4841abc7..a7a3bc70471 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -531,8 +531,7 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode, // Ooh, what a nice little hack we have here :-) nsAutoString name; nameAtom->ToString(name); - name.InsertWithConversion("xmlns:", 0); - nameAtom = dont_AddRef(NS_NewAtom(name)); + nameAtom = dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("xmlns:") + name)); nameSpaceID = kNameSpaceID_HTML; // XXX this is wrong, but necessary until HTML can store other namespaces for attrs } @@ -1406,7 +1405,7 @@ nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode) nsAutoString docTypeStr(aNode.GetText()); nsAutoString str, name, publicId, systemId; - if (docTypeStr.EqualsWithConversion("GetAttribute(NS_LITERAL_STRING("multiple"), multiple); - if (!multiple.EqualsWithConversion("true")) { + if (!multiple.Equals(NS_LITERAL_STRING("true"))) { // We're a single selection tree only. This // is not allowed. return NS_OK; @@ -363,7 +363,7 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement } else currentItem = do_QueryInterface(startItem); - nsAutoString trueString; trueString.AssignWithConversion("true", 4); + nsAutoString trueString(NS_LITERAL_STRING("true")); nsCOMPtr content; nsCOMPtr tag; @@ -452,7 +452,7 @@ nsXULTreeElement::FireOnSelectHandler() nsCOMPtr kSuppressSelectChange = dont_AddRef(NS_NewAtom("suppressonselect")); nsAutoString value; content->GetAttr(kNameSpaceID_None, kSuppressSelectChange, value); - if (value.EqualsWithConversion("true")) + if (value.Equals(NS_LITERAL_STRING("true"))) return NS_OK; PRInt32 count = document->GetNumberOfShells(); diff --git a/mozilla/content/xul/document/src/nsXULContentSink.cpp b/mozilla/content/xul/document/src/nsXULContentSink.cpp index 93496e2fad3..b5c8acc927b 100644 --- a/mozilla/content/xul/document/src/nsXULContentSink.cpp +++ b/mozilla/content/xul/document/src/nsXULContentSink.cpp @@ -423,7 +423,7 @@ XULContentSinkImpl::~XULContentSinkImpl() } else { - prefix.AssignWithConversion(""); + prefix.Assign(NS_LITERAL_STRING("")); } char* prefixStr = ToNewCString(prefix); @@ -966,7 +966,7 @@ XULContentSinkImpl::AddProcessingInstruction(const nsIParserNode& aNode) nsParserUtils::GetQuotedAttributeValue(text, NS_LITERAL_STRING("alternate"), alternate); nsresult rv = ProcessStyleLink(nsnull /* XXX need a node here */, - href, alternate.EqualsWithConversion("yes"), /* XXX ignore case? */ + href, alternate.Equals(NS_LITERAL_STRING("yes")), /* XXX ignore case? */ title, type, media); if (NS_FAILED(rv)) return rv; // Important! A failure can indicate that the parser should block! diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 2dcbad1d9d5..64f6996e80e 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -453,7 +453,7 @@ nsXULDocument::nsXULDocument(void) mBroadcasterMap(nsnull) { NS_INIT_REFCNT(); - mCharSetID.AssignWithConversion("UTF-8"); + mCharSetID.Assign(NS_LITERAL_STRING("UTF-8")); // Force initialization. mBindingManager = do_CreateInstance("@mozilla.org/xbl/binding-manager;1"); diff --git a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp index 2041e86d017..cfe5aa6d2fb 100644 --- a/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/mozilla/content/xul/templates/src/nsXULContentBuilder.cpp @@ -534,7 +534,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member); aChild = VALUE_TO_IRDFRESOURCE(member); } - else if (uri.EqualsWithConversion("...") || uri.EqualsWithConversion("rdf:*")) { + else if (uri.Equals(NS_LITERAL_STRING("...")) || uri.Equals(NS_LITERAL_STRING("rdf:*"))) { // If we -are- the resource element, then we are no // matter unique. isResourceElement = PR_TRUE; diff --git a/mozilla/content/xul/templates/src/nsXULContentUtils.cpp b/mozilla/content/xul/templates/src/nsXULContentUtils.cpp index 3efdc68cbdc..75e0f9dacb5 100644 --- a/mozilla/content/xul/templates/src/nsXULContentUtils.cpp +++ b/mozilla/content/xul/templates/src/nsXULContentUtils.cpp @@ -495,7 +495,7 @@ nsXULContentUtils::GetResource(PRInt32 aNameSpaceID, const nsAReadableString& aA // XXX check to see if we need to insert a '/' or a '#'. Oy. if (uri.Length() > 0 && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#') - uri.AppendWithConversion('#'); + uri.Append(PRUnichar('#')); uri.Append(aAttribute); diff --git a/mozilla/content/xul/templates/src/nsXULTemplateBuilder.cpp b/mozilla/content/xul/templates/src/nsXULTemplateBuilder.cpp index 1b853d16eed..7bcee09875f 100644 --- a/mozilla/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/mozilla/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -2220,10 +2220,10 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { iscontainer = nsRDFConInstanceTestNode::eTrue; } - else if (value.EqualsWithConversion("false")) { + else if (value.Equals(NS_LITERAL_STRING("false"))) { iscontainer = nsRDFConInstanceTestNode::eFalse; } } @@ -2235,10 +2235,10 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { isempty = nsRDFConInstanceTestNode::eTrue; } - else if (value.EqualsWithConversion("false")) { + else if (value.Equals(NS_LITERAL_STRING("false"))) { isempty = nsRDFConInstanceTestNode::eFalse; } } diff --git a/mozilla/docshell/base/nsDefaultURIFixup.cpp b/mozilla/docshell/base/nsDefaultURIFixup.cpp index 872970f9b48..9976ffb37c3 100644 --- a/mozilla/docshell/base/nsDefaultURIFixup.cpp +++ b/mozilla/docshell/base/nsDefaultURIFixup.cpp @@ -147,9 +147,9 @@ nsDefaultURIFixup::CreateFixupURI(const PRUnichar *aStringURI, PRUint32 aFixupFl // insert url spec corresponding to host name if (hostSpec.EqualsIgnoreCase("ftp")) - uriString.InsertWithConversion("ftp://", 0, 6); + uriString.Assign(NS_LITERAL_STRING("ftp://") + uriString); else - uriString.InsertWithConversion("http://", 0, 7); + uriString.Assign(NS_LITERAL_STRING("http://") + uriString); } // end if checkprotocol return NS_NewURI(aURI, uriString, nsnull); @@ -273,7 +273,7 @@ nsresult nsDefaultURIFixup::ConvertStringURIToFileCharset(nsString& aIn, // find out the file system charset first if(0 == fsCharset.Length()) { - fsCharset.AssignWithConversion("ISO-8859-1"); // set the fallback first. + fsCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // set the fallback first. nsCOMPtr plat(do_GetService(kPlatformCharsetCID)); NS_ENSURE_TRUE(plat, NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(plat->GetCharset(kPlatformCharsetSel_FileName, fsCharset), diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index bf7abe2cb16..52888cfa953 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -847,7 +847,7 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget, else if (name.EqualsIgnoreCase("_blank") || name.EqualsIgnoreCase("_new")) { mustMakeNewWindow = PR_TRUE; - name.AssignWithConversion(""); + name.Assign(NS_LITERAL_STRING("")); } else if(name.EqualsIgnoreCase("_parent")) { @@ -918,7 +918,7 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget, // Neither is from the origin domain, send load to a new window (_blank) mustMakeNewWindow = PR_TRUE; - name.AssignWithConversion(""); + name.Assign(NS_LITERAL_STRING("")); } // else (target's parent from origin domain) allow this load } // else (no parent) allow this load since shell is a toplevel window } // else (target from origin domain) allow this load @@ -3968,7 +3968,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, if (!bIsChromeOrResource) { if (name.EqualsIgnoreCase("_blank") || name.EqualsIgnoreCase("_new")) { - name.AssignWithConversion("_top"); + name.Assign(NS_LITERAL_STRING("_top")); } else { nsCOMPtr targetTreeItem; @@ -3978,7 +3978,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, if (targetTreeItem) targetDocShell = do_QueryInterface(targetTreeItem); else - name.AssignWithConversion("_top"); + name.Assign(NS_LITERAL_STRING("_top")); } } } diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 5a52fd3abb1..9446a8e430f 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -766,7 +766,7 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent, switch(aVerb) { case eLinkVerb_New: - target.AssignWithConversion("_blank"); + target.Assign(NS_LITERAL_STRING("_blank")); // Fall into replace case case eLinkVerb_Undefined: // Fall through, this seems like the most reasonable action @@ -993,7 +993,7 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, if(keywordsEnabled && (-1 == dotLoc)) { // only send non-qualified hosts to the keyword server - nsAutoString keywordSpec; keywordSpec.AssignWithConversion("keyword:"); + nsAutoString keywordSpec(NS_LITERAL_STRING("keyword:")); keywordSpec.Append(NS_ConvertUTF8toUCS2(host)); return LoadURI(keywordSpec.get(), // URI string diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 2eca909cfb3..2e792704f31 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -2604,7 +2604,7 @@ GlobalWindowImpl::Escape(const nsAReadableString& aStr, NS_ENSURE_TRUE(ccm, NS_ERROR_FAILURE); // Get the document character set - charset.AssignWithConversion("UTF-8"); // default to utf-8 + charset.Assign(NS_LITERAL_STRING("UTF-8")); // default to utf-8 if (mDocument) { nsCOMPtr doc(do_QueryInterface(mDocument)); @@ -2677,7 +2677,7 @@ NS_IMETHODIMP GlobalWindowImpl::Unescape(const nsAReadableString& aStr, NS_ENSURE_TRUE(ccm, NS_ERROR_FAILURE); // Get the document character set - charset.AssignWithConversion("UTF-8"); // default to utf-8 + charset.Assign(NS_LITERAL_STRING("UTF-8")); // default to utf-8 if (mDocument) { nsCOMPtr doc(do_QueryInterface(mDocument)); diff --git a/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index 5e3bfb00a6a..170efd6c0f0 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/dom/src/base/nsJSEnvironment.cpp @@ -218,19 +218,21 @@ NS_ScriptErrorReporter(JSContext *cx, // Print it to stderr as well, for the benefit of those invoking // mozilla with -console. nsAutoString error; - error.AssignWithConversion("JavaScript "); + error.Assign(NS_LITERAL_STRING("JavaScript ")); if (JSREPORT_IS_STRICT(report->flags)) - error.AppendWithConversion("strict "); - error.AppendWithConversion(JSREPORT_IS_WARNING(report->flags) ? "warning: " : "error: "); - error.AppendWithConversion("\n"); + error.Append(NS_LITERAL_STRING("strict ")); + if (JSREPORT_IS_WARNING(report->flags)) + error.Append(NS_LITERAL_STRING("warning: \n")); + else + error.Append(NS_LITERAL_STRING("error: \n")); error.AppendWithConversion(report->filename); - error.AppendWithConversion(" line "); + error.Append(NS_LITERAL_STRING(" line ")); error.AppendInt(report->lineno, 10); - error.AppendWithConversion(": "); + error.Append(NS_LITERAL_STRING(": ")); error.Append(NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage)); - error.AppendWithConversion("\n"); + error.Append(NS_LITERAL_STRING("\n")); if (status != nsEventStatus_eIgnore && !JSREPORT_IS_WARNING(report->flags)) - error.AppendWithConversion("Error was suppressed by event handler\n"); + error.Append(NS_LITERAL_STRING("Error was suppressed by event handler\n")); #ifdef DEBUG char *errorStr = ToNewCString(error); @@ -305,12 +307,12 @@ nsJSContext::DOMBranchCallback(JSContext *cx, JSScript *script) ireq->GetInterface(NS_GET_IID(nsIPrompt), getter_AddRefs(prompt)); NS_ENSURE_TRUE(prompt, JS_TRUE); - nsAutoString title, msg; - title.AssignWithConversion("Script warning"); - msg.AssignWithConversion("A script on this page is causing mozilla to " - "run slowly. If it continues to run, your " - "computer may become unresponsive.\n\nDo you " - "want to abort the script?"); + NS_NAMED_LITERAL_STRING(title, "Script warning"); + NS_NAMED_MULTILINE_LITERAL_STRING(msg, + NS_L("A script on this page is causing mozilla to ") + NS_L("run slowly. If it continues to run, your ") + NS_L("computer may become unresponsive.\n\nDo you ") + NS_L("want to abort the script?")); JSBool ret = JS_TRUE; diff --git a/mozilla/dom/src/events/nsJSEventListener.cpp b/mozilla/dom/src/events/nsJSEventListener.cpp index 8fc6abb4618..7ccbf6f760a 100644 --- a/mozilla/dom/src/events/nsJSEventListener.cpp +++ b/mozilla/dom/src/events/nsJSEventListener.cpp @@ -105,14 +105,14 @@ nsresult nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent) return NS_OK; } //if (mReturnResult == nsReturnResult_eNotSet) { - if (eventString.EqualsWithConversion("error") || eventString.EqualsWithConversion("mouseover")) { + if (eventString.Equals(NS_LITERAL_STRING("error")) || eventString.Equals(NS_LITERAL_STRING("mouseover"))) { mReturnResult = nsReturnResult_eReverseReturnResult; } else { mReturnResult = nsReturnResult_eDoNotReverseReturnResult; } //} - eventString.InsertWithConversion("on", 0, 2); + eventString.Assign(NS_LITERAL_STRING("on") + eventString); } else { mEventName->ToString(eventString); diff --git a/mozilla/editor/composer/src/nsComposerCommands.cpp b/mozilla/editor/composer/src/nsComposerCommands.cpp index 71412e30ab8..4eac7a1c950 100644 --- a/mozilla/editor/composer/src/nsComposerCommands.cpp +++ b/mozilla/editor/composer/src/nsComposerCommands.cpp @@ -735,7 +735,7 @@ nsFontFaceStateCommand::SetState(nsIEditorShell *aEditorShell, nsString& newStat // Remove any existing TT nodes rv = htmlEditor->RemoveInlineProperty(ttAtom, NS_LITERAL_STRING("")); - if (!newState.Length() || newState.Equals(NS_LITERAL_STRING("normal"))) { + if (newState.IsEmpty() || newState.Equals(NS_LITERAL_STRING("normal"))) { rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("face")); } else { rv = htmlEditor->SetInlineProperty(fontAtom, NS_LITERAL_STRING("face"), newState); @@ -783,7 +783,7 @@ nsFontColorStateCommand::SetState(nsIEditorShell *aEditorShell, nsString& newSta nsCOMPtr fontAtom = getter_AddRefs(NS_NewAtom("font")); - if (!newState.Length() || newState.Equals(NS_LITERAL_STRING("normal"))) { + if (newState.IsEmpty() || newState.Equals(NS_LITERAL_STRING("normal"))) { rv = htmlEditor->RemoveInlineProperty(fontAtom, NS_LITERAL_STRING("color")); } else { rv = htmlEditor->SetInlineProperty(fontAtom, NS_LITERAL_STRING("color"), newState); diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index e39a38fce65..bb9c3ef5aaf 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -1842,13 +1842,11 @@ nsEditorShell::UpdateWindowTitleAndRecentMenu(PRBool aSaveToPrefs) nsCOMPtr url = do_QueryInterface(docFileSpec); if (url) { - char *fileNameChar = nsnull; - url->GetFileName(&fileNameChar); - windowCaption.Append(NS_LITERAL_STRING(" [")); - windowCaption.AppendWithConversion(fileNameChar); - windowCaption.Append(NS_LITERAL_STRING("]")); - if (fileNameChar) - nsCRT::free(fileNameChar); + nsXPIDLCString fileNameChar; + url->GetFileName(getter_Copies(fileNameChar)); + windowCaption += NS_LITERAL_STRING(" [") + + NS_ConvertASCIItoUCS2(fileNameChar) + + NS_LITERAL_STRING("]"); } } nsCOMPtr contentAreaAsWin(do_QueryInterface(mContentAreaDocShell)); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index 64c2e90e022..c48e424076c 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -3402,7 +3402,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList) { nsAutoString href; if (NS_SUCCEEDED(anchor->GetHref(href))) - if (href.CompareWithConversion("file:", PR_TRUE, 5) == 0) + if (Compare(Substring(href, 0, 5), NS_LITERAL_STRING("file:"), nsCaseInsensitiveStringComparator()) == 0) (*aNodeList)->AppendElement(node); } } diff --git a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp index f53dea24ce1..2e6987b5381 100644 --- a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -736,7 +736,7 @@ LRESULT CMozillaBrowser::OnViewSource(WORD wNotifyCode, WORD wID, HWND hWndCtl, mWebBrowserContainer->m_pCurrentURI->GetSpec(getter_Copies(aURI)); nsAutoString strURI; - strURI.AssignWithConversion("view-source:"); + strURI.Assign(NS_LITERAL_STRING("view-source:")); strURI.AppendWithConversion(aURI); CIPtr(IDispatch) spDispNew; @@ -998,7 +998,7 @@ HRESULT CMozillaBrowser::Initialize() } // Make a new default profile - nsAutoString newProfileName; newProfileName.AssignWithConversion("MozillaControl"); + nsAutoString newProfileName(NS_LITERAL_STRING("MozillaControl")); PRBool profileExists = PR_FALSE; rv = profileService->ProfileExists(newProfileName.get(), &profileExists); if (NS_FAILED(rv)) @@ -1709,7 +1709,7 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoHome(void) } nsAutoString sUrl; - sUrl.AssignWithConversion("http://home.netscape.com"); + sUrl.Assign(NS_LITERAL_STRING("http://home.netscape.com")); // Find the home page stored in prefs if (mPrefs) diff --git a/mozilla/embedding/browser/build/makefile.win b/mozilla/embedding/browser/build/makefile.win index 3d16a8691cc..c776393e011 100644 --- a/mozilla/embedding/browser/build/makefile.win +++ b/mozilla/embedding/browser/build/makefile.win @@ -56,6 +56,7 @@ SUB_LIBRARIES=\ $(NULL) LLIBS = \ + $(DIST)\lib\unicharutil_s.lib \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\gkgfx.lib \ $(LIBNSPR) diff --git a/mozilla/embedding/browser/macbuild/webBrowser.xml b/mozilla/embedding/browser/macbuild/webBrowser.xml index 5d67c62757d..3c544183390 100644 --- a/mozilla/embedding/browser/macbuild/webBrowser.xml +++ b/mozilla/embedding/browser/macbuild/webBrowser.xml @@ -105,6 +105,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -1011,6 +1021,13 @@ Text + + Name + UnicharUtilsStaticDebug.o + MacOS + Library + Debug + @@ -1073,6 +1090,11 @@ nsWebBrowserContentPolicy.cpp MacOS + + Name + UnicharUtilsStaticDebug.o + MacOS + @@ -1127,6 +1149,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -2033,6 +2065,13 @@ Text + + Name + UnicharUtilsStatic.o + MacOS + Library + Debug + @@ -2095,6 +2134,11 @@ nsWebBrowserContentPolicy.cpp MacOS + + Name + UnicharUtilsStatic.o + MacOS + @@ -2105,6 +2149,20 @@ + Static Libs + + webBrowser.shlb + Name + UnicharUtilsStatic.o + MacOS + + + webBrowserDebug.shlb + Name + UnicharUtilsStaticDebug.o + MacOS + + webBrowser webBrowserDebug.shlb diff --git a/mozilla/embedding/browser/photon/src/nsPrintSettingsImpl.cpp b/mozilla/embedding/browser/photon/src/nsPrintSettingsImpl.cpp index ba156064399..75551dd2185 100644 --- a/mozilla/embedding/browser/photon/src/nsPrintSettingsImpl.cpp +++ b/mozilla/embedding/browser/photon/src/nsPrintSettingsImpl.cpp @@ -76,11 +76,11 @@ nsPrintSettings::nsPrintSettings() : mPrintOptions = kOptPrintOddPages | kOptPrintEvenPages; - mHeaderStrs[0].AssignWithConversion("&T"); - mHeaderStrs[2].AssignWithConversion("&U"); + mHeaderStrs[0].Assign(NS_LITERAL_STRING("&T")); + mHeaderStrs[2].Assign(NS_LITERAL_STRING("&U")); - mFooterStrs[0].AssignWithConversion("&PT"); // Use &P (Page Num Only) or &PT (Page Num of Page Total) - mFooterStrs[2].AssignWithConversion("&D"); + mFooterStrs[0].Assign(NS_LITERAL_STRING("&PT")); // Use &P (Page Num Only) or &PT (Page Num of Page Total) + mFooterStrs[2].Assign(NS_LITERAL_STRING("&D")); } diff --git a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp index edfd785c896..03815bdb9e7 100644 --- a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp +++ b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp @@ -751,7 +751,7 @@ Boolean CBrowserShell::DoSaveFileDialog(FSSpec& outSpec, Boolean& outIsReplacing // For now, we'll assume that we're saving HTML NS_NAMED_LITERAL_STRING(htmlSuffix, ".html"); if (docTitle.IsEmpty()) - docTitle.AssignWithConversion("untitled"); + docTitle.Assign(NS_LITERAL_STRING("untitled")); else { if (docTitle.Length() > 31 - htmlSuffix.Length()) docTitle.Truncate(31 - htmlSuffix.Length()); diff --git a/mozilla/embedding/browser/webBrowser/Makefile.in b/mozilla/embedding/browser/webBrowser/Makefile.in index 18a678ab251..51dae53a47c 100644 --- a/mozilla/embedding/browser/webBrowser/Makefile.in +++ b/mozilla/embedding/browser/webBrowser/Makefile.in @@ -44,6 +44,7 @@ REQUIRES = xpcom \ wallet \ appcomps \ webbrowserpersist \ + unicharutil \ $(NULL) include $(DEPTH)/config/autoconf.mk diff --git a/mozilla/embedding/browser/webBrowser/makefile.win b/mozilla/embedding/browser/webBrowser/makefile.win index 15185153c61..8713d53a5c2 100644 --- a/mozilla/embedding/browser/webBrowser/makefile.win +++ b/mozilla/embedding/browser/webBrowser/makefile.win @@ -39,6 +39,7 @@ REQUIRES = xpcom \ content \ history \ webbrowserpersist \ + unicharutil \ $(NULL) EXPORTS = \ diff --git a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index 715ac98179f..1e183a710e6 100644 --- a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -36,6 +36,7 @@ #include "nsIServiceManager.h" #include "nsXPIDLString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" // Interfaces needed to be included #include "nsIContextMenuListener.h" @@ -1466,27 +1467,27 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent ) element->GetTagName(tag); // Test what kind of element we're dealing with here - if (tag.EqualsWithConversion("img", PR_TRUE)) + if (!Compare(tag, NS_LITERAL_STRING("img"), nsCaseInsensitiveStringComparator())) { flags |= nsIContextMenuListener::CONTEXT_IMAGE; targetDOMnode = node; // if we see an image, keep searching for a possible anchor } - else if (tag.EqualsWithConversion("input", PR_TRUE)) + else if (!Compare(tag, NS_LITERAL_STRING("input"), nsCaseInsensitiveStringComparator())) { // INPUT element - button, combo, checkbox, text etc. flags |= nsIContextMenuListener::CONTEXT_INPUT; targetDOMnode = node; break; // exit do-while } - else if (tag.EqualsWithConversion("textarea", PR_TRUE)) + else if (!Compare(tag, NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator())) { // text area flags |= nsIContextMenuListener::CONTEXT_TEXT; targetDOMnode = node; break; // exit do-while } - else if (tag.EqualsWithConversion("html", PR_TRUE)) + else if (!Compare(tag, NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator())) { // only care about this if no other context was found. if (!flags) { @@ -1502,7 +1503,7 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent ) if (attributes) { nsCOMPtr hrefNode; - nsAutoString href; href.AssignWithConversion("href"); + nsAutoString href(NS_LITERAL_STRING("href")); attributes->GetNamedItem(href, getter_AddRefs(hrefNode)); if (hrefNode) { diff --git a/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp b/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp index 68b37e1cee9..700fb1f4292 100644 --- a/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp +++ b/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp @@ -652,7 +652,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( // Save the document nsCOMPtr diskDoc = do_QueryInterface(docAsNode); - nsString contentType; contentType.AssignWithConversion("text/html"); // TODO + nsString contentType(NS_LITERAL_STRING("text/html")); // TODO nsString charType; // Empty rv = diskDoc->SaveFile( @@ -686,7 +686,7 @@ nsresult nsWebBrowserPersist::SaveDocuments() // Save the document, fixing it up with the new URIs as we do nsCOMPtr diskDoc = do_QueryInterface(docData->mDocument); - nsString contentType; contentType.AssignWithConversion("text/html"); // TODO + nsString contentType(NS_LITERAL_STRING("text/html")); // TODO nsString charType; // Empty nsEncoderNodeFixup *nodeFixup; @@ -1072,7 +1072,7 @@ nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode, PRBool *aAbort) StoreURIAttribute(aNode, "src", PR_FALSE, &data); data->mIsSubFrame = PR_TRUE; // TODO how do we get the proper extension (or MIME type) from a DOM document? - data->mSubFrameExt.AssignWithConversion(".htm"); + data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm")); // Save the frame content nsCOMPtr content; nodeAsFrame->GetContentDocument(getter_AddRefs(content)); @@ -1090,7 +1090,7 @@ nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode, PRBool *aAbort) StoreURIAttribute(aNode, "src", PR_FALSE, &data); data->mIsSubFrame = PR_TRUE; // TODO how do we get the proper extension (or MIME type) from a DOM document? - data->mSubFrameExt.AssignWithConversion(".htm"); + data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm")); // Save the frame content nsCOMPtr content; nodeAsIFrame->GetContentDocument(getter_AddRefs(content)); @@ -1318,7 +1318,7 @@ nsWebBrowserPersist::FixupAnchor(nsIDOMNode *aNode) NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); // Make all anchor links absolute so they point off onto the Internet - nsString attribute; attribute.AssignWithConversion("href"); + nsString attribute(NS_LITERAL_STRING("href")); rv = attrMap->GetNamedItem(attribute, getter_AddRefs(attrNode)); if (attrNode) { @@ -1378,7 +1378,7 @@ nsWebBrowserPersist::SaveSubframeContent( NS_ENSURE_SUCCESS(rv, PR_FALSE); nsCOMPtr frameDatapath = do_QueryInterface(frameDataPathAsFile); nsString frameDataPathName = aData->mFilename; - frameDataPathName.AppendWithConversion("_data"); + frameDataPathName.Append(NS_LITERAL_STRING("_data")); frameDatapath->AppendUnicode(frameDataPathName.get()); SaveDocumentInternal(aFrameContent, frameFile, frameDatapath); @@ -1445,7 +1445,7 @@ nsWebBrowserPersist::SaveDocumentToFileWithFixup( rv = aDocument->GetDocumentCharacterSet(charsetStr); if(NS_FAILED(rv)) { - charsetStr.AssignWithConversion("ISO-8859-1"); + charsetStr.Assign(NS_LITERAL_STRING("ISO-8859-1")); } } encoder->SetCharset(charsetStr); diff --git a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index 92312e44cb3..141dccfb29e 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -1067,7 +1067,7 @@ void nsWindowWatcher::CheckWindowName(nsString& aName) // Don't use js_ReportError as this will cause the application // to shut down (JS_ASSERT calls abort()) See bug 32898 nsAutoString warn; - warn.AssignWithConversion("Illegal character in window name "); + warn.Assign(NS_LITERAL_STRING("Illegal character in window name ")); warn.Append(aName); char *cp = ToNewCString(warn); NS_WARNING(cp); diff --git a/mozilla/embedding/tests/mfcembed/nsPrintSettingsImpl.cpp b/mozilla/embedding/tests/mfcembed/nsPrintSettingsImpl.cpp index cffb914e2a5..0c92a944d89 100644 --- a/mozilla/embedding/tests/mfcembed/nsPrintSettingsImpl.cpp +++ b/mozilla/embedding/tests/mfcembed/nsPrintSettingsImpl.cpp @@ -76,11 +76,11 @@ nsPrintSettings::nsPrintSettings() : mPrintOptions = kOptPrintOddPages | kOptPrintEvenPages; - mHeaderStrs[0].AssignWithConversion("&T"); - mHeaderStrs[2].AssignWithConversion("&U"); + mHeaderStrs[0].Assign(NS_LITERAL_STRING("&T")); + mHeaderStrs[2].Assign(NS_LITERAL_STRING("&U")); - mFooterStrs[0].AssignWithConversion("&PT"); // Use &P (Page Num Only) or &PT (Page Num of Page Total) - mFooterStrs[2].AssignWithConversion("&D"); + mFooterStrs[0].Assign(NS_LITERAL_STRING("&PT")); // Use &P (Page Num Only) or &PT (Page Num of Page Total) + mFooterStrs[2].Assign(NS_LITERAL_STRING("&D")); } diff --git a/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp b/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp index 364275ae5bb..2ab673c3257 100644 --- a/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp +++ b/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp @@ -138,7 +138,7 @@ NS_IMETHODIMP nsAccessProxy::HandleEvent(nsIDOMEvent* aEvent) } //return NS_OK; /* - if (presShell && eventNameStr.EqualsWithConversion("click")) { + if (presShell && eventNameStr.Equals(NS_LITERAL_STRING("click"))) { nsCOMPtr frameSelection; presShell->GetFrameSelection(getter_AddRefs(frameSelection)); if (!frameSelection) diff --git a/mozilla/extensions/cookie/nsCookies.cpp b/mozilla/extensions/cookie/nsCookies.cpp index ff46d7a94f2..cb7a1dd01b1 100644 --- a/mozilla/extensions/cookie/nsCookies.cpp +++ b/mozilla/extensions/cookie/nsCookies.cpp @@ -1561,12 +1561,12 @@ COOKIE_Read() { new_cookie->cookie = ToNewCString(cookie); new_cookie->host = ToNewCString(host); new_cookie->path = ToNewCString(path); - if (isDomain.EqualsWithConversion("TRUE")) { + if (isDomain.Equals(NS_LITERAL_STRING("TRUE"))) { new_cookie->isDomain = PR_TRUE; } else { new_cookie->isDomain = PR_FALSE; } - if (isSecure.EqualsWithConversion("TRUE")) { + if (isSecure.Equals(NS_LITERAL_STRING("TRUE"))) { new_cookie->isSecure = PR_TRUE; } else { new_cookie->isSecure = PR_FALSE; diff --git a/mozilla/extensions/cookie/nsPermissions.cpp b/mozilla/extensions/cookie/nsPermissions.cpp index d66dfc77dfb..5e21a7d4ac5 100644 --- a/mozilla/extensions/cookie/nsPermissions.cpp +++ b/mozilla/extensions/cookie/nsPermissions.cpp @@ -523,7 +523,7 @@ PERMISSION_Read() { * a host value of "@@@@" is a special code designating the * state of the nag-box's checkmark */ - if (host.EqualsWithConversion("@@@@")) { + if (host.Equals(NS_LITERAL_STRING("@@@@"))) { if (!permissionString.IsEmpty()) { permission_SetRememberChecked(type, permission); } diff --git a/mozilla/extensions/finger/nsFingerChannel.cpp b/mozilla/extensions/finger/nsFingerChannel.cpp index 029174c72af..3db53101364 100644 --- a/mozilla/extensions/finger/nsFingerChannel.cpp +++ b/mozilla/extensions/finger/nsFingerChannel.cpp @@ -372,8 +372,8 @@ nsFingerChannel::OnStopRequest(nsIRequest *aRequest, nsISupports* aContext, do_GetService(kStreamConverterServiceCID, &rv); if (NS_FAILED(rv)) return rv; - nsAutoString fromStr; fromStr.AssignWithConversion("text/plain"); - nsAutoString toStr; toStr.AssignWithConversion("text/html"); + nsAutoString fromStr(NS_LITERAL_STRING("text/plain")); + nsAutoString toStr(NS_LITERAL_STRING("text/html")); rv = StreamConvService->AsyncConvertData(fromStr.get(), toStr.get(), this, mResponseContext, @@ -382,7 +382,7 @@ nsFingerChannel::OnStopRequest(nsIRequest *aRequest, nsISupports* aContext, nsCOMPtr converter(do_QueryInterface(converterListener)); if (converter) { - nsAutoString title; title.AssignWithConversion("Finger information for "); + nsAutoString title(NS_LITERAL_STRING("Finger information for ")); nsXPIDLCString userHost; rv = mUrl->GetPath(getter_Copies(userHost)); title.AppendWithConversion(userHost); diff --git a/mozilla/extensions/p3p/src/nsP3PDataStruct.cpp b/mozilla/extensions/p3p/src/nsP3PDataStruct.cpp index e590b9ac8c4..15a019d7f5f 100644 --- a/mozilla/extensions/p3p/src/nsP3PDataStruct.cpp +++ b/mozilla/extensions/p3p/src/nsP3PDataStruct.cpp @@ -205,7 +205,7 @@ nsP3PDataStruct::GetFullName( nsString& aName ) { mParent->GetFullName( aName ); if (aName.Length( ) > 0) { - aName.AppendWithConversion( "." ); + aName.Append(NS_LITERAL_STRING(".")); } aName += mName; diff --git a/mozilla/extensions/p3p/src/nsP3PObserverHTML.cpp b/mozilla/extensions/p3p/src/nsP3PObserverHTML.cpp index e8603aa5714..be86e64d921 100644 --- a/mozilla/extensions/p3p/src/nsP3PObserverHTML.cpp +++ b/mozilla/extensions/p3p/src/nsP3PObserverHTML.cpp @@ -371,7 +371,7 @@ nsP3PObserverHTML::Notify( nsISupports *aDocumentID, if (NS_SUCCEEDED( rv )) { // Extract the DocShell from the ParserBundle - sDocumentKey.AssignWithConversion( "docshell" ); + sDocumentKey.Assign(NS_LITERAL_STRING("docshell")); rv = pParserBundle->GetDataFromBundle( sDocumentKey, getter_AddRefs( pDocShell ) ); diff --git a/mozilla/extensions/p3p/src/nsP3PObserverXML.cpp b/mozilla/extensions/p3p/src/nsP3PObserverXML.cpp index bdd005a42ee..b15928839e4 100644 --- a/mozilla/extensions/p3p/src/nsP3PObserverXML.cpp +++ b/mozilla/extensions/p3p/src/nsP3PObserverXML.cpp @@ -381,7 +381,7 @@ nsP3PObserverXML::Notify( nsISupports *aDocumentID, if (NS_SUCCEEDED( rv )) { // Extract the DocShell from the ParserBundle - sDocumentKey.AssignWithConversion( "docshell" ); + sDocumentKey.Assign(NS_LITERAL_STRING("docshell")); rv = pParserBundle->GetDataFromBundle( sDocumentKey, getter_AddRefs( pDocShell ) ); diff --git a/mozilla/extensions/p3p/src/nsP3PPolicy.cpp b/mozilla/extensions/p3p/src/nsP3PPolicy.cpp index 45d2a760535..b02bb11760b 100644 --- a/mozilla/extensions/p3p/src/nsP3PPolicy.cpp +++ b/mozilla/extensions/p3p/src/nsP3PPolicy.cpp @@ -580,7 +580,7 @@ nsP3PPolicy::ProcessExpiryTagExpiry( nsIP3PTag *aTag ) { else if (pExpiryTag->mMaxAge.Length( ) > 0) { // "max-age" attribute specified mCacheControlValue.AssignWithConversion( P3P_CACHECONTROL_MAXAGE ); - mCacheControlValue.AppendWithConversion( "=" ); + mCacheControlValue.Append(NS_LITERAL_STRING("=")); mCacheControlValue += pExpiryTag->mMaxAge; } @@ -1282,9 +1282,9 @@ nsP3PPolicy::CreateRDFPolicyDescription( nsIP3PTag *aEntityTag, if (csPolicy) { // Create a unique "about" attribute - mRDFAbout.AssignWithConversion( "#__" ); + mRDFAbout.Assign(NS_LITERAL_STRING("#__")); mRDFAbout += mURISpec; - mRDFAbout.AppendWithConversion( " @ " ); + mRDFAbout.Append(NS_LITERAL_STRING(" @ ")); mRDFAbout.AppendWithConversion( csPolicy ); PR_smprintf_free( csPolicy ); @@ -1333,7 +1333,7 @@ nsP3PPolicy::CreateRDFPolicyDescription( nsIP3PTag *aEntityTag, if (aEntityTag) { // tag is present, add the entity information sName = mRDFAbout; - sName.AppendWithConversion( "__Entity" ); + sName.Append(NS_LITERAL_STRING("__Entity")); sValue.Truncate( ); rv = mP3PService->GetLocaleString( "EntityInformation", sTitle ); @@ -1474,7 +1474,7 @@ nsP3PPolicy::CreateRDFPolicyDescription( nsIP3PTag *aEntityTag, if (NS_SUCCEEDED( rv ) && (mFailedDataTagRefs.Count( ) > 0)) { // Some tags failed the preference comparison sName = mRDFAbout; - sName.AppendWithConversion( "__DataTags" ); + sName.Append(NS_LITERAL_STRING("__DataTags")); sValue.Truncate( ); rv = mP3PService->GetLocaleString( "FailedData", sTitle ); @@ -1588,7 +1588,7 @@ nsP3PPolicy::CreateRDFEntityDescription( nsIP3PTag *aEntityTag ) { // Create a "unique" about attribute sName = mRDFAbout; - sName.AppendWithConversion( "__Entity" ); + sName.Append(NS_LITERAL_STRING("__Entity")); sTitle.Truncate( ); sValue.Truncate( ); @@ -1775,7 +1775,7 @@ nsP3PPolicy::CreateRDFDataTagsDescription( ) { sName = mRDFAbout; - sName.AppendWithConversion( "__DataTags" ); + sName.Append(NS_LITERAL_STRING("__DataTags")); sTitle.Truncate( ); sValue.Truncate( ); @@ -1874,7 +1874,7 @@ nsP3PPolicy::AddRDFDataTag( nsString& aDescription, // Create a unique "about" attribute for the data tag information sName = mRDFAbout; - sName.AppendWithConversion( "__DataTags__DataTag_" ); + sName.Append(NS_LITERAL_STRING("__DataTags__DataTag_")); sName += aDescription; sTitle = aDescription; sValue.Truncate( ); @@ -2738,9 +2738,9 @@ nsP3PPolicy::SetFailedPrefsCombination( nsString& aDataStructName, else { if (aShortDescription.Length( ) > 0) { sDescription = aShortDescription; - sDescription.AppendWithConversion( " (" ); + sDescription.Append(NS_LITERAL_STRING(" (")); sDescription += aDataStructName; - sDescription.AppendWithConversion( ")" ); + sDescription.Append(NS_LITERAL_STRING(")")); } else { sDescription = aDataStructName; @@ -2771,9 +2771,9 @@ nsP3PPolicy::SetFailedPrefsCombination( nsString& aDataStructName, if (NS_SUCCEEDED( rv )) { sPrefsCombination = aCategoryValue; - sPrefsCombination.AppendWithConversion( ", " ); + sPrefsCombination.Append(NS_LITERAL_STRING(", ")); sPrefsCombination += aPurposeValue; - sPrefsCombination.AppendWithConversion( ", " ); + sPrefsCombination.Append(NS_LITERAL_STRING(", ")); sPrefsCombination += aRecipientValue; pDataTagResult->mFailedPrefsCombinations.AppendString( sPrefsCombination ); diff --git a/mozilla/extensions/p3p/src/nsP3PPolicyRefFile.cpp b/mozilla/extensions/p3p/src/nsP3PPolicyRefFile.cpp index 48bd39399ea..8eab83eb5f8 100644 --- a/mozilla/extensions/p3p/src/nsP3PPolicyRefFile.cpp +++ b/mozilla/extensions/p3p/src/nsP3PPolicyRefFile.cpp @@ -520,7 +520,7 @@ nsP3PPolicyRefFile::ProcessExpiryTagExpiry( nsIP3PTag *aTag ) { // "max-age" attribute specified mCacheControlValue.AssignWithConversion( P3P_CACHECONTROL_MAXAGE ); - mCacheControlValue.AppendWithConversion( "=" ); + mCacheControlValue.Append(NS_LITERAL_STRING("=")); mCacheControlValue += pExpiryTag->mMaxAge; } @@ -677,7 +677,7 @@ nsP3PPolicyRefFile::AddInlinePolicy( nsIP3PTag *aTag, (void **)&pPolicyTag ); if (NS_SUCCEEDED( rv )) { - sPolicyName.AssignWithConversion( "#" ); + sPolicyName.Assign(NS_LITERAL_STRING("#")); sPolicyName += pPolicyTag->mName; rv = CreatePolicyURISpec( sPolicyName, @@ -1223,14 +1223,14 @@ nsP3PPolicyRefFile::UnEscapeAsterisks( nsString& aString ) { nsAutoString sAsterisk, sAsteriskEscapeSequence; - sAsterisk.AssignWithConversion( "*" ); + sAsterisk.Assign(NS_LITERAL_STRING("*")); - sAsteriskEscapeSequence.AssignWithConversion( "%2a" ); + sAsteriskEscapeSequence.Assign(NS_LITERAL_STRING("%2a")); UnEscape( aString, sAsteriskEscapeSequence, sAsterisk ); - sAsteriskEscapeSequence.AssignWithConversion( "%2A" ); + sAsteriskEscapeSequence.Assign(NS_LITERAL_STRING("%2A")); UnEscape( aString, sAsteriskEscapeSequence, sAsterisk ); diff --git a/mozilla/extensions/p3p/src/nsP3PPrivacyResult.cpp b/mozilla/extensions/p3p/src/nsP3PPrivacyResult.cpp index f10a087db55..95885970177 100644 --- a/mozilla/extensions/p3p/src/nsP3PPrivacyResult.cpp +++ b/mozilla/extensions/p3p/src/nsP3PPrivacyResult.cpp @@ -454,7 +454,7 @@ nsP3PPrivacyResult::GetPrivacyInfo( nsIRDFDataSource **aDataSource ) { getter_AddRefs( pDataSource ) ); if (NS_SUCCEEDED( rv )) { - sName.AssignWithConversion( "NC:P3PPolicyRoot" ); + sName.Assign(NS_LITERAL_STRING("NC:P3PPolicyRoot")); sTitle.Truncate( ); sValue.Truncate( ); @@ -592,9 +592,9 @@ nsP3PPrivacyResult::CreateRDFDescription( nsString& aAbout, if (csPrivacyResult) { // Create a unique "about" attribute - mRDFAbout.AssignWithConversion( "#__" ); + mRDFAbout.Assign(NS_LITERAL_STRING("#__")); mRDFAbout += mURISpec; - mRDFAbout.AppendWithConversion( " @ " ); + mRDFAbout.Append(NS_LITERAL_STRING(" @ ")); mRDFAbout.AppendWithConversion( csPrivacyResult ); PR_smprintf_free( csPrivacyResult ); @@ -685,7 +685,7 @@ nsP3PPrivacyResult::CreateRDFDescription( nsString& aAbout, ("P3PPrivacyResult: %s CreateRDFDescription, no Policy associated.\n", (const char *)mcsURISpec) ); sPolicyAbout = mRDFAbout; - sPolicyAbout.AppendWithConversion( "NoPolicy" ); + sPolicyAbout.Append(NS_LITERAL_STRING("NoPolicy")); rv = mP3PService->GetLocaleString( "NoPolicy", sPolicyTitle ); } @@ -693,7 +693,7 @@ nsP3PPrivacyResult::CreateRDFDescription( nsString& aAbout, if (NS_FAILED( rv )) { // An error occurred obtaining the Policy information, let it be known sPolicyAbout = mRDFAbout; - sPolicyAbout.AppendWithConversion( "ErrorObtainingPolicy" ); + sPolicyAbout.Append(NS_LITERAL_STRING("ErrorObtainingPolicy")); rv = mP3PService->GetLocaleString( "ErrorObtainingPolicy", sPolicyTitle ); } diff --git a/mozilla/extensions/p3p/src/nsP3PService.cpp b/mozilla/extensions/p3p/src/nsP3PService.cpp index 46b69777315..28ab0ee0003 100644 --- a/mozilla/extensions/p3p/src/nsP3PService.cpp +++ b/mozilla/extensions/p3p/src/nsP3PService.cpp @@ -567,7 +567,7 @@ nsP3PService::LoadingObject( nsIURI *aLoadingURI, } else { // Not the first load - if (!sLoadingURISpec.EqualsWithConversion( "about:layout-dummy-request" )) { + if (!sLoadingURISpec.Equals(NS_LITERAL_STRING("about:layout-dummy-request"))) { // We don't have a dummy layout request // Make sure a DocShellTreeItemData object exists @@ -1767,7 +1767,7 @@ nsP3PService::GetURIComponents( nsIURI *aURI, PRInt32 iPort; - aURISpec.AssignWithConversion( "" ); + aURISpec.Assign(NS_LITERAL_STRING("")); rv = aURI->GetSpec( getter_Copies( xcsBuffer ) ); if (NS_SUCCEEDED( rv )) { @@ -1780,7 +1780,7 @@ nsP3PService::GetURIComponents( nsIURI *aURI, } if (NS_SUCCEEDED( rv )) { - aURIScheme.AssignWithConversion( "" ); + aURIScheme.Assign(NS_LITERAL_STRING("")); rv = aURI->GetScheme( getter_Copies( xcsBuffer ) ); if (NS_SUCCEEDED( rv )) { @@ -1794,7 +1794,7 @@ nsP3PService::GetURIComponents( nsIURI *aURI, } if (NS_SUCCEEDED( rv ) && !aURIScheme.EqualsIgnoreCase( "about" )) { - aURIHostPort.AssignWithConversion( "" ); + aURIHostPort.Assign(NS_LITERAL_STRING("")); rv = aURI->GetHost( getter_Copies( xcsBuffer ) ); if (NS_SUCCEEDED( rv )) { @@ -1802,7 +1802,7 @@ nsP3PService::GetURIComponents( nsIURI *aURI, rv = aURI->GetPort(&iPort ); if (NS_SUCCEEDED( rv ) && (iPort >= 0) && (iPort != 80)) { - aURIHostPort.AppendWithConversion( ":" ); + aURIHostPort.Append(NS_LITERAL_STRING(":")); aURIHostPort.AppendInt( iPort ); } else if (NS_FAILED( rv )) { @@ -1819,7 +1819,7 @@ nsP3PService::GetURIComponents( nsIURI *aURI, } if (NS_SUCCEEDED( rv )) { - aURIPath.AssignWithConversion( "" ); + aURIPath.Assign(NS_LITERAL_STRING("")); rv = aURI->GetPath( getter_Copies( xcsBuffer ) ); if (NS_SUCCEEDED( rv )) { @@ -2805,7 +2805,7 @@ nsP3PService::DeleteCookie( nsIURI *aURI, iExpiresEnd; - sExpires.AssignWithConversion( "expires=" ); + sExpires.Assign(NS_LITERAL_STRING("expires=")); sExpires.AppendWithConversion( mGMTStartTime ); sWork.Trim( " " ); @@ -2832,10 +2832,10 @@ nsP3PService::DeleteCookie( nsIURI *aURI, char lastChar = (char)sWork.Last( ); if (lastChar != ';') { - sWork.AppendWithConversion( ";" ); + sWork.Append(NS_LITERAL_STRING(";")); } - sWork.AppendWithConversion( " " ); + sWork.Append(NS_LITERAL_STRING(" ")); sWork += sExpires; } @@ -2964,7 +2964,7 @@ nsP3PService::GetFormRequestMethod( nsIContent *aFormContent, } if (NS_SUCCEEDED( rv ) && !bAttributeFound) { - aURIMethod.AssignWithConversion( "GET" ); + aURIMethod.Assign(NS_LITERAL_STRING("GET")); } return rv; diff --git a/mozilla/extensions/p3p/src/nsP3PTags.cpp b/mozilla/extensions/p3p/src/nsP3PTags.cpp index e7ed72b74e0..3ec91121d58 100644 --- a/mozilla/extensions/p3p/src/nsP3PTags.cpp +++ b/mozilla/extensions/p3p/src/nsP3PTags.cpp @@ -257,7 +257,7 @@ nsP3PTag::GetAttribute( nsString& aAttributeName, nsAutoString sAttributeNameSpace; - aAttributeValue.AssignWithConversion( "" ); + aAttributeValue.Assign(NS_LITERAL_STRING("")); if (aAttributePresent) { *aAttributePresent = PR_FALSE; } diff --git a/mozilla/extensions/p3p/src/nsP3PXMLProcessor.cpp b/mozilla/extensions/p3p/src/nsP3PXMLProcessor.cpp index 2e237424c0e..994983dbb41 100644 --- a/mozilla/extensions/p3p/src/nsP3PXMLProcessor.cpp +++ b/mozilla/extensions/p3p/src/nsP3PXMLProcessor.cpp @@ -492,7 +492,7 @@ nsP3PXMLProcessor::HandleEvent( nsIDOMEvent *aEvent ) { if (NS_SUCCEEDED( rv )) { nsAutoLock lock( mLock ); - if (sEventType.EqualsWithConversion( "load" )) { + if (sEventType.Equals(NS_LITERAL_STRING("load"))) { // "Load" event #ifdef DEBUG_P3P { printf( "P3P: Read complete for %s (read as %s)\n", (const char *)mcsURISpec, (const char *)mcsReadURISpec ); diff --git a/mozilla/extensions/wallet/src/nsWalletService.cpp b/mozilla/extensions/wallet/src/nsWalletService.cpp index 652cd4bb31b..446efe30e41 100644 --- a/mozilla/extensions/wallet/src/nsWalletService.cpp +++ b/mozilla/extensions/wallet/src/nsWalletService.cpp @@ -64,6 +64,7 @@ #include "nsIWindowWatcher.h" #include "nsIWebProgress.h" #include "nsXPIDLString.h" +#include "nsUnicharUtils.h" #include "nsReadableUtils.h" #include "nsICategoryManager.h" @@ -428,7 +429,7 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress, nsAutoString type; rv = inputElement->GetType(type); if (NS_SUCCEEDED(rv)) { - if (type.CompareWithConversion("password", PR_TRUE) == 0) { + if (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0) { passwordCount++; } } @@ -448,8 +449,8 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress, nsAutoString type; rv = inputElement->GetType(type); if (NS_SUCCEEDED(rv)) { - if ((type.IsEmpty()) || (type.CompareWithConversion("text", PR_TRUE) == 0) || - (type.CompareWithConversion("password", PR_TRUE) == 0)) { + if ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0) || + (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0)) { nsAutoString field; rv = inputElement->GetName(field); if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/extensions/wallet/src/singsign.cpp b/mozilla/extensions/wallet/src/singsign.cpp index c35ea2baf3a..8bb630dee03 100644 --- a/mozilla/extensions/wallet/src/singsign.cpp +++ b/mozilla/extensions/wallet/src/singsign.cpp @@ -1144,7 +1144,7 @@ si_GetURLAndUserForChangeForm(nsIPrompt* dialog, const nsString& password) nsAutoString userName; if (NS_SUCCEEDED(si_Decrypt (data->value, userName))) { nsAutoString temp; temp.AssignWithConversion(url->passwordRealm); - temp.AppendWithConversion(":"); + temp.Append(NS_LITERAL_STRING(":")); temp.Append(userName); *list2 = ToNewUnicode(temp); diff --git a/mozilla/extensions/wallet/src/wallet.cpp b/mozilla/extensions/wallet/src/wallet.cpp index 27e0a9a8a70..bf475a5ae23 100644 --- a/mozilla/extensions/wallet/src/wallet.cpp +++ b/mozilla/extensions/wallet/src/wallet.cpp @@ -1932,7 +1932,7 @@ wallet_StepForwardOrBack return; } } else { - if (NS_SUCCEEDED(result) && (type.CompareWithConversion("hidden", PR_TRUE) != 0)) { + if (NS_SUCCEEDED(result) && (Compare(type, NS_LITERAL_STRING("hidden"), nsCaseInsensitiveStringComparator()) != 0)) { /* at element and it's type is not "hidden" */ atInputOrSelect = PR_TRUE; return; @@ -2374,7 +2374,7 @@ wallet_GetPrefills( if ((NS_SUCCEEDED(result)) && (nsnull != inputElement)) { nsAutoString type; result = inputElement->GetType(type); - if ((NS_SUCCEEDED(result)) && ((type.IsEmpty()) || (type.CompareWithConversion("text", PR_TRUE) == 0))) { + if ((NS_SUCCEEDED(result)) && ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) { nsAutoString field; result = inputElement->GetName(field); if (NS_SUCCEEDED(result)) { @@ -3515,7 +3515,7 @@ wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) { nsAutoString type; result = inputElement->GetType(type); if ((NS_SUCCEEDED(result)) && - (type.IsEmpty() || (type.CompareWithConversion("text", PR_TRUE) == 0))) { + (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) { nsAutoString field; result = inputElement->GetName(field); if (NS_SUCCEEDED(result)) { @@ -3883,8 +3883,8 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindowInternal* window) { rv = inputElement->GetType(type); if (NS_SUCCEEDED(rv)) { - PRBool isText = (type.IsEmpty() || (type.CompareWithConversion("text", PR_TRUE)==0)); - PRBool isPassword = (type.CompareWithConversion("password", PR_TRUE)==0); + PRBool isText = (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator())==0)); + PRBool isPassword = (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())==0); // don't save password if field was left blank if (isPassword) { diff --git a/mozilla/extensions/xmlextras/base/src/nsDOMParser.cpp b/mozilla/extensions/xmlextras/base/src/nsDOMParser.cpp index b27bb592363..dfad8a61a56 100644 --- a/mozilla/extensions/xmlextras/base/src/nsDOMParser.cpp +++ b/mozilla/extensions/xmlextras/base/src/nsDOMParser.cpp @@ -395,7 +395,7 @@ ConvertWStringToStream(const PRUnichar* aStr, do_GetService(kCharsetConverterManagerCID, &rv); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - charsetStr.AssignWithConversion("UTF-8"); + charsetStr.Assign(NS_LITERAL_STRING("UTF-8")); rv = charsetConv->GetUnicodeEncoder(&charsetStr, getter_AddRefs(encoder)); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); diff --git a/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp b/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp index bc74a1d099f..8100af82a33 100644 --- a/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp +++ b/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp @@ -683,7 +683,7 @@ nsXMLHttpRequest::GetStreamForWString(const PRUnichar* aStr, do_GetService(kCharsetConverterManagerCID, &rv); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - charsetStr.AssignWithConversion("UTF-8"); + charsetStr.Assign(NS_LITERAL_STRING("UTF-8")); rv = charsetConv->GetUnicodeEncoder(&charsetStr, getter_AddRefs(encoder)); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp index 2028ebfbda4..04e7d62d490 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp @@ -331,43 +331,43 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) keyChar = U_ESCAPE; break; case nsIDOMKeyEvent::DOM_VK_HOME: - JSCommand.AssignWithConversion("ScrollHomeKey"); + JSCommand.Assign(NS_LITERAL_STRING("ScrollHomeKey")); break; case nsIDOMKeyEvent::DOM_VK_END: - JSCommand.AssignWithConversion("ScrollEndKey"); + JSCommand.Assign(NS_LITERAL_STRING("ScrollEndKey")); break; case nsIDOMKeyEvent::DOM_VK_PAGE_UP: - JSCommand.AssignWithConversion("ScrollPageUpKey"); + JSCommand.Assign(NS_LITERAL_STRING("ScrollPageUpKey")); break; case nsIDOMKeyEvent::DOM_VK_PAGE_DOWN: - JSCommand.AssignWithConversion("ScrollPageDownKey"); + JSCommand.Assign(NS_LITERAL_STRING("ScrollPageDownKey")); break; case nsIDOMKeyEvent::DOM_VK_F1: - JSCommand.AssignWithConversion("F1Key"); + JSCommand.Assign(NS_LITERAL_STRING("F1Key")); break; case nsIDOMKeyEvent::DOM_VK_F2: - JSCommand.AssignWithConversion("F2Key"); + JSCommand.Assign(NS_LITERAL_STRING("F2Key")); break; case nsIDOMKeyEvent::DOM_VK_F3: - JSCommand.AssignWithConversion("F3Key"); + JSCommand.Assign(NS_LITERAL_STRING("F3Key")); break; case nsIDOMKeyEvent::DOM_VK_F4: - JSCommand.AssignWithConversion("F4Key"); + JSCommand.Assign(NS_LITERAL_STRING("F4Key")); break; case nsIDOMKeyEvent::DOM_VK_F5: - JSCommand.AssignWithConversion("F5Key"); + JSCommand.Assign(NS_LITERAL_STRING("F5Key")); break; case nsIDOMKeyEvent::DOM_VK_F6: - JSCommand.AssignWithConversion("F6Key"); + JSCommand.Assign(NS_LITERAL_STRING("F6Key")); break; case nsIDOMKeyEvent::DOM_VK_F7: - JSCommand.AssignWithConversion("F7Key"); + JSCommand.Assign(NS_LITERAL_STRING("F7Key")); break; case nsIDOMKeyEvent::DOM_VK_F8: - JSCommand.AssignWithConversion("F8Key"); + JSCommand.Assign(NS_LITERAL_STRING("F8Key")); break; case nsIDOMKeyEvent::DOM_VK_F9: - JSCommand.AssignWithConversion("F9Key"); + JSCommand.Assign(NS_LITERAL_STRING("F9Key")); break; default: if ( (ctrlKey && (keyCode ==nsIDOMKeyEvent::DOM_VK_SPACE)) || @@ -399,11 +399,11 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) if (NS_SUCCEEDED(result) && domDocument) { nsAutoString JSInput = JSCommand; nsAutoString JSOutput; JSOutput.SetLength(0); - JSInput.AppendWithConversion("("); + JSInput.Append(NS_LITERAL_STRING("(")); JSInput.AppendInt(shiftKey,10); - JSInput.AppendWithConversion(","); + JSInput.Append(NS_LITERAL_STRING(",")); JSInput.AppendInt(ctrlKey,10); - JSInput.AppendWithConversion(");"); + JSInput.Append(NS_LITERAL_STRING(");")); result = mozXMLTermUtils::ExecuteScript(domDocument, JSInput, JSOutput); diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp index 84ac8b0d408..f65cd34f312 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp @@ -210,7 +210,7 @@ NS_IMETHODIMP mozXMLTermSession::Init(mozIXMLTerminal* aXMLTerminal, // Locate document body node nsCOMPtr nodeList; nsAutoString bodyTag; - bodyTag.AssignWithConversion("body"); + bodyTag.Assign(NS_LITERAL_STRING("body")); result = vDOMHTMLDocument->GetElementsByTagName(bodyTag, getter_AddRefs(nodeList)); if (NS_FAILED(result) || !nodeList) @@ -452,7 +452,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, result = lineTermAux->ReadAux(&opcodes, &opvals, &buf_row, &buf_col, &buf_str, &buf_style); if (NS_FAILED(result)) { - abortCode.AssignWithConversion("lineTermReadAux"); + abortCode.Assign(NS_LITERAL_STRING("lineTermReadAux")); break; } @@ -544,7 +544,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, if (streamIsSecure) { // Secure stream, i.e., prefixed with cookie; fragments allowed - streamURL.AssignWithConversion("chrome://xmlterm/content/xmltblank.html"); + streamURL.Assign(NS_LITERAL_STRING("chrome://xmlterm/content/xmltblank.html")); if (opcodes & LTERM_JSSTREAM_CODE) { // Javascript stream @@ -557,7 +557,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, } else { // Insecure stream; do not display - streamURL.AssignWithConversion("http://in.sec.ure"); + streamURL.Assign(NS_LITERAL_STRING("http://in.sec.ure")); streamMarkupType = INSECURE_FRAGMENT; } @@ -887,9 +887,9 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, { // Construct Javascript command to handle default meta comand nsAutoString JSCommand; - JSCommand.AssignWithConversion("MetaDefault(\""); + JSCommand.Assign(NS_LITERAL_STRING("MetaDefault(\"")); JSCommand.Append(commandArgs); - JSCommand.AppendWithConversion("\");"); + JSCommand.Append(NS_LITERAL_STRING("\");")); // Execute JavaScript command result = mozXMLTermUtils::ExecuteScript(domDoc, @@ -910,16 +910,16 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, { // Display URL using IFRAME nsAutoString url; - url.AssignWithConversion("http:"); + url.Assign(NS_LITERAL_STRING("http:")); url.Append(commandArgs); nsAutoString width; - width.AssignWithConversion("100%"); + width.Assign(NS_LITERAL_STRING("100%")); nsAutoString height; - height.AssignWithConversion("100"); + height.Assign(NS_LITERAL_STRING("100")); result = NewIFrame(mOutputBlockNode, mCurrentEntryNumber, 2, url, width, height); if (NS_FAILED(result)) - metaCommandOutput.AssignWithConversion("Error in displaying URL\n"); + metaCommandOutput.Assign(NS_LITERAL_STRING("Error in displaying URL\n")); } break; @@ -953,12 +953,12 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, lsCommand.SetLength(0); if (commandArgs.Length() > 0) { - lsCommand.AppendWithConversion("cd "); + lsCommand.Append(NS_LITERAL_STRING("cd ")); lsCommand.Append(commandArgs); - lsCommand.AppendWithConversion(";"); + lsCommand.Append(NS_LITERAL_STRING(";")); } - lsCommand.AppendWithConversion("ls -dF `pwd`/*\n"); + lsCommand.Append(NS_LITERAL_STRING("ls -dF `pwd`/*\n")); //mXMLTerminal->SendText(lsCommand); @@ -980,7 +980,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, XMLT_LOG(mozXMLTermSession::ReadAll,62,("metaCommandOutput\n")); // Ignore the string "false", if that's the only output - if (metaCommandOutput.EqualsWithConversion("false")) + if (metaCommandOutput.Equals(NS_LITERAL_STRING("false"))) metaCommandOutput.SetLength(0); // Check metacommand output for markup (secure) @@ -1136,15 +1136,15 @@ NS_IMETHODIMP mozXMLTermSession::Abort(mozILineTermAux* lineTermAux, // Display error message using DIV node nsCOMPtr divNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("div"); - nsAutoString elementName; elementName.AssignWithConversion("errmsg"); + nsAutoString tagName(NS_LITERAL_STRING("div")); + nsAutoString elementName(NS_LITERAL_STRING("errmsg")); result = NewElementWithText(tagName, elementName, -1, mSessionNode, divNode, textNode); if (NS_SUCCEEDED(result) && divNode && textNode) { - nsAutoString errMsg; errMsg.AssignWithConversion("Error in XMLterm (code "); + nsAutoString errMsg(NS_LITERAL_STRING("Error in XMLterm (code ")); errMsg.Append(abortCode); - errMsg.AppendWithConversion("); session closed."); + errMsg.Append(NS_LITERAL_STRING("); session closed.")); SetDOMText(textNode, errMsg); // Collapse selection and position cursor @@ -1275,7 +1275,7 @@ NS_IMETHODIMP mozXMLTermSession::AutoDetectMarkup(const nsString& aString, if (str.First() == U_LESSTHAN) { // Markup tag detected str.CompressWhitespace(); - str.AppendWithConversion(" "); + str.Append(NS_LITERAL_STRING(" ")); if ( (str.Find(" spanNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("span"); - nsAutoString elementName; elementName.AssignWithConversion("stream"); + nsAutoString tagName(NS_LITERAL_STRING("span")); + nsAutoString elementName(NS_LITERAL_STRING("stream")); result = NewElementWithText(tagName, elementName, -1, mOutputBlockNode, spanNode, textNode); @@ -1474,11 +1474,11 @@ NS_IMETHODIMP mozXMLTermSession::BreakOutput(PRBool positionCursorBelow) // Handle stream output error messages switch (mOutputMarkupType) { case INSECURE_FRAGMENT: - mFragmentBuffer.AssignWithConversion("XMLTerm: *Error* Insecure stream data; is LTERM_COOKIE set?"); + mFragmentBuffer.Assign(NS_LITERAL_STRING("XMLTerm: *Error* Insecure stream data; is LTERM_COOKIE set?")); break; case INCOMPLETE_FRAGMENT: - mFragmentBuffer.AssignWithConversion("XMLTerm: *Error* Incomplete stream data"); + mFragmentBuffer.Assign(NS_LITERAL_STRING("XMLTerm: *Error* Incomplete stream data")); break; default: @@ -1503,7 +1503,7 @@ NS_IMETHODIMP mozXMLTermSession::BreakOutput(PRBool positionCursorBelow) mFragmentBuffer, jsOutput); if (NS_FAILED(result)) - jsOutput.AssignWithConversion("Error in JavaScript execution\n"); + jsOutput.Assign(NS_LITERAL_STRING("Error in JavaScript execution\n")); mFragmentBuffer.SetLength(0); @@ -1615,9 +1615,9 @@ NS_IMETHODIMP mozXMLTermSession::ProcessOutput(const nsString& aString, } else { mOutputMarkupType = OVERFLOW_FRAGMENT; - mFragmentBuffer.AssignWithConversion("XMLTerm: *Error* Stream data overflow ("); + mFragmentBuffer.Assign(NS_LITERAL_STRING("XMLTerm: *Error* Stream data overflow (")); mFragmentBuffer.AppendInt(strLen,10); - mFragmentBuffer.AppendWithConversion(" chars)"); + mFragmentBuffer.Append(NS_LITERAL_STRING(" chars)")); break; } @@ -1632,7 +1632,7 @@ NS_IMETHODIMP mozXMLTermSession::ProcessOutput(const nsString& aString, if (newline || streamOutput) { nsAutoString str(aString); if (newline) - str.AppendWithConversion("\n"); + str.Append(NS_LITERAL_STRING("\n")); result = mXMLTermStream->Write(str.get()); if (NS_FAILED(result)) { @@ -1683,7 +1683,7 @@ NS_IMETHODIMP mozXMLTermSession::LimitOutputLines(PRBool deleteAllOld) if (!attValue.EqualsWithConversion(sessionElementNames[WARNING_ELEMENT])) { // Create warning message element nsCOMPtr divNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("div"); + nsAutoString tagName(NS_LITERAL_STRING("div")); nsAutoString elementName; elementName.AssignWithConversion(sessionElementNames[WARNING_ELEMENT]); result = NewElementWithText(tagName, elementName, -1, mOutputBlockNode, divNode, textNode, @@ -1694,9 +1694,9 @@ NS_IMETHODIMP mozXMLTermSession::LimitOutputLines(PRBool deleteAllOld) firstChild = divNode; nsAutoString warningMsg; - warningMsg.AssignWithConversion("XMLTerm: *WARNING* Command output truncated to "); + warningMsg.Assign(NS_LITERAL_STRING("XMLTerm: *WARNING* Command output truncated to ")); warningMsg.AppendInt(300,10); - warningMsg.AppendWithConversion(" lines"); + warningMsg.Append(NS_LITERAL_STRING(" lines")); result = SetDOMText(textNode, warningMsg); } @@ -1878,7 +1878,7 @@ NS_IMETHODIMP mozXMLTermSession::AppendOutput(const nsString& aString, // Create PRE display node nsCOMPtr preNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("pre"); + nsAutoString tagName(NS_LITERAL_STRING("pre")); result = NewElementWithText(tagName, elementName, -1, mOutputBlockNode, preNode, textNode); @@ -1965,7 +1965,7 @@ NS_IMETHODIMP mozXMLTermSession::AppendOutput(const nsString& aString, // Create new DIV node nsAutoString elementName; elementName.AssignWithConversion(sessionElementNames[MIXED_ELEMENT]); nsCOMPtr divNode; - nsAutoString tagName; tagName.AssignWithConversion("div"); + nsAutoString tagName(NS_LITERAL_STRING("div")); result = NewElement(tagName, elementName, -1, mOutputBlockNode, divNode); @@ -1988,7 +1988,7 @@ NS_IMETHODIMP mozXMLTermSession::AppendOutput(const nsString& aString, currentStyle = strStyle[0]; mOutputTextOffset = 0; - tagName.AssignWithConversion("span"); + tagName.Assign(NS_LITERAL_STRING("span")); PR_ASSERT(strLength > 0); @@ -2179,26 +2179,26 @@ NS_IMETHODIMP mozXMLTermSession::AppendLineLS(const nsString& aString, aString.Mid(pathname, wordBegin, wordEnd-wordBegin+1-dropSuffix); // Append to markup string - markupString.AssignWithConversion(""); + markupString.Assign(NS_LITERAL_STRING(">")); markupString.Assign(filename); - markupString.AssignWithConversion(""); + markupString.Assign(NS_LITERAL_STRING("")); // Search for new word wordBegin = wordEnd+1; @@ -2223,7 +2223,7 @@ NS_IMETHODIMP mozXMLTermSession::AppendLineLS(const nsString& aString, // Insert text node containing newline only nsCOMPtr newText; - nsAutoString newlineStr; newlineStr.AssignWithConversion("\n"); + nsAutoString newlineStr(NS_LITERAL_STRING("\n")); result = domDoc->CreateTextNode(newlineStr, getter_AddRefs(newText)); if (NS_FAILED(result) || !newText) @@ -2541,7 +2541,7 @@ NS_IMETHODIMP mozXMLTermSession::DeepSanitizeFragment( nsAutoString attName, attValue; for (j=0; j= 0) { // Process ID attribute - attName.AssignWithConversion("id"); + attName.Assign(NS_LITERAL_STRING("id")); attValue.SetLength(0); result = domElement->GetAttribute(attName, attValue); @@ -2618,7 +2618,7 @@ NS_IMETHODIMP mozXMLTermSession::DeepSanitizeFragment( for (j=0; j spanNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("span"); + nsAutoString tagName(NS_LITERAL_STRING("span")); nsAutoString elementName; elementName.AssignWithConversion(sessionElementNames[STDOUT_ELEMENT]); result = NewElementWithText(tagName, elementName, -1, mOutputBlockNode, spanNode, textNode); @@ -3040,8 +3040,8 @@ NS_IMETHODIMP mozXMLTermSession::NewPreface(void) // Create preface element and append as child of session element nsCOMPtr divNode; - nsAutoString tagName; tagName.AssignWithConversion("div"); - nsAutoString name; name.AssignWithConversion("preface"); + nsAutoString tagName(NS_LITERAL_STRING("div")); + nsAutoString name(NS_LITERAL_STRING("preface")); result = NewElement(tagName, name, 0, mSessionNode, divNode); @@ -3125,7 +3125,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create "entry" element nsCOMPtr entryNode; - tagName.AssignWithConversion("div"); + tagName.Assign(NS_LITERAL_STRING("div")); name.AssignWithConversion(sessionElementNames[ENTRY_ELEMENT]); result = NewElement(tagName, name, mCurrentEntryNumber, mSessionNode, entryNode); @@ -3141,7 +3141,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create "input" element containing "prompt" and "command" elements nsCOMPtr inputNode; - tagName.AssignWithConversion("div"); + tagName.Assign(NS_LITERAL_STRING("div")); name.AssignWithConversion(sessionElementNames[INPUT_ELEMENT]); result = NewElement(tagName, name, mCurrentEntryNumber, mCurrentEntryNode, inputNode); @@ -3153,7 +3153,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create prompt element nsCOMPtr newPromptSpanNode; - tagName.AssignWithConversion("span"); + tagName.Assign(NS_LITERAL_STRING("span")); name.AssignWithConversion(sessionElementNames[PROMPT_ELEMENT]); result = NewElement(tagName, name, mCurrentEntryNumber, inputNode, newPromptSpanNode); @@ -3174,8 +3174,8 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create text node + image node as child of prompt element nsCOMPtr spanNode, textNode; - tagName.AssignWithConversion("span"); - name.AssignWithConversion("noicons"); + tagName.Assign(NS_LITERAL_STRING("span")); + name.Assign(NS_LITERAL_STRING("noicons")); result = NewElementWithText(tagName, name, -1, mPromptSpanNode, spanNode, textNode); if (NS_FAILED(result) || !spanNode || !textNode) { @@ -3193,23 +3193,23 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) return NS_ERROR_FAILURE; // Create IMG element - tagName.AssignWithConversion("img"); + tagName.Assign(NS_LITERAL_STRING("img")); nsCOMPtr imgElement; result = domDoc->CreateElement(tagName, getter_AddRefs(imgElement)); if (NS_FAILED(result) || !imgElement) return NS_ERROR_FAILURE; // Set attributes - nsAutoString attName; attName.AssignWithConversion("class"); - nsAutoString attValue; attValue.AssignWithConversion("icons"); + nsAutoString attName(NS_LITERAL_STRING("class")); + nsAutoString attValue(NS_LITERAL_STRING("icons")); imgElement->SetAttribute(attName, attValue); - attName.AssignWithConversion("src"); - attValue.AssignWithConversion("chrome://xmlterm/content/wheel.gif"); + attName.Assign(NS_LITERAL_STRING("src")); + attValue.Assign(NS_LITERAL_STRING("chrome://xmlterm/content/wheel.gif")); imgElement->SetAttribute(attName, attValue); - attName.AssignWithConversion("align"); - attValue.AssignWithConversion("middle"); + attName.Assign(NS_LITERAL_STRING("align")); + attValue.Assign(NS_LITERAL_STRING("middle")); imgElement->SetAttribute(attName, attValue); nsCOMPtr resultNode; @@ -3223,7 +3223,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Append text node containing single space nsCOMPtr stubText; - nsAutoString spaceStr; spaceStr.AssignWithConversion(" "); + nsAutoString spaceStr(NS_LITERAL_STRING(" ")); result = domDoc->CreateTextNode(spaceStr, getter_AddRefs(stubText)); if (NS_FAILED(result) || !stubText) return NS_ERROR_FAILURE; @@ -3256,7 +3256,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create command element nsCOMPtr newCommandSpanNode; - tagName.AssignWithConversion("span"); + tagName.Assign(NS_LITERAL_STRING("span")); name.AssignWithConversion(sessionElementNames[COMMAND_ELEMENT]); result = NewElement(tagName, name, mCurrentEntryNumber, inputNode, newCommandSpanNode); @@ -3277,7 +3277,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) // Create output element and append as child of current entry element nsCOMPtr divNode; - tagName.AssignWithConversion("div"); + tagName.Assign(NS_LITERAL_STRING("div")); name.AssignWithConversion(sessionElementNames[OUTPUT_ELEMENT]); result = NewElement(tagName, name, mCurrentEntryNumber, mCurrentEntryNode, divNode); @@ -3312,8 +3312,8 @@ NS_IMETHODIMP mozXMLTermSession::NewScreen(void) // Create screen element and append as child of session element nsCOMPtr divNode; - nsAutoString tagName; tagName.AssignWithConversion("div"); - nsAutoString name; name.AssignWithConversion("screen"); + nsAutoString tagName(NS_LITERAL_STRING("div")); + nsAutoString name(NS_LITERAL_STRING("screen")); result = NewElement(tagName, name, 0, mSessionNode, divNode); @@ -3497,8 +3497,8 @@ NS_IMETHODIMP mozXMLTermSession::NewRow(nsIDOMNode* beforeRowNode, // Create PRE display node nsCOMPtr preNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("pre"); - nsAutoString elementName; elementName.AssignWithConversion("row"); + nsAutoString tagName(NS_LITERAL_STRING("pre")); + nsAutoString elementName(NS_LITERAL_STRING("row")); result = NewElementWithText(tagName, elementName, -1, mScreenNode, preNode, textNode); @@ -3508,13 +3508,13 @@ NS_IMETHODIMP mozXMLTermSession::NewRow(nsIDOMNode* beforeRowNode, // Set PRE element attributes nsCOMPtr preElement = do_QueryInterface(preNode); - nsAutoString att; att.AssignWithConversion("cols"); + nsAutoString att(NS_LITERAL_STRING("cols")); nsAutoString val; val.SetLength(0); val.AppendInt(mScreenCols,10); preElement->SetAttribute(att, val); - att.AssignWithConversion("rows"); - val.AssignWithConversion("1"); + att.Assign(NS_LITERAL_STRING("rows")); + val.Assign(NS_LITERAL_STRING("1")); preElement->SetAttribute(att, val); if (beforeRowNode) { @@ -3615,7 +3615,7 @@ NS_IMETHODIMP mozXMLTermSession::DisplayRow(const nsString& aString, } nsCOMPtr spanNode, textNode; - nsAutoString tagName; tagName.AssignWithConversion("span"); + nsAutoString tagName(NS_LITERAL_STRING("span")); nsAutoString elementName; nsAutoString subString; PRInt32 k; @@ -3643,19 +3643,19 @@ NS_IMETHODIMP mozXMLTermSession::DisplayRow(const nsString& aString, switch (currentStyle) { case LTERM_STDOUT_STYLE | LTERM_BOLD_STYLE: - elementName.AssignWithConversion("boldstyle"); + elementName.Assign(NS_LITERAL_STRING("boldstyle")); break; case LTERM_STDOUT_STYLE | LTERM_ULINE_STYLE: - elementName.AssignWithConversion("underlinestyle"); + elementName.Assign(NS_LITERAL_STRING("underlinestyle")); break; case LTERM_STDOUT_STYLE | LTERM_BLINK_STYLE: - elementName.AssignWithConversion("blinkstyle"); + elementName.Assign(NS_LITERAL_STRING("blinkstyle")); break; case LTERM_STDOUT_STYLE | LTERM_INVERSE_STYLE: - elementName.AssignWithConversion("inversestyle"); + elementName.Assign(NS_LITERAL_STRING("inversestyle")); break; default: - elementName.AssignWithConversion("boldstyle"); + elementName.Assign(NS_LITERAL_STRING("boldstyle")); break; } @@ -3689,7 +3689,7 @@ NS_IMETHODIMP mozXMLTermSession::DisplayRow(const nsString& aString, NS_IMETHODIMP mozXMLTermSession::NewBreak(nsIDOMNode* parentNode) { nsresult result; - nsAutoString tagName; tagName.AssignWithConversion("br"); + nsAutoString tagName(NS_LITERAL_STRING("br")); XMLT_LOG(mozXMLTermSession::NewBreak,60,("\n")); @@ -3764,7 +3764,7 @@ NS_IMETHODIMP mozXMLTermSession::NewAnchor(const nsString& classAttribute, nsCOMPtr& anchorNode) { nsresult result; - nsAutoString tagName; tagName.AssignWithConversion("a"); + nsAutoString tagName(NS_LITERAL_STRING("a")); XMLT_LOG(mozXMLTermSession::NewAnchor,80,("\n")); @@ -3780,16 +3780,16 @@ NS_IMETHODIMP mozXMLTermSession::NewAnchor(const nsString& classAttribute, return NS_ERROR_FAILURE; // Set element attributes - nsAutoString hrefAtt; hrefAtt.AssignWithConversion("href"); - nsAutoString hrefVal; hrefVal.AssignWithConversion("#"); + nsAutoString hrefAtt(NS_LITERAL_STRING("href")); + nsAutoString hrefVal(NS_LITERAL_STRING("#")); newElement->SetAttribute(hrefAtt, hrefVal); if (classAttribute.Length() > 0) { - nsAutoString classStr; classStr.AssignWithConversion("class"); + nsAutoString classStr(NS_LITERAL_STRING("class")); newElement->SetAttribute(classStr, classAttribute); if (number >= 0) { - nsAutoString idAtt; idAtt.AssignWithConversion("id"); + nsAutoString idAtt(NS_LITERAL_STRING("id")); nsAutoString idVal(classAttribute); idVal.AppendInt(number,10); newElement->SetAttribute(idAtt, idVal); @@ -3843,16 +3843,16 @@ NS_IMETHODIMP mozXMLTermSession::NewElement(const nsString& tagName, if (name.Length() > 0) { // Set attributes - nsAutoString classAtt; classAtt.AssignWithConversion("class"); + nsAutoString classAtt(NS_LITERAL_STRING("class")); nsAutoString classVal(name); newElement->SetAttribute(classAtt, classVal); - nsAutoString nameAtt; nameAtt.AssignWithConversion("name"); + nsAutoString nameAtt(NS_LITERAL_STRING("name")); nsAutoString nameVal(name); newElement->SetAttribute(nameAtt, nameVal); if (number >= 0) { - nsAutoString idAtt; idAtt.AssignWithConversion("id"); + nsAutoString idAtt(NS_LITERAL_STRING("id")); nsAutoString idVal(name); idVal.AppendInt(number,10); newElement->SetAttribute(idAtt, idVal); @@ -3957,7 +3957,7 @@ NS_IMETHODIMP mozXMLTermSession::NewIFrame(nsIDOMNode* parentNode, #else // Create IFRAME element nsCOMPtr newElement; - nsAutoString tagName; tagName.AssignWithConversion("iframe"); + nsAutoString tagName(NS_LITERAL_STRING("iframe")); result = domDoc->CreateElement(tagName, getter_AddRefs(newElement)); if (NS_FAILED(result) || !newElement) return NS_ERROR_FAILURE; @@ -3966,32 +3966,32 @@ NS_IMETHODIMP mozXMLTermSession::NewIFrame(nsIDOMNode* parentNode, // Set attributes if (number >= 0) { - attName.AssignWithConversion("name"); - attValue.AssignWithConversion("iframe"); + attName.Assign(NS_LITERAL_STRING("name")); + attValue.Assign(NS_LITERAL_STRING("iframe")); attValue.AppendInt(number,10); newElement->SetAttribute(attName, attValue); } - attName.AssignWithConversion("frameborder"); + attName.Assign(NS_LITERAL_STRING("frameborder")); attValue.SetLength(0); attValue.AppendInt(frameBorder,10); newElement->SetAttribute(attName, attValue); if (src.Length() > 0) { // Set SRC attribute - attName.AssignWithConversion("src"); + attName.Assign(NS_LITERAL_STRING("src")); newElement->SetAttribute(attName, src); } if (width.Length() > 0) { // Set WIDTH attribute - attName.AssignWithConversion("width"); + attName.Assign(NS_LITERAL_STRING("width")); newElement->SetAttribute(attName, width); } if (height.Length() > 0) { // Set HEIGHT attribute - attName.AssignWithConversion("height"); + attName.Assign(NS_LITERAL_STRING("height")); newElement->SetAttribute(attName, height); } @@ -4024,16 +4024,16 @@ NS_IMETHODIMP mozXMLTermSession::SetEventAttributes(const nsString& name, int j; for (j=0; jSetAttribute(attName, attValue); if (NS_FAILED(result)) @@ -4138,7 +4138,7 @@ NS_IMETHODIMP mozXMLTermSession::ToHTMLString(nsIDOMNode* aNode, XMLT_LOG(mozXMLTermSession::ToHTMLString,80,("\n")); nsAutoString newIndentString (indentString); - newIndentString.AppendWithConversion(" "); + newIndentString.Append(NS_LITERAL_STRING(" ")); htmlString.SetLength(0); @@ -4157,7 +4157,7 @@ NS_IMETHODIMP mozXMLTermSession::ToHTMLString(nsIDOMNode* aNode, if (!insidePRENode) { htmlString += indentString; } - htmlString.AppendWithConversion("<"); + htmlString.Append(NS_LITERAL_STRING("<")); htmlString += tagName; PRBool isPRENode = tagName.EqualsIgnoreCase("pre"); @@ -4185,15 +4185,15 @@ NS_IMETHODIMP mozXMLTermSession::ToHTMLString(nsIDOMNode* aNode, result = attr->GetName(attrName); if (NS_SUCCEEDED(result)) { - htmlString.AppendWithConversion(" "); + htmlString.Append(NS_LITERAL_STRING(" ")); htmlString.Append(attrName); } result = attr->GetValue(attrValue); if (NS_SUCCEEDED(result) && (attrName.Length() > 0)) { - htmlString.AppendWithConversion("=\""); + htmlString.Append(NS_LITERAL_STRING("=\"")); htmlString.Append(attrValue); - htmlString.AppendWithConversion("\""); + htmlString.Append(NS_LITERAL_STRING("\"")); } } } @@ -4202,14 +4202,14 @@ NS_IMETHODIMP mozXMLTermSession::ToHTMLString(nsIDOMNode* aNode, } if (!deepContent) { - htmlString.AppendWithConversion(">"); + htmlString.Append(NS_LITERAL_STRING(">")); } else { // Iterate over all child nodes to generate deep content nsCOMPtr child; result = aNode->GetFirstChild(getter_AddRefs(child)); - nsAutoString htmlInner; htmlInner.AssignWithConversion(""); + nsAutoString htmlInner(NS_LITERAL_STRING("")); while (child) { nsAutoString innerString; ToHTMLString(child, newIndentString, innerString, deepContent, @@ -4225,27 +4225,27 @@ NS_IMETHODIMP mozXMLTermSession::ToHTMLString(nsIDOMNode* aNode, if (htmlInner.Length() > 0) { if (insidePRENode) - htmlString.AppendWithConversion("\n>"); + htmlString.Append(NS_LITERAL_STRING("\n>")); else - htmlString.AppendWithConversion(">\n"); + htmlString.Append(NS_LITERAL_STRING(">\n")); htmlString += htmlInner; if (!insidePRENode) htmlString += indentString; } else { - htmlString.AppendWithConversion(">"); + htmlString.Append(NS_LITERAL_STRING(">")); } - htmlString.AppendWithConversion(""); + htmlString.Append(NS_LITERAL_STRING("\n")); + htmlString.Append(NS_LITERAL_STRING(">")); if (!insidePRENode) - htmlString.AppendWithConversion("\n"); + htmlString.Append(NS_LITERAL_STRING("\n")); } } } diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp index 622c3112010..63ef3e2ae79 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp @@ -153,12 +153,12 @@ NS_IMETHODIMP mozXMLTermStream::Open(nsIDOMWindowInternal* aDOMWindow, if (mMaxResizeHeight > 0) { // Set initial IFRAME size to be as wide as the window, but very short - nsAutoString attWidth; attWidth.AssignWithConversion("width"); - nsAutoString valWidth; valWidth.AssignWithConversion("100%"); + nsAutoString attWidth(NS_LITERAL_STRING("width")); + nsAutoString valWidth(NS_LITERAL_STRING("100%")); mDOMIFrameElement->SetAttribute(attWidth,valWidth); - nsAutoString attHeight; attHeight.AssignWithConversion("height"); - nsAutoString valHeight; valHeight.AssignWithConversion("10"); + nsAutoString attHeight(NS_LITERAL_STRING("height")); + nsAutoString valHeight(NS_LITERAL_STRING("10")); mDOMIFrameElement->SetAttribute(attHeight,valHeight); } @@ -408,8 +408,8 @@ NS_IMETHODIMP mozXMLTermStream::SizeToContentHeight(PRInt32 maxHeight) if ((pageHeight > shellHeight) || (pageWidth > shellWidth)) { // Page larger than docshell - nsAutoString attHeight; attHeight.AssignWithConversion("height"); - nsAutoString attWidth; attWidth.AssignWithConversion("width"); + nsAutoString attHeight(NS_LITERAL_STRING("height")); + nsAutoString attWidth(NS_LITERAL_STRING("width")); nsAutoString attValue; attValue.SetLength(0); PRInt32 newPageHeight = pageHeight; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index 82be7bc5397..dd4647518ab 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -678,7 +678,7 @@ NS_IMETHODIMP mozXMLTerminal::SendText(const PRUnichar* aString, if (NS_FAILED(result)) { // Abort XMLterm session nsAutoString abortCode; - abortCode.AssignWithConversion("SendText"); + abortCode.Assign(NS_LITERAL_STRING("SendText")); mXMLTermSession->Abort(mLineTermAux, abortCode); return NS_ERROR_FAILURE; } diff --git a/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp b/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp index 5a36dc54e5c..282502ec92c 100644 --- a/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp +++ b/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp @@ -830,7 +830,7 @@ nsSystemFontsGTK::GetSystemFontInfo(GdkFont* iFont, nsFont* aFont, float aPixels --numFonts; if (numFonts == 0) break; - fontName.AppendWithConversion(","); + fontName.Append(NS_LITERAL_STRING(",")); } } return NS_OK; diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index 19db017982b..bd8102bb219 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -288,7 +288,7 @@ NS_IMETHODIMP nsDeviceContextMac :: GetSystemFont(nsSystemFontID aID, nsFont *aF aID == eSystemFont_PullDownMenu || aID == eSystemFont_List || aID == eSystemFont_Field) { - aFont->name.AssignWithConversion( "sans-serif" ); + aFont->name.Assign(NS_LITERAL_STRING("sans-serif")); aFont->size = NSToCoordRound(aFont->size * 0.875f); // quick hack } else if (HasAppearanceManager()) @@ -336,7 +336,7 @@ NS_IMETHODIMP nsDeviceContextMac :: GetSystemFont(nsSystemFontID aID, nsFont *aF } else { - aFont->name.AssignWithConversion( "geneva" ); + aFont->name.Assign(NS_LITERAL_STRING("geneva")); } break; @@ -919,15 +919,15 @@ nsresult nsDeviceContextMac::CreateFontAliasTable() mFontAliasTable = new nsHashtable(); if (nsnull != mFontAliasTable) { - nsAutoString fontTimes; fontTimes.AssignWithConversion("Times"); - nsAutoString fontTimesNewRoman; fontTimesNewRoman.AssignWithConversion("Times New Roman"); - nsAutoString fontTimesRoman; fontTimesRoman.AssignWithConversion("Times Roman"); - nsAutoString fontArial; fontArial.AssignWithConversion("Arial"); - nsAutoString fontHelvetica; fontHelvetica.AssignWithConversion("Helvetica"); - nsAutoString fontCourier; fontCourier.AssignWithConversion("Courier"); - nsAutoString fontCourierNew; fontCourierNew.AssignWithConversion("Courier New"); - nsAutoString fontUnicode; fontUnicode.AssignWithConversion("Unicode"); - nsAutoString fontBitstreamCyberbit; fontBitstreamCyberbit.AssignWithConversion("Bitstream Cyberbit"); + nsAutoString fontTimes; fontTimes.Assign(NS_LITERAL_STRING("Times")); + nsAutoString fontTimesNewRoman; fontTimesNewRoman.Assign(NS_LITERAL_STRING("Times New Roman")); + nsAutoString fontTimesRoman; fontTimesRoman.Assign(NS_LITERAL_STRING("Times Roman")); + nsAutoString fontArial; fontArial.Assign(NS_LITERAL_STRING("Arial")); + nsAutoString fontHelvetica; fontHelvetica.Assign(NS_LITERAL_STRING("Helvetica")); + nsAutoString fontCourier; fontCourier.Assign(NS_LITERAL_STRING("Courier")); + nsAutoString fontCourierNew; fontCourierNew.Assign(NS_LITERAL_STRING("Courier New")); + nsAutoString fontUnicode; fontUnicode.Assign(NS_LITERAL_STRING("Unicode")); + nsAutoString fontBitstreamCyberbit; fontBitstreamCyberbit.Assign(NS_LITERAL_STRING("Bitstream Cyberbit")); nsAutoString fontNullStr; AliasFont(fontTimes, fontTimesNewRoman, fontTimesRoman, PR_FALSE); diff --git a/mozilla/gfx/src/mac/nsFontMetricsMac.cpp b/mozilla/gfx/src/mac/nsFontMetricsMac.cpp index 1807373d2ac..66521a24400 100644 --- a/mozilla/gfx/src/mac/nsFontMetricsMac.cpp +++ b/mozilla/gfx/src/mac/nsFontMetricsMac.cpp @@ -121,7 +121,7 @@ nsUnicodeFontMappingMac* nsFontMetricsMac::GetUnicodeFontMapping() if (mLangGroup) mLangGroup->ToString(langGroup); else - langGroup.AssignWithConversion("ja"); + langGroup.Assign(NS_LITERAL_STRING("ja")); nsString lang; mFontMapping = nsUnicodeFontMappingMac::GetCachedInstance(mFont, mContext, langGroup, lang); @@ -148,33 +148,33 @@ static void MapGenericFamilyToFont(const nsString& aGenericFamily, nsString& aFo } NS_ASSERTION(0, "Failed to find a font"); - aFontFace.AssignWithConversion("Times"); + aFontFace.Assign(NS_LITERAL_STRING("Times")); /* // fall back onto hard-coded font names if (aGenericFamily.EqualsIgnoreCase("serif")) { - aFontFace.AssignWithConversion("Times"); + aFontFace.Assign(NS_LITERAL_STRING("Times")); } else if (aGenericFamily.EqualsIgnoreCase("sans-serif")) { - aFontFace.AssignWithConversion("Helvetica"); + aFontFace.Assign(NS_LITERAL_STRING("Helvetica")); } else if (aGenericFamily.EqualsIgnoreCase("cursive")) { - aFontFace.AssignWithConversion("Apple Chancery"); + aFontFace.Assign(NS_LITERAL_STRING("Apple Chancery")); } else if (aGenericFamily.EqualsIgnoreCase("fantasy")) { - aFontFace.AssignWithConversion("Gadget"); + aFontFace.Assign(NS_LITERAL_STRING("Gadget")); } else if (aGenericFamily.EqualsIgnoreCase("monospace")) { - aFontFace.AssignWithConversion("Courier"); + aFontFace.Assign(NS_LITERAL_STRING("Courier")); } else if (aGenericFamily.EqualsIgnoreCase("-moz-fixed")) { - aFontFace.AssignWithConversion("Courier"); + aFontFace.Assign(NS_LITERAL_STRING("Courier")); } */ } @@ -226,7 +226,7 @@ void nsFontMetricsMac::RealizeFont() if (mLangGroup) mLangGroup->ToString(theLangGroupString); else - theLangGroupString.AssignWithConversion("ja"); + theLangGroupString.Assign(NS_LITERAL_STRING("ja")); theScriptCode = unicodeMappingUtil->MapLangGroupToScriptCode( NS_ConvertUCS2toUTF8(theLangGroupString).get()); diff --git a/mozilla/gfx/src/mac/nsUnicodeFontMappingMac.cpp b/mozilla/gfx/src/mac/nsUnicodeFontMappingMac.cpp index 785c54a022e..67595a7bc07 100644 --- a/mozilla/gfx/src/mac/nsUnicodeFontMappingMac.cpp +++ b/mozilla/gfx/src/mac/nsUnicodeFontMappingMac.cpp @@ -330,9 +330,9 @@ nsUnicodeFontMappingMac* nsUnicodeFontMappingMac::GetCachedInstance( nsUnicodeFontMappingMac* obj = nsnull; nsAutoString key(aFont->name); - key.AppendWithConversion(":"); + key.Append(NS_LITERAL_STRING(":")); key.Append(aLangGroup); - key.AppendWithConversion(":"); + key.Append(NS_LITERAL_STRING(":")); key.Append(aLANG); if(! fontMappingCache->Get ( key, &obj )){ obj = new nsUnicodeFontMappingMac(aFont, aDeviceContext, aLangGroup, aLANG); diff --git a/mozilla/gfx/src/nsDeviceContext.cpp b/mozilla/gfx/src/nsDeviceContext.cpp index fa49c3e05d3..2c5b5da5abc 100644 --- a/mozilla/gfx/src/nsDeviceContext.cpp +++ b/mozilla/gfx/src/nsDeviceContext.cpp @@ -491,13 +491,13 @@ nsresult DeviceContextImpl::CreateFontAliasTable() mFontAliasTable = new nsHashtable(); if (nsnull != mFontAliasTable) { - nsAutoString times; times.AssignWithConversion("Times"); - nsAutoString timesNewRoman; timesNewRoman.AssignWithConversion("Times New Roman"); - nsAutoString timesRoman; timesRoman.AssignWithConversion("Times Roman"); - nsAutoString arial; arial.AssignWithConversion("Arial"); - nsAutoString helvetica; helvetica.AssignWithConversion("Helvetica"); - nsAutoString courier; courier.AssignWithConversion("Courier"); - nsAutoString courierNew; courierNew.AssignWithConversion("Courier New"); + nsAutoString times; times.Assign(NS_LITERAL_STRING("Times")); + nsAutoString timesNewRoman; timesNewRoman.Assign(NS_LITERAL_STRING("Times New Roman")); + nsAutoString timesRoman; timesRoman.Assign(NS_LITERAL_STRING("Times Roman")); + nsAutoString arial; arial.Assign(NS_LITERAL_STRING("Arial")); + nsAutoString helvetica; helvetica.Assign(NS_LITERAL_STRING("Helvetica")); + nsAutoString courier; courier.Assign(NS_LITERAL_STRING("Courier")); + nsAutoString courierNew; courierNew.Assign(NS_LITERAL_STRING("Courier New")); nsAutoString nullStr; AliasFont(times, timesNewRoman, timesRoman, PR_FALSE); diff --git a/mozilla/gfx/src/nsPrintOptionsImpl.cpp b/mozilla/gfx/src/nsPrintOptionsImpl.cpp index 884aefa4e4c..cd12819989c 100644 --- a/mozilla/gfx/src/nsPrintOptionsImpl.cpp +++ b/mozilla/gfx/src/nsPrintOptionsImpl.cpp @@ -129,11 +129,11 @@ nsPrintOptions::nsPrintOptions() : NS_FONT_WEIGHT_NORMAL,0,NSIntPointsToTwips(10)); } - mHeaderStrs[0].AssignWithConversion("&T"); - mHeaderStrs[2].AssignWithConversion("&U"); + mHeaderStrs[0].Assign(NS_LITERAL_STRING("&T")); + mHeaderStrs[2].Assign(NS_LITERAL_STRING("&U")); - mFooterStrs[0].AssignWithConversion("&PT"); // Use &P (Page Num Only) or &PT (Page Num of Page Total) - mFooterStrs[2].AssignWithConversion("&D"); + mFooterStrs[0].Assign(NS_LITERAL_STRING("&PT")); // Use &P (Page Num Only) or &PT (Page Num of Page Total) + mFooterStrs[2].Assign(NS_LITERAL_STRING("&D")); ReadPrefs(); diff --git a/mozilla/gfx/src/nsRect.cpp b/mozilla/gfx/src/nsRect.cpp index 12be0d08794..fdc56e7b934 100644 --- a/mozilla/gfx/src/nsRect.cpp +++ b/mozilla/gfx/src/nsRect.cpp @@ -211,15 +211,15 @@ FILE* operator<<(FILE* out, const nsRect& rect) nsAutoString tmp; // Output the coordinates in fractional points so they're easier to read - tmp.AppendWithConversion("{"); + tmp.Append(NS_LITERAL_STRING("{")); tmp.AppendFloat(NSTwipsToFloatPoints(rect.x)); - tmp.AppendWithConversion(", "); + tmp.Append(NS_LITERAL_STRING(", ")); tmp.AppendFloat(NSTwipsToFloatPoints(rect.y)); - tmp.AppendWithConversion(", "); + tmp.Append(NS_LITERAL_STRING(", ")); tmp.AppendFloat(NSTwipsToFloatPoints(rect.width)); - tmp.AppendWithConversion(", "); + tmp.Append(NS_LITERAL_STRING(", ")); tmp.AppendFloat(NSTwipsToFloatPoints(rect.height)); - tmp.AppendWithConversion("}"); + tmp.Append(NS_LITERAL_STRING("}")); fputs(NS_LossyConvertUCS2toASCII(tmp).get(), out); return out; } diff --git a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp index 8aef05d825f..036d6561c8d 100644 --- a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp +++ b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp @@ -860,17 +860,17 @@ nsresult nsDeviceContextOS2::CreateFontAliasTable() { mFontAliasTable = new nsHashtable; - nsAutoString times; times.AssignWithConversion("Times"); - nsAutoString timesNewRoman; timesNewRoman.AssignWithConversion("Times New Roman"); - nsAutoString timesRoman; timesRoman.AssignWithConversion("Tms Rmn"); - nsAutoString arial; arial.AssignWithConversion("Arial"); - nsAutoString helv; helv.AssignWithConversion("Helv"); - nsAutoString helvetica; helvetica.AssignWithConversion("Helvetica"); - nsAutoString courier; courier.AssignWithConversion("Courier"); - nsAutoString courierNew; courierNew.AssignWithConversion("Courier New"); - nsAutoString sans; sans.AssignWithConversion("Sans"); - nsAutoString unicode; unicode.AssignWithConversion("Unicode"); - nsAutoString timesNewRomanMT30; timesNewRomanMT30.AssignWithConversion("Times New Roman MT 30"); + nsAutoString times; times.Assign(NS_LITERAL_STRING("Times")); + nsAutoString timesNewRoman; timesNewRoman.Assign(NS_LITERAL_STRING("Times New Roman")); + nsAutoString timesRoman; timesRoman.Assign(NS_LITERAL_STRING("Tms Rmn")); + nsAutoString arial; arial.Assign(NS_LITERAL_STRING("Arial")); + nsAutoString helv; helv.Assign(NS_LITERAL_STRING("Helv")); + nsAutoString helvetica; helvetica.Assign(NS_LITERAL_STRING("Helvetica")); + nsAutoString courier; courier.Assign(NS_LITERAL_STRING("Courier")); + nsAutoString courierNew; courierNew.Assign(NS_LITERAL_STRING("Courier New")); + nsAutoString sans; sans.Assign(NS_LITERAL_STRING("Sans")); + nsAutoString unicode; unicode.Assign(NS_LITERAL_STRING("Unicode")); + nsAutoString timesNewRomanMT30; timesNewRomanMT30.Assign(NS_LITERAL_STRING("Times New Roman MT 30")); nsAutoString nullStr; AliasFont(times, timesNewRoman, timesRoman, PR_FALSE); diff --git a/mozilla/gfx/src/os2/nsFontMetricsOS2.cpp b/mozilla/gfx/src/os2/nsFontMetricsOS2.cpp index f4317009bba..7c5ce00cd91 100644 --- a/mozilla/gfx/src/os2/nsFontMetricsOS2.cpp +++ b/mozilla/gfx/src/os2/nsFontMetricsOS2.cpp @@ -1875,9 +1875,9 @@ CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) const nsString str2( *((const PRUnichar**)aArg2) ); // intermingle vertical fonts (start with '@') with horizontal fonts - if( str1.EqualsWithConversion( "@", PR_FALSE, 1 )) + if( str1.First() == PRUnichar('@') ) { - if( str2.EqualsWithConversion( "@", PR_FALSE, 1 )) + if( str2.First() == PRUnichar('@') ) return str1.CompareWithConversion( str2 ); else { @@ -1890,7 +1890,7 @@ CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) return rv; } } - else if( str2.EqualsWithConversion( "@", PR_FALSE, 1 )) + else if( str2.First() == PRUnichar('@') ) { nsString temp( str2 ); temp.Trim( "@", PR_TRUE, PR_FALSE ); diff --git a/mozilla/gfx/src/photon/nsDeviceContextPh.cpp b/mozilla/gfx/src/photon/nsDeviceContextPh.cpp index 28e7d70af8b..e340dc4463b 100644 --- a/mozilla/gfx/src/photon/nsDeviceContextPh.cpp +++ b/mozilla/gfx/src/photon/nsDeviceContextPh.cpp @@ -286,16 +286,16 @@ NS_IMETHODIMP nsDeviceContextPh :: GetSystemFont( nsSystemFontID aID, nsFont *aF aFont->weight = NS_FONT_WEIGHT_NORMAL; aFont->decorations = NS_FONT_DECORATION_NONE; aFont->size = NSIntPointsToTwips(8); - aFont->name.AssignWithConversion("TextFont"); + aFont->name.Assign(NS_LITERAL_STRING("TextFont")); switch(aID) { case eSystemFont_MessageBox: - aFont->name.AssignWithConversion("MessageFont"); + aFont->name.Assign(NS_LITERAL_STRING("MessageFont")); break; case eSystemFont_Tooltips: - aFont->name.AssignWithConversion("BalloonFont"); + aFont->name.Assign(NS_LITERAL_STRING("BalloonFont")); break; case eSystemFont_Menu: - aFont->name.AssignWithConversion("MenuFont"); + aFont->name.Assign(NS_LITERAL_STRING("MenuFont")); break; } break; diff --git a/mozilla/gfx/src/ps/nsPostScriptObj.cpp b/mozilla/gfx/src/ps/nsPostScriptObj.cpp index 5757e03ad85..3301057aaf7 100644 --- a/mozilla/gfx/src/ps/nsPostScriptObj.cpp +++ b/mozilla/gfx/src/ps/nsPostScriptObj.cpp @@ -1639,7 +1639,7 @@ nsPostScriptObj::InitUnixPrinterProps() { nsCOMPtr printerprops_tmp; nsAutoString propertyURL; - propertyURL.AssignWithConversion("resource:/res/unixpsfonts.properties"); + propertyURL.Assign(NS_LITERAL_STRING("resource:/res/unixpsfonts.properties")); nsCOMPtr uri; NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uri), propertyURL), PR_FALSE); nsCOMPtr in; diff --git a/mozilla/htmlparser/robot/nsDebugRobot.cpp b/mozilla/htmlparser/robot/nsDebugRobot.cpp index 8391ddc5676..127cb73dc25 100644 --- a/mozilla/htmlparser/robot/nsDebugRobot.cpp +++ b/mozilla/htmlparser/robot/nsDebugRobot.cpp @@ -97,15 +97,15 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) // Geez this is ugly. temporary hack to only process html files str.Truncate(); nsString(aURLSpec).Right(str,1); - if (!str.EqualsWithConversion("/")) + if (!str.Equals(NS_LITERAL_STRING("/"))) { str.Truncate(); nsString(aURLSpec).Right(str,4); - if (!str.EqualsWithConversion("html")) + if (!str.Equals(NS_LITERAL_STRING("html"))) { str.Truncate(); nsString(aURLSpec).Right(str,3); - if (!str.EqualsWithConversion("htm")) + if (!str.Equals(NS_LITERAL_STRING("htm"))) return NS_OK; } } @@ -126,7 +126,7 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) g_duplicateList->AppendElement(new nsString(aURLSpec)); str.Truncate(); nsString(aURLSpec).Left(str,5); - if (str.EqualsWithConversion("http:")) { + if (str.Equals(NS_LITERAL_STRING("http:"))) { g_iProcessed++; if (g_iProcessed == (g_iMaxProcess > 0 ? g_iMaxProcess-1 : 0)) g_bHitTop = PR_TRUE; diff --git a/mozilla/htmlparser/robot/nsRobotSink.cpp b/mozilla/htmlparser/robot/nsRobotSink.cpp index 8aa2e81b755..23ee14c83b3 100644 --- a/mozilla/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/htmlparser/robot/nsRobotSink.cpp @@ -244,7 +244,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) { nsAutoString tmp; tmp.Assign(aNode.GetText()); tmp.ToLowerCase(); - if (tmp.EqualsWithConversion("a")) { + if (tmp.Equals(NS_LITERAL_STRING("a"))) { nsAutoString k, v; PRInt32 ac = aNode.GetAttributeCount(); for (PRInt32 i = 0; i < ac; i++) { @@ -252,7 +252,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) const nsAReadableString& key = aNode.GetKeyAt(i); k.Assign(key); k.ToLowerCase(); - if (k.EqualsWithConversion("href")) { + if (k.Equals(NS_LITERAL_STRING("href"))) { // Get value and remove mandatory quotes v.Truncate(); v.Append(aNode.GetValueAt(i)); diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index fbfdd2cc3f0..ce6bef285a6 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -66,6 +66,7 @@ #include "nsIFormProcessor.h" #include "nsVoidArray.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "prmem.h" #ifdef NS_DEBUG @@ -1003,11 +1004,11 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ PRInt32 theIndex=0; for(theIndex=0;theIndexProvideContent(theFormType,theContent,theAttribute); @@ -2130,7 +2131,7 @@ nsresult CNavDTD::HandleEntityToken(CToken* aToken) { //if you're here we have a bogus entity. //convert it into a text token. nsAutoString entityName; - entityName.AssignWithConversion("&"); + entityName.Assign(NS_LITERAL_STRING("&")); entityName.Append(theStr); //should append the entity name; fix bug 51161. theToken = mTokenAllocator->CreateTokenOfType(eToken_text,eHTMLTag_text,entityName); } diff --git a/mozilla/htmlparser/src/COtherDTD.cpp b/mozilla/htmlparser/src/COtherDTD.cpp index 93ec4aeb2a1..ad523be1a6b 100644 --- a/mozilla/htmlparser/src/COtherDTD.cpp +++ b/mozilla/htmlparser/src/COtherDTD.cpp @@ -61,6 +61,7 @@ #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" +#include "nsUnicharUtils.h" #include "prmem.h" @@ -579,11 +580,11 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ PRInt32 theIndex=0; for(theIndex=0;theIndexCreateTokenOfType(eToken_text,eHTMLTag_text,entityName); } diff --git a/mozilla/htmlparser/src/nsDTDUtils.cpp b/mozilla/htmlparser/src/nsDTDUtils.cpp index e5c9eaf8b87..02bb2606981 100644 --- a/mozilla/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/htmlparser/src/nsDTDUtils.cpp @@ -44,6 +44,7 @@ #include "nsParserNode.h" #include "nsIChannel.h" #include "nsIServiceManager.h" +#include "nsUnicharUtils.h" MOZ_DECL_CTOR_COUNTER(nsEntryStack) MOZ_DECL_CTOR_COUNTER(nsDTDContext) @@ -576,7 +577,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); aValue=abs(aValue); // must be positive here... while(next<=aValue) { // scale up in baseN; exceed current value. @@ -610,7 +611,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); PRInt32 root=1000000000; PRInt32 expn=4; @@ -708,7 +709,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); aValue=abs(aValue); char decStr[20]; @@ -842,7 +843,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr nsAutoString theKey(aNode.GetKeyAt(theIndex)); const nsString& theValue=aNode.GetValueAt(theIndex); - if(theKey.EqualsWithConversion("name",PR_TRUE)){ + if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){ theEntity=GetEntity(theValue); if(!theEntity) { theEntity=RegisterEntity(theValue,theValue); @@ -850,10 +851,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr } aTag=eHTMLTag_userdefined; } - else if(theKey.EqualsWithConversion("noincr",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){ theIncrValue=0; } - else if(theKey.EqualsWithConversion("format",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){ PRUnichar theChar=theValue.CharAt(0); if('"'==theChar) theChar=theValue.CharAt(1); @@ -870,7 +871,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr } //determine numbering style } - else if(theKey.EqualsWithConversion("value",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){ PRInt32 err=0; theNewValue=theValue.ToInteger(&err); if(!err) { diff --git a/mozilla/htmlparser/src/nsExpatTokenizer.cpp b/mozilla/htmlparser/src/nsExpatTokenizer.cpp index 9742f7bbd34..4369c93b76f 100644 --- a/mozilla/htmlparser/src/nsExpatTokenizer.cpp +++ b/mozilla/htmlparser/src/nsExpatTokenizer.cpp @@ -319,10 +319,10 @@ CreateSourceText(const nsParserError* aError, nsString& aSourceString) PRInt32 errorPosition = aError->colNumber; aSourceString.Append(aError->sourceLine); - aSourceString.AppendWithConversion("\n"); + aSourceString.Append(NS_LITERAL_STRING("\n")); for (PRInt32 i = 0; i < errorPosition - 1; i++) - aSourceString.AppendWithConversion("-"); - aSourceString.AppendWithConversion("^"); + aSourceString.Append(NS_LITERAL_STRING("-")); + aSourceString.Append(NS_LITERAL_STRING("^")); return NS_OK; } @@ -749,13 +749,13 @@ void Tokenizer_HandleProcessingInstruction(void *userData, { XMLParserState* state = (XMLParserState*) userData; nsAutoString theString; - theString.AppendWithConversion(""); + theString.Append(NS_LITERAL_STRING("?>")); CToken* theToken = state->tokenAllocator->CreateTokenOfType(eToken_instruction,eHTMLTag_unknown, theString); if(theToken) { @@ -1005,7 +1005,7 @@ void Tokenizer_HandleEndDoctypeDecl(void *userData) { XMLParserState* state = (XMLParserState*) userData; - state->doctypeText.AppendWithConversion(">"); + state->doctypeText.Append(NS_LITERAL_STRING(">")); CToken* token = state->tokenAllocator->CreateTokenOfType(eToken_doctypeDecl, eHTMLTag_unknown, state->doctypeText); if (token) { nsExpatTokenizer::AddToken(token, NS_OK, state->tokenDeque, state->tokenAllocator); diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp index 235338995f1..d645cb58e89 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -154,11 +154,11 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream, // Set the line break character: if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak) && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) // Windows/mail - mLineBreak.AssignWithConversion("\r\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\r\n")); else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) // Mac - mLineBreak.AssignWithConversion("\r"); + mLineBreak.Assign(NS_LITERAL_STRING("\r")); else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) // Unix/DOM - mLineBreak.AssignWithConversion("\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\n")); else mLineBreak.AssignWithConversion(NS_LINEBREAK); // Platform/default @@ -246,7 +246,7 @@ nsHTMLContentSinkStream::InitEncoders() if (NS_FAILED(res)) { // failed - unknown alias , fallback to ISO-8859-1 - charsetName.AssignWithConversion("ISO-8859-1"); + charsetName.Assign(NS_LITERAL_STRING("ISO-8859-1")); } res = nsComponentManager::CreateInstance(kSaveAsCharsetCID, NULL, @@ -423,7 +423,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) value.Trim("\"", PR_TRUE, PR_TRUE); // Filter out any attribute starting with _moz - if (key.EqualsWithConversion("_moz", PR_TRUE, 4)) + if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()) continue; // @@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) // used by the editor. Bug 16988. Yuck. // if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br - && ((key.EqualsWithConversion("type", PR_TRUE) - && value.EqualsWithConversion("_moz")))) + && (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator()) + && value.Equals(NS_LITERAL_STRING("_moz"))))) continue; if (mLowerCaseTags == PR_TRUE) @@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) // Make all links absolute when converting only the selection: if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks) - && (key.EqualsWithConversion("href", PR_TRUE) - || key.EqualsWithConversion("src", PR_TRUE) + && (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator()) + || !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator()) // Would be nice to handle OBJECT and APPLET tags, // but that gets more complicated since we have to // search the tag list for CODEBASE as well. @@ -613,7 +613,7 @@ PRBool nsHTMLContentSinkStream::IsDirty(const nsIParserNode& aNode) void nsHTMLContentSinkStream::AddIndent() { - nsAutoString padding; padding.AssignWithConversion(" "); + nsAutoString padding(NS_LITERAL_STRING(" ")); for (PRInt32 i = mIndent; --i >= 0; ) { Write(padding); @@ -752,7 +752,7 @@ void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode) } else if (tag == eHTMLTag_comment) { - tagName.AssignWithConversion("--"); + tagName.Assign(NS_LITERAL_STRING("--")); } else if (tag == eHTMLTag_doctypeDecl || tag == eHTMLTag_markupDecl) { @@ -1057,7 +1057,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode) if (tag == eHTMLTag_userdefined) { nsAutoString name; name.Assign(aNode.GetText()); - if (name.EqualsWithConversion("document_info")) + if (name.Equals(NS_LITERAL_STRING("document_info"))) { PRInt32 count=aNode.GetAttributeCount(); for(PRInt32 i=0;iCreateTokenOfType(eToken_cdatasection,eHTMLTag_comment); - } else if (theBufCopy.EqualsWithConversion("ELEMENT",PR_FALSE,7) || - theBufCopy.EqualsWithConversion("ATTLIST",PR_FALSE,7) || - theBufCopy.EqualsWithConversion("ENTITY",PR_FALSE,6) || - theBufCopy.EqualsWithConversion("NOTATION",PR_FALSE,8)) { + } else if (Substring(theBufCopy, 0, 7).Equals(NS_LITERAL_STRING("ELEMENT")) || + Substring(theBufCopy, 0, 7).Equals(NS_LITERAL_STRING("ATTLIST")) || + Substring(theBufCopy, 0, 6).Equals(NS_LITERAL_STRING("ENTITY")) || + Substring(theBufCopy, 0, 8).Equals(NS_LITERAL_STRING("NOTATION"))) { aToken = theAllocator->CreateTokenOfType(eToken_markupDecl,eHTMLTag_markupDecl); } else { aToken = theAllocator->CreateTokenOfType(eToken_comment,eHTMLTag_comment); diff --git a/mozilla/htmlparser/src/nsHTMLTokens.cpp b/mozilla/htmlparser/src/nsHTMLTokens.cpp index 1b69657d21a..a135807c3a1 100644 --- a/mozilla/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/htmlparser/src/nsHTMLTokens.cpp @@ -283,7 +283,7 @@ const nsAReadableString& CStartToken::GetStringValue() * @return nada */ void CStartToken::GetSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("<"); + anOutputString.Append(PRUnichar('<')); /* * Watch out for Bug 15204 */ @@ -294,7 +294,7 @@ void CStartToken::GetSource(nsString& anOutputString){ anOutputString.Append(mTextValue); else anOutputString.Assign(GetTagName(mTypeID)); - anOutputString.AppendWithConversion('>'); + anOutputString.Append(PRUnichar('>')); } } @@ -306,7 +306,7 @@ void CStartToken::GetSource(nsString& anOutputString){ * @return nada */ void CStartToken::AppendSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("<"); + anOutputString.Append(PRUnichar('<')); /* * Watch out for Bug 15204 */ @@ -317,7 +317,7 @@ void CStartToken::AppendSource(nsString& anOutputString){ anOutputString+=mTextValue; else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion('>'); + anOutputString.Append(PRUnichar('>')); } } @@ -470,12 +470,12 @@ const nsAReadableString& CEndToken::GetStringValue() * @return nada */ void CEndToken::GetSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("0) anOutputString.Append(mTextValue); else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion(">"); + anOutputString.Append(NS_LITERAL_STRING(">")); } /* @@ -486,12 +486,12 @@ void CEndToken::GetSource(nsString& anOutputString){ * @return nada */ void CEndToken::AppendSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("0) anOutputString.Append(mTextValue); else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion(">"); + anOutputString.Append(NS_LITERAL_STRING(">")); } /* @@ -827,14 +827,14 @@ nsresult CCDATASectionToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt3 switch(aChar) { case kCR: result=aScanner.GetChar(aChar); //strip off the \r - mTextValue.AppendWithConversion("\n\n"); + mTextValue.Append(NS_LITERAL_STRING("\n\n")); break; case kNewLine: //which means we saw \r\n, which becomes \n result=aScanner.GetChar(aChar); //strip off the \n //now fall through on purpose... default: - mTextValue.AppendWithConversion("\n"); + mTextValue.Append(NS_LITERAL_STRING("\n")); break; } //switch } //if @@ -1049,7 +1049,7 @@ nsresult ConsumeStrictComment(PRUnichar aChar, nsScanner& aScanner,nsString& aSt *********************************************************/ - aString.AssignWithConversion("', unless you already did! (such as ). if(kGreaterThan!=aChar) { - aString.AppendWithConversion("= 127)) { - aResult.AppendWithConversion("&#"); + aResult.Append(NS_LITERAL_STRING("&#")); aResult.AppendInt(PRInt32(ch), 10); - aResult.AppendWithConversion(';'); + aResult.Append(PRUnichar(';')); } else { aResult.Append(ch); diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index a6cfd0da45c..5fc0af70bfe 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -303,7 +303,7 @@ nsParser::nsParser(nsITokenObserver* anObserver) { } #endif - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); mParserFilter = 0; mObserver = 0; mSink=0; @@ -1229,8 +1229,8 @@ NS_IMETHODIMP nsParser::CreateCompatibleDTD(nsIDTD** aDTD, * nsAutoString theMimeType; * nsAutoString theDocType; * - * theDocType.AssignWithConversion(""); - * theMimeType.AssignWithConversion("text/html"); + * theDocType.Assign(NS_LITERAL_STRING("")); + * theMimeType.Assign(NS_LITERAL_STRING("text/html")); * * result=CreateCompatibleDTD(getter_AddRefs(theDTD),&theDocType,eViewNormal,&theMimeType,eDTDMode_quirks); * @@ -1619,7 +1619,7 @@ nsresult nsParser::Parse(nsIInputStream& aStream,const nsAReadableString& aMimeT nsresult result=NS_ERROR_OUT_OF_MEMORY; //ok, time to create our tokenizer and begin the process - nsAutoString theUnknownFilename; theUnknownFilename.AssignWithConversion("unknown"); + nsAutoString theUnknownFilename(NS_LITERAL_STRING("unknown")); nsInputStream input(&aStream); @@ -1770,12 +1770,12 @@ nsresult nsParser::ParseFragment(const nsAReadableString& aSourceBuffer, PRUint32 theIndex = 0; while (theIndex++ < theCount){ - theContext.AppendWithConversion("<"); + theContext.Append(NS_LITERAL_STRING("<")); theContext.Append((PRUnichar*)aTagStack.ElementAt(theCount - theIndex)); - theContext.AppendWithConversion(">"); + theContext.Append(NS_LITERAL_STRING(">")); } - theContext.AppendWithConversion(""); //XXXHack! I'll make this better later. + theContext.Append(NS_LITERAL_STRING("")); //XXXHack! I'll make this better later. //now it's time to try to build the model from this fragment @@ -2494,12 +2494,12 @@ nsresult nsParser::OnStopRequest(nsIRequest *request, nsISupports* aContext, //What we'll do (for now at least) is construct a blank HTML document. if (!mParserContext->mMimeType.EqualsWithConversion(kPlainTextContentType)) { - temp.AssignWithConversion(""); + temp.Assign(NS_LITERAL_STRING("")); } // XXX: until bug #108067 has been fixed we must ensure that *something* // is in the scanner! so, for now just put in a single space. else { - temp.AssignWithConversion(" "); + temp.Assign(NS_LITERAL_STRING(" ")); } mParserContext->mScanner->Append(temp); result=ResumeParse(PR_TRUE,PR_TRUE); diff --git a/mozilla/htmlparser/src/nsScanner.cpp b/mozilla/htmlparser/src/nsScanner.cpp index 2ed2290bb7e..7bfba5edf04 100644 --- a/mozilla/htmlparser/src/nsScanner.cpp +++ b/mozilla/htmlparser/src/nsScanner.cpp @@ -205,7 +205,7 @@ nsresult nsScanner::SetDocumentCharset(const nsString& aCharset , nsCharsetSourc if(NS_FAILED(res) && (kCharsetUninitialized == mCharsetSource) ) { // failed - unknown alias , fallback to ISO-8859-1 - charsetName.AssignWithConversion("ISO-8859-1"); + charsetName.Assign(NS_LITERAL_STRING("ISO-8859-1")); } mCharset = charsetName; mCharsetSource = aSource; diff --git a/mozilla/htmlparser/src/nsViewSourceHTML.cpp b/mozilla/htmlparser/src/nsViewSourceHTML.cpp index c06ddd98d41..8d87cf32753 100644 --- a/mozilla/htmlparser/src/nsViewSourceHTML.cpp +++ b/mozilla/htmlparser/src/nsViewSourceHTML.cpp @@ -72,6 +72,7 @@ #include "nsHTMLTokenizer.h" #include "nsHTMLEntities.h" #include "nsIPref.h" +#include "nsUnicharUtils.h" #include "COtherDTD.h" #include "nsElementTable.h" @@ -643,9 +644,9 @@ nsresult CViewSourceHTML::GenerateSummary() { if(mErrorCount && mTagCount) { - mErrors.AppendWithConversion("\n\n "); + mErrors.Append(NS_LITERAL_STRING("\n\n ")); mErrors.AppendInt(mErrorCount); - mErrors.AppendWithConversion(" error(s) detected -- see highlighted portions.\n"); + mErrors.Append(NS_LITERAL_STRING(" error(s) detected -- see highlighted portions.\n")); result=WriteTag(mSummaryTag,mErrors,0,PR_FALSE); } @@ -1061,7 +1062,7 @@ void CViewSourceHTML::AddContainmentError(eHTMLTags aChildTag,eHTMLTags aParentT mErrors.AppendWithConversion(theMsg); } else if(gErrorThreshold+1==mErrorCount){ - mErrors.AppendWithConversion("\n -- Too many errors -- terminating output."); + mErrors.Append(NS_LITERAL_STRING("\n -- Too many errors -- terminating output.")); } } @@ -1218,10 +1219,10 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { nsAutoString theStr; theStr.Assign(aToken->GetStringValue()); - if(!theStr.EqualsWithConversion("XI",IGNORE_CASE)) { + if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) { PRUnichar theChar=theStr.CharAt(0); if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){ - theStr.InsertWithConversion("#", 0); + theStr.Assign(NS_LITERAL_STRING("#") + theStr); } } result=WriteTag(mEntityTag,theStr,0,PR_FALSE); diff --git a/mozilla/htmlparser/tests/outsinks/Convert.cpp b/mozilla/htmlparser/tests/outsinks/Convert.cpp index 7e8ba64b758..78073ac67b1 100644 --- a/mozilla/htmlparser/tests/outsinks/Convert.cpp +++ b/mozilla/htmlparser/tests/outsinks/Convert.cpp @@ -161,7 +161,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType, parser->SetContentSink(sink); nsCOMPtr dtd; - if (inType.EqualsWithConversion("text/html")) { + if (inType.Equals(NS_LITERAL_STRING("text/html"))) { static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); rv=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd)); } @@ -203,8 +203,8 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType, int main(int argc, char** argv) { - nsString inType; inType.AssignWithConversion("text/html"); - nsString outType; outType.AssignWithConversion("text/plain"); + nsString inType(NS_LITERAL_STRING("text/html")); + nsString outType(NS_LITERAL_STRING("text/plain")); int wrapCol = 72; int flags = 0; nsString compareAgainst; diff --git a/mozilla/intl/locale/src/mac/nsCollationMac.cpp b/mozilla/intl/locale/src/mac/nsCollationMac.cpp index 50a41dec358..50dc47d8d65 100644 --- a/mozilla/intl/locale/src/mac/nsCollationMac.cpp +++ b/mozilla/intl/locale/src/mac/nsCollationMac.cpp @@ -151,10 +151,10 @@ nsresult nsCollationMac::Initialize(nsILocale* locale) // locale -> script code + charset name m_scriptcode = smRoman; - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); PRUnichar *aLocaleUnichar; - nsAutoString aCategory; aCategory.AssignWithConversion("NSILOCALE_COLLATE"); + nsAutoString aCategory(NS_LITERAL_STRING("NSILOCALE_COLLATE")); // get locale string, use app default if no locale specified if (locale == nsnull) { diff --git a/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp b/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp index 61e0f7d209d..852ffd1040e 100644 --- a/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp +++ b/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp @@ -235,7 +235,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsDateTimeFormatMac, nsIDateTimeFormat); nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale) { PRUnichar *aLocaleUnichar = NULL; - nsString aCategory; aCategory.AssignWithConversion("NSILOCALE_TIME"); + nsString aCategory(NS_LITERAL_STRING("NSILOCALE_TIME")); nsresult res; // use cached info if match with stored locale @@ -258,7 +258,7 @@ nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale) mScriptcode = smSystemScript; mLangcode = langEnglish; mRegioncode = verUS; - mCharset.AssignWithConversion("x-mac-roman"); + mCharset.Assign(NS_LITERAL_STRING("x-mac-roman")); // get application locale diff --git a/mozilla/intl/locale/src/mac/nsMacLocale.cpp b/mozilla/intl/locale/src/mac/nsMacLocale.cpp index b41838ff90a..6716da9c4b2 100644 --- a/mozilla/intl/locale/src/mac/nsMacLocale.cpp +++ b/mozilla/intl/locale/src/mac/nsMacLocale.cpp @@ -305,7 +305,7 @@ nsMacLocale::GetXPLocale(short scriptCode, short langCode, short regionCode, nsS // for(i=0;strlen(country_list[i].iso_code)!=0;i++) { if (regionCode==country_list[i].mac_region_code) { - temp.AppendWithConversion('-'); + temp.Append(PRUnichar('-')); temp.AppendWithConversion(country_list[i].iso_code); validResultFound = true; break; diff --git a/mozilla/intl/locale/src/nsLanguageAtomService.cpp b/mozilla/intl/locale/src/nsLanguageAtomService.cpp index 8e830a0b50f..e2b9f27dea9 100644 --- a/mozilla/intl/locale/src/nsLanguageAtomService.cpp +++ b/mozilla/intl/locale/src/nsLanguageAtomService.cpp @@ -138,7 +138,7 @@ nsLanguageAtomService::InitLangGroupTable() { if (!mLangGroups.get()) { nsAutoString uriStr; - uriStr.AssignWithConversion("resource:/res/langGroups.properties"); + uriStr.Assign(NS_LITERAL_STRING("resource:/res/langGroups.properties")); nsCOMPtr uri; NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uri), uriStr), NS_ERROR_FAILURE); nsCOMPtr in; @@ -208,7 +208,7 @@ nsLanguageAtomService::LookupLanguage(const PRUnichar* aLanguage, truncated.Truncate(hyphen); res = mLangGroups->GetStringProperty(truncated, langGroupStr); if (NS_FAILED(res)) { - langGroupStr.AssignWithConversion("x-western"); + langGroupStr.Assign(NS_LITERAL_STRING("x-western")); } } } diff --git a/mozilla/intl/locale/src/nsLocaleService.cpp b/mozilla/intl/locale/src/nsLocaleService.cpp index 61f78bca551..0e35e79ae17 100644 --- a/mozilla/intl/locale/src/nsLocaleService.cpp +++ b/mozilla/intl/locale/src/nsLocaleService.cpp @@ -216,7 +216,7 @@ nsLocaleService::nsLocaleService(void) char* lang = getenv("LANG"); if ( lang == nsnull ) { nsCAutoString langcstr("en-US"); - platformLocale.AssignWithConversion("en_US"); + platformLocale.Assign(NS_LITERAL_STRING("en_US")); lang = ToNewCString(langcstr); result = posixConverter->GetXPLocale(lang,&xpLocale); nsCRT::free(lang); diff --git a/mozilla/intl/locale/src/os2/nsCollationOS2.cpp b/mozilla/intl/locale/src/os2/nsCollationOS2.cpp index ff80b8fe1de..0cc7efdef9f 100644 --- a/mozilla/intl/locale/src/os2/nsCollationOS2.cpp +++ b/mozilla/intl/locale/src/os2/nsCollationOS2.cpp @@ -76,14 +76,14 @@ nsresult nsCollationOS2::Initialize(nsILocale *locale) } // default local charset name - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // default platform locale - mLocale.AssignWithConversion("C"); + mLocale.Assign(NS_LITERAL_STRING("C")); PRUnichar *aLocaleUnichar = NULL; nsString aCategory; - aCategory.AssignWithConversion("NSILOCALE_COLLATE"); + aCategory.Assign(NS_LITERAL_STRING("NSILOCALE_COLLATE")); // get locale string, use app default if no locale specified if (locale == nsnull) { @@ -112,7 +112,7 @@ nsresult nsCollationOS2::Initialize(nsILocale *locale) // keep the same behavior as 4.x as well as avoiding Linux collation key problem if (aLocale.EqualsIgnoreCase("en-US")) { - aLocale.AssignWithConversion("C"); + aLocale.Assign(NS_LITERAL_STRING("C")); } nsCOMPtr os2Locale = do_GetService(NS_OS2LOCALE_CONTRACTID, &res); diff --git a/mozilla/intl/locale/src/os2/nsOS2Locale.cpp b/mozilla/intl/locale/src/os2/nsOS2Locale.cpp index 7d845d68de2..31388f54a7c 100644 --- a/mozilla/intl/locale/src/os2/nsOS2Locale.cpp +++ b/mozilla/intl/locale/src/os2/nsOS2Locale.cpp @@ -93,7 +93,7 @@ nsOS2Locale::GetXPLocale(const char* os2Locale, nsString* locale) if (os2Locale!=nsnull) { if (strcmp(os2Locale,"C")==0 || strcmp(os2Locale,"OS2")==0) { - locale->AssignWithConversion("en-US"); + locale->Assign(NS_LITERAL_STRING("en-US")); return NS_OK; } if (!ParseLocaleString(os2Locale,lang_code,country_code,extra,'_')) { diff --git a/mozilla/intl/locale/src/unix/nsCollationUnix.cpp b/mozilla/intl/locale/src/unix/nsCollationUnix.cpp index 16761acafb3..0d5f3b14a43 100644 --- a/mozilla/intl/locale/src/unix/nsCollationUnix.cpp +++ b/mozilla/intl/locale/src/unix/nsCollationUnix.cpp @@ -108,10 +108,10 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale) } // default local charset name - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // default platform locale - mLocale.AssignWithConversion("C"); + mLocale.Assign(NS_LITERAL_STRING("C")); PRUnichar *aLocaleUnichar = NULL; nsString aCategory; @@ -146,7 +146,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale) // keep the same behavior as 4.x as well as avoiding Linux collation key problem if (aLocale.EqualsIgnoreCase("en_US")) { // note: locale is in platform format - aLocale.AssignWithConversion("C"); + aLocale.Assign(NS_LITERAL_STRING("C")); } nsCOMPtr posixLocale = do_GetService(NS_POSIXLOCALE_CONTRACTID, &res); diff --git a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index 03094bfd48d..b0293a5121b 100644 --- a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -75,7 +75,7 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) } } - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); PL_strncpy(mPlatformLocale, "en_US", kPlatformLocaleLength+1); // get locale name string, use app default if no locale specified diff --git a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.h b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.h index e1c6150f8e3..ce8112ffe36 100644 --- a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.h +++ b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.h @@ -66,7 +66,7 @@ public: nsDateTimeFormatUnix() {NS_INIT_REFCNT(); - mLocale.AssignWithConversion("");mAppLocale.AssignWithConversion("");} + mLocale.Truncate();mAppLocale.Truncate();} virtual ~nsDateTimeFormatUnix() {} diff --git a/mozilla/intl/locale/src/unix/nsPosixLocale.cpp b/mozilla/intl/locale/src/unix/nsPosixLocale.cpp index c0cfb2dd7d9..7416ca01c69 100644 --- a/mozilla/intl/locale/src/unix/nsPosixLocale.cpp +++ b/mozilla/intl/locale/src/unix/nsPosixLocale.cpp @@ -108,7 +108,7 @@ nsPosixLocale::GetXPLocale(const char* posixLocale, nsString* locale) if (posixLocale!=nsnull) { if (strcmp(posixLocale,"C")==0 || strcmp(posixLocale,"POSIX")==0) { - locale->AssignWithConversion("en-US"); + locale->Assign(NS_LITERAL_STRING("en-US")); return NS_OK; } if (!ParseLocaleString(posixLocale,lang_code,country_code,extra,'_')) { diff --git a/mozilla/intl/locale/src/windows/nsCollationWin.cpp b/mozilla/intl/locale/src/windows/nsCollationWin.cpp index 5bb28a98211..c9c898870bb 100644 --- a/mozilla/intl/locale/src/windows/nsCollationWin.cpp +++ b/mozilla/intl/locale/src/windows/nsCollationWin.cpp @@ -89,13 +89,13 @@ nsresult nsCollationWin::Initialize(nsILocale* locale) } // default charset name - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // default LCID (en-US) mLCID = 1033; PRUnichar *aLocaleUnichar = NULL; - nsString aCategory; aCategory.AssignWithConversion("NSILOCALE_COLLATE"); + nsString aCategory(NS_LITERAL_STRING("NSILOCALE_COLLATE")); // get locale string, use app default if no locale specified if (locale == nsnull) { diff --git a/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp b/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp index 28e90a5d557..8bfb8c69066 100644 --- a/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp +++ b/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp @@ -57,7 +57,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsDateTimeFormatWin, nsIDateTimeFormat); nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale) { PRUnichar *aLocaleUnichar = NULL; - nsString aCategory; aCategory.AssignWithConversion("NSILOCALE_TIME"); + nsString aCategory(NS_LITERAL_STRING("NSILOCALE_TIME")); nsresult res = NS_OK; // use cached info if match with stored locale diff --git a/mozilla/intl/lwbrk/src/nsLWBreakerFImp.cpp b/mozilla/intl/lwbrk/src/nsLWBreakerFImp.cpp index fdd24d148ce..e9acb29cf8e 100644 --- a/mozilla/intl/lwbrk/src/nsLWBreakerFImp.cpp +++ b/mozilla/intl/lwbrk/src/nsLWBreakerFImp.cpp @@ -125,25 +125,25 @@ nsresult nsLWBreakerFImp::GetBreaker(nsString& aParam, nsILineBreaker** oResult) if( NULL == oResult) { return NS_ERROR_NULL_POINTER; } - if( aParam.EqualsWithConversion("ja") ) + if( aParam.Equals(NS_LITERAL_STRING("ja")) ) { *oResult = new nsJISx4501LineBreaker ( gJaNoBegin, sizeof(gJaNoBegin)/sizeof(PRUnichar), gJaNoEnd, sizeof(gJaNoEnd)/sizeof(PRUnichar)); } - else if(aParam.EqualsWithConversion("ko")) + else if(aParam.Equals(NS_LITERAL_STRING("ko"))) { *oResult = new nsJISx4501LineBreaker ( gKoNoBegin, sizeof(gKoNoBegin)/sizeof(PRUnichar), gKoNoEnd, sizeof(gKoNoEnd)/sizeof(PRUnichar)); } - else if(aParam.EqualsWithConversion("tw")) + else if(aParam.Equals(NS_LITERAL_STRING("tw"))) { *oResult = new nsJISx4501LineBreaker ( gTwNoBegin, sizeof(gTwNoBegin)/sizeof(PRUnichar), gTwNoEnd, sizeof(gTwNoEnd)/sizeof(PRUnichar)); } - else if(aParam.EqualsWithConversion("cn")) + else if(aParam.Equals(NS_LITERAL_STRING("cn"))) { *oResult = new nsJISx4501LineBreaker ( gCnNoBegin, sizeof(gCnNoBegin)/sizeof(PRUnichar), diff --git a/mozilla/intl/lwbrk/tests/TestLineBreak.cpp b/mozilla/intl/lwbrk/tests/TestLineBreak.cpp index 79bae789f72..0923224666c 100644 --- a/mozilla/intl/lwbrk/tests/TestLineBreak.cpp +++ b/mozilla/intl/lwbrk/tests/TestLineBreak.cpp @@ -459,7 +459,7 @@ void SamplePrintWordWithBreak() tmp.SetLength(0); fragText.Mid(tmp, start, cur - start); result.Append(tmp); - result.AppendWithConversion("^"); + result.Append(NS_LITERAL_STRING("^")); start = cur; wbk->Next(fragText.get(), fragText.Length(), cur, &cur, &done); } @@ -481,7 +481,7 @@ void SamplePrintWordWithBreak() &canBreak ); if(canBreak) - result.AppendWithConversion("^"); + result.Append(NS_LITERAL_STRING("^")); fragText = nextFragText; } diff --git a/mozilla/intl/strres/tests/StringBundleTest.cpp b/mozilla/intl/strres/tests/StringBundleTest.cpp index 2a02e7cc4e5..42aa458cec2 100644 --- a/mozilla/intl/strres/tests/StringBundleTest.cpp +++ b/mozilla/intl/strres/tests/StringBundleTest.cpp @@ -99,7 +99,7 @@ getCountry(PRUnichar *lc_name_unichar, PRUnichar **aCountry) { nsresult result = NS_OK; - nsAutoString category; category.AssignWithConversion("NSILOCALE_MESSAGES"); + nsAutoString category(NS_LITERAL_STRING("NSILOCALE_MESSAGES")); nsAutoString lc_name; lc_name.Assign(lc_name_unichar); @@ -209,7 +209,7 @@ main(int argc, char *argv[]) } nsAutoString v; - v.AssignWithConversion(""); + v.Assign(NS_LITERAL_STRING("")); PRUnichar *ptrv = nsnull; char *value = nsnull; @@ -225,7 +225,7 @@ main(int argc, char *argv[]) // file nsString strfile; - strfile.AssignWithConversion("file"); + strfile.Assign(NS_LITERAL_STRING("file")); const PRUnichar *ptrFile = strfile.get(); ret = bundle->GetStringFromName(ptrFile, &ptrv); if (NS_FAILED(ret)) { diff --git a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp index 7e0129eb26e..f63075bb60b 100644 --- a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp @@ -114,7 +114,7 @@ nsresult nsCharsetConverterManager::RegisterConverterTitles( nsRegistryKey key; nsAutoString str; str.AssignWithConversion(aRegistryPath); - str.AppendWithConversion("defaultFile"); + str.Append(NS_LITERAL_STRING("defaultFile")); char * p = ToNewCString(str); res = aRegistry->AddSubtree(nsIRegistry::Common, p, &key); @@ -134,7 +134,7 @@ nsresult nsCharsetConverterManager::RegisterConverterData( nsRegistryKey key; nsAutoString str; str.AssignWithConversion(aRegistryPath); - str.AppendWithConversion("defaultFile"); + str.Append(NS_LITERAL_STRING("defaultFile")); char * p = ToNewCString(str); res = aRegistry->AddSubtree(nsIRegistry::Common, p, &key); diff --git a/mozilla/intl/uconv/src/nsOS2Charset.cpp b/mozilla/intl/uconv/src/nsOS2Charset.cpp index 5f0ef860533..4007255b51f 100644 --- a/mozilla/intl/uconv/src/nsOS2Charset.cpp +++ b/mozilla/intl/uconv/src/nsOS2Charset.cpp @@ -56,7 +56,7 @@ nsPlatformCharset::nsPlatformCharset() { UINT acp = ::WinQueryCp(HMQ_CURRENT); PRInt32 acpint = (PRInt32)(acp & 0x00FFFF); - nsAutoString acpKey; acpKey.Assign(NS_LITERAL_STRING("os2.")); + nsAutoString acpKey(NS_LITERAL_STRING("os2.")); acpKey.AppendInt(acpint, 10); nsresult res = gInfo->Get(acpKey, mCharset); diff --git a/mozilla/intl/uconv/tests/TestUConv.cpp b/mozilla/intl/uconv/tests/TestUConv.cpp index 47a137153ec..6265d645d6d 100644 --- a/mozilla/intl/uconv/tests/TestUConv.cpp +++ b/mozilla/intl/uconv/tests/TestUConv.cpp @@ -245,8 +245,8 @@ nsresult nsTestUConv::TestCharsetManager() } // test alias resolving capability - nsAutoString csAlias; csAlias.AssignWithConversion("iso-10646-ucs-basic"); - nsAutoString csName; csName.AssignWithConversion("UTF-16BE"); + nsAutoString csAlias(NS_LITERAL_STRING("iso-10646-ucs-basic")); + nsAutoString csName(NS_LITERAL_STRING("UTF-16BE")); res = ccMan->GetCharsetAtom(csAlias.get(), getter_AddRefs(csAtom)); if (NS_FAILED(res)) { mLog.PrintError("GetCharsetAtom()", res); @@ -263,7 +263,7 @@ nsresult nsTestUConv::TestCharsetManager() } // test self returning if alias was not found - nsAutoString csAlias2; csAlias2.AssignWithConversion("Totally_dummy_charset_name"); + nsAutoString csAlias2(NS_LITERAL_STRING("Totally_dummy_charset_name")); res = ccMan->GetCharsetAtom(csAlias2.get(), getter_AddRefs(csAtom)); if (NS_FAILED(res)) { mLog.PrintError("GetCharsetAtom()", res); @@ -424,22 +424,22 @@ nsresult nsTestUConv::DisplayCharsets() printf(" "); - prop.AssignWithConversion(".notForBrowser"); + prop.Assign(NS_LITERAL_STRING(".notForBrowser")); res = ccMan->GetCharsetData2(cs, prop.get(), &str); if ((dec != NULL) && (NS_FAILED(res))) printf ("B"); else printf("X"); - prop.AssignWithConversion(".notForComposer"); + prop.Assign(NS_LITERAL_STRING(".notForComposer")); res = ccMan->GetCharsetData2(cs, prop.get(), &str); if ((enc != NULL) && (NS_FAILED(res))) printf ("C"); else printf("X"); - prop.AssignWithConversion(".notForMailView"); + prop.Assign(NS_LITERAL_STRING(".notForMailView")); res = ccMan->GetCharsetData2(cs, prop.get(), &str); if ((dec != NULL) && (NS_FAILED(res))) printf ("V"); else printf("X"); - prop.AssignWithConversion(".notForMailEdit"); + prop.Assign(NS_LITERAL_STRING(".notForMailEdit")); res = ccMan->GetCharsetData2(cs, prop.get(), &str); if ((enc != NULL) && (NS_FAILED(res))) printf ("E"); else printf("X"); @@ -457,7 +457,7 @@ nsresult nsTestUConv::TestTempBug() mLog.AddTrace(trace); nsresult res = NS_OK; - nsAutoString charset; charset.AssignWithConversion("ISO-2022-JP"); + nsAutoString charset(NS_LITERAL_STRING("ISO-2022-JP")); PRUnichar src[] = {0x0043, 0x004e, 0x0045, 0x0054, 0x0020, 0x004A, 0x0061, 0x0070, 0x0061, 0x006E, 0x0020, 0x7DE8, 0x96C6, 0x5C40}; PRUnichar * srcEnd = src + ARRAY_SIZE(src); diff --git a/mozilla/intl/uconv/tests/plattest.cpp b/mozilla/intl/uconv/tests/plattest.cpp index 3bef6cc612e..3152003a677 100644 --- a/mozilla/intl/uconv/tests/plattest.cpp +++ b/mozilla/intl/uconv/tests/plattest.cpp @@ -53,7 +53,7 @@ main(int argc, const char** argv) nsCOMPtr locale_service; nsCOMPtr locale; nsCOMPtr platform_charset; - nsString locale_category; locale_category.AssignWithConversion("NSILOCALE_MESSAGES"); + nsString locale_category(NS_LITERAL_STRING("NSILOCALE_MESSAGES")); PRUnichar* category_value, *charset; nsString categoryAsNSString, charsetAsNSString; @@ -74,7 +74,7 @@ main(int argc, const char** argv) categoryAsNSString = category_value; printf("DefaultCharset for %s is %s\n", NS_LossyConvertUCS2toASCII(categoryAsNSString).get(), NS_LossyConvertUCS2toASCII(charsetAsNSString).get()); - categoryAsNSString.AssignWithConversion("en-US"); + categoryAsNSString.Assign(NS_LITERAL_STRING("en-US")); rv = platform_charset->GetDefaultCharsetForLocale(categoryAsNSString.get(),&charset); if (NS_FAILED(rv)) return -1; diff --git a/mozilla/intl/uconv/ucvja/nsJapaneseToUnicode.cpp b/mozilla/intl/uconv/ucvja/nsJapaneseToUnicode.cpp index 787e1addc41..48ef5ee3e58 100644 --- a/mozilla/intl/uconv/ucvja/nsJapaneseToUnicode.cpp +++ b/mozilla/intl/uconv/ucvja/nsJapaneseToUnicode.cpp @@ -758,7 +758,7 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Convert( nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); if (NS_SUCCEEDED(rv)) { - tmpCharset.AssignWithConversion("GB2312"); + tmpCharset.Assign(NS_LITERAL_STRING("GB2312")); rv = ccm->GetUnicodeDecoder(&tmpCharset, &mGB2312Decoder); } } @@ -812,7 +812,7 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Convert( nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); if (NS_SUCCEEDED(rv)) { - tmpCharset.AssignWithConversion("EUC-KR"); + tmpCharset.Assign(NS_LITERAL_STRING("EUC-KR")); rv = ccm->GetUnicodeDecoder(&tmpCharset, &mEUCKRDecoder); } } @@ -885,7 +885,7 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Convert( nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); if (NS_SUCCEEDED(rv)) { - tmpCharset.AssignWithConversion("ISO-8859-7"); + tmpCharset.Assign(NS_LITERAL_STRING("ISO-8859-7")); rv = ccm->GetUnicodeDecoder(&tmpCharset, &mISO88597Decoder); } } diff --git a/mozilla/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp b/mozilla/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp index 190bf3a4d34..964431b373b 100644 --- a/mozilla/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp +++ b/mozilla/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp @@ -146,7 +146,7 @@ NS_IMETHODIMP nsISO2022KRToUnicode::Convert(const char * aSrc, PRInt32 * aSrcLen nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); if (NS_SUCCEEDED(rv)) { - tmpCharset.AssignWithConversion("EUC-KR"); + tmpCharset.Assign(NS_LITERAL_STRING("EUC-KR")); rv = ccm->GetUnicodeDecoder(&tmpCharset, &mEUCKRDecoder); } } diff --git a/mozilla/intl/unicharutil/src/nsEntityConverter.cpp b/mozilla/intl/unicharutil/src/nsEntityConverter.cpp index 2e18c5f19cf..dc0f8b663f1 100644 --- a/mozilla/intl/unicharutil/src/nsEntityConverter.cpp +++ b/mozilla/intl/unicharutil/src/nsEntityConverter.cpp @@ -68,7 +68,7 @@ nsEntityConverter::~nsEntityConverter() NS_IMETHODIMP nsEntityConverter::LoadVersionPropertyFile() { - nsString aUrl; aUrl.AssignWithConversion("resource:/res/entityTables/htmlEntityVersions.properties"); + nsString aUrl(NS_LITERAL_STRING("resource:/res/entityTables/htmlEntityVersions.properties")); nsIPersistentProperties* entityProperties = NULL; nsIURI* url = NULL; nsIInputStream* in = NULL; @@ -87,7 +87,7 @@ nsEntityConverter::LoadVersionPropertyFile() if(NS_SUCCEEDED(rv) && in) { rv = entityProperties->Load(in); if (NS_SUCCEEDED(rv)) { - nsAutoString key, value; key.AssignWithConversion("length"); + nsAutoString key, value; key.Assign(NS_LITERAL_STRING("length")); PRInt32 result; rv = entityProperties->GetStringProperty(key,value); @@ -121,7 +121,7 @@ done: nsIPersistentProperties* nsEntityConverter::LoadEntityPropertyFile(PRInt32 version) { - nsString aUrl; aUrl.AssignWithConversion("resource:/res/entityTables/"); + nsString aUrl(NS_LITERAL_STRING("resource:/res/entityTables/")); nsIPersistentProperties* entityProperties = NULL; nsIURI* url = NULL; nsIInputStream* in = NULL; @@ -132,7 +132,7 @@ nsEntityConverter::LoadEntityPropertyFile(PRInt32 version) if (NULL == versionName) return NULL; aUrl.Append(versionName); - aUrl.AppendWithConversion(".properties"); + aUrl.Append(NS_LITERAL_STRING(".properties")); rv = NS_NewURI(&url,aUrl,NULL); if (NS_FAILED(rv)) return NULL; @@ -221,7 +221,7 @@ nsEntityConverter::ConvertToEntity(PRUnichar character, PRUint32 entityVersion, if (NULL == entityProperties) continue; - nsAutoString key, value; key.AssignWithConversion("entity."); + nsAutoString key, value; key.Assign(NS_LITERAL_STRING("entity.")); key.AppendInt(character,10); nsresult rv = entityProperties->GetStringProperty(key, value); if (NS_SUCCEEDED(rv)) { @@ -250,7 +250,7 @@ nsEntityConverter::ConvertToEntities(const PRUnichar *inString, PRUint32 entityV // per character look for the entity PRUint32 len = nsCRT::strlen(inString); for (PRUint32 i = 0; i < len; i++) { - nsAutoString value, key; key.AssignWithConversion("entity."); + nsAutoString value, key; key.Assign(NS_LITERAL_STRING("entity.")); key.AppendInt(inString[i],10); entity = NULL; for (PRUint32 mask = 1, mask2 = 0xFFFFFFFFL; (0!=(entityVersion & mask2)); mask<<=1, mask2<<=1) { diff --git a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp index 2e179ab9aa4..e643535fac2 100644 --- a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp +++ b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp @@ -388,7 +388,7 @@ static void TestEntityConversion(PRUint32 version) nsresult res; - inString.AssignWithConversion("\xA0\xA1\xA2\xA3"); + inString.Assign(NS_LITERAL_STRING("\xA0\xA1\xA2\xA3")); uChar = (PRUnichar) 8364; //euro inString.Append(&uChar, 1); uChar = (PRUnichar) 9830; // @@ -435,7 +435,7 @@ static void TestSaveAsCharset() nsresult res; nsString inString; - inString.AssignWithConversion("\x61\x62\x80\xA0\x63"); + inString.Assign(NS_LITERAL_STRING("\x61\x62\x80\xA0\x63")); char *outString; // first, dump input string diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 51f92e34f98..c3eeb026050 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1388,7 +1388,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex } else { // XXX Don't assume default. Only use what is in 'quotes' property - contentString.AssignWithConversion('\"'); + contentString.Assign(PRUnichar('\"')); } } break; diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index ad695ea98c0..e62fcaf677e 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -5866,7 +5866,7 @@ DocumentViewerImpl::GetPopupLinkNode(nsIDOMNode** aNode) } } } - if (anchor || area || link || xlinkType.EqualsWithConversion("simple")) { + if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) { *aNode = node; NS_IF_ADDREF(*aNode); // addref return NS_OK; diff --git a/mozilla/layout/base/src/nsFrameUtil.cpp b/mozilla/layout/base/src/nsFrameUtil.cpp index 89ad5176fc9..61d072ff64b 100644 --- a/mozilla/layout/base/src/nsFrameUtil.cpp +++ b/mozilla/layout/base/src/nsFrameUtil.cpp @@ -477,9 +477,9 @@ nsFrameUtil::Tag::ToString(nsString& aResult) aResult.Append(PRUnichar(' ')); aResult.AppendWithConversion(attributes[i]); if (values[i]) { - aResult.AppendWithConversion("=\""); + aResult.Append(NS_LITERAL_STRING("=\"")); aResult.AppendWithConversion(values[i]); - aResult.AppendWithConversion('\"'); + aResult.Append(PRUnichar('\"')); } } } diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 1fd9b2705e0..3b36618c357 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -1949,7 +1949,7 @@ nsComboboxControlFrame::SelectionChanged() } if (shouldSetValue) { if (mTextStr.Length() == 0) { - nsAutoString space; space.AssignWithConversion(" "); + nsAutoString space(NS_LITERAL_STRING(" ")); rv = mDisplayContent->SetText(space.get(), space.Length(), PR_TRUE); } else { rv = mDisplayContent->SetText(mTextStr.get(), mTextStr.Length(), PR_TRUE); diff --git a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp index 963ef5c86e1..c03f035478f 100644 --- a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp @@ -225,7 +225,7 @@ nsGfxButtonControlFrame::DoNavQuirksReflow(nsIPresContext* aPresContext if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { - value.AssignWithConversion(" "); + value.Assign(NS_LITERAL_STRING(" ")); } } @@ -381,7 +381,7 @@ nsGfxButtonControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { - value.AssignWithConversion(" "); + value.Assign(NS_LITERAL_STRING(" ")); } } diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 9e8de8f8c41..a65089125e7 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -204,13 +204,13 @@ nsHTMLButtonControlFrame::GetDefaultLabel(nsString& aString) PRInt32 type; GetType(&type); if (NS_FORM_BUTTON_BUTTON == type) { - aString.AssignWithConversion("Button"); + aString.Assign(NS_LITERAL_STRING("Button")); } else if (NS_FORM_BUTTON_RESET == type) { - aString.AssignWithConversion("Reset"); + aString.Assign(NS_LITERAL_STRING("Reset")); } else if (NS_FORM_BUTTON_SUBMIT == type) { - aString.AssignWithConversion("Submit"); + aString.Assign(NS_LITERAL_STRING("Submit")); } } diff --git a/mozilla/layout/forms/nsIsIndexFrame.cpp b/mozilla/layout/forms/nsIsIndexFrame.cpp index 76f19bb2057..bc83727ee8f 100644 --- a/mozilla/layout/forms/nsIsIndexFrame.cpp +++ b/mozilla/layout/forms/nsIsIndexFrame.cpp @@ -470,10 +470,10 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext) // Append the URI encoded variable/value pairs for GET's if (!isJSURL) { // Not for JS URIs, see bug 26917 if (href.FindChar('?', PR_FALSE, 0) == kNotFound) { // Add a ? if needed - href.AppendWithConversion('?'); + href.Append(PRUnichar('?')); } else { // Adding to existing query string if (href.Last() != '&' && href.Last() != '?') { // Add a & if needed - href.AppendWithConversion('&'); + href.Append(PRUnichar('&')); } } href.Append(data); @@ -494,7 +494,7 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext) void nsIsIndexFrame::GetSubmitCharset(nsString& oCharset) { - oCharset.AssignWithConversion("UTF-8"); // default to utf-8 + oCharset.Assign(NS_LITERAL_STRING("UTF-8")); // default to utf-8 nsresult rv; // XXX // We may want to get it from the HTML 4 Accept-Charset attribute first diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 49a9fc2390f..1d9956b8e60 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -265,7 +265,7 @@ nsBulletFrame::Paint(nsIPresContext* aPresContext, if (NS_STYLE_DIRECTION_RTL == vis->mDirection) { nsStr::Delete(text, 0, 1); - text.AppendWithConversion("."); + text.Append(NS_LITERAL_STRING(".")); } break; } @@ -935,7 +935,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX, GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); if (NS_STYLE_DIRECTION_RTL == vis->mDirection) { - result.AppendWithConversion("."); + result.Append(NS_LITERAL_STRING(".")); } #endif // IBMBIDI @@ -1107,7 +1107,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX, #ifdef IBMBIDI if (NS_STYLE_DIRECTION_RTL != vis->mDirection) #endif // IBMBIDI - result.AppendWithConversion("."); + result.Append(NS_LITERAL_STRING(".")); } #define MIN_BULLET_SIZE 5 // from laytext.c diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 916b6212821..4de9b736783 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -2322,21 +2322,21 @@ nsFrame::XMLQuote(nsString& aString) for (i = 0; i < len; i++) { PRUnichar ch = aString.CharAt(i); if (ch == '<') { - nsAutoString tmp; tmp.AssignWithConversion("<"); + nsAutoString tmp(NS_LITERAL_STRING("<")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 3; i += 3; } else if (ch == '>') { - nsAutoString tmp; tmp.AssignWithConversion(">"); + nsAutoString tmp(NS_LITERAL_STRING(">")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 3; i += 3; } else if (ch == '\"') { - nsAutoString tmp; tmp.AssignWithConversion("""); + nsAutoString tmp(NS_LITERAL_STRING(""")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 5; diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 1c93d200450..7eb51015325 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -1087,7 +1087,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext) value.Left(valuePiece, 7); if (valuePiece.EqualsIgnoreCase("content") && (value.Length() == 7 || - value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) + value.Mid(valuePiece, 7, 1) == 1 && valuePiece.Equals(NS_LITERAL_STRING("-")))) isContent = PR_TRUE; } NS_IF_RELEASE(typeAtom); diff --git a/mozilla/layout/generic/nsFrameUtil.cpp b/mozilla/layout/generic/nsFrameUtil.cpp index 89ad5176fc9..61d072ff64b 100644 --- a/mozilla/layout/generic/nsFrameUtil.cpp +++ b/mozilla/layout/generic/nsFrameUtil.cpp @@ -477,9 +477,9 @@ nsFrameUtil::Tag::ToString(nsString& aResult) aResult.Append(PRUnichar(' ')); aResult.AppendWithConversion(attributes[i]); if (values[i]) { - aResult.AppendWithConversion("=\""); + aResult.Append(NS_LITERAL_STRING("=\"")); aResult.AppendWithConversion(values[i]); - aResult.AppendWithConversion('\"'); + aResult.Append(PRUnichar('\"')); } } } diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp index 466590aa467..b507ac3aec2 100644 --- a/mozilla/layout/generic/nsImageMap.cpp +++ b/mozilla/layout/generic/nsImageMap.cpp @@ -351,37 +351,37 @@ void Area::ToHTML(nsString& aResult) } aResult.Truncate(); - aResult.AppendWithConversion("\"");'); + aResult.Append(PRUnichar('>')); } void Area::HasFocus(PRBool aHasFocus) @@ -427,7 +427,7 @@ void DefaultArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void DefaultArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("default"); + aResult.Append(NS_LITERAL_STRING("default")); } //---------------------------------------------------------------------- @@ -512,7 +512,7 @@ void RectArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void RectArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("rect"); + aResult.Append(NS_LITERAL_STRING("rect")); } //---------------------------------------------------------------------- @@ -647,7 +647,7 @@ void PolyArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void PolyArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("polygon"); + aResult.Append(NS_LITERAL_STRING("polygon")); } //---------------------------------------------------------------------- @@ -732,7 +732,7 @@ void CircleArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void CircleArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("circle"); + aResult.Append(NS_LITERAL_STRING("circle")); } //---------------------------------------------------------------------- diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 8c81fe6ef00..0d5c751cc4b 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1000,7 +1000,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, else { // otherwise, we're either an ActiveX control or an internal widget // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid.EqualsWithConversion("browser")) { + if (classid.Equals(NS_LITERAL_STRING("browser"))) { rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, kCAppShellCID); } diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index 8ea14950de6..a1a18eb19e8 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -514,7 +514,7 @@ nsPageFrame::DrawHeaderFooter(nsIRenderingContext& aRenderingContext, } if (addEllipse && str.Length() > 3) { str.SetLength(str.Length()-3); - str.AppendWithConversion("..."); + str.Append(NS_LITERAL_STRING("...")); aRenderingContext.GetWidth(str, width); } diff --git a/mozilla/layout/generic/nsSimplePageSequence.cpp b/mozilla/layout/generic/nsSimplePageSequence.cpp index 5d64b45cb36..ebd39b6dc5d 100644 --- a/mozilla/layout/generic/nsSimplePageSequence.cpp +++ b/mozilla/layout/generic/nsSimplePageSequence.cpp @@ -742,7 +742,7 @@ nsSimplePageSequenceFrame::StartPrint(nsIPresContext* aPresContext, nsAutoString fontName; rv = nsFormControlHelper::GetLocalizedString(PRINTING_PROPERTIES, NS_LITERAL_STRING("fontname").get(), fontName); if (NS_FAILED(rv)) { - fontName.AssignWithConversion("serif"); + fontName.Assign(NS_LITERAL_STRING("serif")); } nsAutoString fontSizeStr; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index d1079c8d58a..bdea9020794 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -5624,13 +5624,13 @@ nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const while (fragOffset < n) { PRUnichar ch = frag->CharAt(fragOffset++); if (ch == '\r') { - aBuf.AppendWithConversion("\\r"); + aBuf.Append(NS_LITERAL_STRING("\\r")); } else if (ch == '\n') { - aBuf.AppendWithConversion("\\n"); + aBuf.Append(NS_LITERAL_STRING("\\n")); } else if (ch == '\t') { - aBuf.AppendWithConversion("\\t"); + aBuf.Append(NS_LITERAL_STRING("\\t")); } else if ((ch < ' ') || (ch >= 127)) { - aBuf.AppendWithConversion("\\0"); + aBuf.Append(NS_LITERAL_STRING("\\0")); aBuf.AppendInt((PRInt32)ch, 8); } else { aBuf.Append(ch); diff --git a/mozilla/layout/html/base/src/nsBulletFrame.cpp b/mozilla/layout/html/base/src/nsBulletFrame.cpp index 49a9fc2390f..1d9956b8e60 100644 --- a/mozilla/layout/html/base/src/nsBulletFrame.cpp +++ b/mozilla/layout/html/base/src/nsBulletFrame.cpp @@ -265,7 +265,7 @@ nsBulletFrame::Paint(nsIPresContext* aPresContext, if (NS_STYLE_DIRECTION_RTL == vis->mDirection) { nsStr::Delete(text, 0, 1); - text.AppendWithConversion("."); + text.Append(NS_LITERAL_STRING(".")); } break; } @@ -935,7 +935,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX, GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); if (NS_STYLE_DIRECTION_RTL == vis->mDirection) { - result.AppendWithConversion("."); + result.Append(NS_LITERAL_STRING(".")); } #endif // IBMBIDI @@ -1107,7 +1107,7 @@ nsBulletFrame::GetListItemText(nsIPresContext* aCX, #ifdef IBMBIDI if (NS_STYLE_DIRECTION_RTL != vis->mDirection) #endif // IBMBIDI - result.AppendWithConversion("."); + result.Append(NS_LITERAL_STRING(".")); } #define MIN_BULLET_SIZE 5 // from laytext.c diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 916b6212821..4de9b736783 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -2322,21 +2322,21 @@ nsFrame::XMLQuote(nsString& aString) for (i = 0; i < len; i++) { PRUnichar ch = aString.CharAt(i); if (ch == '<') { - nsAutoString tmp; tmp.AssignWithConversion("<"); + nsAutoString tmp(NS_LITERAL_STRING("<")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 3; i += 3; } else if (ch == '>') { - nsAutoString tmp; tmp.AssignWithConversion(">"); + nsAutoString tmp(NS_LITERAL_STRING(">")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 3; i += 3; } else if (ch == '\"') { - nsAutoString tmp; tmp.AssignWithConversion("""); + nsAutoString tmp(NS_LITERAL_STRING(""")); aString.Cut(i, 1); aString.Insert(tmp, i); len += 5; diff --git a/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp b/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp index 06bf73dbed2..5921a04319b 100644 --- a/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp +++ b/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp @@ -219,8 +219,9 @@ nsHTMLImageLoader::StartLoadImage(nsIPresContext* aPresContext) urlSpec = &internalImageURLSpec; mURLSpec.Mid(internalImageURLSpec, GOPHER_SPEC_SIZE, mURLSpec.Length() - GOPHER_SPEC_SIZE); - internalImageURLSpec.InsertWithConversion("resource:/res/html/gopher-", 0); - internalImageURLSpec.AppendWithConversion(".gif"); + internalImageURLSpec = NS_LITERAL_STRING("resource:/res/html/gopher-") + + internalImageURLSpec + + NS_LITERAL_STRING(".gif"); } // This is kind of sick, but its possible that we will get a diff --git a/mozilla/layout/html/base/src/nsImageMap.cpp b/mozilla/layout/html/base/src/nsImageMap.cpp index 466590aa467..b507ac3aec2 100644 --- a/mozilla/layout/html/base/src/nsImageMap.cpp +++ b/mozilla/layout/html/base/src/nsImageMap.cpp @@ -351,37 +351,37 @@ void Area::ToHTML(nsString& aResult) } aResult.Truncate(); - aResult.AppendWithConversion("\"");'); + aResult.Append(PRUnichar('>')); } void Area::HasFocus(PRBool aHasFocus) @@ -427,7 +427,7 @@ void DefaultArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void DefaultArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("default"); + aResult.Append(NS_LITERAL_STRING("default")); } //---------------------------------------------------------------------- @@ -512,7 +512,7 @@ void RectArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void RectArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("rect"); + aResult.Append(NS_LITERAL_STRING("rect")); } //---------------------------------------------------------------------- @@ -647,7 +647,7 @@ void PolyArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void PolyArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("polygon"); + aResult.Append(NS_LITERAL_STRING("polygon")); } //---------------------------------------------------------------------- @@ -732,7 +732,7 @@ void CircleArea::GetRect(nsIPresContext* aCX, nsRect& aRect) void CircleArea::GetShapeName(nsString& aResult) const { - aResult.AppendWithConversion("circle"); + aResult.Append(NS_LITERAL_STRING("circle")); } //---------------------------------------------------------------------- diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 8c81fe6ef00..0d5c751cc4b 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -1000,7 +1000,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, else { // otherwise, we're either an ActiveX control or an internal widget // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid.EqualsWithConversion("browser")) { + if (classid.Equals(NS_LITERAL_STRING("browser"))) { rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, kCAppShellCID); } diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp index 8ea14950de6..a1a18eb19e8 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ b/mozilla/layout/html/base/src/nsPageFrame.cpp @@ -514,7 +514,7 @@ nsPageFrame::DrawHeaderFooter(nsIRenderingContext& aRenderingContext, } if (addEllipse && str.Length() > 3) { str.SetLength(str.Length()-3); - str.AppendWithConversion("..."); + str.Append(NS_LITERAL_STRING("...")); aRenderingContext.GetWidth(str, width); } diff --git a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp index 5d64b45cb36..ebd39b6dc5d 100644 --- a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp +++ b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp @@ -742,7 +742,7 @@ nsSimplePageSequenceFrame::StartPrint(nsIPresContext* aPresContext, nsAutoString fontName; rv = nsFormControlHelper::GetLocalizedString(PRINTING_PROPERTIES, NS_LITERAL_STRING("fontname").get(), fontName); if (NS_FAILED(rv)) { - fontName.AssignWithConversion("serif"); + fontName.Assign(NS_LITERAL_STRING("serif")); } nsAutoString fontSizeStr; diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index d1079c8d58a..bdea9020794 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -5624,13 +5624,13 @@ nsTextFrame::ToCString(nsString& aBuf, PRInt32* aTotalContentLength) const while (fragOffset < n) { PRUnichar ch = frag->CharAt(fragOffset++); if (ch == '\r') { - aBuf.AppendWithConversion("\\r"); + aBuf.Append(NS_LITERAL_STRING("\\r")); } else if (ch == '\n') { - aBuf.AppendWithConversion("\\n"); + aBuf.Append(NS_LITERAL_STRING("\\n")); } else if (ch == '\t') { - aBuf.AppendWithConversion("\\t"); + aBuf.Append(NS_LITERAL_STRING("\\t")); } else if ((ch < ' ') || (ch >= 127)) { - aBuf.AppendWithConversion("\\0"); + aBuf.Append(NS_LITERAL_STRING("\\0")); aBuf.AppendInt((PRInt32)ch, 8); } else { aBuf.Append(ch); diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 1c93d200450..7eb51015325 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -1087,7 +1087,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext) value.Left(valuePiece, 7); if (valuePiece.EqualsIgnoreCase("content") && (value.Length() == 7 || - value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) + value.Mid(valuePiece, 7, 1) == 1 && valuePiece.Equals(NS_LITERAL_STRING("-")))) isContent = PR_TRUE; } NS_IF_RELEASE(typeAtom); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 1fd9b2705e0..3b36618c357 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1949,7 +1949,7 @@ nsComboboxControlFrame::SelectionChanged() } if (shouldSetValue) { if (mTextStr.Length() == 0) { - nsAutoString space; space.AssignWithConversion(" "); + nsAutoString space(NS_LITERAL_STRING(" ")); rv = mDisplayContent->SetText(space.get(), space.Length(), PR_TRUE); } else { rv = mDisplayContent->SetText(mTextStr.get(), mTextStr.Length(), PR_TRUE); diff --git a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp index 963ef5c86e1..c03f035478f 100644 --- a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -225,7 +225,7 @@ nsGfxButtonControlFrame::DoNavQuirksReflow(nsIPresContext* aPresContext if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { - value.AssignWithConversion(" "); + value.Assign(NS_LITERAL_STRING(" ")); } } @@ -381,7 +381,7 @@ nsGfxButtonControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { - value.AssignWithConversion(" "); + value.Assign(NS_LITERAL_STRING(" ")); } } diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 63444507f7b..52bd2d7d877 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -1667,7 +1667,7 @@ nsGfxTextControlFrame2::CalculateSizeStandard (nsIPresContext* aPresContex #else // XP implementation of AveCharWidth nsAutoString aveStr; - aveStr.AssignWithConversion(" ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+=-0987654321~`';\":[]}{?><,./\\|"); + aveStr.Assign(NS_LITERAL_STRING(" ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+=-0987654321~`';\":[]}{?><,./\\|")); aRendContext->GetWidth(aveStr, charWidth); charWidth /= aveStr.Length(); // Round to the nearest twip diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 9e8de8f8c41..a65089125e7 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -204,13 +204,13 @@ nsHTMLButtonControlFrame::GetDefaultLabel(nsString& aString) PRInt32 type; GetType(&type); if (NS_FORM_BUTTON_BUTTON == type) { - aString.AssignWithConversion("Button"); + aString.Assign(NS_LITERAL_STRING("Button")); } else if (NS_FORM_BUTTON_RESET == type) { - aString.AssignWithConversion("Reset"); + aString.Assign(NS_LITERAL_STRING("Reset")); } else if (NS_FORM_BUTTON_SUBMIT == type) { - aString.AssignWithConversion("Submit"); + aString.Assign(NS_LITERAL_STRING("Submit")); } } diff --git a/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp b/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp index 76f19bb2057..bc83727ee8f 100644 --- a/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp +++ b/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp @@ -470,10 +470,10 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext) // Append the URI encoded variable/value pairs for GET's if (!isJSURL) { // Not for JS URIs, see bug 26917 if (href.FindChar('?', PR_FALSE, 0) == kNotFound) { // Add a ? if needed - href.AppendWithConversion('?'); + href.Append(PRUnichar('?')); } else { // Adding to existing query string if (href.Last() != '&' && href.Last() != '?') { // Add a & if needed - href.AppendWithConversion('&'); + href.Append(PRUnichar('&')); } } href.Append(data); @@ -494,7 +494,7 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext) void nsIsIndexFrame::GetSubmitCharset(nsString& oCharset) { - oCharset.AssignWithConversion("UTF-8"); // default to utf-8 + oCharset.Assign(NS_LITERAL_STRING("UTF-8")); // default to utf-8 nsresult rv; // XXX // We may want to get it from the HTML 4 Accept-Charset attribute first diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 51f92e34f98..c3eeb026050 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -1388,7 +1388,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex } else { // XXX Don't assume default. Only use what is in 'quotes' property - contentString.AssignWithConversion('\"'); + contentString.Assign(PRUnichar('\"')); } } break; diff --git a/mozilla/layout/html/tests/TestAttributes.cpp b/mozilla/layout/html/tests/TestAttributes.cpp index 50828a93d88..d0fb5539816 100644 --- a/mozilla/layout/html/tests/TestAttributes.cpp +++ b/mozilla/layout/html/tests/TestAttributes.cpp @@ -60,7 +60,7 @@ void testAttributes(nsIHTMLContent* content) { nsIAtom* sSRC = NS_NewAtom("src"); nsIAtom* sBAD = NS_NewAtom("badattribute"); nsString sempty; - nsString sfoo_gif; sfoo_gif.AssignWithConversion("foo.gif"); + nsString sfoo_gif(NS_LITERAL_STRING("foo.gif")); content->SetHTMLAttribute(sBORDER, nullValue, PR_FALSE); content->SetHTMLAttribute(sWIDTH, nsHTMLValue(5, eHTMLUnit_Pixel), PR_FALSE); @@ -135,19 +135,19 @@ void testStrings(nsIDocument* aDoc) { PRBool val; // regular Equals - val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("mrString"); + val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("mrString")); // XXXjag if (PR_TRUE != val) { printf("test 0 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("MRString"); + val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("MRString")); // XXXjag if (PR_FALSE != val) { printf("test 1 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrString")).EqualsWithConversion("mrStri"); + val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("mrStri")); // XXXjag if (PR_FALSE != val) { printf("test 2 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrStri")).EqualsWithConversion("mrString"); + val = (NS_ConvertASCIItoUCS2("mrStri")).Equals(NS_LITERAL_STRING("mrString")); // XXXjag if (PR_FALSE != val) { printf("test 3 failed\n"); } diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp index 773058042fe..9bae4375f9c 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -243,19 +243,19 @@ printf("String:%s, Number:%s, Unit:%s\n", s1, s2, s3); if (0 == unit.Length()) { cssUnit = eCSSUnit_Number; // no explicit unit, this is a number that will act as a multiplier } - else if (unit.EqualsWithConversion("%")) { + else if (unit.Equals(NS_LITERAL_STRING("%"))) { floatValue = floatValue / 100.0f; aCSSValue.SetPercentValue(floatValue); return PR_TRUE; } - else if (unit.EqualsWithConversion("em")) cssUnit = eCSSUnit_EM; - else if (unit.EqualsWithConversion("ex")) cssUnit = eCSSUnit_XHeight; - else if (unit.EqualsWithConversion("px")) cssUnit = eCSSUnit_Pixel; - else if (unit.EqualsWithConversion("in")) cssUnit = eCSSUnit_Inch; - else if (unit.EqualsWithConversion("cm")) cssUnit = eCSSUnit_Centimeter; - else if (unit.EqualsWithConversion("mm")) cssUnit = eCSSUnit_Millimeter; - else if (unit.EqualsWithConversion("pt")) cssUnit = eCSSUnit_Point; - else if (unit.EqualsWithConversion("pc")) cssUnit = eCSSUnit_Pica; + else if (unit.Equals(NS_LITERAL_STRING("em"))) cssUnit = eCSSUnit_EM; + else if (unit.Equals(NS_LITERAL_STRING("ex"))) cssUnit = eCSSUnit_XHeight; + else if (unit.Equals(NS_LITERAL_STRING("px"))) cssUnit = eCSSUnit_Pixel; + else if (unit.Equals(NS_LITERAL_STRING("in"))) cssUnit = eCSSUnit_Inch; + else if (unit.Equals(NS_LITERAL_STRING("cm"))) cssUnit = eCSSUnit_Centimeter; + else if (unit.Equals(NS_LITERAL_STRING("mm"))) cssUnit = eCSSUnit_Millimeter; + else if (unit.Equals(NS_LITERAL_STRING("pt"))) cssUnit = eCSSUnit_Point; + else if (unit.Equals(NS_LITERAL_STRING("pc"))) cssUnit = eCSSUnit_Pica; else // unexpected unit return PR_FALSE; @@ -312,31 +312,31 @@ nsMathMLContainerFrame::ParseNamedSpaceValue(nsIFrame* aMathMLmstyleFrame, // See if it is one of the 'namedspace' (ranging 1/18em...7/18em) PRInt32 i = 0; nsIAtom* namedspaceAtom; - if (aString.EqualsWithConversion("veryverythinmathspace")) { + if (aString.Equals(NS_LITERAL_STRING("veryverythinmathspace"))) { i = 1; namedspaceAtom = nsMathMLAtoms::veryverythinmathspace_; } - else if (aString.EqualsWithConversion("verythinmathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("verythinmathspace"))) { i = 2; namedspaceAtom = nsMathMLAtoms::verythinmathspace_; } - else if (aString.EqualsWithConversion("thinmathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("thinmathspace"))) { i = 3; namedspaceAtom = nsMathMLAtoms::thinmathspace_; } - else if (aString.EqualsWithConversion("mediummathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("mediummathspace"))) { i = 4; namedspaceAtom = nsMathMLAtoms::mediummathspace_; } - else if (aString.EqualsWithConversion("thickmathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("thickmathspace"))) { i = 5; namedspaceAtom = nsMathMLAtoms::thickmathspace_; } - else if (aString.EqualsWithConversion("verythickmathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("verythickmathspace"))) { i = 6; namedspaceAtom = nsMathMLAtoms::verythickmathspace_; } - else if (aString.EqualsWithConversion("veryverythickmathspace")) { + else if (aString.Equals(NS_LITERAL_STRING("veryverythickmathspace"))) { i = 7; namedspaceAtom = nsMathMLAtoms::veryverythickmathspace_; } @@ -824,12 +824,12 @@ nsMathMLContainerFrame::ReResolveScriptStyle(nsIPresContext* aPresContext, gap = NS_MATHML_CSS_NEGATIVE_SCRIPTLEVEL_LIMIT; gap = -gap; scriptsizemultiplier = 1.0f / scriptsizemultiplier; - fontsize.AssignWithConversion("-"); + fontsize.Assign(NS_LITERAL_STRING("-")); } else { // the size is going to be decreased if (gap > NS_MATHML_CSS_POSITIVE_SCRIPTLEVEL_LIMIT) gap = NS_MATHML_CSS_POSITIVE_SCRIPTLEVEL_LIMIT; - fontsize.AssignWithConversion("+"); + fontsize.Assign(NS_LITERAL_STRING("+")); } fontsize.AppendInt(gap, 10); // we want to make sure that the size will stay readable @@ -840,7 +840,7 @@ nsMathMLContainerFrame::ReResolveScriptStyle(nsIPresContext* aPresContext, newFontSize = (nscoord)((float)(newFontSize) * scriptsizemultiplier); } if (newFontSize <= scriptminsize) { - fontsize.AssignWithConversion("scriptminsize"); + fontsize.Assign(NS_LITERAL_STRING("scriptminsize")); } // set the -moz-math-font-size attribute without notifying that we want a reflow diff --git a/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp index 92d43152e1a..30304183ac6 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp @@ -111,21 +111,21 @@ nsMathMLmfracFrame::CalcLineThickness(nsIPresContext* aPresContext, nscoord minimumThickness = onePixel; if (0 < aThicknessAttribute.Length()) { - if (aThicknessAttribute.EqualsWithConversion("thin")) { + if (aThicknessAttribute.Equals(NS_LITERAL_STRING("thin"))) { lineThickness = NSToCoordFloor(defaultThickness * THIN_FRACTION_LINE); minimumThickness = onePixel * THIN_FRACTION_LINE_MINIMUM_PIXELS; // should visually decrease by at least one pixel, if default is not a pixel if (defaultThickness > onePixel && lineThickness > defaultThickness - onePixel) lineThickness = defaultThickness - onePixel; } - else if (aThicknessAttribute.EqualsWithConversion("medium")) { + else if (aThicknessAttribute.Equals(NS_LITERAL_STRING("medium"))) { lineThickness = NSToCoordRound(defaultThickness * MEDIUM_FRACTION_LINE); minimumThickness = onePixel * MEDIUM_FRACTION_LINE_MINIMUM_PIXELS; // should visually increase by at least one pixel if (lineThickness < defaultThickness + onePixel) lineThickness = defaultThickness + onePixel; } - else if (aThicknessAttribute.EqualsWithConversion("thick")) { + else if (aThicknessAttribute.Equals(NS_LITERAL_STRING("thick"))) { lineThickness = NSToCoordCeil(defaultThickness * THICK_FRACTION_LINE); minimumThickness = onePixel * THICK_FRACTION_LINE_MINIMUM_PIXELS; // should visually increase by at least two pixels @@ -333,17 +333,17 @@ nsMathMLmfracFrame::Place(nsIPresContext* aPresContext, // see if the numalign attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::numalign_, value)) { - if (value.EqualsWithConversion("left")) + if (value.Equals(NS_LITERAL_STRING("left"))) dxNum = onePixel; - else if (value.EqualsWithConversion("right")) + else if (value.Equals(NS_LITERAL_STRING("right"))) dxNum = width - onePixel - sizeNum.width; } // see if the denomalign attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::denomalign_, value)) { - if (value.EqualsWithConversion("left")) + if (value.Equals(NS_LITERAL_STRING("left"))) dxDen = onePixel; - else if (value.EqualsWithConversion("right")) + else if (value.Equals(NS_LITERAL_STRING("right"))) dxDen = width - onePixel - sizeDen.width; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp index bb7ec76112d..0a650676d71 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -141,7 +141,7 @@ XXX The winner is the outermost in conflicting settings like these: baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -171,8 +171,8 @@ XXX The winner is the outermost in conflicting settings like these: if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.Equals(NS_LITERAL_STRING("true"))) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.Equals(NS_LITERAL_STRING("false"))) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; mathMLFrame->SetEmbellishData(embellishData); } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp index 8130fb21b80..e3a82b41300 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp @@ -232,10 +232,10 @@ nsMathMLmpaddedFrame::ParseAttribute(nsString& aString, return PR_TRUE; } - if (value.EqualsWithConversion("width")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; - else if (value.EqualsWithConversion("height")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; - else if (value.EqualsWithConversion("depth")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; - else if (value.EqualsWithConversion("lspace")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; + if (value.Equals(NS_LITERAL_STRING("width"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; + else if (value.Equals(NS_LITERAL_STRING("height"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; + else if (value.Equals(NS_LITERAL_STRING("depth"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; + else if (value.Equals(NS_LITERAL_STRING("lspace"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; else { nsCSSValue aCSSNamedSpaceValue; diff --git a/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp index c20d593bb49..0b726204053 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp @@ -84,11 +84,11 @@ nsMathMLmstyleFrame::Init(nsIPresContext* aPresContext, nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::displaystyle_, value)) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags |= NS_MATHML_DISPLAYSTYLE; } - else if (value.EqualsWithConversion("false")) { + else if (value.Equals(NS_LITERAL_STRING("false"))) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags &= ~NS_MATHML_DISPLAYSTYLE; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp index 944879f128d..ee973a8b9f2 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -140,7 +140,7 @@ XXX The winner is the outermost setting in conflicting settings like these: baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -170,8 +170,8 @@ XXX The winner is the outermost setting in conflicting settings like these: if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.Equals(NS_LITERAL_STRING("true"))) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.Equals(NS_LITERAL_STRING("false"))) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; mathMLFrame->SetEmbellishData(embellishData); } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index 5c55bfd9a25..2e61a1bbcb9 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -140,7 +140,7 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value.EqualsWithConversion("true")) { + if (value.Equals(NS_LITERAL_STRING("true"))) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -170,8 +170,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.Equals(NS_LITERAL_STRING("true"))) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.Equals(NS_LITERAL_STRING("false"))) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; mathMLFrame->SetEmbellishData(embellishData); } @@ -198,8 +198,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.Equals(NS_LITERAL_STRING("true"))) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.Equals(NS_LITERAL_STRING("false"))) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; mathMLFrame->SetEmbellishData(embellishData); } diff --git a/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp b/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp index 822092fda44..3f02fab9e61 100644 --- a/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp +++ b/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp @@ -101,29 +101,29 @@ SetProperty(OperatorData* aOperatorData, // maxsize (default: infinity) // minsize (default: 1) - if (aValue.EqualsWithConversion("true")) { + if (aValue.Equals(NS_LITERAL_STRING("true"))) { // see if we should enable flags with default value=false - if (aName.EqualsWithConversion("fence")) + if (aName.Equals(NS_LITERAL_STRING("fence"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_FENCE; - else if (aName.EqualsWithConversion("accent")) + else if (aName.Equals(NS_LITERAL_STRING("accent"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_ACCENT; - else if (aName.EqualsWithConversion("largeop")) + else if (aName.Equals(NS_LITERAL_STRING("largeop"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_LARGEOP; - else if (aName.EqualsWithConversion("separator")) + else if (aName.Equals(NS_LITERAL_STRING("separator"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_SEPARATOR; - else if (aName.EqualsWithConversion("movablelimits")) + else if (aName.Equals(NS_LITERAL_STRING("movablelimits"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_MOVABLELIMITS; } - else if (aValue.EqualsWithConversion("false")) { + else if (aValue.Equals(NS_LITERAL_STRING("false"))) { // see if we should disable flags with default value=true - if (aName.EqualsWithConversion("symmetric")) + if (aName.Equals(NS_LITERAL_STRING("symmetric"))) aOperatorData->mFlags &= ~NS_MATHML_OPERATOR_SYMMETRIC; } - else if (aName.EqualsWithConversion("stretchy") && + else if (aName.Equals(NS_LITERAL_STRING("stretchy")) && (1 == aOperatorData->mStr.Length())) { - if (aValue.EqualsWithConversion("vertical")) + if (aValue.Equals(NS_LITERAL_STRING("vertical"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_STRETCHY_VERT; - else if (aValue.EqualsWithConversion("horizontal")) + else if (aValue.Equals(NS_LITERAL_STRING("horizontal"))) aOperatorData->mFlags |= NS_MATHML_OPERATOR_STRETCHY_HORIZ; else return; // invalid value if (kNotFound == nsMathMLOperators::FindStretchyOperator(aOperatorData->mStr[0])) { @@ -134,9 +134,9 @@ SetProperty(OperatorData* aOperatorData, PRInt32 i = 0; float space = 0.0f; PRBool isLeftSpace; - if (aName.EqualsWithConversion("lspace")) + if (aName.Equals(NS_LITERAL_STRING("lspace"))) isLeftSpace = PR_TRUE; - else if (aName.EqualsWithConversion("rspace")) + else if (aName.Equals(NS_LITERAL_STRING("rspace"))) isLeftSpace = PR_FALSE; else return; // input is not applicable @@ -147,13 +147,13 @@ SetProperty(OperatorData* aOperatorData, if (error) return; } // See if it is one of the 'namedspace' (ranging 1/18em...7/18em) - else if (aValue.EqualsWithConversion("veryverythinmathspace")) i = 1; - else if (aValue.EqualsWithConversion("verythinmathspace")) i = 2; - else if (aValue.EqualsWithConversion("thinmathspace")) i = 3; - else if (aValue.EqualsWithConversion("mediummathspace")) i = 4; - else if (aValue.EqualsWithConversion("thickmathspace")) i = 5; - else if (aValue.EqualsWithConversion("verythickmathspace")) i = 6; - else if (aValue.EqualsWithConversion("veryverythickmathspace")) i = 7; + else if (aValue.Equals(NS_LITERAL_STRING("veryverythinmathspace"))) i = 1; + else if (aValue.Equals(NS_LITERAL_STRING("verythinmathspace"))) i = 2; + else if (aValue.Equals(NS_LITERAL_STRING("thinmathspace"))) i = 3; + else if (aValue.Equals(NS_LITERAL_STRING("mediummathspace"))) i = 4; + else if (aValue.Equals(NS_LITERAL_STRING("thickmathspace"))) i = 5; + else if (aValue.Equals(NS_LITERAL_STRING("verythickmathspace"))) i = 6; + else if (aValue.Equals(NS_LITERAL_STRING("veryverythickmathspace"))) i = 7; if (0 != i) // it was a namedspace value space = float(i)/float(18); @@ -280,7 +280,7 @@ InitOperators(void) nsresult rv; nsAutoString uriStr; nsCOMPtr uri; - uriStr.AssignWithConversion("resource:/res/fonts/mathfont.properties"); + uriStr.Assign(NS_LITERAL_STRING("resource:/res/fonts/mathfont.properties")); rv = NS_NewURI(getter_AddRefs(uri), uriStr); if (NS_FAILED(rv)) return rv; nsCOMPtr in; diff --git a/mozilla/layout/style/nsCSSDeclaration.cpp b/mozilla/layout/style/nsCSSDeclaration.cpp index 5cea645e101..19641726642 100644 --- a/mozilla/layout/style/nsCSSDeclaration.cpp +++ b/mozilla/layout/style/nsCSSDeclaration.cpp @@ -320,7 +320,7 @@ void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const if (eCSSProperty_UNKNOWN < aPropID) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); } mTop.AppendToString(buffer); @@ -338,22 +338,22 @@ void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) co if (eCSSUnit_Null != mTop.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mTop.AppendToString(buffer); } if (eCSSUnit_Null != mRight.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mRight.AppendToString(buffer); } if (eCSSUnit_Null != mBottom.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mBottom.AppendToString(buffer); } if (eCSSUnit_Null != mLeft.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mLeft.AppendToString(buffer); } diff --git a/mozilla/layout/style/nsCSSParser.cpp b/mozilla/layout/style/nsCSSParser.cpp index 36b7a314d3c..17d17e6e5e2 100644 --- a/mozilla/layout/style/nsCSSParser.cpp +++ b/mozilla/layout/style/nsCSSParser.cpp @@ -436,7 +436,7 @@ CSSParserImpl::CSSParserImpl() NS_INIT_REFCNT(); // set the default charset - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } NS_IMETHODIMP @@ -1053,7 +1053,7 @@ PRBool CSSParserImpl::GatherMedia(PRInt32& aErrorCode, nsString& aMedia, else if (eCSSToken_Ident == mToken.mType) { if (expectIdent) { if (! first) { - aMedia.AppendWithConversion(','); + aMedia.Append(PRUnichar(',')); } ToLowerCase(mToken.mIdent); // case insensitive from CSS - must be lower cased if (aMediaAtoms) { @@ -1572,14 +1572,14 @@ static PRBool IsSinglePseudoClass(const nsCSSSelector& aSelector) #ifdef INCLUDE_XUL static PRBool IsOutlinerPseudoElement(const nsString& aPseudo) { - return !(aPseudo.CompareWithConversion("-moz-outliner-", PR_FALSE, 14)); + return Substring(aPseudo, 0, 14).Equals(NS_LITERAL_STRING("-moz-outliner-")); } static PRBool IsOutlinerPseudoElement(nsIAtom* aPseudo) { nsAutoString str; aPseudo->ToString(str); - return !(str.CompareWithConversion(":-moz-outliner-", PR_FALSE, 15)); + return Substring(str, 0, 15).Equals(NS_LITERAL_STRING(":-moz-outliner-")); } #endif @@ -2164,7 +2164,7 @@ void CSSParserImpl::ParsePseudoSelector(PRInt32& aDataMask, } buffer.Truncate(); - buffer.AppendWithConversion(':'); + buffer.Append(PRUnichar(':')); buffer.Append(mToken.mIdent); ToLowerCase(buffer); nsIAtom* pseudo = NS_NewAtom(buffer); @@ -3086,7 +3086,7 @@ PRBool CSSParserImpl::ParseCounter(PRInt32& aErrorCode, nsCSSValue& aValue) return PR_FALSE; } if (GetToken(aErrorCode, PR_TRUE) && (eCSSToken_String == mToken.mType)) { - counter.AppendWithConversion(','); + counter.Append(PRUnichar(',')); counter.Append(mToken.mSymbol); // quote too counter.Append(mToken.mIdent); counter.Append(mToken.mSymbol); // quote too @@ -3102,7 +3102,7 @@ PRBool CSSParserImpl::ParseCounter(PRInt32& aErrorCode, nsCSSValue& aValue) nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent); if ((eCSSKeyword_UNKNOWN < keyword) && (0 < SearchKeywordTable(keyword, nsCSSProps::kListStyleKTable))) { - counter.AppendWithConversion(','); + counter.Append(PRUnichar(',')); counter.Append(mToken.mIdent); } else { @@ -3148,7 +3148,7 @@ PRBool CSSParserImpl::ParseAttr(PRInt32& aErrorCode, nsCSSValue& aValue) return PR_FALSE; } attr.AppendInt(nameSpaceID, 10); - attr.AppendWithConversion('|'); + attr.Append(PRUnichar('|')); if (! GetToken(aErrorCode, PR_FALSE)) { return PR_FALSE; } @@ -3178,7 +3178,7 @@ PRBool CSSParserImpl::ParseAttr(PRInt32& aErrorCode, nsCSSValue& aValue) else if (mToken.IsSymbol('*')) { // namespace wildcard if (ExpectSymbol(aErrorCode, '|', PR_FALSE)) { attr.AppendInt(kNameSpaceID_Unknown, 10); - attr.AppendWithConversion('|'); + attr.Append(PRUnichar('|')); if (! GetToken(aErrorCode, PR_FALSE)) { return PR_FALSE; } diff --git a/mozilla/layout/style/nsCSSScanner.cpp b/mozilla/layout/style/nsCSSScanner.cpp index ccc3ab84f22..dcd8e59c8df 100644 --- a/mozilla/layout/style/nsCSSScanner.cpp +++ b/mozilla/layout/style/nsCSSScanner.cpp @@ -162,12 +162,10 @@ nsCSSToken::AppendToString(nsString& aBuffer) aBuffer.Append(mIdent); break; case eCSSToken_Includes: - aBuffer.Append(PRUnichar('~')); - aBuffer.Append(PRUnichar('=')); + aBuffer.Append(NS_LITERAL_STRING("~=")); break; case eCSSToken_Dashmatch: - aBuffer.Append(PRUnichar('|')); - aBuffer.Append(PRUnichar('=')); + aBuffer.Append(NS_LITERAL_STRING("|=")); break; default: @@ -236,9 +234,7 @@ void nsCSSScanner::AddToError(const nsAReadableString& aErrorText) mErrorColNumber = mColNumber; mError = aErrorText; } else { - //mError.Append(NS_LITERAL_STRING(" ") + aErrorText); - mError.AppendWithConversion(" "); - mError.Append(aErrorText); + mError.Append(NS_LITERAL_STRING(" ") + aErrorText); } } @@ -494,8 +490,7 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) // WS if ((lexTable[ch] & IS_WHITESPACE) != 0) { aToken.mType = eCSSToken_WhiteSpace; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.Assign(PRUnichar(ch)); (void) EatWhiteSpace(aErrorCode); return PR_TRUE; } @@ -503,8 +498,8 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) PRInt32 nextChar = Peek(aErrorCode); if (nextChar == '*') { (void) Read(aErrorCode); - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.SetCapacity(2); + aToken.mIdent.Assign(PRUnichar(ch)); aToken.mIdent.Append(PRUnichar(nextChar)); return ParseCComment(aErrorCode, aToken); } @@ -514,11 +509,7 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken) if (LookAhead(aErrorCode, '-')) { if (LookAhead(aErrorCode, '-')) { aToken.mType = eCSSToken_HTMLComment; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar('<')); - aToken.mIdent.Append(PRUnichar('!')); - aToken.mIdent.Append(PRUnichar('-')); - aToken.mIdent.Append(PRUnichar('-')); + aToken.mIdent.Assign(NS_LITERAL_STRING("")); return PR_TRUE; } Pushback('-'); @@ -590,8 +578,7 @@ PRBool nsCSSScanner::NextURL(PRInt32& aErrorCode, nsCSSToken& aToken) // WS if ((lexTable[ch] & IS_WHITESPACE) != 0) { aToken.mType = eCSSToken_WhiteSpace; - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.Assign(PRUnichar(ch)); (void) EatWhiteSpace(aErrorCode); return PR_TRUE; } @@ -599,8 +586,8 @@ PRBool nsCSSScanner::NextURL(PRInt32& aErrorCode, nsCSSToken& aToken) PRInt32 nextChar = Peek(aErrorCode); if (nextChar == '*') { (void) Read(aErrorCode); - aToken.mIdent.SetLength(0); - aToken.mIdent.Append(PRUnichar(ch)); + aToken.mIdent.SetCapacity(2); + aToken.mIdent.Assign(PRUnichar(ch)); aToken.mIdent.Append(PRUnichar(nextChar)); return ParseCComment(aErrorCode, aToken); } @@ -880,8 +867,8 @@ PRBool nsCSSScanner::ParseCComment(PRInt32& aErrorCode, nsCSSToken& aToken) if (ch < 0) break; if (ch == '*') { if (LookAhead(aErrorCode, '/')) { - ident.Append(PRUnichar(ch)); // STRING USE WARNING: technically, this should be |AppendWithConversion| - ident.AppendWithConversion('/'); + ident.Append(PRUnichar(ch)); + ident.Append(PRUnichar('/')); break; } } diff --git a/mozilla/layout/style/nsCSSStruct.cpp b/mozilla/layout/style/nsCSSStruct.cpp index 5cea645e101..19641726642 100644 --- a/mozilla/layout/style/nsCSSStruct.cpp +++ b/mozilla/layout/style/nsCSSStruct.cpp @@ -320,7 +320,7 @@ void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const if (eCSSProperty_UNKNOWN < aPropID) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); } mTop.AppendToString(buffer); @@ -338,22 +338,22 @@ void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) co if (eCSSUnit_Null != mTop.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mTop.AppendToString(buffer); } if (eCSSUnit_Null != mRight.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mRight.AppendToString(buffer); } if (eCSSUnit_Null != mBottom.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mBottom.AppendToString(buffer); } if (eCSSUnit_Null != mLeft.GetUnit()) { buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get()); - buffer.AppendWithConversion(": "); + buffer.Append(NS_LITERAL_STRING(": ")); mLeft.AppendToString(buffer); } diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 15ad7073de4..d36b99804e5 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -2389,9 +2389,9 @@ CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const nsAutoString buffer; mSelector.ToString(buffer, mSheet, PR_FALSE, 0); - buffer.AppendWithConversion(" weight: "); + buffer.Append(NS_LITERAL_STRING(" weight: ")); buffer.AppendInt(mWeight, 10); - buffer.AppendWithConversion(" "); + buffer.Append(NS_LITERAL_STRING(" ")); fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out); if (nsnull != mDeclaration) { mDeclaration->List(out); diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index 08d5d204dc1..2a8dfca3dd6 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -1936,7 +1936,7 @@ CSSStyleSheetImpl::SetTitle(const nsString& aTitle) NS_IMETHODIMP CSSStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/css"); + aType.Assign(NS_LITERAL_STRING("text/css")); return NS_OK; } diff --git a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp index 8b525a3968d..98c1e60bdbf 100644 --- a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp @@ -457,14 +457,14 @@ HTMLCSSStyleSheetImpl::GetURL(nsIURI*& aURL) const NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetTitle(nsString& aTitle) const { - aTitle.AssignWithConversion("Internal HTML/CSS Style Sheet"); + aTitle.Assign(NS_LITERAL_STRING("Internal HTML/CSS Style Sheet")); return NS_OK; } NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/html"); + aType.Assign(NS_LITERAL_STRING("text/html")); return NS_OK; } diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index ab4f3fe6364..b9ffa283797 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -894,7 +894,7 @@ HTMLStyleSheetImpl::GetTitle(nsString& aTitle) const NS_IMETHODIMP HTMLStyleSheetImpl::GetType(nsString& aType) const { - aType.AssignWithConversion("text/html"); + aType.Assign(NS_LITERAL_STRING("text/html")); return NS_OK; } diff --git a/mozilla/layout/style/nsROCSSPrimitiveValue.cpp b/mozilla/layout/style/nsROCSSPrimitiveValue.cpp index a6a1c2cb4fe..f6608dea5a6 100644 --- a/mozilla/layout/style/nsROCSSPrimitiveValue.cpp +++ b/mozilla/layout/style/nsROCSSPrimitiveValue.cpp @@ -83,7 +83,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) { PRInt32 px = NSTwipsToIntPixels(mTwips, mT2P); tmpStr.AppendInt(px); - tmpStr.AppendWithConversion("px"); + tmpStr.Append(NS_LITERAL_STRING("px")); break; } @@ -92,7 +92,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_CENTIMETERS(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("cm"); + tmpStr.Append(NS_LITERAL_STRING("cm")); break; } case CSS_MM : @@ -100,7 +100,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_MILLIMETERS(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("mm"); + tmpStr.Append(NS_LITERAL_STRING("mm")); break; } case CSS_IN : @@ -108,7 +108,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NS_TWIPS_TO_INCHES(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("in"); + tmpStr.Append(NS_LITERAL_STRING("in")); break; } case CSS_PT : @@ -116,7 +116,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAWritableString& aCssText) float val = NSTwipsToFloatPoints(mTwips); char buf[64]; PR_snprintf(buf, 63, "%.2fcm", val); - tmpStr.AppendWithConversion("pt"); + tmpStr.Append(NS_LITERAL_STRING("pt")); break; } case CSS_STRING : diff --git a/mozilla/layout/style/nsStyleCoord.cpp b/mozilla/layout/style/nsStyleCoord.cpp index a1f5425db33..bfc924e0fd7 100644 --- a/mozilla/layout/style/nsStyleCoord.cpp +++ b/mozilla/layout/style/nsStyleCoord.cpp @@ -206,25 +206,25 @@ void nsStyleCoord::AppendToString(nsString& aBuffer) const (eStyleUnit_Enumerated == mUnit) || (eStyleUnit_Integer == mUnit)) { aBuffer.AppendInt(mValue.mInt, 10); - aBuffer.AppendWithConversion("[0x"); + aBuffer.Append(NS_LITERAL_STRING("[0x")); aBuffer.AppendInt(mValue.mInt, 16); - aBuffer.AppendWithConversion(']'); + aBuffer.Append(PRUnichar(']')); } switch (mUnit) { - case eStyleUnit_Null: aBuffer.AppendWithConversion("Null"); break; - case eStyleUnit_Coord: aBuffer.AppendWithConversion("tw"); break; - case eStyleUnit_Percent: aBuffer.AppendWithConversion("%"); break; - case eStyleUnit_Factor: aBuffer.AppendWithConversion("f"); break; - case eStyleUnit_Normal: aBuffer.AppendWithConversion("Normal"); break; - case eStyleUnit_Auto: aBuffer.AppendWithConversion("Auto"); break; - case eStyleUnit_Inherit: aBuffer.AppendWithConversion("Inherit"); break; - case eStyleUnit_Proportional: aBuffer.AppendWithConversion("*"); break; - case eStyleUnit_Enumerated: aBuffer.AppendWithConversion("enum"); break; - case eStyleUnit_Integer: aBuffer.AppendWithConversion("int"); break; - case eStyleUnit_Chars: aBuffer.AppendWithConversion("chars"); break; + case eStyleUnit_Null: aBuffer.Append(NS_LITERAL_STRING("Null")); break; + case eStyleUnit_Coord: aBuffer.Append(NS_LITERAL_STRING("tw")); break; + case eStyleUnit_Percent: aBuffer.Append(NS_LITERAL_STRING("%")); break; + case eStyleUnit_Factor: aBuffer.Append(NS_LITERAL_STRING("f")); break; + case eStyleUnit_Normal: aBuffer.Append(NS_LITERAL_STRING("Normal")); break; + case eStyleUnit_Auto: aBuffer.Append(NS_LITERAL_STRING("Auto")); break; + case eStyleUnit_Inherit: aBuffer.Append(NS_LITERAL_STRING("Inherit")); break; + case eStyleUnit_Proportional: aBuffer.Append(NS_LITERAL_STRING("*")); break; + case eStyleUnit_Enumerated: aBuffer.Append(NS_LITERAL_STRING("enum")); break; + case eStyleUnit_Integer: aBuffer.Append(NS_LITERAL_STRING("int")); break; + case eStyleUnit_Chars: aBuffer.Append(NS_LITERAL_STRING("chars")); break; } - aBuffer.AppendWithConversion(' '); + aBuffer.Append(PRUnichar(' ')); } void nsStyleCoord::ToString(nsString& aBuffer) const @@ -276,19 +276,19 @@ void nsStyleSides::AppendToString(nsString& aBuffer) const nsStyleCoord temp; GetLeft(temp); - aBuffer.AppendWithConversion("left: "); + aBuffer.Append(NS_LITERAL_STRING("left: ")); temp.AppendToString(aBuffer); GetTop(temp); - aBuffer.AppendWithConversion("top: "); + aBuffer.Append(NS_LITERAL_STRING("top: ")); temp.AppendToString(aBuffer); GetRight(temp); - aBuffer.AppendWithConversion("right: "); + aBuffer.Append(NS_LITERAL_STRING("right: ")); temp.AppendToString(aBuffer); GetBottom(temp); - aBuffer.AppendWithConversion("bottom: "); + aBuffer.Append(NS_LITERAL_STRING("bottom: ")); temp.AppendToString(aBuffer); } diff --git a/mozilla/layout/xul/base/src/nsBox.cpp b/mozilla/layout/xul/base/src/nsBox.cpp index 860f8ea576a..613cb662c88 100644 --- a/mozilla/layout/xul/base/src/nsBox.cpp +++ b/mozilla/layout/xul/base/src/nsBox.cpp @@ -81,9 +81,9 @@ void nsBox::AppendAttribute(const nsAutoString& aAttribute, const nsAutoString& aValue, nsAutoString& aResult) { aResult.Append(aAttribute); - aResult.AppendWithConversion("='"); + aResult.Append(NS_LITERAL_STRING("='")); aResult.Append(aValue); - aResult.AppendWithConversion("' "); + aResult.Append(NS_LITERAL_STRING("' ")); } void @@ -99,7 +99,7 @@ nsBox::ListBox(nsAutoString& aResult) aResult.AppendWithConversion(addr); aResult.Append(name); - aResult.AppendWithConversion(" "); + aResult.Append(NS_LITERAL_STRING(" ")); nsCOMPtr content; frame->GetContent(getter_AddRefs(content)); @@ -148,7 +148,7 @@ nsBox::ChildrenMustHaveWidgets(PRBool& aMust) void nsBox::GetBoxName(nsAutoString& aName) { - aName.AssignWithConversion("Box"); + aName.Assign(NS_LITERAL_STRING("Box")); } NS_IMETHODIMP @@ -162,13 +162,13 @@ nsBox::BeginLayout(nsBoxLayoutState& aState) switch(aState.GetLayoutReason()) { case nsBoxLayoutState::Dirty: - reason.AssignWithConversion("Dirty"); + reason.Assign(NS_LITERAL_STRING("Dirty")); break; case nsBoxLayoutState::Initial: - reason.AssignWithConversion("Initial"); + reason.Assign(NS_LITERAL_STRING("Initial")); break; case nsBoxLayoutState::Resize: - reason.AssignWithConversion("Resize"); + reason.Assign(NS_LITERAL_STRING("Resize")); break; } diff --git a/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp b/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp index bd1f024427d..0a998bebf68 100644 --- a/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp @@ -148,7 +148,7 @@ nsButtonBoxFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent // Don't execute if we're disabled. nsAutoString disabled; mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled.EqualsWithConversion("true")) + if (disabled.Equals(NS_LITERAL_STRING("true"))) return; nsresult rv = NS_OK; diff --git a/mozilla/layout/xul/base/src/nsContainerBox.cpp b/mozilla/layout/xul/base/src/nsContainerBox.cpp index 56294b0ce1c..009d046c75a 100644 --- a/mozilla/layout/xul/base/src/nsContainerBox.cpp +++ b/mozilla/layout/xul/base/src/nsContainerBox.cpp @@ -98,7 +98,7 @@ nsContainerBox::~nsContainerBox() void nsContainerBox::GetBoxName(nsAutoString& aName) { - aName.AssignWithConversion("ContainerBox"); + aName.Assign(NS_LITERAL_STRING("ContainerBox")); } NS_IMETHODIMP diff --git a/mozilla/layout/xul/base/src/nsGrippyFrame.cpp b/mozilla/layout/xul/base/src/nsGrippyFrame.cpp index 211b111159e..a77bf526bb2 100644 --- a/mozilla/layout/xul/base/src/nsGrippyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsGrippyFrame.cpp @@ -104,12 +104,12 @@ nsGrippyFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent) nsCOMPtr content; splitter->GetContent(getter_AddRefs(content)); - nsString a; a.AssignWithConversion("collapsed"); + nsString a(NS_LITERAL_STRING("collapsed")); nsString value; if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::state, value)) { - if (value.EqualsWithConversion("collapsed")) - a.AssignWithConversion("open"); + if (value.Equals(NS_LITERAL_STRING("collapsed"))) + a.Assign(NS_LITERAL_STRING("open")); } content->SetAttr(kNameSpaceID_None, nsXULAtoms::state, a, PR_TRUE); diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 35bb008c248..c27868f8776 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1071,40 +1071,40 @@ static void ConvertPosition(nsIContent* aPopupElt, nsString& aAnchor, nsString& return; if (position.Equals(NS_LITERAL_STRING("before_start"))) { - aAnchor.AssignWithConversion("topleft"); - aAlign.AssignWithConversion("bottomleft"); + aAnchor.Assign(NS_LITERAL_STRING("topleft")); + aAlign.Assign(NS_LITERAL_STRING("bottomleft")); } else if (position.Equals(NS_LITERAL_STRING("before_end"))) { - aAnchor.AssignWithConversion("topright"); - aAlign.AssignWithConversion("bottomright"); + aAnchor.Assign(NS_LITERAL_STRING("topright")); + aAlign.Assign(NS_LITERAL_STRING("bottomright")); } else if (position.Equals(NS_LITERAL_STRING("after_start"))) { - aAnchor.AssignWithConversion("bottomleft"); - aAlign.AssignWithConversion("topleft"); + aAnchor.Assign(NS_LITERAL_STRING("bottomleft")); + aAlign.Assign(NS_LITERAL_STRING("topleft")); } else if (position.Equals(NS_LITERAL_STRING("after_end"))) { - aAnchor.AssignWithConversion("bottomright"); - aAlign.AssignWithConversion("topright"); + aAnchor.Assign(NS_LITERAL_STRING("bottomright")); + aAlign.Assign(NS_LITERAL_STRING("topright")); } else if (position.Equals(NS_LITERAL_STRING("start_before"))) { - aAnchor.AssignWithConversion("topleft"); - aAlign.AssignWithConversion("topright"); + aAnchor.Assign(NS_LITERAL_STRING("topleft")); + aAlign.Assign(NS_LITERAL_STRING("topright")); } else if (position.Equals(NS_LITERAL_STRING("start_after"))) { - aAnchor.AssignWithConversion("bottomleft"); - aAlign.AssignWithConversion("bottomright"); + aAnchor.Assign(NS_LITERAL_STRING("bottomleft")); + aAlign.Assign(NS_LITERAL_STRING("bottomright")); } else if (position.Equals(NS_LITERAL_STRING("end_before"))) { - aAnchor.AssignWithConversion("topright"); - aAlign.AssignWithConversion("topleft"); + aAnchor.Assign(NS_LITERAL_STRING("topright")); + aAlign.Assign(NS_LITERAL_STRING("topleft")); } else if (position.Equals(NS_LITERAL_STRING("end_after"))) { - aAnchor.AssignWithConversion("bottomright"); - aAlign.AssignWithConversion("bottomleft"); + aAnchor.Assign(NS_LITERAL_STRING("bottomright")); + aAlign.Assign(NS_LITERAL_STRING("bottomleft")); } else if (position.Equals(NS_LITERAL_STRING("overlap"))) { - aAnchor.AssignWithConversion("topleft"); - aAlign.AssignWithConversion("topleft"); + aAnchor.Assign(NS_LITERAL_STRING("topleft")); + aAlign.Assign(NS_LITERAL_STRING("topleft")); } } @@ -1692,8 +1692,8 @@ nsMenuFrame::OnCreate() else grandChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, commandAttr, PR_TRUE); } - commandAttr.AssignWithConversion(""); - menuAttr.AssignWithConversion(""); + commandAttr.Assign(NS_LITERAL_STRING("")); + menuAttr.Assign(NS_LITERAL_STRING("")); // The menu's label and checked states need to be updated to match the command. // Note that (unlike the disabled state) if the command has *no* label for either, we @@ -1705,8 +1705,8 @@ nsMenuFrame::OnCreate() grandChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, commandAttr, PR_TRUE); } - commandAttr.AssignWithConversion(""); - menuAttr.AssignWithConversion(""); + commandAttr.Assign(NS_LITERAL_STRING("")); + menuAttr.Assign(NS_LITERAL_STRING("")); commandContent->GetAttr(kNameSpaceID_None, nsXULAtoms::label, commandAttr); grandChild->GetAttr(kNameSpaceID_None, nsXULAtoms::label, menuAttr); diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 05083e01f77..028f842fb56 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -640,22 +640,22 @@ nsMenuPopupFrame::AdjustPositionForAnchorAlign ( PRInt32* ioXPos, PRInt32* ioYPo const nsStyleVisibility* vis = (const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility); if (vis->mDirection == NS_STYLE_DIRECTION_RTL) { if (popupAnchor == NS_LITERAL_STRING("topright")) - popupAnchor.AssignWithConversion("topleft"); + popupAnchor.Assign(NS_LITERAL_STRING("topleft")); else if (popupAnchor == NS_LITERAL_STRING("topleft")) - popupAnchor.AssignWithConversion("topright"); + popupAnchor.Assign(NS_LITERAL_STRING("topright")); else if (popupAnchor == NS_LITERAL_STRING("bottomleft")) - popupAnchor.AssignWithConversion("bottomright"); + popupAnchor.Assign(NS_LITERAL_STRING("bottomright")); else if (popupAnchor == NS_LITERAL_STRING("bottomright")) - popupAnchor.AssignWithConversion("bottomleft"); + popupAnchor.Assign(NS_LITERAL_STRING("bottomleft")); if (popupAlign == NS_LITERAL_STRING("topright")) - popupAlign.AssignWithConversion("topleft"); + popupAlign.Assign(NS_LITERAL_STRING("topleft")); else if (popupAlign == NS_LITERAL_STRING("topleft")) - popupAlign.AssignWithConversion("topright"); + popupAlign.Assign(NS_LITERAL_STRING("topright")); else if (popupAlign == NS_LITERAL_STRING("bottomleft")) - popupAlign.AssignWithConversion("bottomright"); + popupAlign.Assign(NS_LITERAL_STRING("bottomright")); else if (popupAnchor == NS_LITERAL_STRING("bottomright")) - popupAlign.AssignWithConversion("bottomleft"); + popupAlign.Assign(NS_LITERAL_STRING("bottomleft")); } // Adjust position for margins at the aligned corner diff --git a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp index db8863d9f9a..e80a123b540 100644 --- a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp @@ -176,9 +176,9 @@ nsScrollbarButtonFrame::MouseClicked() { // if our class is DecrementButton subtract the current pos by increment amount // if our class is IncrementButton increment the current pos by the decrement amount - if (value.EqualsWithConversion("decrement")) + if (value.Equals(NS_LITERAL_STRING("decrement"))) curpos -= increment; - else if (value.EqualsWithConversion("increment")) + else if (value.Equals(NS_LITERAL_STRING("increment"))) curpos += increment; // make sure the current positon is between the current and max positions diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp index bec397009b7..948051c7f60 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp @@ -686,10 +686,10 @@ nsTextBoxFrame::UpdateAccessTitle() if ((mTitle.Find(mAccessKey, PR_TRUE) == kNotFound) || AlwaysAppendAccessKey()) { - nsAutoString tmpstring; tmpstring.AssignWithConversion("("); + nsAutoString tmpstring(NS_LITERAL_STRING("(")); tmpstring += mAccessKey; tmpstring.ToUpperCase(); - tmpstring.AppendWithConversion(")"); + tmpstring.Append(NS_LITERAL_STRING(")")); PRInt32 offset = mTitle.RFind("..."); if (offset != kNotFound) mTitle.Insert(tmpstring,NS_STATIC_CAST(PRUint32, offset)); diff --git a/mozilla/layout/xul/base/src/nsTreeItemDragCapturer.cpp b/mozilla/layout/xul/base/src/nsTreeItemDragCapturer.cpp index 0131f71a72c..f3c5b9a823f 100644 --- a/mozilla/layout/xul/base/src/nsTreeItemDragCapturer.cpp +++ b/mozilla/layout/xul/base/src/nsTreeItemDragCapturer.cpp @@ -142,7 +142,7 @@ nsTreeItemDragCapturer :: ComputeDropPosition ( nsIDOMEvent* aDragEvent, nscoord if ( treeItemNode ) { nsAutoString value; treeItemNode->GetAttribute(NS_LITERAL_STRING("container"), value); // can't use an atom here =( - isContainer = value.EqualsWithConversion("true"); + isContainer = value.Equals(NS_LITERAL_STRING("true")); } else NS_WARNING("Not a DOM element"); diff --git a/mozilla/layout/xul/base/src/nsXULTreeCellFrame.cpp b/mozilla/layout/xul/base/src/nsXULTreeCellFrame.cpp index e68441e1827..1e5ae180f2b 100644 --- a/mozilla/layout/xul/base/src/nsXULTreeCellFrame.cpp +++ b/mozilla/layout/xul/base/src/nsXULTreeCellFrame.cpp @@ -91,7 +91,7 @@ nsXULTreeCellFrame::GetFrameForPoint(nsIPresContext* aPresContext, { nsAutoString value; mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.EqualsWithConversion("true")) + if (value.Equals(NS_LITERAL_STRING("true"))) { return nsBoxFrame::GetFrameForPoint(aPresContext, aPoint, aWhichLayer, aFrame); } @@ -161,7 +161,7 @@ nsXULTreeCellFrame::GetFrameForPoint(nsIPresContext* aPresContext, if (content) { // This allows selective overriding for subcontent. content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.EqualsWithConversion("true")) + if (value.Equals(NS_LITERAL_STRING("true"))) return result; } } diff --git a/mozilla/layout/xul/base/src/nsXULTreeGroupFrame.cpp b/mozilla/layout/xul/base/src/nsXULTreeGroupFrame.cpp index 1e639ad7212..512163a6681 100644 --- a/mozilla/layout/xul/base/src/nsXULTreeGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsXULTreeGroupFrame.cpp @@ -763,7 +763,7 @@ nsXULTreeGroupFrame::AttributeChanged(nsIPresContext* aPresContext, nsIContent* nsAutoString attribute; aChild->GetAttr ( kNameSpaceID_None, aAttribute, attribute ); attribute.ToLowerCase(); - mDropOnContainer = attribute.EqualsWithConversion("true"); + mDropOnContainer = attribute.Equals(NS_LITERAL_STRING("true")); } else rv = nsBoxFrame::AttributeChanged ( aPresContext, aChild, aNameSpaceID, aAttribute, aModType, aHint ); diff --git a/mozilla/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp b/mozilla/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp index 95b766fefab..0a61f31e8d2 100644 --- a/mozilla/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp @@ -591,7 +591,7 @@ nsXULTreeOuterGroupFrame::ComputeTotalRowCount(PRInt32& aCount, nsIContent* aPar nsCOMPtr parent; childContent->GetParent(*getter_AddRefs(parent)); parent->GetAttr(kNameSpaceID_None, openAtom, isOpen); - if (isOpen.EqualsWithConversion("true")) + if (isOpen.Equals(NS_LITERAL_STRING("true"))) ComputeTotalRowCount(aCount, childContent); } } @@ -1070,7 +1070,7 @@ nsXULTreeOuterGroupFrame::FindPreviousRowContent(PRInt32& aDelta, nsIContent* aU nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; childContent->GetAttr(kNameSpaceID_None, openAtom, isOpen); - if (isOpen.EqualsWithConversion("true")) { + if (isOpen.Equals(NS_LITERAL_STRING("true"))) { // Find the node. PRInt32 childContentCount; nsCOMPtr grandChild; @@ -1166,7 +1166,7 @@ nsXULTreeOuterGroupFrame::FindNextRowContent(PRInt32& aDelta, nsIContent* aUpwar nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; parentContent->GetAttr(kNameSpaceID_None, openAtom, isOpen); - if (isOpen.EqualsWithConversion("true")) { + if (isOpen.Equals(NS_LITERAL_STRING("true"))) { FindNextRowContent(aDelta, nsnull, childContent, aResult); if (aDelta == 0) return; @@ -1293,7 +1293,7 @@ nsXULTreeOuterGroupFrame::IndexOfItem(nsIContent* aRoot, nsIContent* aContent, nsAutoString isOpen; rv = child->GetAttr(kNameSpaceID_None, nsXULAtoms::open, isOpen); - if (!isOpen.EqualsWithConversion("true")) + if (!isOpen.Equals(NS_LITERAL_STRING("true"))) parentIsOpen=PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp index 3b7911b434c..5522a4437e9 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp @@ -344,14 +344,14 @@ nsOutlinerBodyFrame::Destroy(nsIPresContext* aPresContext) if (mOutlinerBoxObject) { nsCOMPtr box(do_QueryInterface(mOutlinerBoxObject)); if (mTopRowIndex > 0) { - nsAutoString topRowStr; topRowStr.AssignWithConversion("topRow"); + nsAutoString topRowStr; topRowStr.Assign(NS_LITERAL_STRING("topRow")); nsAutoString topRow; topRow.AppendInt(mTopRowIndex); box->SetProperty(topRowStr.get(), topRow.get()); } // Always null out the cached outliner body frame. - nsAutoString outlinerBody; outlinerBody.AssignWithConversion("outlinerbody"); + nsAutoString outlinerBody(NS_LITERAL_STRING("outlinerbody")); box->RemoveProperty(outlinerBody.get()); mOutlinerBoxObject = nsnull; // Drop our ref here. @@ -381,13 +381,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext, nsCOMPtr outlinerBox(do_QueryInterface(box)); SetBoxObject(outlinerBox); - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); nsCOMPtr suppView; box->GetPropertyAsSupports(view.get(), getter_AddRefs(suppView)); nsCOMPtr outlinerView(do_QueryInterface(suppView)); if (outlinerView) { - nsAutoString topRow; topRow.AssignWithConversion("topRow"); + nsAutoString topRow(NS_LITERAL_STRING("topRow")); nsXPIDLString rowStr; box->GetProperty(topRow.get(), getter_Copies(rowStr)); nsAutoString rowStr2(rowStr); @@ -481,7 +481,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView) return NS_OK; // Just ignore the call. An initial reflow when it comes in // will retrieve the view from the box object. - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); if (mView) { mView->SetOutliner(nsnull); @@ -904,7 +904,7 @@ nsOutlinerBodyFrame::GetCoordsForCellItem(PRInt32 aRow, const PRUnichar *aColID, nsCOMPtr cellContext; GetPseudoStyleContext(nsXULAtoms::mozoutlinercell, getter_AddRefs(cellContext)); - nsAutoString cell; cell.AssignWithConversion("cell"); + nsAutoString cell(NS_LITERAL_STRING("cell")); if (currCol->IsCycler() || cell.EqualsWithConversion(aCellItem)) { // If the current Column is a Cycler, then the Rect is just the cell - the margins. // Similarly, if we're just being asked for the cell rect, provide it. @@ -1689,11 +1689,11 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintColumn(nsOutlinerColumn* aColumn, // Read special properties from attributes on the column content node nsAutoString attr; aColumn->GetElement()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertbefore, attr); - if (attr.EqualsWithConversion("true")) + if (attr.Equals(NS_LITERAL_STRING("true"))) mScratchArray->AppendElement(nsXULAtoms::insertbefore); - attr.AssignWithConversion(""); + attr.Assign(NS_LITERAL_STRING("")); aColumn->GetElement()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertafter, attr); - if (attr.EqualsWithConversion("true")) + if (attr.Equals(NS_LITERAL_STRING("true"))) mScratchArray->AppendElement(nsXULAtoms::insertafter); // Resolve style for the column. It contains all the info we need to lay ourselves diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBoxObject.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBoxObject.cpp index 291c2fa8734..585256100ed 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBoxObject.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBoxObject.cpp @@ -75,7 +75,7 @@ nsOutlinerBoxObject::SetDocument(nsIDocument* aDocument) NS_ASSERTION(aDocument == nsnull, "SetDocument called with non-null document"); // Drop the view's ref to us. - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); nsCOMPtr suppView; GetPropertyAsSupports(view.get(), getter_AddRefs(suppView)); nsCOMPtr outlinerView(do_QueryInterface(suppView)); @@ -131,7 +131,7 @@ static void FindBodyElement(nsIContent* aParent, nsIContent** aResult) inline nsIOutlinerBoxObject* nsOutlinerBoxObject::GetOutlinerBody() { - nsAutoString outlinerbody; outlinerbody.AssignWithConversion("outlinerbody"); + nsAutoString outlinerbody(NS_LITERAL_STRING("outlinerbody")); nsCOMPtr supp; GetPropertyAsSupports(outlinerbody.get(), getter_AddRefs(supp)); diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp index 054bd68b4e5..7aa1cd219c4 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp @@ -161,7 +161,7 @@ nsOutlinerColFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.EqualsWithConversion("true")) + if (value.Equals(NS_LITERAL_STRING("true"))) return result; } } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 3b7911b434c..5522a4437e9 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -344,14 +344,14 @@ nsOutlinerBodyFrame::Destroy(nsIPresContext* aPresContext) if (mOutlinerBoxObject) { nsCOMPtr box(do_QueryInterface(mOutlinerBoxObject)); if (mTopRowIndex > 0) { - nsAutoString topRowStr; topRowStr.AssignWithConversion("topRow"); + nsAutoString topRowStr; topRowStr.Assign(NS_LITERAL_STRING("topRow")); nsAutoString topRow; topRow.AppendInt(mTopRowIndex); box->SetProperty(topRowStr.get(), topRow.get()); } // Always null out the cached outliner body frame. - nsAutoString outlinerBody; outlinerBody.AssignWithConversion("outlinerbody"); + nsAutoString outlinerBody(NS_LITERAL_STRING("outlinerbody")); box->RemoveProperty(outlinerBody.get()); mOutlinerBoxObject = nsnull; // Drop our ref here. @@ -381,13 +381,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Reflow(nsIPresContext* aPresContext, nsCOMPtr outlinerBox(do_QueryInterface(box)); SetBoxObject(outlinerBox); - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); nsCOMPtr suppView; box->GetPropertyAsSupports(view.get(), getter_AddRefs(suppView)); nsCOMPtr outlinerView(do_QueryInterface(suppView)); if (outlinerView) { - nsAutoString topRow; topRow.AssignWithConversion("topRow"); + nsAutoString topRow(NS_LITERAL_STRING("topRow")); nsXPIDLString rowStr; box->GetProperty(topRow.get(), getter_Copies(rowStr)); nsAutoString rowStr2(rowStr); @@ -481,7 +481,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView) return NS_OK; // Just ignore the call. An initial reflow when it comes in // will retrieve the view from the box object. - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); if (mView) { mView->SetOutliner(nsnull); @@ -904,7 +904,7 @@ nsOutlinerBodyFrame::GetCoordsForCellItem(PRInt32 aRow, const PRUnichar *aColID, nsCOMPtr cellContext; GetPseudoStyleContext(nsXULAtoms::mozoutlinercell, getter_AddRefs(cellContext)); - nsAutoString cell; cell.AssignWithConversion("cell"); + nsAutoString cell(NS_LITERAL_STRING("cell")); if (currCol->IsCycler() || cell.EqualsWithConversion(aCellItem)) { // If the current Column is a Cycler, then the Rect is just the cell - the margins. // Similarly, if we're just being asked for the cell rect, provide it. @@ -1689,11 +1689,11 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintColumn(nsOutlinerColumn* aColumn, // Read special properties from attributes on the column content node nsAutoString attr; aColumn->GetElement()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertbefore, attr); - if (attr.EqualsWithConversion("true")) + if (attr.Equals(NS_LITERAL_STRING("true"))) mScratchArray->AppendElement(nsXULAtoms::insertbefore); - attr.AssignWithConversion(""); + attr.Assign(NS_LITERAL_STRING("")); aColumn->GetElement()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertafter, attr); - if (attr.EqualsWithConversion("true")) + if (attr.Equals(NS_LITERAL_STRING("true"))) mScratchArray->AppendElement(nsXULAtoms::insertafter); // Resolve style for the column. It contains all the info we need to lay ourselves diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp index 291c2fa8734..585256100ed 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp @@ -75,7 +75,7 @@ nsOutlinerBoxObject::SetDocument(nsIDocument* aDocument) NS_ASSERTION(aDocument == nsnull, "SetDocument called with non-null document"); // Drop the view's ref to us. - nsAutoString view; view.AssignWithConversion("view"); + nsAutoString view(NS_LITERAL_STRING("view")); nsCOMPtr suppView; GetPropertyAsSupports(view.get(), getter_AddRefs(suppView)); nsCOMPtr outlinerView(do_QueryInterface(suppView)); @@ -131,7 +131,7 @@ static void FindBodyElement(nsIContent* aParent, nsIContent** aResult) inline nsIOutlinerBoxObject* nsOutlinerBoxObject::GetOutlinerBody() { - nsAutoString outlinerbody; outlinerbody.AssignWithConversion("outlinerbody"); + nsAutoString outlinerbody(NS_LITERAL_STRING("outlinerbody")); nsCOMPtr supp; GetPropertyAsSupports(outlinerbody.get(), getter_AddRefs(supp)); diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index 054bd68b4e5..7aa1cd219c4 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -161,7 +161,7 @@ nsOutlinerColFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.EqualsWithConversion("true")) + if (value.Equals(NS_LITERAL_STRING("true"))) return result; } } diff --git a/mozilla/mailnews/absync/build/makefile.win b/mozilla/mailnews/absync/build/makefile.win index 9956408566a..9e5ae2376c2 100644 --- a/mozilla/mailnews/absync/build/makefile.win +++ b/mozilla/mailnews/absync/build/makefile.win @@ -54,6 +54,7 @@ SUB_LIBRARIES= \ LLIBS= \ $(LLIBS) \ + $(DIST)\lib\unicharutil_s.lib \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\msgbsutl.lib \ diff --git a/mozilla/mailnews/absync/macbuild/AbSync.xml b/mozilla/mailnews/absync/macbuild/AbSync.xml index 69cf4674ffe..8d00ff2bbe0 100644 --- a/mozilla/mailnews/absync/macbuild/AbSync.xml +++ b/mozilla/mailnews/absync/macbuild/AbSync.xml @@ -115,6 +115,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -1031,6 +1041,13 @@ Library Debug + + Name + UnicharUtilsStaticDebug.o + MacOS + Library + Debug + @@ -1098,6 +1115,11 @@ MsgUtilDebug.lib MacOS + + Name + UnicharUtilsStaticDebug.o + MacOS + @@ -1162,6 +1184,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -2078,6 +2110,13 @@ Library Debug + + Name + UnicharUtilsStatic.o + MacOS + Library + Debug + @@ -2145,6 +2184,11 @@ MsgUtil.lib MacOS + + Name + UnicharUtilsStatic.o + MacOS + @@ -2155,6 +2199,20 @@ + Static Libs + + AbSyncSvc.shlb + Name + UnicharUtilsStatic.o + MacOS + + + AbSyncSvcDebug.shlb + Name + UnicharUtilsStaticDebug.o + MacOS + + src AbSyncSvcDebug.shlb diff --git a/mozilla/mailnews/absync/src/Makefile.in b/mozilla/mailnews/absync/src/Makefile.in index 0c103a12518..4d4ab44b16b 100644 --- a/mozilla/mailnews/absync/src/Makefile.in +++ b/mozilla/mailnews/absync/src/Makefile.in @@ -48,6 +48,7 @@ REQUIRES = xpcom \ mork \ mimetype \ windowwatcher \ + unicharutil \ $(NULL) CPPSRCS = \ diff --git a/mozilla/mailnews/absync/src/makefile.win b/mozilla/mailnews/absync/src/makefile.win index 1f9b51167e2..f7ca23419cc 100644 --- a/mozilla/mailnews/absync/src/makefile.win +++ b/mozilla/mailnews/absync/src/makefile.win @@ -39,6 +39,7 @@ REQUIRES = xpcom \ mork \ mimetype \ windowwatcher \ + unicharutil \ $(NULL) include <$(DEPTH)\config\config.mak> diff --git a/mozilla/mailnews/absync/src/nsAbSync.cpp b/mozilla/mailnews/absync/src/nsAbSync.cpp index 2157a054c60..5eaea9b9e00 100644 --- a/mozilla/mailnews/absync/src/nsAbSync.cpp +++ b/mozilla/mailnews/absync/src/nsAbSync.cpp @@ -54,6 +54,7 @@ #include "plstr.h" #include "nsString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsTextFormatter.h" #include "nsIStringBundle.h" #include "nsMsgI18N.h" @@ -109,7 +110,7 @@ nsAbSync::InternalInit() mLastChangeNum = 1; - mLocale.AssignWithConversion(""); + mLocale.Assign(NS_LITERAL_STRING("")); mDeletedRecordTags = nsnull; mDeletedRecordValues = nsnull; mNewRecordTags = nsnull; @@ -2296,11 +2297,11 @@ nsAbSync::DetermineTagType(nsStringArray *aArray) if ( (!val) || (val->IsEmpty()) ) continue; - if (val->CompareWithConversion("record_id") == 0) + if (val->Equals(NS_LITERAL_STRING("record_id"))) gotRecordID = PR_TRUE; - else if (val->CompareWithConversion("list_id") == 0) + else if (val->Equals(NS_LITERAL_STRING("list_id"))) gotListID = PR_TRUE; - else if (val->CompareWithConversion("group_id") == 0) + else if (val->Equals(NS_LITERAL_STRING("group_id"))) gotGroupID = PR_TRUE; } @@ -2520,7 +2521,7 @@ nsAbSync::HuntForExistingABEntryInServerRecord(PRInt32 aPersonIndex, { // See if this is the record_id... nsString *tagVal = mNewRecordTags->StringAt(j); - if (tagVal->CompareWithConversion("record_id") == 0) + if (tagVal->Equals(NS_LITERAL_STRING("record_id"))) { PRInt32 errorCode; *aServerID = val->ToInteger(&errorCode); @@ -2652,7 +2653,7 @@ nsAbSync::AddNewUsers() { // See if this is the record_id, keep it around for later... nsString *tagVal = mNewRecordTags->StringAt(j); - if (tagVal->CompareWithConversion("record_id") == 0) + if (tagVal->Equals(NS_LITERAL_STRING("record_id"))) { PRInt32 errorCode; serverID = val->ToInteger(&errorCode); @@ -2815,30 +2816,30 @@ nsAbSync::GetTypeOfPhoneNumber(nsString tagName) continue; phoneType.Cut(0, loc+1); - if (!phoneType.CompareWithConversion(ABSYNC_HOME_PHONE_TYPE, PR_TRUE, nsCRT::strlen(ABSYNC_HOME_PHONE_TYPE))) + if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_HOME_PHONE_TYPE), nsCaseInsensitiveStringComparator())) return ABSYNC_HOME_PHONE_ID; - else if (!phoneType.CompareWithConversion(ABSYNC_WORK_PHONE_TYPE, PR_TRUE, nsCRT::strlen(ABSYNC_WORK_PHONE_TYPE))) + else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_WORK_PHONE_TYPE), nsCaseInsensitiveStringComparator())) return ABSYNC_WORK_PHONE_ID; - else if (!phoneType.CompareWithConversion(ABSYNC_FAX_PHONE_TYPE, PR_TRUE, nsCRT::strlen(ABSYNC_FAX_PHONE_TYPE))) + else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_FAX_PHONE_TYPE), nsCaseInsensitiveStringComparator())) return ABSYNC_FAX_PHONE_ID; - else if (!phoneType.CompareWithConversion(ABSYNC_PAGER_PHONE_TYPE, PR_TRUE, nsCRT::strlen(ABSYNC_PAGER_PHONE_TYPE))) + else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_PAGER_PHONE_TYPE), nsCaseInsensitiveStringComparator())) return ABSYNC_PAGER_PHONE_ID; - else if (!phoneType.CompareWithConversion(ABSYNC_CELL_PHONE_TYPE, PR_TRUE, nsCRT::strlen(ABSYNC_CELL_PHONE_TYPE))) + else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_CELL_PHONE_TYPE), nsCaseInsensitiveStringComparator())) return ABSYNC_CELL_PHONE_ID; } } // If we get here...drop back to the defaults...why, oh why is it this way? // - if (!tagName.CompareWithConversion("phone1")) + if (tagName.Equals(NS_LITERAL_STRING("phone1"))) return ABSYNC_HOME_PHONE_ID; - else if (!tagName.CompareWithConversion("phone2")) + else if (tagName.Equals(NS_LITERAL_STRING("phone2"))) return ABSYNC_WORK_PHONE_ID; - else if (!tagName.CompareWithConversion("phone3")) + else if (tagName.Equals(NS_LITERAL_STRING("phone3"))) return ABSYNC_FAX_PHONE_ID; - else if (!tagName.CompareWithConversion("phone4")) + else if (tagName.Equals(NS_LITERAL_STRING("phone4"))) return ABSYNC_PAGER_PHONE_ID; - else if (!tagName.CompareWithConversion("phone5")) + else if (tagName.Equals(NS_LITERAL_STRING("phone5"))) return ABSYNC_CELL_PHONE_ID; return 0; @@ -2909,7 +2910,7 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag PR_FREEIF(tValue); } - if (!aTagName->CompareWithConversion("phone", PR_TRUE, 5)) + if (!Compare(Substring(*aTagName, 0, 5), NS_LITERAL_STRING("phone"), nsCaseInsensitiveStringComparator())) { nsString tempVal; tempVal.Append(*aTagName + @@ -2993,9 +2994,9 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag else if (!aTagName->CompareWithConversion(kServerPlainTextColumn)) { // This is plain text pref...have to add a little logic. - if (!aTagValue->CompareWithConversion("1")) + if (aTagValue->Equals(NS_LITERAL_STRING("1"))) aCard->SetPreferMailFormat(nsIAbPreferMailFormat::html); - else if (!aTagValue->CompareWithConversion("0")) + else if (aTagValue->Equals(NS_LITERAL_STRING("0"))) aCard->SetPreferMailFormat(nsIAbPreferMailFormat::unknown); } diff --git a/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp b/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp index 8633e1699a0..b902362e794 100644 --- a/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp @@ -48,6 +48,7 @@ #include "rdf.h" #include "nsCOMPtr.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsIPref.h" #include "nsIAbDirectory.h" @@ -246,16 +247,16 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v nsString formatStr; switch (format) { case nsIAbPreferMailFormat::unknown : - formatStr.AssignWithConversion("unknown"); + formatStr.Assign(NS_LITERAL_STRING("unknown")); break; case nsIAbPreferMailFormat::plaintext : - formatStr.AssignWithConversion("plaintext"); + formatStr.Assign(NS_LITERAL_STRING("plaintext")); break; case nsIAbPreferMailFormat::html : - formatStr.AssignWithConversion("html"); + formatStr.Assign(NS_LITERAL_STRING("html")); break; default : - formatStr.AssignWithConversion("unknown"); + formatStr.Assign(NS_LITERAL_STRING("unknown")); break; } *value = ToNewUnicode(formatStr); @@ -347,11 +348,11 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich { PRUint32 format = nsIAbPreferMailFormat::unknown; nsString formatStr(value); - if (formatStr.CompareWithConversion("unknown", PR_TRUE)) + if (Compare(formatStr, NS_LITERAL_STRING("unknown"), nsCaseInsensitiveStringComparator())) format = nsIAbPreferMailFormat::unknown; - if (formatStr.CompareWithConversion("plaintext", PR_TRUE)) + if (Compare(formatStr, NS_LITERAL_STRING("plaintext"), nsCaseInsensitiveStringComparator())) format = nsIAbPreferMailFormat::plaintext; - if (formatStr.CompareWithConversion("html", PR_TRUE)) + if (Compare(formatStr, NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator())) format = nsIAbPreferMailFormat::html; SetPreferMailFormat(format); } @@ -706,13 +707,13 @@ nsAbCardProperty::GetName(PRUnichar * *aName) if (lastNameFirst == 1) { name = lastName; - name.AppendWithConversion(", "); + name.Append(NS_LITERAL_STRING(", ")); name += firstName; } else { name = firstName; - name.AppendWithConversion(" "); + name.Append(NS_LITERAL_STRING(" ")); name += lastName; } } diff --git a/mozilla/mailnews/addrbook/src/nsAbDirectoryQuery.cpp b/mozilla/mailnews/addrbook/src/nsAbDirectoryQuery.cpp index 069170b85b3..eb28c222e99 100644 --- a/mozilla/mailnews/addrbook/src/nsAbDirectoryQuery.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbDirectoryQuery.cpp @@ -754,7 +754,7 @@ nsresult nsAbDirectoryQuery::queryMatch (nsIAbCard* card, n.Assign (properties[i]); nsAbDirectoryQueryPropertyValue* _propertyValue = 0; - if (n.EqualsWithConversion ("card:nsIAbCard")) + if (n.Equals(NS_LITERAL_CSTRING("card:nsIAbCard"))) { nsCOMPtr supports(do_QueryInterface(card, &rv)); NS_ENSURE_SUCCESS(rv, rv); @@ -763,7 +763,7 @@ nsresult nsAbDirectoryQuery::queryMatch (nsIAbCard* card, if (_propertyValue == NULL) return NS_ERROR_OUT_OF_MEMORY; } - else if (n.EqualsWithConversion ("card:URI")) + else if (n.Equals(NS_LITERAL_CSTRING("card:URI"))) { nsCOMPtr rdfResource(do_QueryInterface(card, &rv)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp b/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp index 41a74ad05bc..ea8864942e7 100644 --- a/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp @@ -316,7 +316,7 @@ nsresult nsAbQueryLDAPMessageListener::OnLDAPMessageSearchEntry (nsILDAPMessage n.Assign (properties[i]); nsAbDirectoryQueryPropertyValue* _propertyValue = 0; - if (n.EqualsWithConversion ("card:URI")) + if (n.Equals(NS_LITERAL_CSTRING("card:URI"))) { // Meta property // @@ -334,7 +334,7 @@ nsresult nsAbQueryLDAPMessageListener::OnLDAPMessageSearchEntry (nsILDAPMessage if (_propertyValue == NULL) return NS_ERROR_OUT_OF_MEMORY; } - else if (n.EqualsWithConversion ("card:nsIAbCard")) + else if (n.Equals(NS_LITERAL_CSTRING("card:nsIAbCard"))) { // Meta property // @@ -672,13 +672,13 @@ nsresult nsAbLDAPDirectoryQuery::getLdapReturnAttributes ( { n.Assign (properties[i]); - if (n.EqualsWithConversion ("card:URI")) + if (n.Equals(NS_LITERAL_CSTRING("card:URI"))) { // Meta property // continue; } - else if (n.EqualsWithConversion ("card:nsIAbCard")) + else if (n.Equals(NS_LITERAL_CSTRING("card:nsIAbCard"))) { // Meta property // require all attributes diff --git a/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp b/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp index f2d1b2cda92..c52d51f548a 100644 --- a/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp @@ -72,7 +72,7 @@ static void splitString(nsString& aSource, nsString& aTarget) const PRUnichar *source = aSource.get() + offset + 1 ; while (*source) { - if (*source == '\n' || *source == '\r') { aTarget.AppendWithConversion(' ') ; } + if (*source == '\n' || *source == '\r') { aTarget.Append(PRUnichar(' ')) ; } else { aTarget.Append(*source) ; } ++ source ; } diff --git a/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp b/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp index e63ea42dcb9..1176c90a8b6 100644 --- a/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp @@ -131,8 +131,8 @@ NS_IMETHODIMP nsAbOutlookDirectory::Init(const char *aUri) PRINTF(("Cannot get name.\n")) ; return NS_ERROR_FAILURE ; } - if (mAbWinType == nsAbWinType_Outlook) { prefix.AssignWithConversion("OP ") ; } - else { prefix.AssignWithConversion("OE ") ; } + if (mAbWinType == nsAbWinType_Outlook) { prefix.Assign(NS_LITERAL_STRING("OP ")) ; } + else { prefix.Assign(NS_LITERAL_STRING("OE ")) ; } prefix.Append(unichars) ; SetDirName(prefix.get()) ; if (objectType == MAPI_DISTLIST) { @@ -862,37 +862,34 @@ nsresult FillPropertyValues(nsIAbCard *aCard, nsIAbDirectoryQueryArguments *aArg retCode = aArguments->GetReturnProperties(properties.GetSizeAddr(), properties.GetArrayAddr()) ; NS_ENSURE_SUCCESS(retCode, retCode) ; PRUint32 i = 0 ; - nsCAutoString cPropName ; nsAbDirectoryQueryPropertyValue *newValue = nsnull ; nsCOMPtr propertyValue ; for (i = 0 ; i < properties.GetSize() ; ++ i) { + const char* cPropName = properties[i] ; newValue = nsnull ; - cPropName.Assign(properties [i]) ; - if (cPropName.EqualsWithConversion ("card:nsIAbCard")) { + if (!nsCRT::strcmp(cPropName, "card:nsIAbCard")) { nsCOMPtr bogusInterface (do_QueryInterface(aCard, &retCode)) ; NS_ENSURE_SUCCESS(retCode, retCode) ; - newValue = new nsAbDirectoryQueryPropertyValue (cPropName.get(), bogusInterface) ; + newValue = new nsAbDirectoryQueryPropertyValue (cPropName, bogusInterface) ; } - else if (cPropName.EqualsWithConversion ("card:URI")) { + else if (!nsCRT::strcmp(cPropName, "card:URI")) { nsCOMPtr rdfResource (do_QueryInterface(aCard, &retCode)) ; nsXPIDLCString uri; - nsAutoString convertedString ; NS_ENSURE_SUCCESS(retCode, retCode) ; retCode = rdfResource->GetValue(getter_Copies(uri)) ; NS_ENSURE_SUCCESS(retCode, retCode) ; - convertedString.AssignWithConversion(uri.get()) ; - newValue = new nsAbDirectoryQueryPropertyValue(cPropName.get(), convertedString.get()) ; + newValue = new nsAbDirectoryQueryPropertyValue(cPropName, NS_ConvertASCIItoUCS2(uri).get()) ; } else { nsXPIDLString value ; - retCode = aCard->GetCardValue(cPropName.get(), getter_Copies(value)) ; + retCode = aCard->GetCardValue(cPropName, getter_Copies(value)) ; NS_ENSURE_SUCCESS(retCode, retCode) ; - if (value.get() && nsCRT::strlen(value.get()) != 0) { - newValue = new nsAbDirectoryQueryPropertyValue(cPropName.get(), value.get()) ; + if (!value.IsEmpty()) { + newValue = new nsAbDirectoryQueryPropertyValue(cPropName, value.get()) ; } } if (newValue) { diff --git a/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp b/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp index bdf6b8f4b5c..5d8fd49f68f 100644 --- a/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp @@ -669,7 +669,7 @@ BOOL nsAbWinHelper::CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEnt nsAutoString tempName ; displayName.ulPropTag = PR_DISPLAY_NAME_W ; - tempName.AssignWithConversion("__MailUser__") ; + tempName.Assign(NS_LITERAL_STRING("__MailUser__")) ; tempName.AppendInt(mEntryCounter ++) ; displayName.Value.lpszW = NS_CONST_CAST(WORD *, tempName.get()) ; mLastError = newEntry->SetProps(1, &displayName, &problems) ; @@ -732,7 +732,7 @@ BOOL nsAbWinHelper::CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNew nsAutoString tempName ; displayName.ulPropTag = PR_DISPLAY_NAME_W ; - tempName.AssignWithConversion("__MailList__") ; + tempName.Assign(NS_LITERAL_STRING("__MailList__")) ; tempName.AppendInt(mEntryCounter ++) ; displayName.Value.lpszW = NS_CONST_CAST(WORD *, tempName.get()) ; mLastError = newEntry->SetProps(1, &displayName, &problems) ; diff --git a/mozilla/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp b/mozilla/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp index d0a1fab3ed9..6f40b6b3df0 100644 --- a/mozilla/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp +++ b/mozilla/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp @@ -271,18 +271,18 @@ nsAddbookProtocolHandler::AddIndividualUserAttribPair(nsString &aString, const c if (NS_SUCCEEDED(aCard->GetCardValue(aColumn, &aName)) && (aName) && (*aName)) { - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); // RICHIE - Should really convert this to some string bundled thing? aString.AppendWithConversion(aColumn); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); aString.Append(aName); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); } return NS_OK; @@ -452,23 +452,23 @@ nsAddbookProtocolHandler::BuildSingleHTML(nsIAddrDatabase *aDatabase, nsIAbDirec return NS_ERROR_FAILURE; // Ok, build a little HTML for output... - workBuffer.AppendWithConversion(""); - workBuffer.AppendWithConversion("
"); - workBuffer.AppendWithConversion(""); + workBuffer.Append(NS_LITERAL_STRING("")); + workBuffer.Append(NS_LITERAL_STRING("
")); + workBuffer.Append(NS_LITERAL_STRING("
")); if (NS_SUCCEEDED(workCard->GetName(&aName)) && (aName)) { - workBuffer.AppendWithConversion(""); + workBuffer.Append(NS_LITERAL_STRING("")); } for (PRInt32 i=0; i"); - workBuffer.AppendWithConversion("
"); - workBuffer.AppendWithConversion(""); + workBuffer.Append(NS_LITERAL_STRING("
"); + workBuffer.Append(NS_LITERAL_STRING("")); workBuffer.Append(aName); - workBuffer.AppendWithConversion("
")); + workBuffer.Append(NS_LITERAL_STRING("
")); + workBuffer.Append(NS_LITERAL_STRING("")); return rv; } @@ -514,9 +514,9 @@ nsAddbookProtocolHandler::BuildAllHTML(nsIAddrDatabase *aDatabase, nsIAbDirector // Now, we need to generate some fun output! // // Ok, build a little HTML for output... - workBuffer.AppendWithConversion(""); - workBuffer.AppendWithConversion("
"); - workBuffer.AppendWithConversion(""); + workBuffer.Append(NS_LITERAL_STRING("")); + workBuffer.Append(NS_LITERAL_STRING("
")); + workBuffer.Append(NS_LITERAL_STRING("
")); GenerateColumnHeadings(workBuffer); @@ -541,9 +541,9 @@ nsAddbookProtocolHandler::BuildAllHTML(nsIAddrDatabase *aDatabase, nsIAbDirector // Finish up and get out! // - workBuffer.AppendWithConversion("
"); - workBuffer.AppendWithConversion("
"); - workBuffer.AppendWithConversion(""); + workBuffer.Append(NS_LITERAL_STRING("")); + workBuffer.Append(NS_LITERAL_STRING("
")); + workBuffer.Append(NS_LITERAL_STRING("")); return rv; } @@ -563,14 +563,14 @@ TackOnColumn(nsIAbCard *aCard, const char *aColumn, nsString &aString) { PRUnichar *aName = nsnull; - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); if (NS_SUCCEEDED(aCard->GetCardValue(aColumn, &aName)) && (aName) && (*aName)) { aString.Append(aName); } - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); return NS_OK; } @@ -589,22 +589,22 @@ nsAddbookProtocolHandler::CheckColumnValidity(nsIAbCard *aCard) NS_IMETHODIMP nsAddbookProtocolHandler::GenerateColumnHeadings(nsString &aString) { - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); for (PRInt32 i=0; i"); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); + aString.Append(NS_LITERAL_STRING("")); // RICHIE - Should really convert this to some string bundled thing? aString.AppendWithConversion(mReportColumns[i].abField); - aString.AppendWithConversion(""); - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); + aString.Append(NS_LITERAL_STRING("")); } } - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); return NS_OK; } @@ -612,7 +612,7 @@ NS_IMETHODIMP nsAddbookProtocolHandler::GenerateRowForCard(nsString &aString, nsIAbCard *aCard) { - aString.AppendWithConversion(""); + aString.Append(NS_LITERAL_STRING("")); for (PRInt32 i=0; i"); + aString.Append(NS_LITERAL_STRING("")); return NS_OK; } diff --git a/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp b/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp index 1401a2cc30b..32505808fa2 100644 --- a/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp +++ b/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp @@ -636,9 +636,9 @@ nsAbDirectoryDataSource::createDirectoryIsMailListNode(nsIAbDirectory* directory nsresult nsAbDirectoryDataSource::CreateLiterals(nsIRDFService *rdf) { - nsAutoString str; str.AssignWithConversion("true"); + nsAutoString str(NS_LITERAL_STRING("true")); createNode(str, getter_AddRefs(kTrueLiteral)); - str.AssignWithConversion("false"); + str.Assign(NS_LITERAL_STRING("false")); createNode(str, getter_AddRefs(kFalseLiteral)); return NS_OK; } diff --git a/mozilla/mailnews/base/search/src/nsMsgImapSearch.cpp b/mozilla/mailnews/base/search/src/nsMsgImapSearch.cpp index ee054014d63..e3ded1ca7a1 100644 --- a/mozilla/mailnews/base/search/src/nsMsgImapSearch.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgImapSearch.cpp @@ -152,7 +152,7 @@ nsresult nsMsgSearchOnlineMail::Encode (nsCString& pEncoding, else asciiOnly = PR_FALSE; - nsAutoString usAsciiCharSet; usAsciiCharSet.AssignWithConversion("us-ascii"); + nsAutoString usAsciiCharSet(NS_LITERAL_STRING("us-ascii")); // Get the optional CHARSET parameter, in case we need it. char *csname = GetImapCharsetParam(asciiOnly ? usAsciiCharSet.get() : destCharset); diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp index 3cc69988ebe..f842f30a713 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp @@ -369,7 +369,7 @@ nsMsgSearchAdapter::GetSearchCharsets(nsString &srcCharset, nsString& dstCharset // If the dest csid is ISO Latin 1 or MacRoman, attempt to convert the // source text to US-ASCII. (Not for now.) // if ((dst_csid == CS_LATIN1) || (dst_csid == CS_MAC_ROMAN)) - dstCharset.AssignWithConversion("us-ascii"); + dstCharset.Assign(NS_LITERAL_STRING("us-ascii")); } } diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchValue.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchValue.cpp index 940655b1dc2..4c5bcee7c5d 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchValue.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchValue.cpp @@ -218,7 +218,7 @@ nsMsgSearchValueImpl::ToString(PRUnichar **aResult) NS_ENSURE_ARG_POINTER(aResult); nsAutoString resultStr; - resultStr.AssignWithConversion("[nsIMsgSearchValue: "); + resultStr.Assign(NS_LITERAL_STRING("[nsIMsgSearchValue: ")); if (IS_STRING_ATTRIBUTE(mValue.attribute)) { resultStr.Append(NS_ConvertUTF8toUCS2(mValue.string)); return NS_OK; @@ -234,14 +234,14 @@ nsMsgSearchValueImpl::ToString(PRUnichar **aResult) case nsMsgSearchAttrib::Size: case nsMsgSearchAttrib::AgeInDays: case nsMsgSearchAttrib::FolderInfo: - resultStr.AppendWithConversion("type="); + resultStr.Append(NS_LITERAL_STRING("type=")); resultStr.AppendInt(mValue.attribute); break; default: NS_ASSERTION(0, "Unknown search value type"); } - resultStr.AppendWithConversion("]"); + resultStr.Append(NS_LITERAL_STRING("]")); *aResult = ToNewUnicode(resultStr); return NS_OK; diff --git a/mozilla/mailnews/base/src/nsMsgAccount.cpp b/mozilla/mailnews/base/src/nsMsgAccount.cpp index 37820a7b13b..b26f45d2dba 100644 --- a/mozilla/mailnews/base/src/nsMsgAccount.cpp +++ b/mozilla/mailnews/base/src/nsMsgAccount.cpp @@ -361,9 +361,9 @@ nsMsgAccount::SetKey(const char *accountKey) NS_IMETHODIMP nsMsgAccount::ToString(PRUnichar **aResult) { - nsAutoString val; val.AssignWithConversion("[nsIMsgAccount: "); + nsAutoString val(NS_LITERAL_STRING("[nsIMsgAccount: ")); val.AppendWithConversion(m_accountKey); - val.AppendWithConversion("]"); + val.Append(NS_LITERAL_STRING("]")); *aResult = ToNewUnicode(val); return NS_OK; } diff --git a/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp b/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp index a7fe0b02558..4a110259b81 100644 --- a/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp +++ b/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp @@ -297,10 +297,10 @@ nsresult nsMsgNotificationManager::AddNewMailNotification(nsIMsgFolder *folder) nsCOMPtr type, source, description, timeStamp, url; nsString typeString, sourceString, descriptionString, timeStampString, urlString; - sourceString.AssignWithConversion("Messenger"); - descriptionString.AssignWithConversion("You have mail"); - timeStampString.AssignWithConversion("3:33pm"); - urlString.AssignWithConversion("test"); + sourceString.Assign(NS_LITERAL_STRING("Messenger")); + descriptionString.Assign(NS_LITERAL_STRING("You have mail")); + timeStampString.Assign(NS_LITERAL_STRING("3:33pm")); + urlString.Assign(NS_LITERAL_STRING("test")); nsCOMPtr ds = do_QueryInterface(mInMemoryDataSourceISupports); @@ -332,7 +332,7 @@ nsresult nsMsgNotificationManager::AddNewMailNotification(nsIMsgFolder *folder) rv = folder->GetPrettyName(getter_Copies(folderName)); if (NS_SUCCEEDED(rv) && folderName) { - descriptionString.AppendWithConversion(" in "); + descriptionString.Append(NS_LITERAL_STRING(" in ")); descriptionString.Append(folderName); } diff --git a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp index fdfcccea2e8..08e52df9900 100644 --- a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp +++ b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp @@ -334,7 +334,7 @@ nsMsgPrintEngine::InitializeDisplayCharset() // libmime always converts to UTF-8 (both HTML and XML) if (mDocShell) { - nsAutoString aForceCharacterSet; aForceCharacterSet.AssignWithConversion("UTF-8"); + nsAutoString aForceCharacterSet(NS_LITERAL_STRING("UTF-8")); nsCOMPtr cv; mDocShell->GetContentViewer(getter_AddRefs(cv)); if (cv) diff --git a/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp b/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp index 1ffbc869632..689f0207537 100644 --- a/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp +++ b/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp @@ -89,7 +89,7 @@ void nsLocalFolderSummarySpec:: CreateSummaryFileName() // Append .msf (msg summary file) this is what windows will want. // Mac and Unix can decide for themselves. - fullLeafName.AppendWithConversion(".msf"); // message summary file + fullLeafName.Append(NS_LITERAL_STRING(".msf")); // message summary file char *cLeafName = ToNewCString(fullLeafName); SetLeafName(cLeafName); nsMemory::Free(cLeafName); diff --git a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp index 479d4655a6e..61a6cda3a15 100644 --- a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp @@ -445,7 +445,7 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo(PRBool force) PRBool defaultUsed; folderInfo->GetCharacterSet(&mCharset, &defaultUsed); if (defaultUsed) - mCharset.AssignWithConversion(""); + mCharset.Assign(NS_LITERAL_STRING("")); folderInfo->GetCharacterSetOverride(&mCharsetOverride); if (db) { diff --git a/mozilla/mailnews/base/util/nsMsgI18N.cpp b/mozilla/mailnews/base/util/nsMsgI18N.cpp index b5e63e7f829..49b9f9da44c 100644 --- a/mozilla/mailnews/base/util/nsMsgI18N.cpp +++ b/mozilla/mailnews/base/util/nsMsgI18N.cpp @@ -98,7 +98,7 @@ nsresult nsMsgI18NConvertFromUnicode(const nsCString& aCharset, Recycle(s); return NS_OK; } - nsAutoString convCharset; convCharset.AssignWithConversion("ISO-8859-1"); + nsAutoString convCharset(NS_LITERAL_STRING("ISO-8859-1")); nsresult res; // Resolve charset alias @@ -197,7 +197,7 @@ nsresult nsMsgI18NConvertToUnicode(const nsCString& aCharset, PRUnichar localbuf[512]; PRInt32 consumedLen = 0; - outString.AssignWithConversion(""); + outString.Assign(NS_LITERAL_STRING("")); // convert while (consumedLen < originalLength) { @@ -437,7 +437,7 @@ PRBool nsMsgI18Nmultibyte_charset(const char *charset) if (NS_SUCCEEDED(res)) { res = ccm2->GetCharsetData2(charsetAtom, NS_LITERAL_STRING(".isMultibyte").get(), &charsetData); if (NS_SUCCEEDED(res)) { - result = charsetData.EqualsWithConversion("true", PR_TRUE); + result = !Compare(charsetData, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator()); } } } diff --git a/mozilla/mailnews/base/util/nsMsgIdentity.cpp b/mozilla/mailnews/base/util/nsMsgIdentity.cpp index 338ea89ea79..3ef69d9f413 100644 --- a/mozilla/mailnews/base/util/nsMsgIdentity.cpp +++ b/mozilla/mailnews/base/util/nsMsgIdentity.cpp @@ -340,9 +340,9 @@ nsMsgIdentity::GetIdentityName(PRUnichar **idName) { nsAutoString str; str += (const PRUnichar*)fullName; - str.AppendWithConversion(" <"); + str.Append(NS_LITERAL_STRING(" <")); str.AppendWithConversion((const char*)email); - str.AppendWithConversion(">"); + str.Append(NS_LITERAL_STRING(">")); *idName = ToNewUnicode(str); rv = NS_OK; } @@ -357,9 +357,9 @@ nsresult nsMsgIdentity::SetIdentityName(const PRUnichar *idName) { NS_IMETHODIMP nsMsgIdentity::ToString(PRUnichar **aResult) { - nsString idname; idname.AssignWithConversion("[nsIMsgIdentity: "); + nsString idname(NS_LITERAL_STRING("[nsIMsgIdentity: ")); idname.AppendWithConversion(m_identityKey); - idname.AppendWithConversion("]"); + idname.Append(NS_LITERAL_STRING("]")); *aResult = ToNewUnicode(idname); return NS_OK; diff --git a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp index 7799be76660..b47bd8c570e 100644 --- a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp +++ b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp @@ -628,7 +628,7 @@ nsMsgIncomingServer::GetConstructedPrettyName(PRUnichar **retval) if ((const char*)username && PL_strcmp((const char*)username, "")!=0) { prettyName.AssignWithConversion(username); - prettyName.AppendWithConversion(" on "); + prettyName.Append(NS_LITERAL_STRING(" on ")); } nsXPIDLCString hostname; diff --git a/mozilla/mailnews/base/util/nsMsgUtf7Utils.cpp b/mozilla/mailnews/base/util/nsMsgUtf7Utils.cpp index fff2512911f..323073d581f 100644 --- a/mozilla/mailnews/base/util/nsMsgUtf7Utils.cpp +++ b/mozilla/mailnews/base/util/nsMsgUtf7Utils.cpp @@ -60,7 +60,7 @@ CreateUtf7ConvertedString(const char * aSourceString, if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); + nsString aCharset(NS_LITERAL_STRING("x-imap4-modified-utf7")); PRUnichar *unichars = nsnull; PRInt32 unicharLength; @@ -98,7 +98,7 @@ CreateUtf7ConvertedString(const char * aSourceString, // convert from 8 bit ascii string to modified utf7 nsString unicodeStr; unicodeStr.AssignWithConversion(aSourceString); nsIUnicodeEncoder* encoder = nsnull; - aCharset.AssignWithConversion("x-imap4-modified-utf7"); + aCharset.Assign(NS_LITERAL_STRING("x-imap4-modified-utf7")); res = ccm->GetUnicodeEncoder(&aCharset, &encoder); if(NS_SUCCEEDED(res) && (nsnull != encoder)) { @@ -141,13 +141,13 @@ CreateUtf7ConvertedStringFromUnicode(const PRUnichar * aSourceString) if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); + nsString aCharset(NS_LITERAL_STRING("x-imap4-modified-utf7")); PRInt32 unicharLength; // convert from 8 bit ascii string to modified utf7 nsString unicodeStr(aSourceString); nsIUnicodeEncoder* encoder = nsnull; - aCharset.AssignWithConversion("x-imap4-modified-utf7"); + aCharset.Assign(NS_LITERAL_STRING("x-imap4-modified-utf7")); res = ccm->GetUnicodeEncoder(&aCharset, &encoder); if(NS_SUCCEEDED(res) && (nsnull != encoder)) { @@ -190,7 +190,7 @@ nsresult CreateUnicodeStringFromUtf7(const char *aSourceString, PRUnichar **aUni if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); + nsString aCharset(NS_LITERAL_STRING("x-imap4-modified-utf7")); PRUnichar *unichars = nsnull; PRInt32 unicharLength; diff --git a/mozilla/mailnews/base/util/nsMsgUtils.cpp b/mozilla/mailnews/base/util/nsMsgUtils.cpp index 1af0b8eef1f..014962ad0f2 100644 --- a/mozilla/mailnews/base/util/nsMsgUtils.cpp +++ b/mozilla/mailnews/base/util/nsMsgUtils.cpp @@ -193,22 +193,22 @@ nsresult NS_MsgGetUntranslatedPriorityName (nsMsgPriorityValue p, nsString *outN { case nsMsgPriority::notSet: case nsMsgPriority::none: - outName->AssignWithConversion("None"); + outName->Assign(NS_LITERAL_STRING("None")); break; case nsMsgPriority::lowest: - outName->AssignWithConversion("Lowest"); + outName->Assign(NS_LITERAL_STRING("Lowest")); break; case nsMsgPriority::low: - outName->AssignWithConversion("Low"); + outName->Assign(NS_LITERAL_STRING("Low")); break; case nsMsgPriority::normal: - outName->AssignWithConversion("Normal"); + outName->Assign(NS_LITERAL_STRING("Normal")); break; case nsMsgPriority::high: - outName->AssignWithConversion("High"); + outName->Assign(NS_LITERAL_STRING("High")); break; case nsMsgPriority::highest: - outName->AssignWithConversion("Highest"); + outName->Assign(NS_LITERAL_STRING("Highest")); break; default: NS_ASSERTION(PR_FALSE, "invalid priority value"); diff --git a/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp b/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp index b78907b0e9a..7e699d726fa 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp @@ -1681,7 +1681,7 @@ nsMsgNewURL(nsIURI** aInstancePtrResult, const char * aSpec) { if (PL_strstr(aSpec, "://") == nsnull) { - nsAutoString newSpec; newSpec.AssignWithConversion("http://"); + nsAutoString newSpec(NS_LITERAL_STRING("http://")); newSpec.AppendWithConversion(aSpec); nsCAutoString newspecC; newspecC.AssignWithConversion(newSpec); diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index 57d1c88f9f9..a01d5699966 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -2971,11 +2971,11 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, nsString *aMsgBody) sigOutput.AppendWithConversion(htmlsigopen); sigOutput.AppendWithConversion(dashes); sigOutput.AppendWithConversion(htmlBreak); - sigOutput.AppendWithConversion(""); + sigOutput.Append(NS_LITERAL_STRING("\" border=0>")); sigOutput.AppendWithConversion(htmlsigclose); } } @@ -3799,7 +3799,7 @@ nsresult nsMsgCompose::TagConvertible(nsIDOMNode *node, PRInt32 *_retval) if (NS_SUCCEEDED(pItem->GetNodeValue(typeValue))) { typeValue.StripChars("\""); - if (typeValue.EqualsWithConversion("cite", PR_TRUE)) + if (!Compare(typeValue, NS_LITERAL_STRING("cite"), nsCaseInsensitiveStringComparator())) *_retval = nsIMsgCompConvertible::Plain; } } diff --git a/mozilla/mailnews/compose/src/nsMsgPrompts.cpp b/mozilla/mailnews/compose/src/nsMsgPrompts.cpp index 06fa104246e..3a4b369cd06 100644 --- a/mozilla/mailnews/compose/src/nsMsgPrompts.cpp +++ b/mozilla/mailnews/compose/src/nsMsgPrompts.cpp @@ -61,12 +61,12 @@ nsMsgBuildErrorMessageByID(PRInt32 msgID, nsString& retval, nsString* param0, ns nsString target; if (param0) { - target.AssignWithConversion("%P0%"); + target.Assign(NS_LITERAL_STRING("%P0%")); retval.ReplaceSubstring(target, *param0); } if (param1) { - target.AssignWithConversion("%P1%"); + target.Assign(NS_LITERAL_STRING("%P1%")); retval.ReplaceSubstring(target, *param1); } } diff --git a/mozilla/mailnews/compose/src/nsMsgSend.cpp b/mozilla/mailnews/compose/src/nsMsgSend.cpp index eb28806bc8c..a5aa6b5f412 100644 --- a/mozilla/mailnews/compose/src/nsMsgSend.cpp +++ b/mozilla/mailnews/compose/src/nsMsgSend.cpp @@ -63,6 +63,7 @@ #include "nsMsgCopy.h" #include "nsXPIDLString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsMsgPrompts.h" #include "nsIDOMHTMLImageElement.h" #include "nsIDOMHTMLLinkElement.h" @@ -1682,7 +1683,7 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN nsAutoString attributeValue; if (NS_SUCCEEDED(domElement->GetAttribute(NS_LITERAL_STRING("moz-do-not-send"), attributeValue))) { - if (attributeValue.EqualsWithConversion("true", PR_TRUE)) + if (!Compare(attributeValue, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator())) continue; } } @@ -1894,7 +1895,7 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN nsString domURL; if (m_attachments[i].m_content_id) { - nsString newSpec; newSpec.AssignWithConversion("cid:"); + nsString newSpec(NS_LITERAL_STRING("cid:")); // STRING USE WARNING: this is probably not needed. Strings are created empty by default. domURL.SetLength(0); diff --git a/mozilla/mailnews/compose/src/nsMsgSendReport.cpp b/mozilla/mailnews/compose/src/nsMsgSendReport.cpp index c31879890d0..3da4088038d 100644 --- a/mozilla/mailnews/compose/src/nsMsgSendReport.cpp +++ b/mozilla/mailnews/compose/src/nsMsgSendReport.cpp @@ -102,7 +102,7 @@ NS_IMETHODIMP nsMsgProcessReport::Reset() { mProceeded = PR_FALSE; mError = NS_OK; - mMessage.AssignWithConversion(""); + mMessage.Assign(NS_LITERAL_STRING("")); return NS_OK; } diff --git a/mozilla/mailnews/compose/src/nsSmtpDataSource.cpp b/mozilla/mailnews/compose/src/nsSmtpDataSource.cpp index ed3ddf7554f..8f12faf9339 100644 --- a/mozilla/mailnews/compose/src/nsSmtpDataSource.cpp +++ b/mozilla/mailnews/compose/src/nsSmtpDataSource.cpp @@ -95,7 +95,7 @@ nsSmtpDataSource::initGlobalObjects() rdf->GetResource(NC_RDF_ISDEFAULT, getter_AddRefs(kNC_IsDefaultServer)); rdf->GetResource(NC_RDF_ISSESSIONDEFAULT, getter_AddRefs(kNC_IsSessionDefaultServer)); - nsAutoString trueStr; trueStr.AssignWithConversion("true"); + nsAutoString trueStr(NS_LITERAL_STRING("true")); rdf->GetLiteral(trueStr.get(), getter_AddRefs(kTrueLiteral)); // now create cached arrays for each type we support diff --git a/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp b/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp index 44647221e52..5f59f65565b 100644 --- a/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp +++ b/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp @@ -716,7 +716,7 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetOnlineInboxPathForHost(const char *serve if (ns) { result.AssignWithConversion(ns->GetPrefix()); - result.AppendWithConversion("INBOX"); + result.Append(NS_LITERAL_STRING("INBOX")); } } else diff --git a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp index b53d272aed0..b5fca170e12 100644 --- a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp @@ -232,7 +232,7 @@ nsImapIncomingServer::GetConstructedPrettyName(PRUnichar **retval) if ((const char*)username && (const char *) hostName && PL_strcmp((const char*)username, "")!=0) { emailAddress.AssignWithConversion(username); - emailAddress.AppendWithConversion("@"); + emailAddress.Append(NS_LITERAL_STRING("@")); emailAddress.AppendWithConversion(hostName); } @@ -2048,7 +2048,7 @@ nsresult nsImapIncomingServer::GetStringBundle() NS_IMETHODIMP nsImapIncomingServer::GetImapStringByID(PRInt32 aMsgId, PRUnichar **aString) { - nsAutoString resultString; resultString.AssignWithConversion("???"); + nsAutoString resultString(NS_LITERAL_STRING("???")); nsresult res = NS_OK; GetStringBundle(); @@ -2059,9 +2059,9 @@ NS_IMETHODIMP nsImapIncomingServer::GetImapStringByID(PRInt32 aMsgId, PRUnichar if (NS_FAILED(res)) { - resultString.AssignWithConversion("[StringID"); + resultString.Assign(NS_LITERAL_STRING("[StringID")); resultString.AppendInt(aMsgId, 10); - resultString.AssignWithConversion("?]"); + resultString.Assign(NS_LITERAL_STRING("?]")); *aString = ToNewUnicode(resultString); } else @@ -3249,12 +3249,12 @@ nsImapIncomingServer::GeneratePrettyNameForMigration(PRUnichar **aPrettyName) // Construct pretty name from username and hostname nsAutoString constructedPrettyName; constructedPrettyName.AssignWithConversion(userName); - constructedPrettyName.AppendWithConversion("@"); + constructedPrettyName.Append(NS_LITERAL_STRING("@")); constructedPrettyName.AppendWithConversion(hostName); // If the port is valid and not default, add port value to the pretty name if ((serverPort > 0) && (!isItDefaultPort)) { - constructedPrettyName.AppendWithConversion(":"); + constructedPrettyName.Append(NS_LITERAL_STRING(":")); constructedPrettyName.AppendInt(serverPort); } diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 77c10407250..32fe161f5ed 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -305,7 +305,7 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile PRInt32 flags = 0; nsAutoString uri; uri.AppendWithConversion(mURI); - uri.AppendWithConversion('/'); + uri.Append(PRUnichar('/')); uri.Append(*name); char* uriStr = ToNewCString(uri); diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 0c584678c65..96893bf837b 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -4204,7 +4204,7 @@ PRUnichar * nsImapProtocol::CreatePRUnicharStringFromUTF7(const char * aSourceSt if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsAutoString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); + nsAutoString aCharset(NS_LITERAL_STRING("x-imap4-modified-utf7")); PRUnichar *unichars = nsnull; PRInt32 unicharLength; diff --git a/mozilla/mailnews/import/eudora/macbuild/msgImportEudora.xml b/mozilla/mailnews/import/eudora/macbuild/msgImportEudora.xml index f329dbe88c0..23383b16a54 100644 --- a/mozilla/mailnews/import/eudora/macbuild/msgImportEudora.xml +++ b/mozilla/mailnews/import/eudora/macbuild/msgImportEudora.xml @@ -105,6 +105,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path:::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -1035,6 +1045,13 @@ Library Debug + + Name + UnicharUtilsStaticDebug.o + MacOS + Library + Debug + @@ -1112,6 +1129,11 @@ MsgUtilDebug.lib MacOS + + Name + UnicharUtilsStaticDebug.o + MacOS + @@ -1166,6 +1188,16 @@ FrameworkPathfalse HostFlagsAll + + SearchPath + Path:::::intl:unicharutil:macbuild: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + SystemSearchPaths @@ -2096,6 +2128,13 @@ Library Debug + + Name + UnicharUtilsStatic.o + MacOS + Library + Debug + @@ -2173,6 +2212,11 @@ MsgUtil.lib MacOS + + Name + UnicharUtilsStatic.o + MacOS + @@ -2183,6 +2227,20 @@ + Static Libs + + msgImportEudora.shlb + Name + UnicharUtilsStatic.o + MacOS + + + msgImportEudoraDebug.shlb + Name + UnicharUtilsStaticDebug.o + MacOS + + src msgImportEudoraDebug.shlb diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraCompose.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraCompose.cpp index 5815e055f43..71f4cb4614e 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraCompose.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraCompose.cpp @@ -21,6 +21,7 @@ #include "prthread.h" #include "nsString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsCOMPtr.h" #include "nsIFileSpec.h" #include "nsIComponentManager.h" @@ -220,7 +221,7 @@ nsresult nsEudoraCompose::CreateIdentity( void) NS_WITH_PROXIED_SERVICE(nsIMsgAccountManager, accMgr, kMsgAccountMgrCID, NS_UI_THREAD_EVENTQ, &rv); if (NS_FAILED(rv)) return( rv); rv = accMgr->CreateIdentity( &m_pIdentity); - nsString name; name.AssignWithConversion("Import Identity"); + nsString name(NS_LITERAL_STRING("Import Identity")); if (m_pIdentity) { m_pIdentity->SetFullName( name.get()); m_pIdentity->SetIdentityName( name.get()); @@ -500,7 +501,7 @@ void nsEudoraCompose::ExtractType( nsString& str) // valid multipart! if (str.Length() > 10) { str.Left( tStr, 10); - if (!tStr.CompareWithConversion( "multipart/", PR_TRUE)) + if (!Compare(tStr, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator())) str.Truncate(); } } diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraMac.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraMac.cpp index 6996b7f0ac7..f233f59d42b 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraMac.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraMac.cpp @@ -37,6 +37,7 @@ #include "nsEudoraImport.h" #include "nsIPop3IncomingServer.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "EudoraDebugLog.h" @@ -617,7 +618,7 @@ PRBool nsEudoraMac::ImportSettings( nsIFileSpec *pIniFile, nsIMsgAccount **local pStrs[i] = new nsCString; } - nsString accName; accName.AssignWithConversion("Eudora Settings"); + nsString accName(NS_LITERAL_STRING("Eudora Settings")); nsEudoraStringBundle::GetStringByID( EUDORAIMPORT_ACCOUNTNAME, accName); // This is a little overkill but we're not sure yet how multiple accounts @@ -1031,7 +1032,7 @@ PRBool nsEudoraMac::IsValidMailboxName( nsCString& fName) { if (m_depth > 1) return( PR_TRUE); - if (!fName.CompareWithConversion( "Eudora Nicknames", PR_TRUE)) + if (!Compare(fName, NS_LITERAL_CSTRING("Eudora Nicknames"), nsCaseInsensitiveCStringComparator())) return( PR_FALSE); return( PR_TRUE); } diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp index 0cb72e702b9..bbb07a545eb 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp @@ -94,9 +94,9 @@ PRUnichar *nsEudoraStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundle return( ptrv); } - nsString resultString; resultString.AssignWithConversion( "[StringID "); + nsString resultString(NS_LITERAL_STRING("[StringID ")); resultString.AppendInt(stringID, 10); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); return ToNewUnicode(resultString); } diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraWin32.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraWin32.cpp index 55d271ca117..2c7c89a667a 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraWin32.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraWin32.cpp @@ -276,7 +276,7 @@ nsresult nsEudoraWin32::IterateMailDir( nsIFileSpec *pFolder, nsISupportsArray * name = fName; } ext.ToLowerCase(); - if (!ext.CompareWithConversion( ".fol")) { + if (ext.Equals(NS_LITERAL_CSTRING(".fol"))) { isFolder = PR_FALSE; entry->IsDirectory( &isFolder); if (isFolder) { @@ -290,7 +290,7 @@ nsresult nsEudoraWin32::IterateMailDir( nsIFileSpec *pFolder, nsISupportsArray * } } } - else if (!ext.CompareWithConversion( ".mbx")) { + else if (ext.Equals(NS_LITERAL_CSTRING(".mbx"))) { isFile = PR_FALSE; entry->IsFile( &isFile); if (isFile) { @@ -698,8 +698,8 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str) nsCString s(pSection); - if (!s.CompareWithConversion( "Settings", PR_TRUE)) { - str.AssignWithConversion("Eudora "); + if (!Compare(s, NS_LITERAL_CSTRING("Settings"), nsCaseInsensitiveCStringComparator())) { + str.Assign(NS_LITERAL_STRING("Eudora ")); str.AppendWithConversion( pSection); } else { @@ -707,7 +707,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str) str.AssignWithConversion(pSection); if (s.Length() > 8) { s.Left( tStr, 8); - if (!tStr.CompareWithConversion( "Persona-", PR_TRUE)) { + if (!Compare(tStr, NS_LITERAL_CSTRING("Persona-"), nsCaseInsensitiveCStringComparator())) { s.Right( tStr, s.Length() - 8); str.AssignWithConversion(tStr.get()); } @@ -982,7 +982,7 @@ PRBool nsEudoraWin32::FindMimeIniFile( nsIFileSpec *pSpec) name = fName; } ext.ToLowerCase(); - if (!ext.CompareWithConversion( ".ini")) { + if (ext.Equals(NS_LITERAL_CSTRING(".ini"))) { isFile = PR_FALSE; entry->IsFile( &isFile); if (isFile) { @@ -1341,7 +1341,7 @@ nsresult nsEudoraWin32::ScanAddressDir( nsIFileSpec *pDir, nsISupportsArray *pAr name = fName; } ext.ToLowerCase(); - if (!ext.CompareWithConversion( ".txt")) { + if (ext.Equals(NS_LITERAL_CSTRING(".txt"))) { isFile = PR_FALSE; entry->IsFile( &isFile); if (isFile) { diff --git a/mozilla/mailnews/import/oexpress/nsOEAddressIterator.cpp b/mozilla/mailnews/import/oexpress/nsOEAddressIterator.cpp index 79c43bfa93e..a9ed5c5e641 100644 --- a/mozilla/mailnews/import/oexpress/nsOEAddressIterator.cpp +++ b/mozilla/mailnews/import/oexpress/nsOEAddressIterator.cpp @@ -238,11 +238,11 @@ PRBool nsOEAddressIterator::BuildCard( const PRUnichar * pName, nsIMdbRow *newRo else { displayName = firstName; if (!middleName.IsEmpty()) { - displayName.AppendWithConversion( ' '); + displayName.Append(PRUnichar(' ')); displayName.Append( middleName); } if (!lastName.IsEmpty()) { - displayName.AppendWithConversion( ' '); + displayName.Append(PRUnichar(' ')); displayName.Append( lastName); } } diff --git a/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp b/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp index 5b43fa93f96..d02b52a57b9 100644 --- a/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp +++ b/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp @@ -114,9 +114,9 @@ PRUnichar *nsOEStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundle *pB } nsString resultString; - resultString.AppendWithConversion("[StringID "); + resultString.Append(NS_LITERAL_STRING("[StringID ")); resultString.AppendInt(stringID, 10); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); return( ToNewUnicode(resultString)); } diff --git a/mozilla/mailnews/import/outlook/src/MapiApi.cpp b/mozilla/mailnews/import/outlook/src/MapiApi.cpp index 8ff9a28754b..b8d2d525ebe 100644 --- a/mozilla/mailnews/import/outlook/src/MapiApi.cpp +++ b/mozilla/mailnews/import/outlook/src/MapiApi.cpp @@ -1494,7 +1494,7 @@ void CMapiFolderList::AddItem( CMapiFolder *pFolder) void CMapiFolderList::ChangeName( nsString& name) { if (name.IsEmpty()) { - name.AssignWithConversion("1"); + name.Assign(NS_LITERAL_STRING("1")); return; } PRUnichar lastC = name.Last(); @@ -1503,14 +1503,14 @@ void CMapiFolderList::ChangeName( nsString& name) if (lastC > '9') { lastC = '1'; name.SetCharAt( lastC, name.Length() - 1); - name.AppendWithConversion("0"); + name.Append(NS_LITERAL_STRING("0")); } else { name.SetCharAt( lastC, name.Length() - 1); } } else { - name.AppendWithConversion(" 2"); + name.Append(NS_LITERAL_STRING(" 2")); } } @@ -1563,7 +1563,7 @@ void CMapiFolderList::GenerateFilePath( CMapiFolder *pFolder) pCurrent = (CMapiFolder *) GetAt( i); if (pCurrent->GetDepth() == (pFolder->GetDepth() - 1)) { pCurrent->GetFilePath( path); - path.AppendWithConversion(".sbd\\"); + path.Append(NS_LITERAL_STRING(".sbd\\")); pFolder->GetDisplayName( name); path += name; pFolder->SetFilePath(path.get()); diff --git a/mozilla/mailnews/import/outlook/src/MapiMessage.cpp b/mozilla/mailnews/import/outlook/src/MapiMessage.cpp index 62f9d8106fd..aec34c87b5a 100644 --- a/mozilla/mailnews/import/outlook/src/MapiMessage.cpp +++ b/mozilla/mailnews/import/outlook/src/MapiMessage.cpp @@ -279,7 +279,7 @@ BOOL CMapiMessage::IsMultipart( void) { nsCString left; m_mimeContentType.Left( left, 10); - if (!left.CompareWithConversion( "multipart/", PR_TRUE)) + if (left.Equals(NS_LITERAL_CSTRING("multipart/"), nsCaseInsensitiveCStringComparator())) return( TRUE); return( FALSE); } @@ -321,9 +321,9 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) line.Left( left8, 8); line.Left( left5, 5); - if (!left13.CompareWithConversion( "Mime-Version:", PR_TRUE)) + if (left13.Equals(NS_LITERAL_CSTRING("Mime-Version:"), nsCaseInsensitiveCStringComparator())) m_bMimeVersion = TRUE; - else if (!left13.CompareWithConversion( "Content-Type:", PR_TRUE)) { + else if (left13.Equals(NS_LITERAL_CSTRING("Content-Type:"), nsCaseInsensitiveCStringComparator())) { // Note: this isn't a complete parser, the content type // we extract could have rfc822 comments in it len = 13; @@ -347,9 +347,9 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) len++; if (len - start) { line.Mid( tStr, start, len - start); - if (!tStr.CompareWithConversion( "boundary", PR_TRUE)) + if (tStr.Equals(NS_LITERAL_CSTRING("boundary"), nsCaseInsensitiveCStringComparator())) haveB = TRUE; - else if (!tStr.CompareWithConversion( "charset", PR_TRUE)) + else if (tStr.Equals(NS_LITERAL_CSTRING("charset"), nsCaseInsensitiveCStringComparator())) haveC = TRUE; } len++; @@ -399,14 +399,14 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) } } - else if (!left26.CompareWithConversion( "Content-Transfer-Encoding:", PR_TRUE)) { + else if (left26.Equals(NS_LITERAL_CSTRING("Content-Transfer-Encoding:"), nsCaseInsensitiveCStringComparator())) { m_bMimeEncoding = TRUE; } - else if (!left8.CompareWithConversion( "Subject:", PR_TRUE)) + else if (left8.Equals(NS_LITERAL_CSTRING("Subject:"), nsCaseInsensitiveCStringComparator())) m_bHasSubject = TRUE; - else if (!left5.CompareWithConversion( "From:", PR_TRUE)) + else if (left5.Equals(NS_LITERAL_CSTRING("From:"), nsCaseInsensitiveCStringComparator())) m_bHasFrom = TRUE; - else if (!left5.CompareWithConversion( "Date: ", PR_TRUE)) + else if (left5.Equals(NS_LITERAL_CSTRING("Date: "), nsCaseInsensitiveCStringComparator())) m_bHasDate = TRUE; } diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp index 88880d70709..9a460b3ccf8 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp @@ -21,6 +21,7 @@ #include "prthread.h" #include "nsString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsCOMPtr.h" #include "nsIFileSpec.h" #include "nsIComponentManager.h" @@ -216,7 +217,7 @@ nsresult nsOutlookCompose::CreateIdentity( void) if (NS_FAILED(rv)) return( rv); rv = accMgr->CreateIdentity( &m_pIdentity); nsString name; - name.AssignWithConversion("Import Identity"); + name.Assign(NS_LITERAL_STRING("Import Identity")); if (m_pIdentity) { m_pIdentity->SetFullName( name.get()); m_pIdentity->SetIdentityName( name.get()); @@ -496,7 +497,7 @@ void nsOutlookCompose::ExtractType( nsString& str) // valid multipart! if (str.Length() > 10) { str.Left( tStr, 10); - if (!tStr.CompareWithConversion( "multipart/", PR_TRUE)) + if (tStr.Equals(NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator())) str.Truncate(); } } diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp index 609cd96024a..54c3fe58e17 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp @@ -216,9 +216,9 @@ nsresult nsOutlookMail::GetMailFolders( nsISupportsArray **pArray) PRBool nsOutlookMail::IsAddressBookNameUnique( nsString& name, nsString& list) { nsString usedName; - usedName.AppendWithConversion("["); + usedName.Append(NS_LITERAL_STRING("[")); usedName.Append( name); - usedName.AppendWithConversion( "],"); + usedName.Append(NS_LITERAL_STRING("],")); return( list.Find( usedName) == -1); } @@ -231,15 +231,15 @@ void nsOutlookMail::MakeAddressBookNameUnique( nsString& name, nsString& list) newName = name; while (!IsAddressBookNameUnique( newName, list)) { newName = name; - newName.AppendWithConversion( ' '); + newName.Append(PRUnichar(' ')); newName.AppendInt( (PRInt32) idx); idx++; } name = newName; - list.AppendWithConversion( "["); + list.Append(NS_LITERAL_STRING("[")); list.Append( name); - list.AppendWithConversion( "],"); + list.Append(NS_LITERAL_STRING("],")); } nsresult nsOutlookMail::GetAddressBooks( nsISupportsArray **pArray) @@ -955,7 +955,7 @@ nsresult nsOutlookMail::ImportAddresses( PRUint32 *pCount, PRUint32 *pTotal, con if (pVal) { type.Truncate( 0); m_mapi.GetStringFromProp( pVal, type); - if (!type.CompareWithConversion( "IPM.Contact")) { + if (type.Equals(NS_LITERAL_CSTRING("IPM.Contact"))) { // This is a contact, add it to the address book! subject.Truncate( 0); pVal = m_mapi.GetMapiProperty( lpMsg, PR_SUBJECT); diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp index a6954414b12..1025cf6f09a 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp @@ -114,9 +114,9 @@ PRUnichar *nsOutlookStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundl } nsString resultString; - resultString.AppendWithConversion("[StringID "); + resultString.Append(NS_LITERAL_STRING("[StringID ")); resultString.AppendInt(stringID, 10); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); return ToNewUnicode(resultString); } diff --git a/mozilla/mailnews/import/src/nsImportMail.cpp b/mozilla/mailnews/import/src/nsImportMail.cpp index af550e9379d..06bd31d6506 100644 --- a/mozilla/mailnews/import/src/nsImportMail.cpp +++ b/mozilla/mailnews/import/src/nsImportMail.cpp @@ -914,7 +914,7 @@ ImportMailThread( void *stuff) nsCRT::free( pName); } else - lastName.AssignWithConversion("Unknown!"); + lastName.Assign(NS_LITERAL_STRING("Unknown!")); ConvertFromUnicode(lastName.get(), strName); exists = PR_FALSE; @@ -1032,7 +1032,7 @@ PRBool nsImportGenericMail::GetAccount( nsIMsgFolder **ppFolder) if (m_pName) prettyName = m_pName; else - prettyName.AssignWithConversion("Imported Mail"); + prettyName.Assign(NS_LITERAL_STRING("Imported Mail")); nsCOMPtr server; @@ -1142,7 +1142,7 @@ void nsImportGenericMail::GetUniquePrettyName( nsIMsgAccountManager *pMgr, nsStr } if (found) { newName = name; - newName.AppendWithConversion( " "); + newName.Append(NS_LITERAL_STRING(" ")); newName.AppendInt( count); count++; } diff --git a/mozilla/mailnews/import/src/nsImportService.cpp b/mozilla/mailnews/import/src/nsImportService.cpp index aa0bb3fdd68..b56d2f6a3ea 100644 --- a/mozilla/mailnews/import/src/nsImportService.cpp +++ b/mozilla/mailnews/import/src/nsImportService.cpp @@ -259,7 +259,7 @@ NS_IMETHODIMP nsImportService::SystemStringToUnicode(const char *sysStr, nsStrin rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, m_sysCharset); if (NS_FAILED(rv)) - m_sysCharset.AssignWithConversion("ISO-8859-1"); + m_sysCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } if (!sysStr) { @@ -328,7 +328,7 @@ NS_IMETHODIMP nsImportService::SystemStringFromUnicode(const PRUnichar *uniStr, rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, m_sysCharset); if (NS_FAILED(rv)) - m_sysCharset.AssignWithConversion("ISO-8859-1"); + m_sysCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } if (!uniStr) { @@ -664,7 +664,7 @@ nsresult nsImportService::LoadModuleInfo( const char *pClsId, const char *pSuppo delete [] pName; } else - theTitle.AssignWithConversion("Unknown"); + theTitle.Assign(NS_LITERAL_STRING("Unknown")); rv = module->GetDescription( &pName); if (NS_SUCCEEDED( rv)) { @@ -672,7 +672,7 @@ nsresult nsImportService::LoadModuleInfo( const char *pClsId, const char *pSuppo delete [] pName; } else - theDescription.AssignWithConversion("Unknown description"); + theDescription.Assign(NS_LITERAL_STRING("Unknown description")); // call the module to get the info we need m_pModules->AddModule( clsId, pSupports, theTitle.get(), theDescription.get()); diff --git a/mozilla/mailnews/import/src/nsImportStringBundle.cpp b/mozilla/mailnews/import/src/nsImportStringBundle.cpp index e4bce48b930..835806852b7 100644 --- a/mozilla/mailnews/import/src/nsImportStringBundle.cpp +++ b/mozilla/mailnews/import/src/nsImportStringBundle.cpp @@ -112,9 +112,9 @@ PRUnichar *nsImportStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundle return( ptrv); } - nsString resultString; resultString.AssignWithConversion( "[StringID "); + nsString resultString(NS_LITERAL_STRING("[StringID ")); resultString.AppendInt(stringID, 10); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); return( ToNewUnicode(resultString)); } diff --git a/mozilla/mailnews/import/text/src/nsTextImport.cpp b/mozilla/mailnews/import/text/src/nsTextImport.cpp index b9ef158c22a..753ae55371e 100644 --- a/mozilla/mailnews/import/text/src/nsTextImport.cpp +++ b/mozilla/mailnews/import/text/src/nsTextImport.cpp @@ -644,7 +644,7 @@ NS_IMETHODIMP ImportAddressImpl::GetSampleData( PRInt32 index, PRBool *pFound, P PRInt32 fNum = 0; while (nsTextAddress::GetField( pLine, lineLen, fNum, field, m_delim)) { if (fNum) - str.AppendWithConversion( "\n"); + str.Append(NS_LITERAL_STRING("\n")); SanitizeSampleData( field); if (impSvc) impSvc->SystemStringToUnicode( field.get(), uField); diff --git a/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp b/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp index 1088e2794f0..b0714082926 100644 --- a/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp +++ b/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp @@ -95,9 +95,9 @@ PRUnichar *nsTextStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundle * return( ptrv); } - nsString resultString; resultString.AssignWithConversion( "[StringID "); + nsString resultString(NS_LITERAL_STRING("[StringID ")); resultString.AppendInt(stringID, 10); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); return ToNewUnicode(resultString); } diff --git a/mozilla/mailnews/local/src/nsNoIncomingServer.cpp b/mozilla/mailnews/local/src/nsNoIncomingServer.cpp index ff4d56cfea7..816230e7fd0 100644 --- a/mozilla/mailnews/local/src/nsNoIncomingServer.cpp +++ b/mozilla/mailnews/local/src/nsNoIncomingServer.cpp @@ -130,7 +130,7 @@ NS_IMETHODIMP nsNoIncomingServer::CopyDefaultMessages(const char *folderNameOnDi nsCOMPtr chromeRegistry = do_GetService(kChromeRegistryCID, &rv); if (NS_SUCCEEDED(rv)) { nsXPIDLString lc_name; - nsAutoString tmpstr; tmpstr.AssignWithConversion("global-region"); + nsAutoString tmpstr(NS_LITERAL_STRING("global-region")); rv = chromeRegistry->GetSelectedLocale(tmpstr.get(), getter_Copies(lc_name)); if (NS_SUCCEEDED(rv)) { nsAutoString localeStr(lc_name); diff --git a/mozilla/mailnews/mime/src/comi18n.cpp b/mozilla/mailnews/mime/src/comi18n.cpp index 3b74f64c53b..72527c809bf 100644 --- a/mozilla/mailnews/mime/src/comi18n.cpp +++ b/mozilla/mailnews/mime/src/comi18n.cpp @@ -1319,11 +1319,11 @@ PRInt32 MimeCharsetConverterClass::Initialize(const char* from_charset, const ch mInputCharset.AssignWithConversion(from_charset); // remember input charset for a hint if (mInputCharset.IsEmpty()) { - mInputCharset.AssignWithConversion("ISO-8859-1"); + mInputCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } mOutputCharset.AssignWithConversion(to_charset); // remember output charset if (mOutputCharset.IsEmpty()) { - mOutputCharset.AssignWithConversion("UTF-8"); + mOutputCharset.Assign(NS_LITERAL_STRING("UTF-8")); } mAutoDetect = autoDetect; mMaxNumCharsDetect = maxNumCharsDetect; @@ -1335,14 +1335,14 @@ PRInt32 MimeCharsetConverterClass::Initialize(const char* from_charset, const ch if (aAlias.Length()) { res = calias->GetPreferred(aAlias, mInputCharset); if (NS_FAILED(res)) { - mInputCharset.AssignWithConversion("ISO-8859-1"); + mInputCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); } } aAlias = mOutputCharset; if (aAlias.Length()) { res = calias->GetPreferred(aAlias, mOutputCharset); if (NS_FAILED(res)) { - mOutputCharset.AssignWithConversion("UTF-8"); + mOutputCharset.Assign(NS_LITERAL_STRING("UTF-8")); } } } diff --git a/mozilla/mailnews/mime/src/mimemoz2.cpp b/mozilla/mailnews/mime/src/mimemoz2.cpp index b3cdeecb827..fe4529456aa 100644 --- a/mozilla/mailnews/mime/src/mimemoz2.cpp +++ b/mozilla/mailnews/mime/src/mimemoz2.cpp @@ -257,7 +257,7 @@ ValidateRealName(nsMsgAttachmentData *aAttach, MimeHeaders *aHdrs) // if (!aAttach->real_name || *aAttach->real_name == 0) { - nsString newAttachName; newAttachName.AssignWithConversion("attachment"); + nsString newAttachName(NS_LITERAL_STRING("attachment")); nsresult rv = NS_OK; nsCAutoString contentType (aAttach->real_type); PRInt32 pos = contentType.FindCharInSet(";"); @@ -275,7 +275,7 @@ ValidateRealName(nsMsgAttachmentData *aAttach, MimeHeaders *aHdrs) if ( (NS_SUCCEEDED(mimeInfo->FirstExtension(&aFileExtension))) && aFileExtension) { - newAttachName.AppendWithConversion("."); + newAttachName.Append(NS_LITERAL_STRING(".")); newAttachName.AppendWithConversion(aFileExtension); PR_FREEIF(aFileExtension); } diff --git a/mozilla/mailnews/mime/src/mimetpfl.cpp b/mozilla/mailnews/mime/src/mimetpfl.cpp index b3df18d1c65..624f37a18b8 100644 --- a/mozilla/mailnews/mime/src/mimetpfl.cpp +++ b/mozilla/mailnews/mime/src/mimetpfl.cpp @@ -456,8 +456,8 @@ MimeInlineTextPlainFlowed_parse_line (char *line, PRInt32 length, MimeObject *ob && lineSource[0] == '-' && ( - lineSource.EqualsWithConversion("-- \r", PR_FALSE, 4) || - lineSource.EqualsWithConversion("-- \n", PR_FALSE, 4) + Substring(lineSource, 0, 4).Equals(NS_LITERAL_STRING("-- \r")) || + Substring(lineSource, 0, 4).Equals(NS_LITERAL_STRING("-- \n")) ) ) { diff --git a/mozilla/mailnews/mime/src/mimetpla.cpp b/mozilla/mailnews/mime/src/mimetpla.cpp index ef9f77c5c8d..24657e069ca 100644 --- a/mozilla/mailnews/mime/src/mimetpla.cpp +++ b/mozilla/mailnews/mime/src/mimetpla.cpp @@ -419,7 +419,7 @@ MimeInlineTextPlain_parse_line (char *line, PRInt32 length, MimeObject *obj) // recognize signature if ((lineSourceStr.Length() >= 4) && lineSourceStr.First() == '-' - && lineSourceStr.EqualsWithConversion("-- ", PR_FALSE, 3) + && Substring(lineSourceStr, 0, 3).Equals(NS_LITERAL_STRING("-- ")) && (lineSourceStr[3] == '\r' || lineSourceStr[3] == '\n') ) { text->mIsSig = PR_TRUE; diff --git a/mozilla/modules/libjar/nsJAR.cpp b/mozilla/modules/libjar/nsJAR.cpp index e65eaab5ceb..3ce71e8b808 100644 --- a/mozilla/modules/libjar/nsJAR.cpp +++ b/mozilla/modules/libjar/nsJAR.cpp @@ -723,7 +723,7 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, //-- Lines to look for: // (1) Digest: - if (lineName.CompareWithConversion("SHA1-Digest",PR_TRUE) == 0) + if (Compare(lineName, NS_LITERAL_CSTRING("SHA1-Digest"), nsCaseInsensitiveCStringComparator()) == 0) //-- This is a digest line, save the data in the appropriate place { if(aFileType == JAR_MF) @@ -739,7 +739,7 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, } // (2) Name: associates this manifest section with a file in the jar. - if (!foundName && lineName.CompareWithConversion("Name", PR_TRUE) == 0) + if (!foundName && Compare(lineName, NS_LITERAL_CSTRING("Name"), nsCaseInsensitiveCStringComparator()) == 0) { curItemName = lineData; foundName = PR_TRUE; @@ -749,9 +749,9 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, // (3) Magic: this may be an inline Javascript. // We can't do any other kind of magic. if ( aFileType == JAR_MF && - lineName.CompareWithConversion("Magic", PR_TRUE) == 0) + Compare(lineName, NS_LITERAL_CSTRING("Magic"), nsCaseInsensitiveCStringComparator()) == 0) { - if(lineData.CompareWithConversion("javascript", PR_TRUE) == 0) + if(Compare(lineData, NS_LITERAL_CSTRING("javascript"), nsCaseInsensitiveCStringComparator()) == 0) curItemMF->mType = JAR_EXTERNAL; else curItemMF->mType = JAR_INVALID; @@ -791,31 +791,31 @@ void nsJAR::ReportError(const char* aFilename, PRInt16 errorCode) { //-- Generate error message nsAutoString message; - message.AssignWithConversion("Signature Verification Error: the signature on "); + message.Assign(NS_LITERAL_STRING("Signature Verification Error: the signature on ")); if (aFilename) message.AppendWithConversion(aFilename); else - message.AppendWithConversion("this .jar archive"); - message.AppendWithConversion(" is invalid because "); + message.Append(NS_LITERAL_STRING("this .jar archive")); + message.Append(NS_LITERAL_STRING(" is invalid because ")); switch(errorCode) { case nsIJAR::NOT_SIGNED: - message.AppendWithConversion("the archive did not contain a valid PKCS7 signature."); + message.Append(NS_LITERAL_STRING("the archive did not contain a valid PKCS7 signature.")); break; case nsIJAR::INVALID_SIG: - message.AppendWithConversion("the digital signature (*.RSA) file is not a valid signature of the signature instruction file (*.SF)."); + message.Append(NS_LITERAL_STRING("the digital signature (*.RSA) file is not a valid signature of the signature instruction file (*.SF).")); break; case nsIJAR::INVALID_UNKNOWN_CA: - message.AppendWithConversion("the certificate used to sign this file has an unrecognized issuer."); + message.Append(NS_LITERAL_STRING("the certificate used to sign this file has an unrecognized issuer.")); break; case nsIJAR::INVALID_MANIFEST: - message.AppendWithConversion("the signature instruction file (*.SF) does not contain a valid hash of the MANIFEST.MF file."); + message.Append(NS_LITERAL_STRING("the signature instruction file (*.SF) does not contain a valid hash of the MANIFEST.MF file.")); break; case nsIJAR::INVALID_ENTRY: - message.AppendWithConversion("the MANIFEST.MF file does not contain a valid hash of the file being verified."); + message.Append(NS_LITERAL_STRING("the MANIFEST.MF file does not contain a valid hash of the file being verified.")); break; default: - message.AppendWithConversion("of an unknown problem."); + message.Append(NS_LITERAL_STRING("of an unknown problem.")); } // Report error in JS console diff --git a/mozilla/modules/oji/src/nsJVMManager.cpp b/mozilla/modules/oji/src/nsJVMManager.cpp index a3a389060c1..020455d714e 100644 --- a/mozilla/modules/oji/src/nsJVMManager.cpp +++ b/mozilla/modules/oji/src/nsJVMManager.cpp @@ -201,9 +201,8 @@ nsJVMManager::ShowJavaConsole(void) msg = messageUni; nsMemory::Free((void *)messageUni); - msg.AppendWithConversion(" ", 1); - msg.AppendWithConversion("application/x-java-vm", - PL_strlen("application/x-java-vm")); + msg.Append(PRUnichar(' ')); + msg.Append(NS_LITERAL_STRING("application/x-java-vm")); chrome->SetStatus(nsIWebBrowserChrome::STATUS_SCRIPT, msg.get()); } diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index c04b3c3a4f7..9d488d83a33 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -2161,7 +2161,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request, PLUGIN_LOG(PLUGIN_LOG_NOISY, ("nsPluginStreamListenerPeer::OnStopAvailable request=%p, cachefile=%s\n", - request, pathAndFilename)); + request, pathAndFilename.get())); // If we are writting the stream to disk ourselves, lets close it nsCOMPtr outStream; @@ -4237,7 +4237,7 @@ nsPluginHostImpl::PostStartupMessageForType(const char* aMimeType, msg = messageUni; nsMemory::Free((void *)messageUni); - msg.AppendWithConversion(" ", 1); + msg.Append(PRUnichar(' ')); msg.AppendWithConversion(aMimeType, PL_strlen(aMimeType)); #ifdef PLUGIN_LOGGING PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_ALWAYS, diff --git a/mozilla/netwerk/base/src/nsSimpleURI.cpp b/mozilla/netwerk/base/src/nsSimpleURI.cpp index 233c4009369..99623a5f725 100644 --- a/mozilla/netwerk/base/src/nsSimpleURI.cpp +++ b/mozilla/netwerk/base/src/nsSimpleURI.cpp @@ -135,7 +135,7 @@ nsSimpleURI::GetSpec(char* *result) // STRING USE WARNING: perhaps |string| should be |nsCAutoString|? -- scc string.AssignWithConversion(mScheme); - string.AppendWithConversion(':'); + string.Append(PRUnichar(':')); string.AppendWithConversion(mPath); // NS_UNLOCK_INSTANCE(); diff --git a/mozilla/netwerk/base/src/nsSocketTransport.cpp b/mozilla/netwerk/base/src/nsSocketTransport.cpp index 7de24612e4c..63c763e39c2 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport.cpp +++ b/mozilla/netwerk/base/src/nsSocketTransport.cpp @@ -1352,7 +1352,7 @@ nsSocketTransport::GetName(PRUnichar **result) { nsString name; name.AppendWithConversion(mHostName); - name.AppendWithConversion(":"); + name.Append(NS_LITERAL_STRING(":")); name.AppendInt(mPort); *result = ToNewUnicode(name); return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/netwerk/base/src/nsSocketTransportService.cpp b/mozilla/netwerk/base/src/nsSocketTransportService.cpp index f7eeeb5ac55..932d03bd00a 100644 --- a/mozilla/netwerk/base/src/nsSocketTransportService.cpp +++ b/mozilla/netwerk/base/src/nsSocketTransportService.cpp @@ -810,9 +810,9 @@ nsSocketTransportService::GetNeckoStringByName (const char *aName, PRUnichar **a if (NS_FAILED(res)) { - resultString.AssignWithConversion("[StringName"); + resultString.Assign(NS_LITERAL_STRING("[StringName")); resultString.AppendWithConversion(aName); - resultString.AppendWithConversion("?]"); + resultString.Append(NS_LITERAL_STRING("?]")); *aString = ToNewUnicode(resultString); } else diff --git a/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp b/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp index 029174c72af..3db53101364 100644 --- a/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp +++ b/mozilla/netwerk/protocol/finger/src/nsFingerChannel.cpp @@ -372,8 +372,8 @@ nsFingerChannel::OnStopRequest(nsIRequest *aRequest, nsISupports* aContext, do_GetService(kStreamConverterServiceCID, &rv); if (NS_FAILED(rv)) return rv; - nsAutoString fromStr; fromStr.AssignWithConversion("text/plain"); - nsAutoString toStr; toStr.AssignWithConversion("text/html"); + nsAutoString fromStr(NS_LITERAL_STRING("text/plain")); + nsAutoString toStr(NS_LITERAL_STRING("text/html")); rv = StreamConvService->AsyncConvertData(fromStr.get(), toStr.get(), this, mResponseContext, @@ -382,7 +382,7 @@ nsFingerChannel::OnStopRequest(nsIRequest *aRequest, nsISupports* aContext, nsCOMPtr converter(do_QueryInterface(converterListener)); if (converter) { - nsAutoString title; title.AssignWithConversion("Finger information for "); + nsAutoString title(NS_LITERAL_STRING("Finger information for ")); nsXPIDLCString userHost; rv = mUrl->GetPath(getter_Copies(userHost)); title.AppendWithConversion(userHost); diff --git a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index 8e8e8022cca..862f1ed6edd 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -2139,7 +2139,7 @@ nsFtpState::SendFTPCommand(nsCString& command) // we don't want to log the password: nsCAutoString logcmd(command); - if (command.CompareWithConversion("PASS ", PR_FALSE, 5) == 0) + if (Compare(Substring(command, 0, 5), NS_LITERAL_CSTRING("PASS ")) == 0) logcmd = "PASS xxxxx"; PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x)(dwait=%d) Writing \"%s\"\n", this, mWaitingForDConn, logcmd.get())); diff --git a/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp b/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp index 7e5128b300a..751949c6dd6 100644 --- a/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp +++ b/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp @@ -148,7 +148,7 @@ nsGopherChannel::GetName(PRUnichar* *result) { nsString name; name.AppendWithConversion(mHost); - name.AppendWithConversion(":"); + name.Append(NS_LITERAL_STRING(":")); name.AppendInt(mPort); *result = ToNewUnicode(name); return *result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp index a57082c6e56..1428eff89a2 100644 --- a/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp +++ b/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp @@ -56,13 +56,13 @@ mozTXTToHTMLConv::EscapeChar(const PRUnichar ch, nsString& aStringToAppendTo) switch (ch) { case '<': - aStringToAppendTo.AppendWithConversion("<"); + aStringToAppendTo.Append(NS_LITERAL_STRING("<")); break; case '>': - aStringToAppendTo.AppendWithConversion(">"); + aStringToAppendTo.Append(NS_LITERAL_STRING(">")); break; case '&': - aStringToAppendTo.AppendWithConversion("&"); + aStringToAppendTo.Append(NS_LITERAL_STRING("&")); break; default: aStringToAppendTo += ch; @@ -89,17 +89,17 @@ mozTXTToHTMLConv::EscapeStr(nsString& aInString) { case '<': aInString.Cut(i, 1); - aInString.InsertWithConversion("<", i, 4); + aInString.Insert(NS_LITERAL_STRING("<"), i); i += 4; // skip past the integers we just added break; case '>': aInString.Cut(i, 1); - aInString.InsertWithConversion(">", i, 4); + aInString.Insert(NS_LITERAL_STRING(">"), i); i += 4; // skip past the integers we just added break; case '&': aInString.Cut(i, 1); - aInString.InsertWithConversion("&", i, 5); + aInString.Insert(NS_LITERAL_STRING("&"), i); i += 5; // skip past the integers we just added break; default: @@ -120,17 +120,17 @@ mozTXTToHTMLConv::UnescapeStr(const PRUnichar * aInString, PRInt32 aStartPos, PR subString = &aInString[i]; if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("<").get(), MinInt(4, aLength - remainingChars))) { - aOutString.AppendWithConversion('<'); + aOutString.Append(PRUnichar('<')); i += 4; } else if (!nsCRT::strncmp(subString, NS_LITERAL_STRING(">").get(), MinInt(4, aLength - remainingChars))) { - aOutString.AppendWithConversion('>'); + aOutString.Append(PRUnichar('>')); i += 4; } else if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("&").get(), MinInt(5, aLength - remainingChars))) { - aOutString.AppendWithConversion('&'); + aOutString.Append(PRUnichar('&')); i += 5; } else @@ -158,7 +158,7 @@ mozTXTToHTMLConv::CompleteAbbreviatedURL(const PRUnichar * aInString, PRInt32 aI nsDependentString inString(aInString, aInLength); if (inString.FindChar('.', pos) != kNotFound) // if we have a '.' after the @ sign.... { - aOutString.AssignWithConversion("mailto:"); + aOutString.Assign(NS_LITERAL_STRING("mailto:")); aOutString += aInString; } } @@ -167,12 +167,12 @@ mozTXTToHTMLConv::CompleteAbbreviatedURL(const PRUnichar * aInString, PRInt32 aI if (ItMatchesDelimited(aInString, aInLength, NS_LITERAL_STRING("www.").get(), 4, LT_IGNORE, LT_IGNORE)) { - aOutString.AssignWithConversion("http://"); + aOutString.Assign(NS_LITERAL_STRING("http://")); aOutString += aInString; } else if (ItMatchesDelimited(aInString,aInLength, NS_LITERAL_STRING("ftp.").get(), 4, LT_IGNORE, LT_IGNORE)) { - aOutString.AssignWithConversion("ftp://"); + aOutString.Assign(NS_LITERAL_STRING("ftp://")); aOutString += aInString; } } @@ -383,28 +383,28 @@ mozTXTToHTMLConv::CheckURLAndCreateHTML( // Real work if (NS_SUCCEEDED(rv) && uri) { - outputHTML.AssignWithConversion(""); + outputHTML.Append(NS_LITERAL_STRING("\">")); outputHTML += desc; - outputHTML.AppendWithConversion(""); + outputHTML.Append(NS_LITERAL_STRING("")); return PR_TRUE; } else @@ -665,7 +665,7 @@ mozTXTToHTMLConv::SmilyHit(const PRUnichar * aInString, PRInt32 aLength, PRBool else { outputHTML.Truncate(); - outputHTML.AppendWithConversion(' '); + outputHTML.Append(PRUnichar(' ')); outputHTML.AppendWithConversion(tagHTML); } glyphTextLen = (col0 ? 0 : 1) + tagLen; @@ -829,7 +829,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, PRBoo NS_LITERAL_STRING(" +/-").get(), 4, LT_IGNORE, LT_IGNORE)) { - aOutputString.AppendWithConversion(" ±"); + aOutputString.Append(NS_LITERAL_STRING(" ±")); glyphTextLen = 4; MOZ_TIMER_STOP(mGlyphHitTimer); return PR_TRUE; @@ -838,7 +838,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, PRBoo NS_LITERAL_STRING("+/-").get(), 3, LT_IGNORE, LT_IGNORE)) { - aOutputString.AppendWithConversion("±"); + aOutputString.Append(NS_LITERAL_STRING("±")); glyphTextLen = 3; MOZ_TIMER_STOP(mGlyphHitTimer); return PR_TRUE; @@ -878,11 +878,11 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, PRBoo outputHTML.Truncate(); outputHTML += text0; - outputHTML.AppendWithConversion(""); + outputHTML.Append(NS_LITERAL_STRING("")); aOutputString.Append(outputHTML); aOutputString.Append(&aInString[2], delimPos - 2); - aOutputString.AppendWithConversion(""); + aOutputString.Append(NS_LITERAL_STRING("")); glyphTextLen = delimPos /* - 1 + 1 */ ; MOZ_TIMER_STOP(mGlyphHitTimer); diff --git a/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp index 0bc192a1bb5..457834ad994 100644 --- a/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -164,7 +164,7 @@ nsIndexedToHTML::OnStartRequest(nsIRequest* request, nsISupports *aContext) { } nsString buffer; - buffer.AssignWithConversion("\n"); + buffer.Assign(NS_LITERAL_STRING("\n")); // Anything but a gopher url needs to end in a /, // otherwise we end up linking to file:///foo/dirfile diff --git a/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp b/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp index 9a762268384..3c4e27b717b 100644 --- a/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp @@ -71,11 +71,11 @@ nsTXTToHTMLConv::AsyncConvertData(const PRUnichar *aFromType, // nsIRequestObserver methods NS_IMETHODIMP nsTXTToHTMLConv::OnStartRequest(nsIRequest* request, nsISupports *aContext) { - mBuffer.AssignWithConversion("\n"); + mBuffer.Assign(NS_LITERAL_STRING("<html>\n<head><title>")); mBuffer.Append(mPageTitle); - mBuffer.AppendWithConversion("\n\n"); + mBuffer.Append(NS_LITERAL_STRING("\n\n")); if (mPreFormatHTML) { // Use
 tags
-      mBuffer.AppendWithConversion("
\n");
+      mBuffer.Append(NS_LITERAL_STRING("
\n"));
     }
 
     // Push mBuffer to the listener now, so the initial HTML will not
@@ -93,7 +93,7 @@ nsTXTToHTMLConv::OnStartRequest(nsIRequest* request, nsISupports *aContext) {
     rv = mListener->OnDataAvailable(request, aContext,
                                     inputData, 0, mBuffer.Length());
     if (NS_FAILED(rv)) return rv;
-    mBuffer.AssignWithConversion("");
+    mBuffer.Assign(NS_LITERAL_STRING(""));
     return rv;
 }
 
@@ -108,9 +108,9 @@ nsTXTToHTMLConv::OnStopRequest(nsIRequest* request, nsISupports *aContext,
         (void)CatHTML(0, mBuffer.Length());
     }
     if (mPreFormatHTML) {
-      mBuffer.AppendWithConversion("
\n"); + mBuffer.Append(NS_LITERAL_STRING("
\n")); } - mBuffer.AppendWithConversion("\n"); + mBuffer.Append(NS_LITERAL_STRING("\n")); nsCOMPtr inputData; nsCOMPtr inputDataSup; @@ -231,14 +231,14 @@ nsTXTToHTMLConv::Init() { convToken *token = new convToken; if (!token) return NS_ERROR_OUT_OF_MEMORY; token->prepend = PR_TRUE; - token->token.AssignWithConversion("http://"); // XXX need to iterate through all protos + token->token.Assign(NS_LITERAL_STRING("http://")); // XXX need to iterate through all protos mTokens.AppendElement(token); token = new convToken; if (!token) return NS_ERROR_OUT_OF_MEMORY; token->prepend = PR_TRUE; - token->token.AssignWithConversion('@'); - token->modText.AssignWithConversion("mailto:"); + token->token.Assign(PRUnichar('@')); + token->modText.Assign(NS_LITERAL_STRING("mailto:")); mTokens.AppendElement(token); return rv; @@ -276,16 +276,16 @@ nsTXTToHTMLConv::CatHTML(PRInt32 front, PRInt32 back) { // href is implied PRInt32 modLen = mToken->modText.Length(); mBuffer.Mid(linkText, front, back-front); - mBuffer.InsertWithConversion("modText, cursor); cursor += modLen-front+back; - mBuffer.InsertWithConversion("\">", cursor); + mBuffer.Insert(NS_LITERAL_STRING("\">"), cursor); cursor += 2; mBuffer.Insert(linkText, cursor); cursor += linkText.Length(); - mBuffer.InsertWithConversion("", cursor); + mBuffer.Insert(NS_LITERAL_STRING(""), cursor); cursor += 4; } mToken = nsnull; // indicates completeness diff --git a/mozilla/netwerk/streamconv/converters/nsUnknownDecoder.cpp b/mozilla/netwerk/streamconv/converters/nsUnknownDecoder.cpp index 4566b7a5b6d..2bd6a282721 100644 --- a/mozilla/netwerk/streamconv/converters/nsUnknownDecoder.cpp +++ b/mozilla/netwerk/streamconv/converters/nsUnknownDecoder.cpp @@ -293,8 +293,8 @@ void nsUnknownDecoder::DetermineContentType(nsIRequest* request) // This false match happened all the time... For example, CGI scripts // written in sh or perl that emit HTML. // - else if (str.EqualsWithConversion("#!", PR_FALSE, 2) || - str.EqualsWithConversion("%!", PR_FALSE, 2)) { + else if (Substring(str, 0, 2).Equals(NS_LITERAL_CSTRING("#!")) || + Substring(str, 0, 2).Equals(NS_LITERAL_CSTRING("%!"))) { for (i=0; iFrom ", PR_TRUE, 6)) { + else if (!Compare(Substring(str, 0, 5), NS_LITERAL_CSTRING("From "), nsCaseInsensitiveCStringComparator()) || + !Compare(Substring(str, 0, 6), NS_LITERAL_CSTRING(">From "), nsCaseInsensitiveCStringComparator())) { mContentType = TEXT_PLAIN; } // diff --git a/mozilla/netwerk/streamconv/test/TestStreamConv.cpp b/mozilla/netwerk/streamconv/test/TestStreamConv.cpp index d94fc91d8dd..0525589fc2b 100644 --- a/mozilla/netwerk/streamconv/test/TestStreamConv.cpp +++ b/mozilla/netwerk/streamconv/test/TestStreamConv.cpp @@ -207,9 +207,9 @@ main(int argc, char* argv[]) // Define the *from* content type and *to* content-type for conversion. nsString fromStr; - fromStr.AssignWithConversion("a/foo"); + fromStr.Assign(NS_LITERAL_STRING("a/foo")); nsString toStr; - toStr.AssignWithConversion("c/foo"); + toStr.Assign(NS_LITERAL_STRING("c/foo")); #ifdef ASYNC_TEST // ASYNCRONOUS conversion diff --git a/mozilla/netwerk/test/TestPageLoad.cpp b/mozilla/netwerk/test/TestPageLoad.cpp index b5eeedb929a..99f53e3d4a6 100644 --- a/mozilla/netwerk/test/TestPageLoad.cpp +++ b/mozilla/netwerk/test/TestPageLoad.cpp @@ -281,7 +281,7 @@ nsresult NS_AutoregisterComponents() int getStrLine(const char *src, char *str, int ind, int max) { char c = src[ind]; int i=0; - globalStream.AssignWithConversion("\0"); + globalStream.Assign(NS_LITERAL_STRING("\0")); while(c!='\n' && c!='\0' && iAppendElement(new nsString(aURLSpec)); str.Truncate(); nsString(aURLSpec).Left(str,5); - if (str.EqualsWithConversion("http:")) { + if (str.Equals(NS_LITERAL_STRING("http:"))) { g_iProcessed++; if (g_iProcessed == (g_iMaxProcess > 0 ? g_iMaxProcess-1 : 0)) g_bHitTop = PR_TRUE; diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp index 8aa2e81b755..23ee14c83b3 100644 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp @@ -244,7 +244,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) { nsAutoString tmp; tmp.Assign(aNode.GetText()); tmp.ToLowerCase(); - if (tmp.EqualsWithConversion("a")) { + if (tmp.Equals(NS_LITERAL_STRING("a"))) { nsAutoString k, v; PRInt32 ac = aNode.GetAttributeCount(); for (PRInt32 i = 0; i < ac; i++) { @@ -252,7 +252,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) const nsAReadableString& key = aNode.GetKeyAt(i); k.Assign(key); k.ToLowerCase(); - if (k.EqualsWithConversion("href")) { + if (k.Equals(NS_LITERAL_STRING("href"))) { // Get value and remove mandatory quotes v.Truncate(); v.Append(aNode.GetValueAt(i)); diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index fbfdd2cc3f0..ce6bef285a6 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -66,6 +66,7 @@ #include "nsIFormProcessor.h" #include "nsVoidArray.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "prmem.h" #ifdef NS_DEBUG @@ -1003,11 +1004,11 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ PRInt32 theIndex=0; for(theIndex=0;theIndexProvideContent(theFormType,theContent,theAttribute); @@ -2130,7 +2131,7 @@ nsresult CNavDTD::HandleEntityToken(CToken* aToken) { //if you're here we have a bogus entity. //convert it into a text token. nsAutoString entityName; - entityName.AssignWithConversion("&"); + entityName.Assign(NS_LITERAL_STRING("&")); entityName.Append(theStr); //should append the entity name; fix bug 51161. theToken = mTokenAllocator->CreateTokenOfType(eToken_text,eHTMLTag_text,entityName); } diff --git a/mozilla/parser/htmlparser/src/COtherDTD.cpp b/mozilla/parser/htmlparser/src/COtherDTD.cpp index 93ec4aeb2a1..ad523be1a6b 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.cpp +++ b/mozilla/parser/htmlparser/src/COtherDTD.cpp @@ -61,6 +61,7 @@ #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" +#include "nsUnicharUtils.h" #include "prmem.h" @@ -579,11 +580,11 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ PRInt32 theIndex=0; for(theIndex=0;theIndexCreateTokenOfType(eToken_text,eHTMLTag_text,entityName); } diff --git a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp index e5c9eaf8b87..02bb2606981 100644 --- a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp @@ -44,6 +44,7 @@ #include "nsParserNode.h" #include "nsIChannel.h" #include "nsIServiceManager.h" +#include "nsUnicharUtils.h" MOZ_DECL_CTOR_COUNTER(nsEntryStack) MOZ_DECL_CTOR_COUNTER(nsDTDContext) @@ -576,7 +577,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); aValue=abs(aValue); // must be positive here... while(next<=aValue) { // scale up in baseN; exceed current value. @@ -610,7 +611,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); PRInt32 root=1000000000; PRInt32 expn=4; @@ -708,7 +709,7 @@ public: aString.Truncate(); if(aValue<0) - aString.AppendWithConversion('-'); + aString.Append(PRUnichar('-')); aValue=abs(aValue); char decStr[20]; @@ -842,7 +843,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr nsAutoString theKey(aNode.GetKeyAt(theIndex)); const nsString& theValue=aNode.GetValueAt(theIndex); - if(theKey.EqualsWithConversion("name",PR_TRUE)){ + if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){ theEntity=GetEntity(theValue); if(!theEntity) { theEntity=RegisterEntity(theValue,theValue); @@ -850,10 +851,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr } aTag=eHTMLTag_userdefined; } - else if(theKey.EqualsWithConversion("noincr",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){ theIncrValue=0; } - else if(theKey.EqualsWithConversion("format",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){ PRUnichar theChar=theValue.CharAt(0); if('"'==theChar) theChar=theValue.CharAt(1); @@ -870,7 +871,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr } //determine numbering style } - else if(theKey.EqualsWithConversion("value",PR_TRUE)){ + else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){ PRInt32 err=0; theNewValue=theValue.ToInteger(&err); if(!err) { diff --git a/mozilla/parser/htmlparser/src/nsExpatTokenizer.cpp b/mozilla/parser/htmlparser/src/nsExpatTokenizer.cpp index 9742f7bbd34..4369c93b76f 100644 --- a/mozilla/parser/htmlparser/src/nsExpatTokenizer.cpp +++ b/mozilla/parser/htmlparser/src/nsExpatTokenizer.cpp @@ -319,10 +319,10 @@ CreateSourceText(const nsParserError* aError, nsString& aSourceString) PRInt32 errorPosition = aError->colNumber; aSourceString.Append(aError->sourceLine); - aSourceString.AppendWithConversion("\n"); + aSourceString.Append(NS_LITERAL_STRING("\n")); for (PRInt32 i = 0; i < errorPosition - 1; i++) - aSourceString.AppendWithConversion("-"); - aSourceString.AppendWithConversion("^"); + aSourceString.Append(NS_LITERAL_STRING("-")); + aSourceString.Append(NS_LITERAL_STRING("^")); return NS_OK; } @@ -749,13 +749,13 @@ void Tokenizer_HandleProcessingInstruction(void *userData, { XMLParserState* state = (XMLParserState*) userData; nsAutoString theString; - theString.AppendWithConversion(""); + theString.Append(NS_LITERAL_STRING("?>")); CToken* theToken = state->tokenAllocator->CreateTokenOfType(eToken_instruction,eHTMLTag_unknown, theString); if(theToken) { @@ -1005,7 +1005,7 @@ void Tokenizer_HandleEndDoctypeDecl(void *userData) { XMLParserState* state = (XMLParserState*) userData; - state->doctypeText.AppendWithConversion(">"); + state->doctypeText.Append(NS_LITERAL_STRING(">")); CToken* token = state->tokenAllocator->CreateTokenOfType(eToken_doctypeDecl, eHTMLTag_unknown, state->doctypeText); if (token) { nsExpatTokenizer::AddToken(token, NS_OK, state->tokenDeque, state->tokenAllocator); diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index 235338995f1..d645cb58e89 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -154,11 +154,11 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream, // Set the line break character: if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak) && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) // Windows/mail - mLineBreak.AssignWithConversion("\r\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\r\n")); else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) // Mac - mLineBreak.AssignWithConversion("\r"); + mLineBreak.Assign(NS_LITERAL_STRING("\r")); else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) // Unix/DOM - mLineBreak.AssignWithConversion("\n"); + mLineBreak.Assign(NS_LITERAL_STRING("\n")); else mLineBreak.AssignWithConversion(NS_LINEBREAK); // Platform/default @@ -246,7 +246,7 @@ nsHTMLContentSinkStream::InitEncoders() if (NS_FAILED(res)) { // failed - unknown alias , fallback to ISO-8859-1 - charsetName.AssignWithConversion("ISO-8859-1"); + charsetName.Assign(NS_LITERAL_STRING("ISO-8859-1")); } res = nsComponentManager::CreateInstance(kSaveAsCharsetCID, NULL, @@ -423,7 +423,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) value.Trim("\"", PR_TRUE, PR_TRUE); // Filter out any attribute starting with _moz - if (key.EqualsWithConversion("_moz", PR_TRUE, 4)) + if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()) continue; // @@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) // used by the editor. Bug 16988. Yuck. // if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br - && ((key.EqualsWithConversion("type", PR_TRUE) - && value.EqualsWithConversion("_moz")))) + && (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator()) + && value.Equals(NS_LITERAL_STRING("_moz"))))) continue; if (mLowerCaseTags == PR_TRUE) @@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode) // Make all links absolute when converting only the selection: if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks) - && (key.EqualsWithConversion("href", PR_TRUE) - || key.EqualsWithConversion("src", PR_TRUE) + && (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator()) + || !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator()) // Would be nice to handle OBJECT and APPLET tags, // but that gets more complicated since we have to // search the tag list for CODEBASE as well. @@ -613,7 +613,7 @@ PRBool nsHTMLContentSinkStream::IsDirty(const nsIParserNode& aNode) void nsHTMLContentSinkStream::AddIndent() { - nsAutoString padding; padding.AssignWithConversion(" "); + nsAutoString padding(NS_LITERAL_STRING(" ")); for (PRInt32 i = mIndent; --i >= 0; ) { Write(padding); @@ -752,7 +752,7 @@ void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode) } else if (tag == eHTMLTag_comment) { - tagName.AssignWithConversion("--"); + tagName.Assign(NS_LITERAL_STRING("--")); } else if (tag == eHTMLTag_doctypeDecl || tag == eHTMLTag_markupDecl) { @@ -1057,7 +1057,7 @@ nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode) if (tag == eHTMLTag_userdefined) { nsAutoString name; name.Assign(aNode.GetText()); - if (name.EqualsWithConversion("document_info")) + if (name.Equals(NS_LITERAL_STRING("document_info"))) { PRInt32 count=aNode.GetAttributeCount(); for(PRInt32 i=0;iCreateTokenOfType(eToken_cdatasection,eHTMLTag_comment); - } else if (theBufCopy.EqualsWithConversion("ELEMENT",PR_FALSE,7) || - theBufCopy.EqualsWithConversion("ATTLIST",PR_FALSE,7) || - theBufCopy.EqualsWithConversion("ENTITY",PR_FALSE,6) || - theBufCopy.EqualsWithConversion("NOTATION",PR_FALSE,8)) { + } else if (Substring(theBufCopy, 0, 7).Equals(NS_LITERAL_STRING("ELEMENT")) || + Substring(theBufCopy, 0, 7).Equals(NS_LITERAL_STRING("ATTLIST")) || + Substring(theBufCopy, 0, 6).Equals(NS_LITERAL_STRING("ENTITY")) || + Substring(theBufCopy, 0, 8).Equals(NS_LITERAL_STRING("NOTATION"))) { aToken = theAllocator->CreateTokenOfType(eToken_markupDecl,eHTMLTag_markupDecl); } else { aToken = theAllocator->CreateTokenOfType(eToken_comment,eHTMLTag_comment); diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp index 1b69657d21a..a135807c3a1 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp @@ -283,7 +283,7 @@ const nsAReadableString& CStartToken::GetStringValue() * @return nada */ void CStartToken::GetSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("<"); + anOutputString.Append(PRUnichar('<')); /* * Watch out for Bug 15204 */ @@ -294,7 +294,7 @@ void CStartToken::GetSource(nsString& anOutputString){ anOutputString.Append(mTextValue); else anOutputString.Assign(GetTagName(mTypeID)); - anOutputString.AppendWithConversion('>'); + anOutputString.Append(PRUnichar('>')); } } @@ -306,7 +306,7 @@ void CStartToken::GetSource(nsString& anOutputString){ * @return nada */ void CStartToken::AppendSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("<"); + anOutputString.Append(PRUnichar('<')); /* * Watch out for Bug 15204 */ @@ -317,7 +317,7 @@ void CStartToken::AppendSource(nsString& anOutputString){ anOutputString+=mTextValue; else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion('>'); + anOutputString.Append(PRUnichar('>')); } } @@ -470,12 +470,12 @@ const nsAReadableString& CEndToken::GetStringValue() * @return nada */ void CEndToken::GetSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("0) anOutputString.Append(mTextValue); else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion(">"); + anOutputString.Append(NS_LITERAL_STRING(">")); } /* @@ -486,12 +486,12 @@ void CEndToken::GetSource(nsString& anOutputString){ * @return nada */ void CEndToken::AppendSource(nsString& anOutputString){ - anOutputString.AppendWithConversion("0) anOutputString.Append(mTextValue); else anOutputString.Append(GetTagName(mTypeID)); - anOutputString.AppendWithConversion(">"); + anOutputString.Append(NS_LITERAL_STRING(">")); } /* @@ -827,14 +827,14 @@ nsresult CCDATASectionToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt3 switch(aChar) { case kCR: result=aScanner.GetChar(aChar); //strip off the \r - mTextValue.AppendWithConversion("\n\n"); + mTextValue.Append(NS_LITERAL_STRING("\n\n")); break; case kNewLine: //which means we saw \r\n, which becomes \n result=aScanner.GetChar(aChar); //strip off the \n //now fall through on purpose... default: - mTextValue.AppendWithConversion("\n"); + mTextValue.Append(NS_LITERAL_STRING("\n")); break; } //switch } //if @@ -1049,7 +1049,7 @@ nsresult ConsumeStrictComment(PRUnichar aChar, nsScanner& aScanner,nsString& aSt *********************************************************/ - aString.AssignWithConversion("', unless you already did! (such as ). if(kGreaterThan!=aChar) { - aString.AppendWithConversion("= 127)) { - aResult.AppendWithConversion("&#"); + aResult.Append(NS_LITERAL_STRING("&#")); aResult.AppendInt(PRInt32(ch), 10); - aResult.AppendWithConversion(';'); + aResult.Append(PRUnichar(';')); } else { aResult.Append(ch); diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index a6cfd0da45c..5fc0af70bfe 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -303,7 +303,7 @@ nsParser::nsParser(nsITokenObserver* anObserver) { } #endif - mCharset.AssignWithConversion("ISO-8859-1"); + mCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); mParserFilter = 0; mObserver = 0; mSink=0; @@ -1229,8 +1229,8 @@ NS_IMETHODIMP nsParser::CreateCompatibleDTD(nsIDTD** aDTD, * nsAutoString theMimeType; * nsAutoString theDocType; * - * theDocType.AssignWithConversion(""); - * theMimeType.AssignWithConversion("text/html"); + * theDocType.Assign(NS_LITERAL_STRING("")); + * theMimeType.Assign(NS_LITERAL_STRING("text/html")); * * result=CreateCompatibleDTD(getter_AddRefs(theDTD),&theDocType,eViewNormal,&theMimeType,eDTDMode_quirks); * @@ -1619,7 +1619,7 @@ nsresult nsParser::Parse(nsIInputStream& aStream,const nsAReadableString& aMimeT nsresult result=NS_ERROR_OUT_OF_MEMORY; //ok, time to create our tokenizer and begin the process - nsAutoString theUnknownFilename; theUnknownFilename.AssignWithConversion("unknown"); + nsAutoString theUnknownFilename(NS_LITERAL_STRING("unknown")); nsInputStream input(&aStream); @@ -1770,12 +1770,12 @@ nsresult nsParser::ParseFragment(const nsAReadableString& aSourceBuffer, PRUint32 theIndex = 0; while (theIndex++ < theCount){ - theContext.AppendWithConversion("<"); + theContext.Append(NS_LITERAL_STRING("<")); theContext.Append((PRUnichar*)aTagStack.ElementAt(theCount - theIndex)); - theContext.AppendWithConversion(">"); + theContext.Append(NS_LITERAL_STRING(">")); } - theContext.AppendWithConversion(""); //XXXHack! I'll make this better later. + theContext.Append(NS_LITERAL_STRING("")); //XXXHack! I'll make this better later. //now it's time to try to build the model from this fragment @@ -2494,12 +2494,12 @@ nsresult nsParser::OnStopRequest(nsIRequest *request, nsISupports* aContext, //What we'll do (for now at least) is construct a blank HTML document. if (!mParserContext->mMimeType.EqualsWithConversion(kPlainTextContentType)) { - temp.AssignWithConversion(""); + temp.Assign(NS_LITERAL_STRING("")); } // XXX: until bug #108067 has been fixed we must ensure that *something* // is in the scanner! so, for now just put in a single space. else { - temp.AssignWithConversion(" "); + temp.Assign(NS_LITERAL_STRING(" ")); } mParserContext->mScanner->Append(temp); result=ResumeParse(PR_TRUE,PR_TRUE); diff --git a/mozilla/parser/htmlparser/src/nsScanner.cpp b/mozilla/parser/htmlparser/src/nsScanner.cpp index 2ed2290bb7e..7bfba5edf04 100644 --- a/mozilla/parser/htmlparser/src/nsScanner.cpp +++ b/mozilla/parser/htmlparser/src/nsScanner.cpp @@ -205,7 +205,7 @@ nsresult nsScanner::SetDocumentCharset(const nsString& aCharset , nsCharsetSourc if(NS_FAILED(res) && (kCharsetUninitialized == mCharsetSource) ) { // failed - unknown alias , fallback to ISO-8859-1 - charsetName.AssignWithConversion("ISO-8859-1"); + charsetName.Assign(NS_LITERAL_STRING("ISO-8859-1")); } mCharset = charsetName; mCharsetSource = aSource; diff --git a/mozilla/parser/htmlparser/src/nsViewSourceHTML.cpp b/mozilla/parser/htmlparser/src/nsViewSourceHTML.cpp index c06ddd98d41..8d87cf32753 100644 --- a/mozilla/parser/htmlparser/src/nsViewSourceHTML.cpp +++ b/mozilla/parser/htmlparser/src/nsViewSourceHTML.cpp @@ -72,6 +72,7 @@ #include "nsHTMLTokenizer.h" #include "nsHTMLEntities.h" #include "nsIPref.h" +#include "nsUnicharUtils.h" #include "COtherDTD.h" #include "nsElementTable.h" @@ -643,9 +644,9 @@ nsresult CViewSourceHTML::GenerateSummary() { if(mErrorCount && mTagCount) { - mErrors.AppendWithConversion("\n\n "); + mErrors.Append(NS_LITERAL_STRING("\n\n ")); mErrors.AppendInt(mErrorCount); - mErrors.AppendWithConversion(" error(s) detected -- see highlighted portions.\n"); + mErrors.Append(NS_LITERAL_STRING(" error(s) detected -- see highlighted portions.\n")); result=WriteTag(mSummaryTag,mErrors,0,PR_FALSE); } @@ -1061,7 +1062,7 @@ void CViewSourceHTML::AddContainmentError(eHTMLTags aChildTag,eHTMLTags aParentT mErrors.AppendWithConversion(theMsg); } else if(gErrorThreshold+1==mErrorCount){ - mErrors.AppendWithConversion("\n -- Too many errors -- terminating output."); + mErrors.Append(NS_LITERAL_STRING("\n -- Too many errors -- terminating output.")); } } @@ -1218,10 +1219,10 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { nsAutoString theStr; theStr.Assign(aToken->GetStringValue()); - if(!theStr.EqualsWithConversion("XI",IGNORE_CASE)) { + if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) { PRUnichar theChar=theStr.CharAt(0); if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){ - theStr.InsertWithConversion("#", 0); + theStr.Assign(NS_LITERAL_STRING("#") + theStr); } } result=WriteTag(mEntityTag,theStr,0,PR_FALSE); diff --git a/mozilla/parser/htmlparser/tests/outsinks/Convert.cpp b/mozilla/parser/htmlparser/tests/outsinks/Convert.cpp index 7e8ba64b758..78073ac67b1 100644 --- a/mozilla/parser/htmlparser/tests/outsinks/Convert.cpp +++ b/mozilla/parser/htmlparser/tests/outsinks/Convert.cpp @@ -161,7 +161,7 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType, parser->SetContentSink(sink); nsCOMPtr dtd; - if (inType.EqualsWithConversion("text/html")) { + if (inType.Equals(NS_LITERAL_STRING("text/html"))) { static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); rv=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd)); } @@ -203,8 +203,8 @@ HTML2text(nsString& inString, nsString& inType, nsString& outType, int main(int argc, char** argv) { - nsString inType; inType.AssignWithConversion("text/html"); - nsString outType; outType.AssignWithConversion("text/plain"); + nsString inType(NS_LITERAL_STRING("text/html")); + nsString outType(NS_LITERAL_STRING("text/plain")); int wrapCol = 72; int flags = 0; nsString compareAgainst; diff --git a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp index c987d15e9b9..4e762347c99 100644 --- a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp @@ -1698,9 +1698,9 @@ Fix4xCookies(nsIFileSpec * profilePath) { /* generate the output buffer and write it to file */ outBuffer = prefix; - outBuffer.AppendWithConversion('\t'); + outBuffer.Append(PRUnichar('\t')); outBuffer.AppendWithConversion(dateString); - outBuffer.AppendWithConversion('\t'); + outBuffer.Append(PRUnichar('\t')); outBuffer.Append(suffix); PutCookieLine(outStream, outBuffer); } @@ -2281,7 +2281,7 @@ nsPrefConverter::GetPlatformCharset(nsAutoString& aCharset) rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, aCharset); } if (NS_FAILED(rv)) { - aCharset.AssignWithConversion("ISO-8859-1"); // use ISO-8859-1 in case of any error + aCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // use ISO-8859-1 in case of any error } return rv; diff --git a/mozilla/profile/src/nsProfileAccess.cpp b/mozilla/profile/src/nsProfileAccess.cpp index 68eac15d13e..f305da59e87 100644 --- a/mozilla/profile/src/nsProfileAccess.cpp +++ b/mozilla/profile/src/nsProfileAccess.cpp @@ -125,7 +125,7 @@ GetPlatformCharset(nsString& aCharset) rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, aCharset); } if (NS_FAILED(rv)) { - aCharset.AssignWithConversion("ISO-8859-1"); // use ISO-8859-1 in case of any error + aCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // use ISO-8859-1 in case of any error } return rv; } diff --git a/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp b/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp index 9c248e60f64..62a335da172 100644 --- a/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp +++ b/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp @@ -311,7 +311,7 @@ nsRDFXMLSerializer::SerializeInlineAssertion(nsIOutputStream* aStream, if (nameSpacePrefix.Length()) { attr.Append(nameSpacePrefix); - attr.AppendWithConversion(':'); + attr.Append(PRUnichar(':')); } attr.Append(property); @@ -353,7 +353,7 @@ nsRDFXMLSerializer::SerializeChildAssertion(nsIOutputStream* aStream, if (nameSpacePrefix.Length()) { tag.Append(nameSpacePrefix); - tag.AppendWithConversion(':'); + tag.Append(PRUnichar(':')); } tag.Append(property); diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index 760be31cd02..140f0f389b1 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -2071,15 +2071,15 @@ NS_IMETHODIMP nsChromeRegistry::InstallProvider(const nsCString& aProviderType, // Get the literal for our loc type. nsAutoString locstr; if (aUseProfile) - locstr.AssignWithConversion("profile"); - else locstr.AssignWithConversion("install"); + locstr.Assign(NS_LITERAL_STRING("profile")); + else locstr.Assign(NS_LITERAL_STRING("install")); nsCOMPtr locLiteral; rv = mRDFService->GetLiteral(locstr.get(), getter_AddRefs(locLiteral)); if (NS_FAILED(rv)) return rv; // Get the literal for our script access. nsAutoString scriptstr; - scriptstr.AssignWithConversion("false"); + scriptstr.Assign(NS_LITERAL_STRING("false")); nsCOMPtr scriptLiteral; rv = mRDFService->GetLiteral(scriptstr.get(), getter_AddRefs(scriptLiteral)); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/security/manager/ssl/src/nsKeygenHandler.cpp b/mozilla/security/manager/ssl/src/nsKeygenHandler.cpp index 5ebb4690cfd..abe8c3a88b5 100644 --- a/mozilla/security/manager/ssl/src/nsKeygenHandler.cpp +++ b/mozilla/security/manager/ssl/src/nsKeygenHandler.cpp @@ -379,8 +379,8 @@ nsKeygenFormProcessor::GetPublicKey(nsString& aValue, nsString& aChallenge, } // Set the keygen mechanism - rsaStr.AssignWithConversion("rsa"); - dsaStr.AssignWithConversion("dsa"); + rsaStr.Assign(NS_LITERAL_STRING("rsa")); + dsaStr.Assign(NS_LITERAL_STRING("dsa")); if (aKeyType.IsEmpty() || aKeyType.Equals(rsaStr)) { type = rsaKey; keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN; @@ -573,7 +573,7 @@ nsKeygenFormProcessor::ProcessValue(nsIDOMHTMLElement *aElement, res = selectElement->GetAttribute(NS_LITERAL_STRING("keytype"), keyTypeValue); if (NS_FAILED(res) || keyTypeValue.IsEmpty()) { // If this field is not present, we default to rsa. - keyTypeValue.AssignWithConversion("rsa"); + keyTypeValue.Assign(NS_LITERAL_STRING("rsa")); } res = selectElement->GetAttribute(NS_LITERAL_STRING("challenge"), challengeValue); rv = GetPublicKey(aValue, challengeValue, keyTypeValue, @@ -592,7 +592,7 @@ NS_METHOD nsKeygenFormProcessor::ProvideContent(const nsString& aFormType, nsString selectKey; SECKeySizeChoiceInfo *choice = SECKeySizeChoiceList; - selectKey.AssignWithConversion("SELECT"); + selectKey.Assign(NS_LITERAL_STRING("SELECT")); if (Compare(aFormType, NS_LITERAL_STRING("SELECT"), nsCaseInsensitiveStringComparator()) == 0) { for (SECKeySizeChoiceInfo* choice = SECKeySizeChoiceList; choice && choice->name; ++choice) { diff --git a/mozilla/security/manager/ssl/src/nsNSSCertificate.cpp b/mozilla/security/manager/ssl/src/nsNSSCertificate.cpp index 62615e6f2a8..eab7d57820d 100644 --- a/mozilla/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/mozilla/security/manager/ssl/src/nsNSSCertificate.cpp @@ -32,7 +32,7 @@ * may use your version of this file under either the MPL or the * GPL. * - * $Id: nsNSSCertificate.cpp,v 1.57 2001-12-13 01:17:49 javi%netscape.com Exp $ + * $Id: nsNSSCertificate.cpp,v 1.58 2001-12-16 11:41:09 jaggernaut%netscape.com Exp $ */ #include "prmem.h" @@ -1997,7 +1997,7 @@ nsNSSCertificate::GetPurposes(PRUint32 *_verified, rv = GetUsageArray(suffix, _verified, &tmpCount, tmpUsages); nsAutoString porpoises; for (PRUint32 i=0; i0) porpoises.AppendWithConversion(","); + if (i>0) porpoises.Append(NS_LITERAL_STRING(",")); porpoises.Append(tmpUsages[i]); nsMemory::Free(tmpUsages[i]); } diff --git a/mozilla/security/manager/ssl/src/nsPK11TokenDB.cpp b/mozilla/security/manager/ssl/src/nsPK11TokenDB.cpp index 9d1fe794071..68ac4c01516 100644 --- a/mozilla/security/manager/ssl/src/nsPK11TokenDB.cpp +++ b/mozilla/security/manager/ssl/src/nsPK11TokenDB.cpp @@ -58,11 +58,11 @@ nsPK11Token::nsPK11Token(PK11SlotInfo *slot) mTokenManID.Trim(" ", PR_FALSE, PR_TRUE); // Set the Hardware Version field mTokenHWVersion.AppendInt(tok_info.hardwareVersion.major); - mTokenHWVersion.AppendWithConversion("."); + mTokenHWVersion.Append(NS_LITERAL_STRING(".")); mTokenHWVersion.AppendInt(tok_info.hardwareVersion.minor); // Set the Firmware Version field mTokenFWVersion.AppendInt(tok_info.firmwareVersion.major); - mTokenFWVersion.AppendWithConversion("."); + mTokenFWVersion.Append(NS_LITERAL_STRING(".")); mTokenFWVersion.AppendInt(tok_info.firmwareVersion.minor); // Set the Serial Number field mTokenSerialNum.AssignWithConversion((char *)tok_info.serialNumber, diff --git a/mozilla/security/manager/ssl/src/nsPKCS11Slot.cpp b/mozilla/security/manager/ssl/src/nsPKCS11Slot.cpp index e14721ac8b9..45843efe3f0 100644 --- a/mozilla/security/manager/ssl/src/nsPKCS11Slot.cpp +++ b/mozilla/security/manager/ssl/src/nsPKCS11Slot.cpp @@ -67,11 +67,11 @@ nsPKCS11Slot::nsPKCS11Slot(PK11SlotInfo *slot) mSlotManID.Trim(" ", PR_FALSE, PR_TRUE); // Set the Hardware Version field mSlotHWVersion.AppendInt(slot_info.hardwareVersion.major); - mSlotHWVersion.AppendWithConversion("."); + mSlotHWVersion.Append(NS_LITERAL_STRING(".")); mSlotHWVersion.AppendInt(slot_info.hardwareVersion.minor); // Set the Firmware Version field mSlotFWVersion.AppendInt(slot_info.firmwareVersion.major); - mSlotFWVersion.AppendWithConversion("."); + mSlotFWVersion.Append(NS_LITERAL_STRING(".")); mSlotFWVersion.AppendInt(slot_info.firmwareVersion.minor); } diff --git a/mozilla/security/manager/ssl/src/nsPKCS12Blob.cpp b/mozilla/security/manager/ssl/src/nsPKCS12Blob.cpp index e6ff904b38f..28356c87e40 100644 --- a/mozilla/security/manager/ssl/src/nsPKCS12Blob.cpp +++ b/mozilla/security/manager/ssl/src/nsPKCS12Blob.cpp @@ -31,7 +31,7 @@ * may use your version of this file under either the MPL or the * GPL. * - * $Id: nsPKCS12Blob.cpp,v 1.20 2001-09-29 08:28:00 jaggernaut%netscape.com Exp $ + * $Id: nsPKCS12Blob.cpp,v 1.21 2001-12-16 11:44:44 jaggernaut%netscape.com Exp $ */ #include "prmem.h" @@ -362,7 +362,7 @@ nsPKCS12Blob::ExportToFile(nsILocalFile *file, // We're going to add the .p12 extension to the file name just like // Communicator used to. We create a new nsILocalFile and initialize // it with the new patch. - filePath.AppendWithConversion(".p12"); + filePath.Append(NS_LITERAL_STRING(".p12")); localFileRef = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); if (NS_FAILED(rv)) goto finish; localFileRef->InitWithUnicodePath(filePath.get()); diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 96fef0a114b..9e1721a5eef 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -851,9 +851,9 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) { PRIntn ix = aID - VIEWER_DEMO0; nsAutoString url; url.AssignWithConversion(SAMPLES_BASE_URL); - url.AppendWithConversion("/test"); + url.Append(NS_LITERAL_STRING("/test")); url.AppendInt(ix, 10); - url.AppendWithConversion(".html"); + url.Append(NS_LITERAL_STRING(".html")); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } @@ -862,7 +862,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) case VIEWER_XPTOOLKITTOOLBAR1: { nsAutoString url; url.AssignWithConversion(SAMPLES_BASE_URL); - url.AppendWithConversion("/toolbarTest1.xul"); + url.Append(NS_LITERAL_STRING("/toolbarTest1.xul")); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); break; @@ -870,7 +870,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) case VIEWER_XPTOOLKITTREE1: { nsAutoString url; url.AssignWithConversion(SAMPLES_BASE_URL); - url.AppendWithConversion("/treeTest1.xul"); + url.Append(NS_LITERAL_STRING("/treeTest1.xul")); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); break; @@ -991,7 +991,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) #ifndef HTMLDialogs if (aID == PRVCY_PREFILL) { - nsAutoString url; url.AssignWithConversion("file:///y|/htmldlgs.htm"); + nsAutoString url(NS_LITERAL_STRING("file:///y|/htmldlgs.htm")); nsBrowserWindow* bw = nsnull; mApp->OpenWindow(PRUint32(~0), bw); bw->SetVisibility(PR_TRUE); @@ -1320,7 +1320,7 @@ nsBrowserWindow::nsBrowserWindow() gTitleSuffix = GetTitleSuffix(); #endif if ( (gTitleSuffix = new nsString) != 0 ) - gTitleSuffix->AssignWithConversion(" - Raptor"); + gTitleSuffix->Assign(NS_LITERAL_STRING(" - Raptor")); } AddBrowser(this); } @@ -1602,7 +1602,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth) NS_CreateButton(mWindow,mBack,r,HandleBackEvent,&font); if (NS_OK == mBack->QueryInterface(kIWidgetIID,(void**)&widget)) { - nsAutoString back; back.AssignWithConversion("Back"); + nsAutoString back(NS_LITERAL_STRING("Back")); mBack->SetLabel(back); NS_RELEASE(widget); } @@ -1625,7 +1625,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth) widget->Create(mWindow.get(), r, HandleForwardEvent, NULL); widget->SetFont(font); widget->Show(PR_TRUE); - nsAutoString forward; forward.AssignWithConversion("Forward"); + nsAutoString forward(NS_LITERAL_STRING("Forward")); mForward->SetLabel(forward); NS_RELEASE(widget); } @@ -2098,12 +2098,12 @@ nsBrowserWindow::OnProgress(nsIRequest* request, nsISupports *ctxt, url.AssignWithConversion(str); nsCRT::free(str); } - url.AppendWithConversion(": progress "); + url.Append(NS_LITERAL_STRING(": progress ")); url.AppendInt(aProgress, 10); if (0 != aProgressMax) { - url.AppendWithConversion(" (out of "); + url.Append(NS_LITERAL_STRING(" (out of ")); url.AppendInt(aProgressMax, 10); - url.AppendWithConversion(")"); + url.Append(NS_LITERAL_STRING(")")); } PRUint32 size; mStatus->SetText(url,size); @@ -2224,9 +2224,9 @@ void nsBrowserWindow::DoPrintSetup() //return; } - nsString printHTML; printHTML.AssignWithConversion("resource:/res/samples/printsetup.html"); + nsString printHTML(NS_LITERAL_STRING("resource:/res/samples/printsetup.html")); nsRect rect(0, 0, 375, 510); - nsString title; title.AssignWithConversion("Print Setup"); + nsString title(NS_LITERAL_STRING("Print Setup")); nsXPBaseWindow * dialog = nsnull; nsresult rv = nsComponentManager::CreateInstance(kXPBaseWindowCID, nsnull, @@ -2254,8 +2254,8 @@ void nsBrowserWindow::DoPrintSetup() mPrintSetupInfo.mDocTitle = PR_TRUE; mPrintSetupInfo.mDocLocation = PR_TRUE; - mPrintSetupInfo.mHeaderText.AssignWithConversion("Header Text"); - mPrintSetupInfo.mFooterText.AssignWithConversion("Footer Text"); + mPrintSetupInfo.mHeaderText.Assign(NS_LITERAL_STRING("Header Text")); + mPrintSetupInfo.mFooterText.Assign(NS_LITERAL_STRING("Footer Text")); mPrintSetupInfo.mPageNum = PR_TRUE; mPrintSetupInfo.mPageTotal = PR_TRUE; @@ -2307,9 +2307,9 @@ void nsBrowserWindow::DoTableInspector() nsIDOMDocument* domDoc = GetDOMDocument(mDocShell); if (nsnull != domDoc) { - nsString printHTML; printHTML.AssignWithConversion("resource:/res/samples/printsetup.html"); + nsString printHTML(NS_LITERAL_STRING("resource:/res/samples/printsetup.html")); nsRect rect(0, 0, 375, 510); - nsString title; title.AssignWithConversion("Table Inspector"); + nsString title(NS_LITERAL_STRING("Table Inspector")); nsXPBaseWindow * xpWin = nsnull; nsresult rv = nsComponentManager::CreateInstance(kXPBaseWindowCID, nsnull, @@ -2340,9 +2340,9 @@ void nsBrowserWindow::DoImageInspector() nsIDOMDocument* domDoc = GetDOMDocument(mDocShell); if (nsnull != domDoc) { - nsString printHTML; printHTML.AssignWithConversion("resource:/res/samples/image_props.html"); + nsString printHTML(NS_LITERAL_STRING("resource:/res/samples/image_props.html")); nsRect rect(0, 0, 485, 124); - nsString title; title.AssignWithConversion("Image Inspector"); + nsString title(NS_LITERAL_STRING("Image Inspector")); nsXPBaseWindow * xpWin = nsnull; nsresult rv = nsComponentManager::CreateInstance(kXPBaseWindowCID, nsnull, kIXPBaseWindowIID, (void**) &xpWin); diff --git a/mozilla/webshell/tests/viewer/nsEditorMode.cpp b/mozilla/webshell/tests/viewer/nsEditorMode.cpp index cccba0f82f9..5048b881ca0 100644 --- a/mozilla/webshell/tests/viewer/nsEditorMode.cpp +++ b/mozilla/webshell/tests/viewer/nsEditorMode.cpp @@ -118,13 +118,13 @@ static nsresult PrintEditorOutput(nsIEditor* editor, PRInt32 aCommandID) switch (aCommandID) { case VIEWER_DISPLAYTEXT: - formatString.AssignWithConversion("text/plain"); + formatString.Assign(NS_LITERAL_STRING("text/plain")); flags = nsIDocumentEncoder::OutputFormatted; editor->OutputToString(outString, formatString, flags); break; case VIEWER_DISPLAYHTML: - formatString.AssignWithConversion("text/html"); + formatString.Assign(NS_LITERAL_STRING("text/html")); editor->OutputToString(outString, formatString, flags); break; } diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.cpp b/mozilla/webshell/tests/viewer/nsViewerApp.cpp index bd5f2b25430..bd99faab7df 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.cpp +++ b/mozilla/webshell/tests/viewer/nsViewerApp.cpp @@ -650,7 +650,7 @@ nsViewerApp::ProcessArguments(int argc, char** argv) mStartURL.AssignWithConversion(argv[i]); #if defined(XP_UNIX) || defined(XP_BEOS) if (argv[i][0] == '/') { - mStartURL.InsertWithConversion("file:", 0); + mStartURL.Assign(NS_LITERAL_STRING("file:") + mStartURL); } #endif } @@ -1422,9 +1422,9 @@ PRBool CreateSiteDialog(nsIWidget * aParent) //mSiteDialog->SetLabel("Top 100 Site Walker"); } //mSiteDialog->SetClientData(this); - nsAutoString titleStr; titleStr.AssignWithConversion("Top "); + nsAutoString titleStr(NS_LITERAL_STRING("Top ")); titleStr.AppendInt(gTop100LastPointer); - titleStr.AppendWithConversion(" Sites"); + titleStr.Append(NS_LITERAL_STRING(" Sites")); mSiteDialog->SetTitle(titleStr); nscoord w = 65; diff --git a/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp b/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp index cd72c0d00ab..3d7f3a3cd1b 100644 --- a/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp +++ b/mozilla/webshell/tests/viewer/nsWebBrowserChrome.cpp @@ -354,7 +354,7 @@ NS_IMETHODIMP nsWebBrowserChrome::SetTitle(const PRUnichar* aTitle) nsAutoString newTitle(aTitle); - newTitle.AppendWithConversion(" - Raptor"); + newTitle.Append(NS_LITERAL_STRING(" - Raptor")); mBrowserWindow->SetTitle(newTitle.get()); return NS_OK; @@ -378,15 +378,15 @@ nsWebBrowserChrome::OnProgressChange(nsIWebProgress* aProgress, nsAutoString buf; PRUint32 size; - buf.AppendWithConversion("Loaded "); + buf.Append(NS_LITERAL_STRING("Loaded ")); buf.AppendInt(mCurrent); - buf.AppendWithConversion(" of "); + buf.Append(NS_LITERAL_STRING(" of ")); buf.AppendInt(mTotal); - buf.AppendWithConversion(" items. ("); + buf.Append(NS_LITERAL_STRING(" items. (")); buf.AppendInt(mProgress); - buf.AppendWithConversion(" bytes of "); + buf.Append(NS_LITERAL_STRING(" bytes of ")); buf.AppendInt(mMaxProgress); - buf.AppendWithConversion(" bytes)"); + buf.Append(NS_LITERAL_STRING(" bytes)")); mBrowserWindow->mStatus->SetText(buf,size); } @@ -417,15 +417,15 @@ nsWebBrowserChrome::OnStateChange(nsIWebProgress* aProgress, nsAutoString buf; PRUint32 size; - buf.AppendWithConversion("Loaded "); + buf.Append(NS_LITERAL_STRING("Loaded ")); buf.AppendInt(mCurrent); - buf.AppendWithConversion(" of "); + buf.Append(NS_LITERAL_STRING(" of ")); buf.AppendInt(mTotal); - buf.AppendWithConversion(" items. ("); + buf.Append(NS_LITERAL_STRING(" items. (")); buf.AppendInt(mProgress); - buf.AppendWithConversion(" bytes of "); + buf.Append(NS_LITERAL_STRING(" bytes of ")); buf.AppendInt(mMaxProgress); - buf.AppendWithConversion(" bytes)"); + buf.Append(NS_LITERAL_STRING(" bytes)")); mBrowserWindow->mStatus->SetText(buf,size); } @@ -556,7 +556,7 @@ mCurrent=mTotal=mProgress=mMaxProgress=0; uri->GetSpec(getter_Copies(uriString)); nsAutoString url; url.AssignWithConversion(uriString); - url.AppendWithConversion(": start"); + url.Append(NS_LITERAL_STRING(": start")); PRUint32 size; mBrowserWindow->mStatus->SetText(url,size); } @@ -608,7 +608,7 @@ void nsWebBrowserChrome::OnLoadFinished(nsIRequest* aRequest, { // PRUint32 size; - msg.AppendWithConversion(" done."); + msg.Append(NS_LITERAL_STRING(" done.")); /// mBrowserWindow->mStatus->SetText(msg, size); } @@ -629,7 +629,7 @@ void nsWebBrowserChrome::OnStatusConnecting(nsIChannel* aChannel) uri->GetSpec(getter_Copies(uriString)); } - nsAutoString msg; msg.AssignWithConversion("Connecting to "); + nsAutoString msg(NS_LITERAL_STRING("Connecting to ")); msg.AppendWithConversion(uriString); PRUint32 size; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index ae5aa4910e0..1439535b6a7 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -938,7 +938,7 @@ OpenRegressionFile(const nsString& aBaseName, const nsString& aOutputName) { nsAutoString a; a.Append(aBaseName); - a.AppendWithConversion("/"); + a.Append(NS_LITERAL_STRING("/")); a.Append(aOutputName); char* fn = ToNewCString(a); FILE* fp = fopen(fn, "r"); diff --git a/mozilla/webshell/tests/viewer/windows/nsTextWidget.cpp b/mozilla/webshell/tests/viewer/windows/nsTextWidget.cpp index d79ce86de87..22aea2ac9d4 100644 --- a/mozilla/webshell/tests/viewer/windows/nsTextWidget.cpp +++ b/mozilla/webshell/tests/viewer/windows/nsTextWidget.cpp @@ -315,7 +315,7 @@ NS_METHOD nsTextWidget::Paint(nsIRenderingContext& aRenderingContext, nsString astricks; PRUint32 i; for (i=0;iGetElementById(keyValue, getter_AddRefs(keyElement)); if ( keyElement ) { nsCOMPtr keyContent ( do_QueryInterface(keyElement) ); - nsAutoString keyChar; keyChar.AssignWithConversion(" "); + nsAutoString keyChar(NS_LITERAL_STRING(" ")); keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyChar); if(keyChar != NS_LITERAL_STRING(" ")) pnsMenuItem->SetShortcutChar(keyChar); diff --git a/mozilla/widget/src/gtk/nsClipboard.cpp b/mozilla/widget/src/gtk/nsClipboard.cpp index 1aa36068fd2..872cfd50fb3 100644 --- a/mozilla/widget/src/gtk/nsClipboard.cpp +++ b/mozilla/widget/src/gtk/nsClipboard.cpp @@ -616,7 +616,7 @@ nsClipboard::SelectionReceiver (GtkWidget *aWidget, if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_Menu, platformCharset); if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // get the decoder nsCOMPtr ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv); @@ -660,7 +660,7 @@ nsClipboard::SelectionReceiver (GtkWidget *aWidget, nsCOMPtr decoder; // get the charset nsAutoString platformCharset; - platformCharset.AssignWithConversion("UTF-8"); + platformCharset.Assign(NS_LITERAL_STRING("UTF-8")); // get the decoder nsCOMPtr ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv); @@ -937,7 +937,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_Menu, platformCharset); if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // get the encoder nsCOMPtr ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv); diff --git a/mozilla/widget/src/gtk/nsGtkIMEHelper.cpp b/mozilla/widget/src/gtk/nsGtkIMEHelper.cpp index aafddfd3ada..c660578ea31 100644 --- a/mozilla/widget/src/gtk/nsGtkIMEHelper.cpp +++ b/mozilla/widget/src/gtk/nsGtkIMEHelper.cpp @@ -115,10 +115,10 @@ void nsGtkIMEHelper::SetupUnicodeDecoder() do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &result); if (platform && NS_SUCCEEDED(result)) { nsAutoString charset; - charset.AssignWithConversion(""); + charset.Assign(NS_LITERAL_STRING("")); result = platform->GetCharset(kPlatformCharsetSel_Menu, charset); if (NS_FAILED(result) || (charset.Length() == 0)) { - charset.AssignWithConversion("ISO-8859-1"); // default + charset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // default } nsICharsetConverterManager* manager = nsnull; nsresult res = nsServiceManager:: diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index e2696c90a63..a11b3a3fd8c 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -2261,7 +2261,7 @@ NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle) // This is broken, it's just a random guess if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // get the encoder nsCOMPtr ccm = diff --git a/mozilla/widget/src/mac/nsMacControl.cpp b/mozilla/widget/src/mac/nsMacControl.cpp index 3e374f601a1..404e3b81a3e 100644 --- a/mozilla/widget/src/mac/nsMacControl.cpp +++ b/mozilla/widget/src/mac/nsMacControl.cpp @@ -630,7 +630,7 @@ void nsMacControl::GetFileSystemCharset(nsString & fileSystemCharset) NS_ASSERTION(NS_SUCCEEDED(rv), "error getting platform charset"); if (NS_FAILED(rv)) - aCharset.AssignWithConversion("x-mac-roman"); + aCharset.Assign(NS_LITERAL_STRING("x-mac-roman")); } fileSystemCharset = aCharset; } diff --git a/mozilla/widget/src/mac/nsMacEventHandler.cpp b/mozilla/widget/src/mac/nsMacEventHandler.cpp index 64a37b27a72..5be927fd6d0 100644 --- a/mozilla/widget/src/mac/nsMacEventHandler.cpp +++ b/mozilla/widget/src/mac/nsMacEventHandler.cpp @@ -2319,7 +2319,7 @@ nsresult nsMacEventHandler::UnicodeHandleUpdateInputArea(PRUnichar* text, long c // This is needed when we input some uncommitted text, and then delete all of them // When the last delete come, we will got a text_size = 0 and fixedLength = 0 // In that case, we need to send a text event to clean up the input hole.... - mIMECompositionStr->AssignWithConversion(""); + mIMECompositionStr->Assign(NS_LITERAL_STRING("")); #ifdef DEBUG_TSM printf("3.====================================\n"); #endif diff --git a/mozilla/widget/src/mac/nsMenu.cpp b/mozilla/widget/src/mac/nsMenu.cpp index bf7bcb7ab41..66208046c65 100644 --- a/mozilla/widget/src/mac/nsMenu.cpp +++ b/mozilla/widget/src/mac/nsMenu.cpp @@ -344,7 +344,7 @@ NS_METHOD nsMenu::AddMenuItem(nsIMenuItem * aMenuItem) MenuHelpers::SetMenuItemText(mMacMenuHandle, currItemIndex, label, mUnicodeTextRunConverter); // I want to be internationalized too! - nsAutoString keyEquivalent; keyEquivalent.AssignWithConversion(" "); + nsAutoString keyEquivalent(NS_LITERAL_STRING(" ")); aMenuItem->GetShortcutChar(keyEquivalent); if(keyEquivalent != NS_LITERAL_STRING(" ")) { keyEquivalent.ToUpperCase(); @@ -1077,7 +1077,7 @@ nsMenu::LoadMenuItem( nsIMenu* inParentMenu, nsIContent* inMenuItemContent ) xulDocument->GetElementById(keyValue, getter_AddRefs(keyElement)); if ( keyElement ) { nsCOMPtr keyContent ( do_QueryInterface(keyElement) ); - nsAutoString keyChar; keyChar.AssignWithConversion(" "); + nsAutoString keyChar(NS_LITERAL_STRING(" ")); keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyChar); if(keyChar != NS_LITERAL_STRING(" ")) pnsMenuItem->SetShortcutChar(keyChar); diff --git a/mozilla/widget/src/mac/nsMenuItem.cpp b/mozilla/widget/src/mac/nsMenuItem.cpp index b0ae9e76729..759c346ba69 100644 --- a/mozilla/widget/src/mac/nsMenuItem.cpp +++ b/mozilla/widget/src/mac/nsMenuItem.cpp @@ -72,7 +72,7 @@ nsMenuItem::nsMenuItem() NS_INIT_REFCNT(); mMenuParent = nsnull; mIsSeparator = PR_FALSE; - mKeyEquivalent.AssignWithConversion(" "); + mKeyEquivalent.Assign(NS_LITERAL_STRING(" ")); mEnabled = PR_TRUE; mIsChecked = PR_FALSE; mMenuType = eRegular; diff --git a/mozilla/widget/src/mac/nsMenuItemX.cpp b/mozilla/widget/src/mac/nsMenuItemX.cpp index a07691af1f5..384c94d5425 100644 --- a/mozilla/widget/src/mac/nsMenuItemX.cpp +++ b/mozilla/widget/src/mac/nsMenuItemX.cpp @@ -71,7 +71,7 @@ nsMenuItemX::nsMenuItemX() NS_INIT_REFCNT(); mMenuParent = nsnull; mIsSeparator = PR_FALSE; - mKeyEquivalent.AssignWithConversion(" "); + mKeyEquivalent.Assign(NS_LITERAL_STRING(" ")); mEnabled = PR_TRUE; mIsChecked = PR_FALSE; mMenuType = eRegular; diff --git a/mozilla/widget/src/mac/nsMenuX.cpp b/mozilla/widget/src/mac/nsMenuX.cpp index bf522ea11b8..f989895e993 100644 --- a/mozilla/widget/src/mac/nsMenuX.cpp +++ b/mozilla/widget/src/mac/nsMenuX.cpp @@ -891,7 +891,7 @@ void nsMenuX::LoadMenuItem( nsIMenu* inParentMenu, nsIContent* inMenuItemContent xulDocument->GetElementById(keyValue, getter_AddRefs(keyElement)); if ( keyElement ) { nsCOMPtr keyContent ( do_QueryInterface(keyElement) ); - nsAutoString keyChar; keyChar.AssignWithConversion(" "); + nsAutoString keyChar(NS_LITERAL_STRING(" ")); keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyChar); if(keyChar != NS_LITERAL_STRING(" ")) pnsMenuItem->SetShortcutChar(keyChar); diff --git a/mozilla/widget/src/os2/nsFilePicker.cpp b/mozilla/widget/src/os2/nsFilePicker.cpp index b0af0fbfe5a..d4c390d91d7 100644 --- a/mozilla/widget/src/os2/nsFilePicker.cpp +++ b/mozilla/widget/src/os2/nsFilePicker.cpp @@ -310,7 +310,7 @@ void nsFilePicker::GetFileSystemCharset(nsString & fileSystemCharset) NS_ASSERTION(NS_SUCCEEDED(rv), "error getting platform charset"); if (NS_FAILED(rv)) - aCharset.AssignWithConversion("windows-1252"); + aCharset.Assign(NS_LITERAL_STRING("windows-1252")); } fileSystemCharset = aCharset; } @@ -397,9 +397,9 @@ NS_IMETHODIMP nsFilePicker::AppendFilter(const PRUnichar *aTitle, const PRUnichar *aFilter) { mFilterList.Append(aTitle); - mFilterList.AppendWithConversion('\0'); + mFilterList.Append(PRUnichar('\0')); mFilterList.Append(aFilter); - mFilterList.AppendWithConversion('\0'); + mFilterList.Append(PRUnichar('\0')); return NS_OK; } diff --git a/mozilla/widget/src/photon/nsWidget.cpp b/mozilla/widget/src/photon/nsWidget.cpp index 19e739f99f9..fedc8c2ba5a 100644 --- a/mozilla/widget/src/photon/nsWidget.cpp +++ b/mozilla/widget/src/photon/nsWidget.cpp @@ -2114,7 +2114,7 @@ nsAutoString nsWidget::GuiEventToString(nsGUIEvent * aGuiEvent) { NS_ASSERTION(nsnull != aGuiEvent,"cmon, null gui event."); - nsAutoString eventName; eventName.AssignWithConversion("UNKNOWN"); + nsAutoString eventName(NS_LITERAL_STRING("UNKNOWN")); #define _ASSIGN_eventName(_value,_name)\ case _value: eventName = (const PRUnichar *) _name ; break @@ -2200,7 +2200,7 @@ nsAutoString nsWidget::PhotonEventToString(PhEvent_t * aPhEvent) { NS_ASSERTION(nsnull != aPhEvent,"cmon, null photon gui event."); - nsAutoString eventName; eventName.AssignWithConversion("UNKNOWN"); + nsAutoString eventName(NS_LITERAL_STRING("UNKNOWN")); #define _ASSIGN_eventName(_value,_name)\ case _value: eventName = (const PRUnichar *) _name ; break diff --git a/mozilla/widget/src/windows/nsFilePicker.cpp b/mozilla/widget/src/windows/nsFilePicker.cpp index 63543b9f611..62157ea1047 100644 --- a/mozilla/widget/src/windows/nsFilePicker.cpp +++ b/mozilla/widget/src/windows/nsFilePicker.cpp @@ -378,7 +378,7 @@ void nsFilePicker::GetFileSystemCharset(nsString & fileSystemCharset) NS_ASSERTION(NS_SUCCEEDED(rv), "error getting platform charset"); if (NS_FAILED(rv)) - aCharset.AssignWithConversion("windows-1252"); + aCharset.Assign(NS_LITERAL_STRING("windows-1252")); } fileSystemCharset = aCharset; } @@ -465,9 +465,9 @@ NS_IMETHODIMP nsFilePicker::AppendFilter(const PRUnichar *aTitle, const PRUnichar *aFilter) { mFilterList.Append(aTitle); - mFilterList.AppendWithConversion('\0'); + mFilterList.Append(PRUnichar('\0')); mFilterList.Append(aFilter); - mFilterList.AppendWithConversion('\0'); + mFilterList.Append(PRUnichar('\0')); return NS_OK; } diff --git a/mozilla/widget/src/xlib/nsButton.cpp b/mozilla/widget/src/xlib/nsButton.cpp index 5a01900bfae..3dafbcd17cc 100644 --- a/mozilla/widget/src/xlib/nsButton.cpp +++ b/mozilla/widget/src/xlib/nsButton.cpp @@ -43,7 +43,7 @@ NS_IMPL_RELEASE(nsButton) nsButton::nsButton() : nsWidget() , nsIButton() { NS_INIT_REFCNT(); - mName.AssignWithConversion("nsButton"); + mName.Assign(NS_LITERAL_STRING("nsButton")); } nsButton::~nsButton() diff --git a/mozilla/widget/src/xlib/nsTextWidget.cpp b/mozilla/widget/src/xlib/nsTextWidget.cpp index 84809f8f7a1..881ee0cd598 100644 --- a/mozilla/widget/src/xlib/nsTextWidget.cpp +++ b/mozilla/widget/src/xlib/nsTextWidget.cpp @@ -43,7 +43,7 @@ NS_IMPL_RELEASE(nsTextWidget) nsTextWidget::nsTextWidget() : nsTextHelper() { NS_INIT_REFCNT(); - mName.AssignWithConversion("nsTextWidget"); + mName.Assign(NS_LITERAL_STRING("nsTextWidget")); } nsTextWidget::~nsTextWidget() diff --git a/mozilla/widget/src/xlib/nsWidget.cpp b/mozilla/widget/src/xlib/nsWidget.cpp index 0e13cfc81db..64e50752967 100644 --- a/mozilla/widget/src/xlib/nsWidget.cpp +++ b/mozilla/widget/src/xlib/nsWidget.cpp @@ -132,7 +132,7 @@ nsWidget::nsWidget() // : nsBaseWidget() mBackground = NS_RGB(192, 192, 192); mBorderPixel = xxlib_rgb_xpixel_from_rgb(mXlibRgbHandle, mBorderRGB); mParentWidget = nsnull; - mName.AssignWithConversion("unnamed"); + mName.Assign(NS_LITERAL_STRING("unnamed")); mIsShown = PR_FALSE; mIsToplevel = PR_FALSE; mVisibility = VisibilityFullyObscured; // this is an X constant. diff --git a/mozilla/widget/src/xlib/nsWindow.cpp b/mozilla/widget/src/xlib/nsWindow.cpp index f0ad4dddc24..01a8f4c3454 100644 --- a/mozilla/widget/src/xlib/nsWindow.cpp +++ b/mozilla/widget/src/xlib/nsWindow.cpp @@ -207,7 +207,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsWidget) nsWindow::nsWindow() : nsWidget() { NS_INIT_REFCNT(); - mName.AssignWithConversion("nsWindow"); + mName.Assign(NS_LITERAL_STRING("nsWindow")); mBackground = NS_RGB(255, 255, 255); mBackgroundPixel = xxlib_rgb_xpixel_from_rgb(mXlibRgbHandle, mBackground); mBorderRGB = NS_RGB(255,255,255); @@ -802,7 +802,7 @@ NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_Menu, platformCharset); if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); /* get the encoder */ nsCOMPtr ccm = @@ -853,7 +853,7 @@ NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle) ChildWindow::ChildWindow(): nsWindow() { - mName.AssignWithConversion("nsChildWindow"); + mName.Assign(NS_LITERAL_STRING("nsChildWindow")); } diff --git a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp index d1166d043ec..12a95232cbb 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp @@ -811,7 +811,7 @@ nsBaseWidget::debug_GuiEventToString(nsGUIEvent * aGuiEvent) { NS_ASSERTION(nsnull != aGuiEvent,"cmon, null gui event."); - nsAutoString eventName; eventName.AssignWithConversion("UNKNOWN"); + nsAutoString eventName(NS_LITERAL_STRING("UNKNOWN")); #define _ASSIGN_eventName(_value,_name)\ case _value: eventName.AssignWithConversion(_name) ; break diff --git a/mozilla/widget/src/xpwidgets/nsHTMLFormatConverter.cpp b/mozilla/widget/src/xpwidgets/nsHTMLFormatConverter.cpp index 858ac796774..dfae726d041 100644 --- a/mozilla/widget/src/xpwidgets/nsHTMLFormatConverter.cpp +++ b/mozilla/widget/src/xpwidgets/nsHTMLFormatConverter.cpp @@ -330,9 +330,9 @@ NS_IMETHODIMP nsHTMLFormatConverter::ConvertFromHTMLToAOLMail(const nsAutoString & aFromStr, nsAutoString & aToStr) { - aToStr.AssignWithConversion(""); + aToStr.Assign(NS_LITERAL_STRING("")); aToStr.Append(aFromStr); - aToStr.AppendWithConversion(""); + aToStr.Append(NS_LITERAL_STRING("")); return NS_OK; } diff --git a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index 757cec8d305..8a82a157479 100644 --- a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -148,7 +148,7 @@ nsPrimitiveHelpers :: ConvertUnicodeToPlatformPlainText ( PRUnichar* inUnicode, if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset); if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // use transliterate to convert things like smart quotes to normal quotes for plain text nsCAutoString cPlatformCharset; @@ -195,7 +195,7 @@ nsPrimitiveHelpers :: ConvertPlatformPlainTextToUnicode ( const char* inText, PR if (NS_SUCCEEDED(rv)) rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset); if (NS_FAILED(rv)) - platformCharset.AssignWithConversion("ISO-8859-1"); + platformCharset.Assign(NS_LITERAL_STRING("ISO-8859-1")); // get the decoder nsCOMPtr ccm = diff --git a/mozilla/xpcom/ds/nsPersistentProperties.cpp b/mozilla/xpcom/ds/nsPersistentProperties.cpp index bd73a618427..6fad960e149 100644 --- a/mozilla/xpcom/ds/nsPersistentProperties.cpp +++ b/mozilla/xpcom/ds/nsPersistentProperties.cpp @@ -161,13 +161,13 @@ nsPersistentProperties::Load(nsIInputStream *aIn) uchar=0; break; case 't': - value.AppendWithConversion('\t'); + value.Append(PRUnichar('\t')); break; case 'n': - value.AppendWithConversion('\n'); + value.Append(PRUnichar('\n')); break; case 'r': - value.AppendWithConversion('\r'); + value.Append(PRUnichar('\r')); break; default: value.Append((PRUnichar) c); diff --git a/mozilla/xpcom/ds/nsTextFormatter.cpp b/mozilla/xpcom/ds/nsTextFormatter.cpp index 099e282f617..4083d8f881a 100644 --- a/mozilla/xpcom/ds/nsTextFormatter.cpp +++ b/mozilla/xpcom/ds/nsTextFormatter.cpp @@ -647,7 +647,7 @@ static int cvt_S(SprintfState *ss, const PRUnichar *s, int width, /* and away we go */ nsAutoString nullstr; - nullstr.AssignWithConversion("(null)"); + nullstr.Assign(NS_LITERAL_STRING("(null)")); return fill2(ss, s ? s : nullstr.get(), slen, width, flags); } @@ -968,10 +968,10 @@ static int dosprintf(SprintfState *ss, const PRUnichar *fmt, va_list ap) const PRUnichar *fmt0; nsAutoString hex; - hex.AssignWithConversion("0123456789abcdef"); + hex.Assign(NS_LITERAL_STRING("0123456789abcdef")); nsAutoString HEX; - HEX.AssignWithConversion("0123456789ABCDEF"); + HEX.Assign(NS_LITERAL_STRING("0123456789ABCDEF")); const PRUnichar *hexp; int rv, i; @@ -1518,8 +1518,7 @@ PRUnichar * nsTextFormatter::vsprintf_append(PRUnichar *last, const PRUnichar *f PRBool nsTextFormatter::SelfTest() { PRBool passed = PR_TRUE ; - nsAutoString fmt; - fmt.AssignWithConversion("%3$s %4$S %1$d %2$d"); + nsAutoString fmt(NS_LITERAL_STRING("%3$s %4$S %1$d %2$d")); char utf8[] = "Hello"; PRUnichar ucs2[]={'W', 'o', 'r', 'l', 'd', 0x4e00, 0xAc00, 0xFF45, 0x0103}; diff --git a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp index 58c52f368b3..aed3a697b23 100644 --- a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -235,7 +235,7 @@ nsContentTreeOwner::SetPersistence(PRBool aPersistPosition, persistString.Cut(index, 7); saveString = PR_TRUE; } else if (aPersistPosition && index < 0) { - persistString.AppendWithConversion(" screenX"); + persistString.Append(NS_LITERAL_STRING(" screenX")); saveString = PR_TRUE; } // Set Y @@ -244,7 +244,7 @@ nsContentTreeOwner::SetPersistence(PRBool aPersistPosition, persistString.Cut(index, 7); saveString = PR_TRUE; } else if (aPersistPosition && index < 0) { - persistString.AppendWithConversion(" screenY"); + persistString.Append(NS_LITERAL_STRING(" screenY")); saveString = PR_TRUE; } // Set CX @@ -253,7 +253,7 @@ nsContentTreeOwner::SetPersistence(PRBool aPersistPosition, persistString.Cut(index, 5); saveString = PR_TRUE; } else if (aPersistSize && index < 0) { - persistString.AppendWithConversion(" width"); + persistString.Append(NS_LITERAL_STRING(" width")); saveString = PR_TRUE; } // Set CY @@ -262,7 +262,7 @@ nsContentTreeOwner::SetPersistence(PRBool aPersistPosition, persistString.Cut(index, 6); saveString = PR_TRUE; } else if (aPersistSize && index < 0) { - persistString.AppendWithConversion(" height"); + persistString.Append(NS_LITERAL_STRING(" height")); saveString = PR_TRUE; } // Set SizeMode @@ -271,7 +271,7 @@ nsContentTreeOwner::SetPersistence(PRBool aPersistPosition, persistString.Cut(index, 8); saveString = PR_TRUE; } else if (aPersistSizeMode && (index < 0)) { - persistString.AppendWithConversion(" sizemode"); + persistString.Append(NS_LITERAL_STRING(" sizemode")); saveString = PR_TRUE; } @@ -319,7 +319,7 @@ NS_IMETHODIMP nsContentTreeOwner::SetStatus(PRUint32 aStatusType, const PRUnicha return NS_OK; nsCOMPtr xpConnectObj; - nsAutoString xulBrowserWinId; xulBrowserWinId.AssignWithConversion("XULBrowserWindow"); + nsAutoString xulBrowserWinId(NS_LITERAL_STRING("XULBrowserWindow")); piDOMWindow->GetObjectProperty(xulBrowserWinId.get(), getter_AddRefs(xpConnectObj)); nsCOMPtr xulBrowserWindow(do_QueryInterface(xpConnectObj)); @@ -646,7 +646,7 @@ void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow) if(docShellElement) { docShellElement->GetAttribute(NS_LITERAL_STRING("contenttitlesetting"), contentTitleSetting); - if(contentTitleSetting.EqualsWithConversion("true")) + if(contentTitleSetting.Equals(NS_LITERAL_STRING("true"))) { mContentTitleSetting = PR_TRUE; docShellElement->GetAttribute(NS_LITERAL_STRING("titlemodifier"), mWindowTitleModifier); diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index afe8084d7d8..28a68671326 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -633,7 +633,7 @@ NS_IMETHODIMP nsWebShellWindow::CreateMenu(nsIMenuBar * aMenuBar, if (menuPopupElement) { nsString menuPopupNodeType; menuPopupElement->GetNodeName(menuPopupNodeType); - if (menuPopupNodeType.EqualsWithConversion("menupopup")) + if (menuPopupNodeType.Equals(NS_LITERAL_STRING("menupopup"))) break; } nsCOMPtr oldMenuPopupNode(menuPopupNode); @@ -652,12 +652,12 @@ NS_IMETHODIMP nsWebShellWindow::CreateMenu(nsIMenuBar * aMenuBar, nsString menuitemNodeType; nsString menuitemName; menuitemElement->GetNodeName(menuitemNodeType); - if (menuitemNodeType.EqualsWithConversion("menuitem")) { + if (menuitemNodeType.Equals(NS_LITERAL_STRING("menuitem"))) { // LoadMenuItem LoadMenuItem(pnsMenu, menuitemElement, menuitemNode); - } else if (menuitemNodeType.EqualsWithConversion("menuseparator")) { + } else if (menuitemNodeType.Equals(NS_LITERAL_STRING("menuseparator"))) { pnsMenu->AddSeparator(); - } else if (menuitemNodeType.EqualsWithConversion("menu")) { + } else if (menuitemNodeType.Equals(NS_LITERAL_STRING("menu"))) { // Load a submenu LoadSubMenu(pnsMenu, menuitemElement, menuitemNode); } @@ -701,7 +701,7 @@ NS_IMETHODIMP nsWebShellWindow::LoadMenuItem( //pnsMenuItem->SetLabel(menuitemName); // Set key shortcut and modifiers - nsAutoString keyAtom; keyAtom.AssignWithConversion("key"); + nsAutoString keyAtom(NS_LITERAL_STRING("key")); nsString keyValue; domElement->GetAttribute(keyAtom, keyValue); @@ -725,29 +725,29 @@ NS_IMETHODIMP nsWebShellWindow::LoadMenuItem( if(keyElement){ PRUint8 modifiers = knsMenuItemNoModifier; - nsAutoString shiftAtom; shiftAtom.AssignWithConversion("shift"); - nsAutoString altAtom; altAtom.AssignWithConversion("alt"); - nsAutoString commandAtom; commandAtom.AssignWithConversion("command"); + nsAutoString shiftAtom(NS_LITERAL_STRING("shift")); + nsAutoString altAtom(NS_LITERAL_STRING("alt")); + nsAutoString commandAtom(NS_LITERAL_STRING("command")); nsString shiftValue; nsString altValue; nsString commandValue; - nsString keyChar; keyChar.AssignWithConversion(" "); + nsString keyChar(NS_LITERAL_STRING(" ")); keyElement->GetAttribute(keyAtom, keyChar); keyElement->GetAttribute(shiftAtom, shiftValue); keyElement->GetAttribute(altAtom, altValue); keyElement->GetAttribute(commandAtom, commandValue); - if(!keyChar.EqualsWithConversion(" ")) + if(!keyChar.Equals(NS_LITERAL_STRING(" "))) pnsMenuItem->SetShortcutChar(keyChar); - if(shiftValue.EqualsWithConversion("true")) + if(shiftValue.Equals(NS_LITERAL_STRING("true"))) modifiers |= knsMenuItemShiftModifier; - if(altValue.EqualsWithConversion("true")) + if(altValue.Equals(NS_LITERAL_STRING("true"))) modifiers |= knsMenuItemAltModifier; - if(commandValue.EqualsWithConversion("false")) + if(commandValue.Equals(NS_LITERAL_STRING("false"))) modifiers |= knsMenuItemCommandModifier; pnsMenuItem->SetModifiers(modifiers); @@ -761,7 +761,7 @@ NS_IMETHODIMP nsWebShellWindow::LoadMenuItem( - nsAutoString cmdAtom; cmdAtom.AssignWithConversion("onaction"); + nsAutoString cmdAtom(NS_LITERAL_STRING("onaction")); nsString cmdName; domElement->GetAttribute(cmdAtom, cmdName); @@ -846,7 +846,7 @@ void nsWebShellWindow::LoadSubMenu( if (menuPopupElement) { nsString menuPopupNodeType; menuPopupElement->GetNodeName(menuPopupNodeType); - if (menuPopupNodeType.EqualsWithConversion("menupopup")) + if (menuPopupNodeType.Equals(NS_LITERAL_STRING("menupopup"))) break; } nsCOMPtr oldMenuPopupNode(menuPopupNode); @@ -869,12 +869,12 @@ void nsWebShellWindow::LoadSubMenu( printf("Type [%s] %d\n", NS_LossyConvertUCS2toASCII(menuitemNodeType).get(), menuitemNodeType.Equals("menuseparator")); #endif - if (menuitemNodeType.EqualsWithConversion("menuitem")) { + if (menuitemNodeType.Equals(NS_LITERAL_STRING("menuitem"))) { // Load a menuitem LoadMenuItem(pnsMenu, menuitemElement, menuitemNode); - } else if (menuitemNodeType.EqualsWithConversion("menuseparator")) { + } else if (menuitemNodeType.Equals(NS_LITERAL_STRING("menuseparator"))) { pnsMenu->AddSeparator(); - } else if (menuitemNodeType.EqualsWithConversion("menu")) { + } else if (menuitemNodeType.Equals(NS_LITERAL_STRING("menu"))) { // Add a submenu LoadSubMenu(pnsMenu, menuitemElement, menuitemNode); } @@ -1009,7 +1009,7 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi nsString menuNodeType; nsString menuName; menuElement->GetNodeName(menuNodeType); - if (menuNodeType.EqualsWithConversion("menu")) { + if (menuNodeType.Equals(NS_LITERAL_STRING("menu"))) { menuElement->GetAttribute(NS_LITERAL_STRING("label"), menuName); #ifdef DEBUG_rods diff --git a/mozilla/xpfe/components/bookmarks/src/Makefile.in b/mozilla/xpfe/components/bookmarks/src/Makefile.in index b79137e814a..2fa5ad00b77 100644 --- a/mozilla/xpfe/components/bookmarks/src/Makefile.in +++ b/mozilla/xpfe/components/bookmarks/src/Makefile.in @@ -42,6 +42,7 @@ REQUIRES = xpcom \ intl \ webshell \ windowwatcher \ + unicharutil \ $(NULL) CPPSRCS = nsBookmarksService.cpp diff --git a/mozilla/xpfe/components/bookmarks/src/makefile.win b/mozilla/xpfe/components/bookmarks/src/makefile.win index ca462bd64a8..62232730541 100644 --- a/mozilla/xpfe/components/bookmarks/src/makefile.win +++ b/mozilla/xpfe/components/bookmarks/src/makefile.win @@ -35,6 +35,7 @@ REQUIRES = xpcom \ intl \ webshell \ windowwatcher \ + unicharutil \ $(NULL) CPP_OBJS= \ diff --git a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp index b17cce80d76..cd1de298880 100644 --- a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -72,6 +72,7 @@ #include "nsIDirectoryService.h" #include "nsAppDirectoryServiceDefs.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nsISound.h" #include "nsIPrompt.h" @@ -935,22 +936,22 @@ BookmarkParser::Unescape(nsString &text) nsAutoString temp; text.Mid(temp, offset, 6); - if (temp.CompareWithConversion("<", PR_TRUE, 4) == 0) + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('<'), offset); } - else if (temp.CompareWithConversion(">", PR_TRUE, 4) == 0) + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('>'), offset); } - else if (temp.CompareWithConversion("&", PR_TRUE, 5) == 0) + if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 5); text.Insert(PRUnichar('&'), offset); } - else if (temp.CompareWithConversion(""", PR_TRUE, 6) == 0) + if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 6); text.Insert(PRUnichar('\"'), offset); @@ -1343,7 +1344,7 @@ BookmarkParser::ParseResource(nsIRDFResource *arc, nsString& url, nsIRDFNode** a // if we don't have a protocol scheme, add "http://" as a default scheme if (url.FindChar(PRUnichar(':')) < 0) { - url.InsertWithConversion("http://", 0); + url.Assign(NS_LITERAL_STRING("http://") + url); } } @@ -2422,7 +2423,7 @@ nsBookmarksService::OnStopRequest(nsIRequest* request, nsISupports *ctxt, { nsAutoString promptStr; getLocaleString("WebPageUpdated", promptStr); - if (promptStr.Length() > 0) promptStr.AppendWithConversion("\n\n"); + if (!promptStr.IsEmpty()) promptStr.Append(NS_LITERAL_STRING("\n\n")); nsCOMPtr nameNode; if (NS_SUCCEEDED(mInner->GetTarget(busyResource, kNC_Name, @@ -2438,12 +2439,12 @@ nsBookmarksService::OnStopRequest(nsIRequest* request, nsISupports *ctxt, nsAutoString info; getLocaleString("WebPageTitle", info); promptStr += info; - promptStr.AppendWithConversion(" "); + promptStr.Append(NS_LITERAL_STRING(" ")); promptStr += nameUni; - promptStr.AppendWithConversion("\n"); + promptStr.Append(NS_LITERAL_STRING("\n")); getLocaleString("WebPageURL", info); promptStr += info; - promptStr.AppendWithConversion(" "); + promptStr.Append(NS_LITERAL_STRING(" ")); } } } @@ -2453,7 +2454,7 @@ nsBookmarksService::OnStopRequest(nsIRequest* request, nsISupports *ctxt, getLocaleString("WebPageAskDisplay", temp); if (temp.Length() > 0) { - promptStr.AppendWithConversion("\n\n"); + promptStr.Append(NS_LITERAL_STRING("\n\n")); promptStr += temp; } diff --git a/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp b/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp index f1cca168786..79fcfe56e43 100644 --- a/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp +++ b/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp @@ -473,7 +473,7 @@ DownloadItem::UpdateProgressInfo() rv = sbs->CreateBundle(NSDOWNLOADMANAGER_PROPERTIES_URI, getter_AddRefs(bundle)); if (NS_FAILED(rv)) return rv; - nsAutoString key; key.AssignWithConversion("progressFormat"); + nsAutoString key(NS_LITERAL_STRING("progressFormat")); nsAutoString curTotalProgressStr; curTotalProgressStr.AppendInt(mCurTotalProgress); nsAutoString maxTotalProgressStr; maxTotalProgressStr.AppendInt(mMaxTotalProgress); const PRUnichar* formatStrings[2] = { curTotalProgressStr.get(), maxTotalProgressStr.get() }; diff --git a/mozilla/xpfe/components/intl/nsCharsetMenu.cpp b/mozilla/xpfe/components/intl/nsCharsetMenu.cpp index 4b535afa962..4c143a9692d 100644 --- a/mozilla/xpfe/components/intl/nsCharsetMenu.cpp +++ b/mozilla/xpfe/components/intl/nsCharsetMenu.cpp @@ -1445,7 +1445,7 @@ nsresult nsCharsetMenu::AddFromStringToMenu( nsresult nsCharsetMenu::AddSeparatorToContainer(nsIRDFContainer * aContainer) { nsAutoString str; - str.AssignWithConversion("----"); + str.Assign(NS_LITERAL_STRING("----")); // hack to generate unique id's for separators static PRInt32 u = 0; @@ -1498,7 +1498,7 @@ nsresult nsCharsetMenu::WriteCacheToPrefs(nsVoidArray * aArray, // create together the cache string nsAutoString cache; - nsAutoString sep; sep.AppendWithConversion(", "); + nsAutoString sep(NS_LITERAL_STRING(", ")); PRInt32 count = aArray->Count(); for (PRInt32 i = aCacheStart; i < count; i++) { diff --git a/mozilla/xpfe/components/related/src/Makefile.in b/mozilla/xpfe/components/related/src/Makefile.in index d1820336176..bb041d26c8f 100644 --- a/mozilla/xpfe/components/related/src/Makefile.in +++ b/mozilla/xpfe/components/related/src/Makefile.in @@ -34,6 +34,7 @@ REQUIRES = xpcom \ necko \ uconv \ pref \ + unicharutil \ $(NULL) CPPSRCS = nsRelatedLinksHandler.cpp diff --git a/mozilla/xpfe/components/related/src/makefile.win b/mozilla/xpfe/components/related/src/makefile.win index 541a9d00a0f..54182ff068a 100644 --- a/mozilla/xpfe/components/related/src/makefile.win +++ b/mozilla/xpfe/components/related/src/makefile.win @@ -27,6 +27,7 @@ REQUIRES = xpcom \ necko \ uconv \ pref \ + unicharutil \ $(NULL) include <$(DEPTH)/config/config.mak> diff --git a/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp b/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp index 39e18b3c4d6..f48bce58ab6 100644 --- a/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp +++ b/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp @@ -59,6 +59,7 @@ #include "nsVoidArray.h" #include "nsXPIDLString.h" #include "nsReadableUtils.h" +#include "nsUnicharUtils.h" #include "nscore.h" #include "plhash.h" #include "plstr.h" @@ -223,7 +224,7 @@ RelatedLinksStreamListener::Init() (nsISupports**)&charsetConv); if (NS_SUCCEEDED(rv) && (charsetConv)) { - nsString utf8; utf8.AssignWithConversion("UTF-8"); + nsString utf8(NS_LITERAL_STRING("UTF-8")); rv = charsetConv->GetUnicodeDecoder(&utf8, getter_AddRefs(mUnicodeDecoder)); NS_RELEASE(charsetConv); @@ -257,10 +258,9 @@ NS_IMPL_ISUPPORTS1(RelatedLinksStreamListener, nsIStreamListener) NS_IMETHODIMP RelatedLinksStreamListener::OnStartRequest(nsIRequest *request, nsISupports *ctxt) { - nsAutoString trueStr; trueStr.AssignWithConversion("true"); nsIRDFLiteral *literal = nsnull; nsresult rv; - if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(trueStr.get(), &literal))) + if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(NS_LITERAL_STRING("true").get(), &literal))) { mDataSource->Assert(kNC_RelatedLinksRoot, kNC_loading, literal, PR_TRUE); NS_RELEASE(literal); @@ -274,10 +274,9 @@ NS_IMETHODIMP RelatedLinksStreamListener::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status) { - nsAutoString trueStr; trueStr.AssignWithConversion("true"); nsIRDFLiteral *literal = nsnull; nsresult rv; - if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(trueStr.get(), &literal))) + if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(NS_LITERAL_STRING("true").get(), &literal))) { mDataSource->Unassert(kNC_RelatedLinksRoot, kNC_loading, literal); NS_RELEASE(literal); @@ -562,22 +561,22 @@ RelatedLinksStreamListener::Unescape(nsString &text) nsAutoString temp; text.Mid(temp, offset, 6); - if (temp.CompareWithConversion("<", PR_TRUE, 4) == 0) + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('<'), offset); } - else if (temp.CompareWithConversion(">", PR_TRUE, 4) == 0) + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('>'), offset); } - else if (temp.CompareWithConversion("&", PR_TRUE, 5) == 0) + if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 5); text.Insert(PRUnichar('&'), offset); } - else if (temp.CompareWithConversion(""", PR_TRUE, 6) == 0) + if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 6); text.Insert(PRUnichar('\"'), offset); diff --git a/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp b/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp index b020367f57d..d025e380e84 100755 --- a/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp +++ b/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp @@ -2469,8 +2469,7 @@ InternetSearchDataSource::GetInternetSearchURL(const char *searchEngineURI, // we can only handle HTTP GET if (!method.EqualsIgnoreCase("get")) return(NS_ERROR_UNEXPECTED); // HTTP Get method support - action.AppendWithConversion("?"); - action += input; + action += NS_LITERAL_STRING("?") + input; // return a copy of the resulting search URL *resultURL = ToNewCString(action); @@ -2599,16 +2598,16 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea if (userVar.Length() < 1) return(NS_RDF_NO_VALUE); nsAutoString queryStr; - queryStr.AssignWithConversion("?"); - queryStr += userVar; - queryStr.AppendWithConversion("="); + queryStr = NS_LITERAL_STRING("?") + + userVar + + NS_LITERAL_STRING("="); PRInt32 queryOffset; if ((queryOffset = searchURL.Find(queryStr, PR_TRUE )) < 0) { - queryStr.AssignWithConversion("&"); - queryStr += userVar; - queryStr.AppendWithConversion("="); + queryStr = NS_LITERAL_STRING("&") + + userVar + + NS_LITERAL_STRING("="); queryOffset = searchURL.Find(queryStr, PR_TRUE); } @@ -2664,9 +2663,8 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea RememberLastSearchText(searchText.get()); // construct the search query uri - engineURI.InsertWithConversion("internetsearch:engine=", 0); - engineURI.AppendWithConversion("&text="); - engineURI += searchText; + engineURI.Assign(NS_LITERAL_STRING("internetsearch:engine=") + engineURI + + NS_LITERAL_STRING("&text=") + searchText); #ifdef DEBUG_SEARCH_OUTPUT char *engineMatch = ToNewCString(searchText); @@ -3499,7 +3497,7 @@ InternetSearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engin if (fullURL.Length() > 0) { action.Assign(fullURL); - methodStr.AssignWithConversion("get"); + methodStr.Assign(NS_LITERAL_STRING("get")); } else { @@ -3579,8 +3577,7 @@ InternetSearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engin if (input.Length() < 1) return(NS_ERROR_UNEXPECTED); // HTTP Get method support - action.AppendWithConversion("?"); - action += input; + action += NS_LITERAL_STRING("?") + input; } nsCOMPtr context; @@ -3725,7 +3722,7 @@ InternetSearchDataSource::SaveEngineInfoIntoGraph(nsIFile *file, nsIFile *icon, if ((extensionOffset = basename.RFindChar(PRUnichar('.'))) > 0) { basename.Truncate(extensionOffset); - basename.AppendWithConversion(".src"); + basename.Append(NS_LITERAL_STRING(".src")); } nsXPIDLCString filePath; @@ -3743,7 +3740,7 @@ InternetSearchDataSource::SaveEngineInfoIntoGraph(nsIFile *file, nsIFile *icon, if ((extensionOffset = searchURL.RFindChar(PRUnichar('.'))) > 0) { searchURL.Truncate(extensionOffset); - searchURL.AppendWithConversion(".src"); + searchURL.Append(NS_LITERAL_STRING(".src")); } if (NS_FAILED(rv = gRDFService->GetUnicodeResource(searchURL.get(), @@ -3970,7 +3967,7 @@ InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir, PRBool checkMa nsCOMPtr iconFile; uri.Left(temp, uri.Length()-4); - temp.AppendWithConversion(".gif"); + temp.Append(NS_LITERAL_STRING(".gif")); const nsFileSpec gifIconFile(temp); if (gifIconFile.IsFile()) { @@ -3980,7 +3977,7 @@ InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir, PRBool checkMa if (foundIconFlag == PR_FALSE) { uri.Left(temp, uri.Length()-4); - temp.AppendWithConversion(".jpg"); + temp.Append(NS_LITERAL_STRING(".jpg")); const nsFileSpec jpgIconFile(temp); if (jpgIconFile.IsFile()) { @@ -3991,7 +3988,7 @@ InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir, PRBool checkMa if (foundIconFlag == PR_FALSE) { uri.Left(temp, uri.Length()-4); - temp.AppendWithConversion(".jpeg"); + temp.Append(NS_LITERAL_STRING(".jpeg")); const nsFileSpec jpegIconFile(temp); if (jpegIconFile.IsFile()) { @@ -4002,7 +3999,7 @@ InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir, PRBool checkMa if (foundIconFlag == PR_FALSE) { uri.Left(temp, uri.Length()-4); - temp.AppendWithConversion(".png"); + temp.Append(NS_LITERAL_STRING(".png")); const nsFileSpec pngIconFile(temp); if (pngIconFile.IsFile()) { @@ -4064,7 +4061,7 @@ InternetSearchDataSource::GetNumInterpretSections(const PRUnichar *dataUni, PRUi nsString buffer(dataUni); nsAutoString section; - section.AssignWithConversion(" 0) @@ -4113,7 +4110,7 @@ InternetSearchDataSource::GetData(const PRUnichar *dataUni, const char *sectionT PRBool inSection = PR_FALSE; nsAutoString section; - section.AssignWithConversion("<"); + section.Assign(NS_LITERAL_STRING("<")); section.AppendWithConversion(sectionToFind); while(buffer.Length() > 0) @@ -4334,10 +4331,10 @@ InternetSearchDataSource::GetInputs(const PRUnichar *dataUni, nsString &userVar, { if (input.Length() > 0) { - input.AppendWithConversion("&"); + input.Append(NS_LITERAL_STRING("&")); } input += nameAttrib; - input.AppendWithConversion("="); + input.Append(NS_LITERAL_STRING("=")); input += valueAttrib; } } @@ -4839,7 +4836,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD nsAutoString nameStartStr, nameEndStr; nsAutoString emailStartStr, emailEndStr; nsAutoString browserResultTypeStr; - browserResultTypeStr.AssignWithConversion("result"); // default to "result" + browserResultTypeStr.Assign(NS_LITERAL_STRING("result")); // default to "result" // need an original copy of the HTML every time through the loop nsAutoString htmlResults(htmlPage); @@ -4877,7 +4874,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD GetData(dataUni, "interpret", interpretSectionNum, "browserResultType", browserResultTypeStr); if (browserResultTypeStr.Length() < 1) { - browserResultTypeStr.AssignWithConversion("result"); // default to "result" + browserResultTypeStr.Assign(NS_LITERAL_STRING("result")); // default to "result" } } @@ -4935,7 +4932,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD // if resultItemStartStr is not specified, try making it just be "HREF=" if (resultItemStartStr.Length() < 1) { - resultItemStartStr.AssignWithConversion("HREF="); + resultItemStartStr.Assign(NS_LITERAL_STRING("HREF=")); trimItemStart = PR_FALSE; } @@ -5418,7 +5415,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD } if (relItem.Length() < 1) { - relItem.AssignWithConversion("-"); + relItem.Assign(NS_LITERAL_STRING("-")); } const PRUnichar *relItemUni = relItem.get(); @@ -5431,7 +5428,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD } } - if ((relItem.Length() > 0) && (!relItem.EqualsWithConversion("-"))) + if ((!relItem.IsEmpty()) && (!relItem.Equals(NS_LITERAL_STRING("-")))) { // If its a percentage, remove "%" if (relItem[relItem.Length()-1] == PRUnichar('%')) @@ -5441,7 +5438,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD // left-pad with "0"s and set special sorting value nsAutoString zero; - zero.AssignWithConversion("000"); + zero.Assign(NS_LITERAL_STRING("000")); if (relItem.Length() < 3) { relItem.Insert(zero.get(), 0, zero.Length() - relItem.Length()); @@ -5449,7 +5446,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD } else { - relItem.AssignWithConversion("000"); + relItem.Assign(NS_LITERAL_STRING("000")); } const PRUnichar *relSortUni = relItem.get(); @@ -5495,9 +5492,9 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD nsAutoString iconChromeDefault; if (browserResultTypeStr.EqualsIgnoreCase("category")) - iconChromeDefault.AssignWithConversion("chrome://communicator/skin/search/category.gif"); + iconChromeDefault.Assign(NS_LITERAL_STRING("chrome://communicator/skin/search/category.gif")); else if ((browserResultTypeStr.EqualsIgnoreCase("result")) && (!engineIconNode)) - iconChromeDefault.AssignWithConversion("chrome://communicator/skin/search/result.gif"); + iconChromeDefault.Assign(NS_LITERAL_STRING("chrome://communicator/skin/search/result.gif")); if (iconChromeDefault.Length() > 0) { diff --git a/mozilla/xpfe/components/search/src/nsLocalSearchService.cpp b/mozilla/xpfe/components/search/src/nsLocalSearchService.cpp index f654edd31eb..4c26cdc6770 100755 --- a/mozilla/xpfe/components/search/src/nsLocalSearchService.cpp +++ b/mozilla/xpfe/components/search/src/nsLocalSearchService.cpp @@ -260,7 +260,7 @@ LocalSearchDataSource::GetTarget(nsIRDFResource *source, } else if (property == kNC_pulse) { - nsAutoString pulse; pulse.AssignWithConversion("15"); + nsAutoString pulse(NS_LITERAL_STRING("15")); nsIRDFLiteral *pulseLiteral; rv = gRDFService->GetLiteral(pulse.get(), &pulseLiteral); if (NS_FAILED(rv)) return rv; @@ -708,7 +708,7 @@ LocalSearchDataSource::GetTargets(nsIRDFResource *source, } else if (property == kNC_pulse) { - nsAutoString pulse; pulse.AssignWithConversion("15"); + nsAutoString pulse(NS_LITERAL_STRING("15")); nsIRDFLiteral *pulseLiteral; rv = gRDFService->GetLiteral(pulse.get(), &pulseLiteral); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/xpinstall/src/nsInstall.cpp b/mozilla/xpinstall/src/nsInstall.cpp index 8148504f2d5..38b3a50e59c 100644 --- a/mozilla/xpinstall/src/nsInstall.cpp +++ b/mozilla/xpinstall/src/nsInstall.cpp @@ -408,7 +408,7 @@ nsInstall::AddDirectory(const nsString& aRegName, if (!subdirectory.IsEmpty()) { - subdirectory.AppendWithConversion("/"); + subdirectory.Append(NS_LITERAL_STRING("/")); } @@ -440,11 +440,11 @@ nsInstall::AddDirectory(const nsString& aRegName, nsString *thisPath = (nsString *)paths->ElementAt(i); nsString newJarSource = aJarSource; - newJarSource.AppendWithConversion("/"); + newJarSource.Append(NS_LITERAL_STRING("/")); newJarSource += *thisPath; nsString fullRegName = qualifiedRegName; - fullRegName.AppendWithConversion("/"); + fullRegName.Append(NS_LITERAL_STRING("/")); fullRegName += *thisPath; @@ -584,7 +584,7 @@ nsInstall::AddSubcomponent(const nsString& aRegName, } if (qualifiedVersion.IsEmpty()) - qualifiedVersion.AssignWithConversion("0.0.0.0"); + qualifiedVersion.Assign(NS_LITERAL_STRING("0.0.0.0")); if ( aRegName.IsEmpty() ) @@ -2324,7 +2324,7 @@ nsInstall::GetQualifiedPackageName( const nsString& name, nsString& qualifiedNam nsString startOfName; name.Left(startOfName, 7); - if ( startOfName.EqualsWithConversion( "=USER=/") ) + if ( startOfName.Equals(NS_LITERAL_STRING("=USER=/")) ) { CurrentUserNode(qualifiedName); qualifiedName += name; @@ -2366,7 +2366,7 @@ nsInstall::GetQualifiedRegName(const nsString& name, nsString& qualifiedRegName nsString usr (); - if ( startOfName.EqualsWithConversion("=COMM=/") || startOfName.EqualsWithConversion("=USER=/")) + if ( startOfName.Equals(NS_LITERAL_STRING("=COMM=/")) || startOfName.Equals(NS_LITERAL_STRING("=USER=/"))) { qualifiedRegName = name; qualifiedRegName.Cut( 0, 7 ); @@ -2376,7 +2376,7 @@ nsInstall::GetQualifiedRegName(const nsString& name, nsString& qualifiedRegName if (!mRegistryPackageName.IsEmpty()) { qualifiedRegName = mRegistryPackageName; - qualifiedRegName.AppendWithConversion("/"); + qualifiedRegName.Append(NS_LITERAL_STRING("/")); qualifiedRegName += name; } else @@ -2429,11 +2429,11 @@ nsInstall::CurrentUserNode(nsString& userRegNode) profname = NULL; } - userRegNode.AssignWithConversion("/Netscape/Users/"); + userRegNode.Assign(NS_LITERAL_STRING("/Netscape/Users/")); if (profname != nsnull) { userRegNode.AppendWithConversion(profname); - userRegNode.AppendWithConversion("/"); + userRegNode.Append(NS_LITERAL_STRING("/")); PR_FREEIF(profname); } } @@ -2616,7 +2616,7 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsIFile* aSuggestedName, directoryService->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), getter_AddRefs(tempFile)); - nsString tempFileName; tempFileName.AssignWithConversion("xpinstall"); + nsString tempFileName(NS_LITERAL_STRING("xpinstall")); // Get the extension of the file in the JAR extpos = aJarfile.RFindChar('.'); diff --git a/mozilla/xpinstall/src/nsInstallFile.cpp b/mozilla/xpinstall/src/nsInstallFile.cpp index 90354cf9e95..24d7a36050d 100644 --- a/mozilla/xpinstall/src/nsInstallFile.cpp +++ b/mozilla/xpinstall/src/nsInstallFile.cpp @@ -351,7 +351,7 @@ char* nsInstallFile::toString() nsString interimStr; if(mMode & nsInstall::DO_NOT_UNINSTALL) - interimStr.AssignWithConversion("(*dnu*) "); + interimStr.Assign(NS_LITERAL_STRING("(*dnu*) ")); interimStr.AppendWithConversion(rsrcVal); interimCStr = ToNewCString(interimStr); diff --git a/mozilla/xpinstall/src/nsInstallFileOpItem.cpp b/mozilla/xpinstall/src/nsInstallFileOpItem.cpp index 948f59ebfe1..50b89c1d633 100644 --- a/mozilla/xpinstall/src/nsInstallFileOpItem.cpp +++ b/mozilla/xpinstall/src/nsInstallFileOpItem.cpp @@ -415,7 +415,7 @@ char* nsInstallFileOpItem::toString() { mShortcutPath->GetPath(&temp); result.AssignWithConversion(temp); - result.AppendWithConversion("\\"); + result.Append(NS_LITERAL_STRING("\\")); result.Append(*mDescription); dstPath = ToNewCString(result); if(dstPath) @@ -1349,7 +1349,7 @@ nsInstallFileOpItem::NativeFileOpWindowsShortcutAbort() if(mShortcutPath && mDescription) { shortcutDescription = *mDescription; - shortcutDescription.AppendWithConversion(".lnk"); + shortcutDescription.Append(NS_LITERAL_STRING(".lnk")); mShortcutPath->Clone(getter_AddRefs(shortcutTarget)); shortcutTarget->Append(NS_LossyConvertUCS2toASCII(shortcutDescription).get()); diff --git a/mozilla/xpinstall/src/nsInstallPatch.cpp b/mozilla/xpinstall/src/nsInstallPatch.cpp index d66a744fb66..8aebf4c1343 100644 --- a/mozilla/xpinstall/src/nsInstallPatch.cpp +++ b/mozilla/xpinstall/src/nsInstallPatch.cpp @@ -452,7 +452,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n char* leafName; rv = sourceFile->GetLeafName(&leafName); - nsString tmpName; tmpName.AssignWithConversion("-src"); + nsString tmpName(NS_LITERAL_STRING("-src")); nsString tmpFileName; tmpFileName.AssignWithConversion(leafName); PRInt32 i; @@ -516,7 +516,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n goto cleanup; // make a unique file at the same location of our source file (FILENAME-ptch.EXT) - nsString patchFileName; patchFileName.AssignWithConversion("-ptch"); + nsString patchFileName(NS_LITERAL_STRING("-ptch")); char* leafName; sourceFile->GetLeafName(&leafName); nsString newFileName; newFileName.AssignWithConversion(leafName);; diff --git a/mozilla/xpinstall/src/nsJSFile.cpp b/mozilla/xpinstall/src/nsJSFile.cpp index 7e65c004e03..f2266869077 100644 --- a/mozilla/xpinstall/src/nsJSFile.cpp +++ b/mozilla/xpinstall/src/nsJSFile.cpp @@ -1295,7 +1295,7 @@ InstallFileOpFileMacAlias(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, else { aliasLeaf = sourceLeaf; - aliasLeaf.AppendWithConversion(" alias"); // XXX use GetResourcedString(id) + aliasLeaf.Append(NS_LITERAL_STRING(" alias")); // XXX use GetResourcedString(id) } rv2 = iFileAlias->Append(NS_LossyConvertUCS2toASCII(aliasLeaf).get()); diff --git a/mozilla/xpinstall/src/nsJSInstallVersion.cpp b/mozilla/xpinstall/src/nsJSInstallVersion.cpp index a69a03f8404..f98a5192ab7 100644 --- a/mozilla/xpinstall/src/nsJSInstallVersion.cpp +++ b/mozilla/xpinstall/src/nsJSInstallVersion.cpp @@ -302,7 +302,7 @@ InstallVersionInit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } else { - b0.AssignWithConversion("0.0.0.0"); + b0.Assign(NS_LITERAL_STRING("0.0.0.0")); } if (NS_OK != nativeThis->Init(b0)) diff --git a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp index ae694895b74..f108e9a4b62 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -138,9 +138,9 @@ XPInstallErrorReporter(JSContext *cx, const char *message, JSErrorReport *report if(listener) { nsAutoString logMessage; - logMessage.AssignWithConversion("Line: "); + logMessage.Assign(NS_LITERAL_STRING("Line: ")); logMessage.AppendInt(report->lineno, 10); - logMessage.AppendWithConversion("\t"); + logMessage.Append(NS_LITERAL_STRING("\t")); if (report->ucmessage) logMessage.Append( NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage) ); else diff --git a/mozilla/xpinstall/src/nsWinProfile.cpp b/mozilla/xpinstall/src/nsWinProfile.cpp index a0beb4bc11d..e9017671d40 100644 --- a/mozilla/xpinstall/src/nsWinProfile.cpp +++ b/mozilla/xpinstall/src/nsWinProfile.cpp @@ -55,7 +55,7 @@ nsWinProfile::nsWinProfile( nsInstall* suObj, const nsString& folder, const nsSt { if(mFilename->Last() != '\\') { - mFilename->AppendWithConversion("\\"); + mFilename->Append(NS_LITERAL_STRING("\\")); } mFilename->Append(file); diff --git a/mozilla/xpinstall/src/nsWinProfileItem.cpp b/mozilla/xpinstall/src/nsWinProfileItem.cpp index 09de967b0cc..a89494ad9a8 100644 --- a/mozilla/xpinstall/src/nsWinProfileItem.cpp +++ b/mozilla/xpinstall/src/nsWinProfileItem.cpp @@ -90,17 +90,17 @@ char* nsWinProfileItem::toString() nsString* filename = new nsString(*mProfile->GetFilename()); nsString* result = new nsString; - result->AssignWithConversion("Write "); + result->Assign(NS_LITERAL_STRING("Write ")); if (filename == nsnull || result == nsnull) return nsnull; result->Append(*filename); - result->AppendWithConversion(": ["); + result->Append(NS_LITERAL_STRING(": [")); result->Append(*mSection); - result->AppendWithConversion("] "); + result->Append(NS_LITERAL_STRING("] ")); result->Append(*mKey); - result->AppendWithConversion("="); + result->Append(NS_LITERAL_STRING("=")); result->Append(*mValue); resultCString = new char[result->Length() + 1]; diff --git a/mozilla/xpinstall/src/nsWinRegItem.cpp b/mozilla/xpinstall/src/nsWinRegItem.cpp index ca3e6dce737..542ee479c49 100644 --- a/mozilla/xpinstall/src/nsWinRegItem.cpp +++ b/mozilla/xpinstall/src/nsWinRegItem.cpp @@ -265,28 +265,28 @@ nsString* nsWinRegItem::keystr(PRInt32 root, nsString* mSubkey, nsString* mName) switch(root) { case (int)(HKEY_CLASSES_ROOT) : - rootstr.AssignWithConversion("HKEY_CLASSES_ROOT\\"); + rootstr.Assign(NS_LITERAL_STRING("HKEY_CLASSES_ROOT\\")); break; case (int)(HKEY_CURRENT_USER) : - rootstr.AssignWithConversion("HKEY_CURRENT_USER\\"); + rootstr.Assign(NS_LITERAL_STRING("HKEY_CURRENT_USER\\")); break; case (int)(HKEY_LOCAL_MACHINE) : - rootstr.AssignWithConversion("HKEY_LOCAL_MACHINE\\"); + rootstr.Assign(NS_LITERAL_STRING("HKEY_LOCAL_MACHINE\\")); break; case (int)(HKEY_USERS) : - rootstr.AssignWithConversion("HKEY_USERS\\"); + rootstr.Assign(NS_LITERAL_STRING("HKEY_USERS\\")); break; default: istr = itoa(root); if (istr) { - rootstr.AssignWithConversion("#"); + rootstr.Assign(NS_LITERAL_STRING("#")); rootstr.AppendWithConversion(istr); - rootstr.AppendWithConversion("\\"); + rootstr.Append(NS_LITERAL_STRING("\\")); PR_DELETE(istr); } @@ -297,12 +297,12 @@ nsString* nsWinRegItem::keystr(PRInt32 root, nsString* mSubkey, nsString* mName) if(finalstr != nsnull) { finalstr->Append(*mSubkey); - finalstr->AppendWithConversion(" ["); + finalstr->Append(NS_LITERAL_STRING(" [")); if(mName != nsnull) finalstr->Append(*mName); - finalstr->AppendWithConversion("]"); + finalstr->Append(NS_LITERAL_STRING("]")); } return finalstr; diff --git a/mozilla/xpinstall/src/nsXPITriggerInfo.h b/mozilla/xpinstall/src/nsXPITriggerInfo.h index b9dbf3214c1..7e9d6fe938a 100644 --- a/mozilla/xpinstall/src/nsXPITriggerInfo.h +++ b/mozilla/xpinstall/src/nsXPITriggerInfo.h @@ -66,7 +66,7 @@ class nsXPITriggerItem nsCOMPtr mFile; nsCOMPtr mOutStream; - PRBool IsFileURL() { return mURL.EqualsWithConversion("file:/",PR_FALSE,6); } + PRBool IsFileURL() { return Substring(mURL, 0, 6).Equals(NS_LITERAL_STRING("file:/")); } PRBool IsRelativeURL(); private: diff --git a/mozilla/xpinstall/src/nsXPInstallManager.cpp b/mozilla/xpinstall/src/nsXPInstallManager.cpp index ed2d7dba883..92e09b5fbdf 100644 --- a/mozilla/xpinstall/src/nsXPInstallManager.cpp +++ b/mozilla/xpinstall/src/nsXPInstallManager.cpp @@ -930,7 +930,7 @@ nsXPInstallManager::FinalizeProgress(const PRUnichar *message, PRInt32 itemNum, mFinalizing = PR_TRUE; if (mStringBundle) { - nsString rsrcName; rsrcName.AssignWithConversion("FinishingInstallMsg"); + nsString rsrcName(NS_LITERAL_STRING("FinishingInstallMsg")); const PRUnichar* ucRsrcName = rsrcName.get(); PRUnichar* ucRsrcVal = nsnull; rv = mStringBundle->GetStringFromName(ucRsrcName, &ucRsrcVal);