Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/UI/FileManager/PanelItemOpen.cpp')
-rwxr-xr-xCPP/7zip/UI/FileManager/PanelItemOpen.cpp47
1 files changed, 29 insertions, 18 deletions
diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
index 15e01483..12206786 100755
--- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
+++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
@@ -163,40 +163,51 @@ HRESULT CPanel::OpenParentArchiveFolder()
return S_OK;
}
-static const wchar_t *kStartExtensions[] =
-{
+static const char *kStartExtensions =
#ifdef UNDER_CE
- L"cab",
+ " cab"
#endif
- L"exe", L"bat", L"com",
- L"chm",
- L"msi", L"doc", L"xls", L"ppt", L"pps", L"wps", L"wpt", L"wks", L"xlr", L"wdb",
+ " exe bat com"
+ " chm"
+ " msi doc xls ppt pps wps wpt wks xlr wdb"
- L"docx", L"docm", L"dotx", L"dotm", L"xlsx", L"xlsm", L"xltx", L"xltm", L"xlsb",
- L"xlam", L"pptx", L"pptm", L"potx", L"potm", L"ppam", L"ppsx", L"ppsm", L"xsn",
- L"msg",
- L"dwf",
+ " docx docm dotx dotm xlsx xlsm xltx xltm xlsb"
+ " xlam pptx pptm potx potm ppam ppsx ppsm xsn"
+ " mpp"
+ " msg"
+ " dwf"
- L"flv", L"swf",
+ " flv swf"
- L"odt", L"ods",
- L"wb3",
- L"pdf"
-};
+ " odt ods"
+ " wb3"
+ " pdf"
+ " ";
-static bool DoItemAlwaysStart(const UString &name)
+static bool FindExt(const char *p, const UString &name)
{
int extPos = name.ReverseFind('.');
if (extPos < 0)
return false;
UString ext = name.Mid(extPos + 1);
ext.MakeLower();
- for (int i = 0; i < sizeof(kStartExtensions) / sizeof(kStartExtensions[0]); i++)
- if (ext.Compare(kStartExtensions[i]) == 0)
+ AString ext2 = UnicodeStringToMultiByte(ext);
+ for (int i = 0; p[i] != 0;)
+ {
+ int j;
+ for (j = i; p[j] != ' '; j++);
+ if (ext2.Length() == j - i && memcmp(p + i, (const char *)ext2, ext2.Length()) == 0)
return true;
+ i = j + 1;
+ }
return false;
}
+static bool DoItemAlwaysStart(const UString &name)
+{
+ return FindExt(kStartExtensions, name);
+}
+
static UString GetQuotedString(const UString &s)
{
return UString(L'\"') + s + UString(L'\"');