Modify

Opened 12 years ago

Closed 11 years ago

#2340 closed Bug (Completed)

_GUICtrlListView_SimpleSort changes sort parameter variable value

Reported by: BrewManNH Owned by: guinness
Milestone: 3.3.9.8 Component: Standard UDFs
Version: 3.3.9.4 Severity: None
Keywords: Cc:

Description

In reference to this thread http://www.autoitscript.com/forum/topic/149831-help-on-listview-sorting/, I noticed that the function, _GUICtrlListView_SimpleSort, is changing the value of the variable passed to the function after it's done with sorting the listview.

What this does is it arbitrarily changes a value that a user passes it in their script, without telling them that it does so, and for no discernible reason, that I can see. It's inverting the value of the $vDescending variable, which is passed ByRef, from true to false or from false to true, after it has sorted the listview and recreated it. This, in my opinion, shouldn't be happening, because it can cause issues with code that uses this sort especially since it's not mentioned anywhere that it's doing this.

This section of code should be removed unless someone can explain why it's necessary, or why it's good practice.

If (IsArray($vDescending)) Then
	$vDescending[$iCol] = Not $b_desc
Else
	$vDescending = Not $b_desc
EndIf

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by guinness

  • Milestone set to 3.3.9.8
  • Owner set to guinness
  • Resolution set to Completed
  • Status changed from new to closed

Added by revision [7935] in version: 3.3.9.8

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain guinness.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.