void FileList::MoveSelection(FileListItem **ListData,long FileCount, FileListItem **OldData,long OldFileCount) { FileListItem **OldPtr; SelFileCount=0; SelFileSize=0; CacheSelIndex=-1; CacheSelClearIndex=-1; qsortex(reinterpret_cast<char*>(OldData),OldFileCount,sizeof(*OldData),SortSearchList,nullptr); while (FileCount--) { OldPtr=(FileListItem **)bsearchex(ListData,(void *)OldData, OldFileCount,sizeof(*ListData),SortSearchList,nullptr); if (OldPtr) { if (OldPtr[0]->ShowFolderSize) { ListData[0]->ShowFolderSize=2; ListData[0]->FileSize=OldPtr[0]->FileSize; ListData[0]->AllocationSize=OldPtr[0]->AllocationSize; } Select(ListData[0],OldPtr[0]->Selected); ListData[0]->PrevSelected=OldPtr[0]->PrevSelected; } ListData++; } }
int DizList::GetDizPos(const string& Name, int *TextPos) { if (!DizData || !*Name) return -1; if (NeedRebuild) BuildIndex(); SearchDizData=DizData; string DizSearchKey(Name); int *DestIndex=(int *)bsearchex(&DizSearchKey,IndexData,IndexCount,sizeof(*IndexData),SortDizSearch,nullptr); if (DestIndex) { if (TextPos) { *TextPos=DizData[*DestIndex]->NameStart+DizData[*DestIndex]->NameLength; if (DizData[*DestIndex]->NameStart && DizData[*DestIndex]->DizText[*TextPos]==L'\"') (*TextPos)++; } return *DestIndex; } return -1; }