superreview granted: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()

Peter Van der Beken <peterv@propagandism.org> has granted Johnny Stenback
<jst@mozilla.jstenback.com>'s request for superreview:
Bug 232503: Start using Empty[C]String()
http://bugzilla.mozilla.org/show_bug.cgi?id=232503

Attachment 140140: Use Empty[C]String()
http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit

------- Additional Comments from Peter Van der Beken <peterv@propagandism.org>
> Index: editor/libeditor/html/Makefile.in
> ===================================================================

> @@ -58,19 +58,18 @@ CPPSRCS  = \
>	      nsHTMLEditRules.cpp	     \
>	      nsHTMLEditUtils.cpp	     \
>	      nsHTMLObjectResizer.cpp	     \
>	      nsHTMLEditorMouseListener.cpp  \
>	      nsHTMLInlineTableEditor.cpp    \
>	     nsHTMLURIRefObject.cpp	    \
>	      nsTableEditor.cpp 	     \
>	      nsWSRunObject.cpp 	     \
>	      TypeInState.cpp		     \
> -	      TextEditorTest.cpp	     \

You should move that into DEBUG (this'll break debug builds) and remove the
include of TextEditorTest.h in
mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp. I don't think we can move
nsEditor::DebugUnitTests and nsHTMLEditor::DebugUnitTests completely inside
DEBUG, they seem to be called from front-end code
(mozilla/editor/ui/composer/content/EditorCommandsDebug.js). Unless you ifdef
it in the IDL and test with |if (debugUnitTests in GetCurrentEditor())| in the
JS?

> Index: editor/libeditor/html/nsHTMLDataTransfer.cpp
> ===================================================================

> @@ -1101,19 +1103,19 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTr
>	       {
>		 stuffToPaste.Assign(NS_LITERAL_STRING("<A href=\""));
>		 AppendUTF8toUTF16(urltext, stuffToPaste);
>		 stuffToPaste.Append(NS_LITERAL_STRING("\">"));
>		 AppendUTF8toUTF16(urltext, stuffToPaste);
>		 stuffToPaste.Append(NS_LITERAL_STRING("</A>"));
>	       }
>	       nsAutoEditBatch beginBatching(this);
>	       rv = InsertHTMLWithContext(stuffToPaste,
> -					  nsString(), nsString(), flavor, 
> +					  EmptyString(), EmptyString(), flavor,


No local variable to combine these?


> @@ -1603,19 +1605,19 @@ NS_IMETHODIMP nsHTMLEditor::PasteNoForma
>    // Get the nsITransferable interface for getting the data from the
clipboard.
>    // use nsPlaintextEditor::PrepareTransferable() to force unicode plaintext
data.
>    nsCOMPtr<nsITransferable> trans;
>    rv = nsPlaintextEditor::PrepareTransferable(getter_AddRefs(trans));
>    if (NS_SUCCEEDED(rv) && trans)
>    {
>      // Get the Data from the clipboard  
>      if (NS_SUCCEEDED(clipboard->GetData(trans, aSelectionType)) &&
IsModifiable())
>      {
> -	 rv = InsertFromTransferable(trans, nsnull, nsString(), nsString(),
> +	 rv = InsertFromTransferable(trans, nsnull, EmptyString(),
EmptyString(),
>				     nsnull, 0, PR_TRUE);

and here

> Index: extensions/transformiix/source/xslt/txInstructions.cpp
> ===================================================================

> @@ -371,21 +371,21 @@ nsresult
>  txCopy::execute(txExecutionState& aEs)
>  {
>      nsresult rv = NS_OK;
>      const txXPathNode& node = aEs.getEvalContext()->getContextNode();
>  
>      switch (txXPathNodeUtils::getNodeType(node)) {
>	   case txXPathNodeType::DOCUMENT_NODE:
>	   {
>	       // "close" current element to ensure that no attributes are
added
> -	       aEs.mResultHandler->characters(NS_LITERAL_STRING(""), PR_FALSE);

> +	       aEs.mResultHandler->characters(EmptyString(), PR_FALSE);
>  
> -	       rv = aEs.pushString(NS_LITERAL_STRING(""));
> +	       rv = aEs.pushString(EmptyString());

and here

> Index: extensions/webservices/schema/src/nsSchema.cpp
> ===================================================================

>  nsSchema::nsSchema(nsISchemaCollection* aCollection,
>		      nsIDOMElement* aSchemaElement) 
>  {
>    mCollection = aCollection;  // Weak reference
>    
>    if (aSchemaElement) {
> -    aSchemaElement->GetAttributeNS(NS_LITERAL_STRING(""), 
> +    aSchemaElement->GetAttributeNS(EmptyString(), 
>				      NS_LITERAL_STRING("targetNamespace"), 
>				      mTargetNamespace);
>      mTargetNamespace.Trim(" \r\n\t");
>      aSchemaElement->GetNamespaceURI(mSchemaNamespace);
>  
>      nsAutoString elementFormDefault;
> -    aSchemaElement->GetAttributeNS(NS_LITERAL_STRING(""), 
> +    aSchemaElement->GetAttributeNS(EmptyString(), 

and here

> Index: mailnews/base/src/nsMessenger.cpp
> ===================================================================

> @@ -1121,20 +1121,20 @@ nsMessenger::SaveAs(const char *aURI, PR
>	 rv = CreateStartupUrl(urlString.get(), getter_AddRefs(url));
>	 NS_ASSERTION(NS_SUCCEEDED(rv), "CreateStartupUrl failed");
>	 if (NS_FAILED(rv)) 
>	   goto done;
>	 
>	 saveListener->m_channel = nsnull;
>	 rv = NS_NewInputStreamChannel(getter_AddRefs(saveListener->m_channel),

>	   url, 
>	   nsnull,		   // inputStream
> -	   NS_LITERAL_CSTRING(""), // contentType
> -	   NS_LITERAL_CSTRING("")); // contentCharset
> +	   EmptyCString(),	   // contentType
> +	   EmptyCString());	   // contentCharset

and here

> Index: mailnews/base/util/nsMsgDBFolder.cpp
> ===================================================================

> @@ -1984,19 +1984,19 @@ nsresult nsMsgDBFolder::PromptForCachePa
>	   rv = server->GetServerURI(getter_Copies(currServerUri));
>	   NS_ENSURE_SUCCESS(rv, rv);
>  
>	   currServerUri.Insert('x', 0);
>	   nsCAutoString hostFound;
>	   nsAutoString userNameFound;
>	   nsAutoString passwordFound;
>  
>	   // Get password entry corresponding to the host URI we are passing
in.
> -	   rv = passwordMgrInt->FindPasswordEntry(currServerUri,
NS_LITERAL_STRING(""), NS_LITERAL_STRING(""),
> +	   rv = passwordMgrInt->FindPasswordEntry(currServerUri, EmptyString(),
EmptyString(),

and here

> Index: mailnews/base/util/nsMsgIncomingServer.cpp
> ===================================================================

> @@ -816,19 +816,19 @@ nsMsgIncomingServer::GetPasswordWithUI(c
>	 nsXPIDLCString currServerUri;
>	 rv = GetServerURI(getter_Copies(currServerUri));
>	 NS_ENSURE_SUCCESS(rv, rv);
>  
>	 nsCAutoString hostFound;
>	 nsAutoString userNameFound;
>	 nsAutoString passwordFound;
>  
>	 // Get password entry corresponding to the host URI we are passing in.

> -	 if (NS_SUCCEEDED(passwordMgrInt->FindPasswordEntry(currServerUri,
NS_LITERAL_STRING(""), NS_LITERAL_STRING(""),
> +	 if (NS_SUCCEEDED(passwordMgrInt->FindPasswordEntry(currServerUri,
EmptyString(), EmptyString(),

and here

> Index: netwerk/test/TestStreamChannel.cpp
> ===================================================================

> @@ -210,20 +210,19 @@ RunTest(nsIFile *file)
>      rv = NS_NewLocalFileInputStream(getter_AddRefs(stream), file);
>      if (NS_FAILED(rv)) return rv;
>  
>      nsCOMPtr<nsIURI> uri = do_CreateInstance(kSimpleURICID);
>      if (uri)
>	   uri->SetSpec(NS_LITERAL_CSTRING("foo://bar"));
>  
>      nsCOMPtr<nsIChannel> chan;
>      rv = NS_NewInputStreamChannel(getter_AddRefs(chan), uri, stream,
> -				     NS_LITERAL_CSTRING(""),
> -				     NS_LITERAL_CSTRING(""));
> +				     EmptyCString(), EmptyCString());

and here

> Index: rdf/chrome/src/nsChromeRegistry.cpp
> ===================================================================

> @@ -2842,20 +2842,20 @@ nsChromeRegistry::GetProfileRoot(nsACStr
>	  if (NS_FAILED(rv))
>	    return(rv);
>	  defaultUserContentFile->AppendNative(NS_LITERAL_CSTRING("chrome"));
>	 
defaultUserContentFile->AppendNative(NS_LITERAL_CSTRING("userContent-example.cs
s"));
>	  defaultUserChromeFile->AppendNative(NS_LITERAL_CSTRING("chrome"));
>	 
defaultUserChromeFile->AppendNative(NS_LITERAL_CSTRING("userChrome-example.css"
));
>  
>	  // copy along
>	  // It aint an error if these files dont exist
> -	  (void) defaultUserContentFile->CopyToNative(userChromeDir,
NS_LITERAL_CSTRING(""));
> -	  (void) defaultUserChromeFile->CopyToNative(userChromeDir,
NS_LITERAL_CSTRING(""));
> +	  defaultUserContentFile->CopyToNative(userChromeDir, EmptyCString());
> +	  defaultUserChromeFile->CopyToNative(userChromeDir, EmptyCString());

and here.
0
bugzilla
1/29/2004 10:23:15 AM
netscape.mozilla.reviewers 29156 articles. 0 followers. Follow

0 Replies
1234 Views

Similar Articles

[PageSpeed] 19
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

superreview requested: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String()
Johnny Stenback <jst@mozilla.jstenback.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 232503: Start using Empty[C]String() http://bugzilla.mozilla.org/show_bug.cgi?id=232503 Attachment 140140: Use Empty[C]String() http://bugzilla.mozilla.org/attachment.cgi?id=140140&action=edit ...

superreview granted: [Bug 334189] nsSHistory::PrintHistory should use a string class : [Attachment 218648] reindent file and use string class
jag (Peter Annema) <jag@tty.nl> has granted superreview: Bug 334189: nsSHistory::PrintHistory should use a string class https://bugzilla.mozilla.org/show_bug.cgi?id=334189 Attachment 218648: reindent file and use string class https://bugzilla.mozilla.org/attachment.cgi?id=218648&action=edit ------- Additional Comments from jag (Peter Annema) <jag@tty.nl> Are you re-indenting the whole file, or just that section? ...

superreview granted: [Bug 261798] crash if CSSStyleSheet::insertRule is used with an empty string : [Attachment 160436] Patch with the InsertElementsAt() change that dveditz caught
David Baron <dbaron@dbaron.org> has granted Boris Zbarsky <bzbarsky@mit.edu>'s request for superreview: Bug 261798: crash if CSSStyleSheet::insertRule is used with an empty string https://bugzilla.mozilla.org/show_bug.cgi?id=261798 Attachment 160436: Patch with the InsertElementsAt() change that dveditz caught https://bugzilla.mozilla.org/attachment.cgi?id=160436&action=edit ...

superreview granted: [Bug 289053] ###!!! ASSERTION: |First()| called on an empty string: 'mLength > 0', file r:\mozilla\all-i686-pc-cygwin\dist\include\string\nsTSubstring.h, line 201 : [Attachment 1
Boris Zbarsky <bzbarsky@mit.edu> has granted Jonas Sicking <bugmail@sicking.cc>'s request for superreview: Bug 289053: ###!!! ASSERTION: |First()| called on an empty string: 'mLength > 0', file r:\mozilla\all-i686-pc-cygwin\dist\include\string\nsTSubstring.h, line 201 https://bugzilla.mozilla.org/show_bug.cgi?id=289053 Attachment 179790: patch to fix https://bugzilla.mozilla.org/attachment.cgi?id=179790&action=edit ...

superreview requested: [Bug 334189] nsSHistory::PrintHistory should use a string class : [Attachment 218648] reindent file and use string class
timeless <timeless@bemail.org> has asked jag (Peter Annema) <jag@tty.nl> for superreview: Bug 334189: nsSHistory::PrintHistory should use a string class https://bugzilla.mozilla.org/show_bug.cgi?id=334189 Attachment 218648: reindent file and use string class https://bugzilla.mozilla.org/attachment.cgi?id=218648&action=edit ...

superreview granted: [Bug 220093] inCSSValueSearch incorrectly uses strings : [Attachment 132002] use nsString instead
Boris Zbarsky (on vacation until end of September) <bz-vacation@mit.edu> has granted timeless@myrealbox.com <timeless@bemail.org>'s request for superreview: Bug 220093: inCSSValueSearch incorrectly uses strings http://bugzilla.mozilla.org/show_bug.cgi?id=220093 Attachment 132002: use nsString instead http://bugzilla.mozilla.org/attachment.cgi?id=132002&action=edit ------- Additional Comments from Boris Zbarsky (on vacation until end of September) <bz-vacation@mit.edu> sr=bzbarsky ...

superreview granted: [Bug 341436] ###!!! ASSERTION: URI is empty: '!aURI.IsEmpty()', file c:/mozilla.org/baseline/mozilla/rdf/base/src/nsRDFService.cpp, line 978 : [Attachment 225493] Don't pass null
neil@parkwaycc.co.uk <neil@httl.net> has granted Alex Vincent <ajvincent@gmail.com>'s request for superreview: Bug 341436: ###!!! ASSERTION: URI is empty: '!aURI.IsEmpty()', file c:/mozilla.org/baseline/mozilla/rdf/base/src/nsRDFService.cpp, line 978 https://bugzilla.mozilla.org/show_bug.cgi?id=341436 Attachment 225493: Don't pass null in. https://bugzilla.mozilla.org/attachment.cgi?id=225493&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil@httl.net> Nit: adding a blank line after the return would make the code look nicer...

superreview granted: [Bug 298807] nsIBookmarksService::ResolveKeyword can make a better use of strings : [Attachment 188012] patch (use AString)
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has granted Jungshik Shin <jshin1987@gmail.com>'s request for superreview: Bug 298807: nsIBookmarksService::ResolveKeyword can make a better use of strings https://bugzilla.mozilla.org/show_bug.cgi?id=298807 Attachment 188012: patch (use AString) https://bugzilla.mozilla.org/attachment.cgi?id=188012&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> >- nsDependentString postDataStr(postDataVal); >- *aPostData = ToNewUnicode(post...

superreview granted: [Bug 226439] Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings : [Attachment 150174] tada!
Darin Fisher (IBM) <darin@meer.net> has granted Robert O'Callahan <roc@ocallahan.org>'s request for superreview: Bug 226439: Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings http://bugzilla.mozilla.org/show_bug.cgi?id=226439 Attachment 150174: tada! http://bugzilla.mozilla.org/attachment.cgi?id=150174&action=edit ------- Additional Comments from Darin Fisher (IBM) <darin@meer.net> well done! r+sr=darin ...

superreview granted: [Bug 131867] Our use of setlocale() is not threadsafe : [Attachment 141891] Use a Private string class for floating point numbers
tor@acm.org has granted Kenneth Herron (kherron) <kjh-5727@comcast.net>'s request for superreview: Bug 131867: Our use of setlocale() is not threadsafe http://bugzilla.mozilla.org/show_bug.cgi?id=131867 Attachment 141891: Use a Private string class for floating point numbers http://bugzilla.mozilla.org/attachment.cgi?id=141891&action=edit ...

superreview granted: [Bug 226439] Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings : [Attachment 149104] udpated^2
Darin Fisher (IBM) <darin@meer.net> has granted Robert O'Callahan <roc@ocallahan.org>'s request for superreview: Bug 226439: Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings http://bugzilla.mozilla.org/show_bug.cgi?id=226439 Attachment 149104: udpated^2 http://bugzilla.mozilla.org/attachment.cgi?id=149104&action=edit ------- Additional Comments from Darin Fisher (IBM) <darin@meer.net> no need for a new patch. just drop the LC everywhere, and document the cases where the input string must be lowercase. r+sr=darin with that. ...

superreview granted: [Bug 226439] Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings : [Attachment 145975] revised^2
David Baron <dbaron@dbaron.org> has granted Robert O'Callahan <roc@ocallahan.org>'s request for superreview: Bug 226439: Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings http://bugzilla.mozilla.org/show_bug.cgi?id=226439 Attachment 145975: revised^2 http://bugzilla.mozilla.org/attachment.cgi?id=145975&action=edit ------- Additional Comments from David Baron <dbaron@dbaron.org> The NSCAP_ prefix has always been used only for nsCOMPtr. Perhaps just use NS_? #ifdef-ing includes is a recipe for bustage. However, nsCharTraits.h alr...

superreview granted: [Bug 243034] Make nsWyciwygChannel suck less : [Attachment 148219] Don't concatenate strings with empty strings.
Boris Zbarsky <bzbarsky@mit.edu> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 243034: Make nsWyciwygChannel suck less http://bugzilla.mozilla.org/show_bug.cgi?id=243034 Attachment 148219: Don't concatenate strings with empty strings. http://bugzilla.mozilla.org/attachment.cgi?id=148219&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> r+sr=bzbarsky ...

superreview granted: [Bug 226439] Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings : [Attachment 147310] layout conversion
David Baron <dbaron@dbaron.org> has granted Robert O'Callahan <roc@ocallahan.org>'s request for superreview: Bug 226439: Reduce footprint of nsA(C?)String::Equals() applied to ASCII strings http://bugzilla.mozilla.org/show_bug.cgi?id=226439 Attachment 147310: layout conversion http://bugzilla.mozilla.org/attachment.cgi?id=147310&action=edit ...

Web resources about - superreview granted: [Bug 232503] Start using Empty[C]String() : [Attachment 140140] Use Empty[C]String() - netscape.mozilla.reviewers

Resources last updated: 11/27/2015 8:40:15 AM