fix listbox insert algorithmus
Modified: trunk/reactos/subsys/system/explorer/shell/pane.cpp
Modified: trunk/reactos/subsys/system/explorer/shell/pane.h
_____
Modified: trunk/reactos/subsys/system/explorer/shell/pane.cpp
--- trunk/reactos/subsys/system/explorer/shell/pane.cpp 2005-05-11
17:12:24 UTC (rev 15221)
+++ trunk/reactos/subsys/system/explorer/shell/pane.cpp 2005-05-11
17:30:21 UTC (rev 15222)
@@ -85,7 +85,7 @@
Entry* entry = _root;
if (entry)
- insert_entries(entry, -1);
+ insert_entries(entry);
init();
@@ -657,12 +657,12 @@
// insert listbox entries after index idx
-void Pane::insert_entries(Entry* dir, int idx)
+int Pane::insert_entries(Entry* dir, int idx)
{
Entry* entry = dir;
if (!entry)
- return;
+ return idx;
for(; entry; entry=entry->_next) {
#ifndef _LEFT_FILES
@@ -685,8 +685,10 @@
ListBox_InsertItemData(_hwnd, idx, entry);
if (_treePane && entry->_expanded)
- insert_entries(entry->_down, idx);
+ idx = insert_entries(entry->_down, idx);
}
+
+ return idx;
}
_____
Modified: trunk/reactos/subsys/system/explorer/shell/pane.h
--- trunk/reactos/subsys/system/explorer/shell/pane.h 2005-05-11
17:12:24 UTC (rev 15221)
+++ trunk/reactos/subsys/system/explorer/shell/pane.h 2005-05-11
17:30:21 UTC (rev 15222)
@@ -92,7 +92,7 @@
void calc_single_width(int col);
void draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int
calcWidthCol=-1);
- void insert_entries(Entry* dir, int idx=-1);
+ int insert_entries(Entry* dir, int idx=-1);
BOOL command(UINT cmd);
int Notify(int id, NMHDR* pnmh);