﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
759	_GUICtrlListView_GetItemTextString() --> BIG speed optimize	Zedna	Jpm	"$iSelected = _GUICtrlListView_GetNextItem($hWnd)
should be before FOR NEXT loop and not inside.

When I need to get text of all listview items then this function will be called many times: number of rows * number of columns!

original:

{{{
Func _GUICtrlListView_GetItemTextString($hWnd, $iItem = -1)
	If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd)
	Local $sRow = """", $SeparatorChar = Opt('GUIDataSeparatorChar')
	If $iItem <> -1 Then ; get row
		For $x = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1
			$sRow &= _GUICtrlListView_GetItemText($hWnd, $iItem, $x) & $SeparatorChar
		Next
		Return StringTrimRight($sRow, 1)
	Else ; get current row selected
		For $x = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1
			$sRow &= _GUICtrlListView_GetItemText($hWnd, _GUICtrlListView_GetNextItem($hWnd), $x) & $SeparatorChar
		Next
		Return StringTrimRight($sRow, 1)
	EndIf
EndFunc   ;==>_GUICtrlListView_GetItemTextString

}}}

optimized:

{{{
Func _GUICtrlListView_GetItemTextString($hWnd, $iItem = -1)
	If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd)
	Local $sRow = """", $SeparatorChar = Opt('GUIDataSeparatorChar')
	If $iItem <> -1 Then ; get row
		For $x = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1
			$sRow &= _GUICtrlListView_GetItemText($hWnd, $iItem, $x) & $SeparatorChar
		Next
		Return StringTrimRight($sRow, 1)
	Else ; get current row selected
		$iSelected = _GUICtrlListView_GetNextItem($hWnd)
		For $x = 0 To _GUICtrlListView_GetColumnCount($hWnd) - 1
			$sRow &= _GUICtrlListView_GetItemText($hWnd, $iSelected, $x) & $SeparatorChar
		Next
		Return StringTrimRight($sRow, 1)
	EndIf
EndFunc   ;==>_GUICtrlListView_GetItemTextString

}}}
"	Bug	closed	3.3.1.0	Standard UDFs	3.2.12.1	None	Fixed		
