Closed Bug 100897 Opened 23 years ago Closed 23 years ago

Redeclaration of var outlinerView in line 568 of searchDialog.js

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: stephend)

Details

Attachments

(2 files)

Redeclaration of var outlinerView in line 568.

function HandleDeleteOrMoveMessageCompleted(folder)
{
        var outlinerView =
gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView);
        var outlinerSelection = outlinerView.selection;
        viewSize = outlinerView.rowCount;

        if (gNextMessageViewIndexAfterDelete >= viewSize)
        {
            if (viewSize > 0)
                gNextMessageViewIndexAfterDelete = viewSize - 1;
            else
                gNextMessageViewIndexAfterDelete = -1;
        }

        // if we are about to set the selection with a new element then DON'T clear
        // the selection then add the next message to select. This just generates
        // an extra round of command updating notifications that we are trying to
        // optimize away.
        if (gNextMessageViewIndexAfterDelete != -1) {
            outlinerSelection.select(gNextMessageViewIndexAfterDelete);
            // since gNextMessageViewIndexAfterDelete probably has the same value
            // as the last index we had selected, the outliner isn't generating
a new
            // selectionChanged notification for the outliner view. So we aren't
loading the 
            // next message. to fix this, force the selection changed update.
(right here --->)var outlinerView =
gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView);
            if (outlinerView)
                outlinerView.selectionChanged();
QA Contact: laurel → stephend
r=naving
is gSearchView changed between when we first declare it and the second time?  
if not, we can can just remove the second instance.
It seems the only thing that gets assigned anything new is the global
gNextMessageViewIndexAfterDelete.  I'll remove the second declaration entirely
and start testing.
err, that second redeclaration is not required, the entire line can be 
removed. 
Comment on attachment 50213 [details] [diff] [review]
Fix, part deux.

sr=jst
Attachment #50213 - Flags: superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Marking Verified using todays trunk debug build.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
Component: MailNews: Search → MailNews: Message Display
QA Contact: stephend → search
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: