Closed Bug 833988 Opened 7 years ago Closed 7 years ago

Convert nsMsgCompose::BuildMailListArray nsISupportsArray argument to something better

Categories

(MailNews Core :: Composition, defect, trivial)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 21.0

People

(Reporter: aceman, Assigned: neil)

References

()

Details

Attachments

(1 file, 1 obsolete file)

nsresult nsMsgCompose::BuildMailListArray(nsIAbDirectory* parentDir,
                                          nsISupportsArray* array)

and

nsresult nsMsgCompose::GetMailListAddresses(nsString& name, nsISupportsArray* mailListArray, nsIMutableArray** addressesArray)
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #705567 - Flags: review?(neil)
Attachment #705567 - Flags: feedback?(mkmelin+mozilla)
Blocks: 834020
Comment on attachment 705567 [details] [diff] [review]
patch

Review of attachment 705567 [details] [diff] [review]:
-----------------------------------------------------------------

Looks ok afaikt.
Attachment #705567 - Flags: feedback?(mkmelin+mozilla) → feedback+
Comment on attachment 705567 [details] [diff] [review]
patch

>       nsMsgMailList* mailList;
>-      rv = enumerator->CurrentItem((nsISupports**)&mailList);
>+      rv = enumerator->GetNext((nsISupports**)&mailList);
I'm sorry but I can't perpetuate this horror, the code needs a rewrite.
Attachment #705567 - Flags: review?(neil) → review-
Attached patch Proposed patchSplinter Review
* Moved more of the fullname init code into the constructor
* Changed the array from an nsISupportsArray to an nsTArray
* Rewrote GetMailListAddresses to use an IndexOf comparator
Assignee: acelists → neil
Attachment #705567 - Attachment is obsolete: true
Attachment #705819 - Flags: review?(mbanner)
Quite involved rewrite, even the class changed to struct :)
Summary: Convert nsMsgCompose::BuildMailListArray nsISupportsArray argument to nsIMutableArray → Convert nsMsgCompose::BuildMailListArray nsISupportsArray argument to something better
Comment on attachment 705819 [details] [diff] [review]
Proposed patch

Review of attachment 705819 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, and the unit tests pass :-)
Attachment #705819 - Flags: review?(mbanner) → review+
Blocks: 838805
Pushed comm-central changeset c52e29d0ff20.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 21.0
You need to log in before you can comment on or make changes to this bug.