diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/UI/FileManager/FSFolder.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/CPP/7zip/UI/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp index 26a2ccf..7956d86 100644 --- a/CPP/7zip/UI/FileManager/FSFolder.cpp +++ b/CPP/7zip/UI/FileManager/FSFolder.cpp | |||
@@ -535,7 +535,7 @@ Z7_COM7F_IMF(CFSFolder::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va | |||
535 | { | 535 | { |
536 | NCOM::CPropVariant prop; | 536 | NCOM::CPropVariant prop; |
537 | /* | 537 | /* |
538 | if (index >= (UInt32)Files.Size()) | 538 | if (index >= Files.Size()) |
539 | { | 539 | { |
540 | CAltStream &ss = Streams[index - Files.Size()]; | 540 | CAltStream &ss = Streams[index - Files.Size()]; |
541 | CDirItem &fi = Files[ss.Parent]; | 541 | CDirItem &fi = Files[ss.Parent]; |
@@ -561,7 +561,7 @@ Z7_COM7F_IMF(CFSFolder::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va | |||
561 | case kpidComment: break; | 561 | case kpidComment: break; |
562 | default: index = ss.Parent; | 562 | default: index = ss.Parent; |
563 | } | 563 | } |
564 | if (index >= (UInt32)Files.Size()) | 564 | if (index >= Files.Size()) |
565 | { | 565 | { |
566 | prop.Detach(value); | 566 | prop.Detach(value); |
567 | return S_OK; | 567 | return S_OK; |
@@ -716,8 +716,8 @@ Z7_COM7F_IMF2(Int32, CFSFolder::CompareItems(UInt32 index1, UInt32 index2, PROPI | |||
716 | /* | 716 | /* |
717 | const CAltStream *ss1 = NULL; | 717 | const CAltStream *ss1 = NULL; |
718 | const CAltStream *ss2 = NULL; | 718 | const CAltStream *ss2 = NULL; |
719 | if (index1 >= (UInt32)Files.Size()) { ss1 = &Streams[index1 - Files.Size()]; index1 = ss1->Parent; } | 719 | if (index1 >= Files.Size()) { ss1 = &Streams[index1 - Files.Size()]; index1 = ss1->Parent; } |
720 | if (index2 >= (UInt32)Files.Size()) { ss2 = &Streams[index2 - Files.Size()]; index2 = ss2->Parent; } | 720 | if (index2 >= Files.Size()) { ss2 = &Streams[index2 - Files.Size()]; index2 = ss2->Parent; } |
721 | */ | 721 | */ |
722 | CDirItem &fi1 = Files[index1]; | 722 | CDirItem &fi1 = Files[index1]; |
723 | CDirItem &fi2 = Files[index2]; | 723 | CDirItem &fi2 = Files[index2]; |
@@ -1034,7 +1034,7 @@ Z7_COM7F_IMF(CFSFolder::GetItemFullSize(UInt32 index, PROPVARIANT *value, IProgr | |||
1034 | 1034 | ||
1035 | Z7_COM7F_IMF(CFSFolder::CalcItemFullSize(UInt32 index, IProgress *progress)) | 1035 | Z7_COM7F_IMF(CFSFolder::CalcItemFullSize(UInt32 index, IProgress *progress)) |
1036 | { | 1036 | { |
1037 | if (index >= (UInt32)Files.Size()) | 1037 | if (index >= Files.Size()) |
1038 | return S_OK; | 1038 | return S_OK; |
1039 | CDirItem &fi = Files[index]; | 1039 | CDirItem &fi = Files[index]; |
1040 | if (!fi.IsDir()) | 1040 | if (!fi.IsDir()) |
@@ -1080,7 +1080,7 @@ Z7_COM7F_IMF(CFSFolder::CreateFile(const wchar_t *name, IProgress * /* progress | |||
1080 | 1080 | ||
1081 | Z7_COM7F_IMF(CFSFolder::Rename(UInt32 index, const wchar_t *newName, IProgress * /* progress */)) | 1081 | Z7_COM7F_IMF(CFSFolder::Rename(UInt32 index, const wchar_t *newName, IProgress * /* progress */)) |
1082 | { | 1082 | { |
1083 | if (index >= (UInt32)Files.Size()) | 1083 | if (index >= Files.Size()) |
1084 | return E_NOTIMPL; | 1084 | return E_NOTIMPL; |
1085 | const CDirItem &fi = Files[index]; | 1085 | const CDirItem &fi = Files[index]; |
1086 | // FString prefix; | 1086 | // FString prefix; |
@@ -1103,9 +1103,9 @@ Z7_COM7F_IMF(CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,IProgress | |||
1103 | UInt32 index = indices[i]; | 1103 | UInt32 index = indices[i]; |
1104 | bool result = true; | 1104 | bool result = true; |
1105 | /* | 1105 | /* |
1106 | if (index >= (UInt32)Files.Size()) | 1106 | if (index >= Files.Size()) |
1107 | { | 1107 | { |
1108 | const CAltStream &ss = Streams[index - (UInt32)Files.Size()]; | 1108 | const CAltStream &ss = Streams[index - Files.Size()]; |
1109 | if (prevDeletedFileIndex != ss.Parent) | 1109 | if (prevDeletedFileIndex != ss.Parent) |
1110 | { | 1110 | { |
1111 | const CDirItem &fi = Files[ss.Parent]; | 1111 | const CDirItem &fi = Files[ss.Parent]; |
@@ -1134,7 +1134,7 @@ Z7_COM7F_IMF(CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,IProgress | |||
1134 | Z7_COM7F_IMF(CFSFolder::SetProperty(UInt32 index, PROPID propID, | 1134 | Z7_COM7F_IMF(CFSFolder::SetProperty(UInt32 index, PROPID propID, |
1135 | const PROPVARIANT *value, IProgress * /* progress */)) | 1135 | const PROPVARIANT *value, IProgress * /* progress */)) |
1136 | { | 1136 | { |
1137 | if (index >= (UInt32)Files.Size()) | 1137 | if (index >= Files.Size()) |
1138 | return E_INVALIDARG; | 1138 | return E_INVALIDARG; |
1139 | CDirItem &fi = Files[index]; | 1139 | CDirItem &fi = Files[index]; |
1140 | if (fi.Parent >= 0) | 1140 | if (fi.Parent >= 0) |
@@ -1172,17 +1172,12 @@ Z7_COM7F_IMF(CFSFolder::SetProperty(UInt32 index, PROPID propID, | |||
1172 | 1172 | ||
1173 | Z7_COM7F_IMF(CFSFolder::GetSystemIconIndex(UInt32 index, Int32 *iconIndex)) | 1173 | Z7_COM7F_IMF(CFSFolder::GetSystemIconIndex(UInt32 index, Int32 *iconIndex)) |
1174 | { | 1174 | { |
1175 | if (index >= (UInt32)Files.Size()) | 1175 | *iconIndex = -1; |
1176 | if (index >= Files.Size()) | ||
1176 | return E_INVALIDARG; | 1177 | return E_INVALIDARG; |
1177 | const CDirItem &fi = Files[index]; | 1178 | const CDirItem &fi = Files[index]; |
1178 | *iconIndex = 0; | 1179 | return Shell_GetFileInfo_SysIconIndex_for_Path_return_HRESULT( |
1179 | int iconIndexTemp; | 1180 | _path + GetRelPath(fi), fi.Attrib, iconIndex); |
1180 | if (GetRealIconIndex(_path + GetRelPath(fi), fi.Attrib, iconIndexTemp) != 0) | ||
1181 | { | ||
1182 | *iconIndex = iconIndexTemp; | ||
1183 | return S_OK; | ||
1184 | } | ||
1185 | return GetLastError_noZero_HRESULT(); | ||
1186 | } | 1181 | } |
1187 | 1182 | ||
1188 | Z7_COM7F_IMF(CFSFolder::SetFlatMode(Int32 flatMode)) | 1183 | Z7_COM7F_IMF(CFSFolder::SetFlatMode(Int32 flatMode)) |