From c327cd0a03837f97b2086f73c56be2f2877f0447 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 6 Dec 2003 21:04:22 +0000 Subject: [PATCH] adjust displayed file tree svn path=/trunk/; revision=6869 --- reactos/subsys/system/explorer/shell/pane.cpp | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/pane.cpp b/reactos/subsys/system/explorer/shell/pane.cpp index 0a18e95b9d2..4a700b1f7e9 100644 --- a/reactos/subsys/system/explorer/shell/pane.cpp +++ b/reactos/subsys/system/explorer/shell/pane.cpp @@ -406,14 +406,23 @@ void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol) do { x -= IMAGE_WIDTH+_out_wrkr._spaceSize.cx; - if (up->_next + if (up->_next) { #ifndef _LEFT_FILES - && ((up->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) // a directory? - || up->_next->_down) // a file with NTFS sub-streams? + bool following_child = (up->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory? + + if (!following_child) + for(Entry*n=up->_next; n; n=n->_next) + if (n->_down) { // any file with NTFS sub-streams? + following_child = true; + break; + } + + if (following_child) #endif - ) { - MoveToEx(dis->hDC, x, dis->rcItem.top, 0); - LineTo(dis->hDC, x, dis->rcItem.bottom); + { + MoveToEx(dis->hDC, x, dis->rcItem.top, 0); + LineTo(dis->hDC, x, dis->rcItem.bottom); + } } } while((up=up->_up) != NULL); } @@ -423,13 +432,21 @@ void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol) MoveToEx(dis->hDC, x, dis->rcItem.top, 0); LineTo(dis->hDC, x, y); - if (entry->_next + if (entry->_next) { #ifndef _LEFT_FILES - && ((entry->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) // a directory? - || entry->_next->_down) // a file with NTFS sub-streams? + bool following_child = (entry->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory? + + if (!following_child) + for(Entry*n=entry->_next; n; n=n->_next) + if (n->_down) { // any file with NTFS sub-streams? + following_child = true; + break; + } + + if (following_child) #endif - ) - LineTo(dis->hDC, x, dis->rcItem.bottom); + LineTo(dis->hDC, x, dis->rcItem.bottom); + } if (entry->_down && entry->_expanded) { x += IMAGE_WIDTH + _out_wrkr._spaceSize.cx;