Fix issue #190 (level 0 = copy!)

This commit is contained in:
Tino Reichardt
2021-05-15 06:12:53 +02:00
parent 13ab23699f
commit f8207b4ab3

View File

@@ -190,6 +190,7 @@ static const EMethodID g_Lz5Methods[] =
static const EMethodID g_7zMethods[] = static const EMethodID g_7zMethods[] =
{ {
kCopy,
kZSTD, kZSTD,
kBROTLI, kBROTLI,
kLZ4, kLZ4,
@@ -219,6 +220,7 @@ static const EMethodID g_7zSfxMethods[] =
static const EMethodID g_ZipMethods[] = static const EMethodID g_ZipMethods[] =
{ {
kCopy,
kDeflate, kDeflate,
kDeflate64, kDeflate64,
kBZip2, kBZip2,
@@ -317,7 +319,7 @@ static const CFormatInfo g_Formats[] =
}, },
{ {
"zstd", /* 6 */ "zstd", /* 6 */
(1 << 0) | (1 << 1) | (1 << 5) | (1 << 11) | (1 << 17) | (1 << 22), (1 << 1) | (1 << 3) | (1 << 5) | (1 << 11) | (1 << 17) | (1 << 22),
METHODS_PAIR(g_ZstdMethods), METHODS_PAIR(g_ZstdMethods),
false, false, true, false, false, false false, false, true, false, false, false
}, },
@@ -335,13 +337,13 @@ static const CFormatInfo g_Formats[] =
}, },
{ {
"LZ4", /* 9 */ "LZ4", /* 9 */
(1 << 0) | (1 << 1) | (1 << 3) | (1 << 6) | (1 << 9) | (1 << 12), (1 << 1) | (1 << 3) | (1 << 6) | (1 << 9) | (1 << 12),
METHODS_PAIR(g_Lz4Methods), METHODS_PAIR(g_Lz4Methods),
false, false, true, false, false, false false, false, true, false, false, false
}, },
{ {
"LZ5", /* 10 */ "LZ5", /* 10 */
(1 << 0) | (1 << 1) | (1 << 3) | (1 << 7) | (1 << 11) | (1 << 15), (1 << 1) | (1 << 3) | (1 << 7) | (1 << 11) | (1 << 15),
METHODS_PAIR(g_Lz5Methods), METHODS_PAIR(g_Lz5Methods),
false, false, true, false, false, false false, false, true, false, false, false
}, },
@@ -1129,16 +1131,21 @@ void CCompressDialog::SetLevel()
{ {
UInt32 level = GetLevel2(); UInt32 level = GetLevel2();
UInt32 LevelsMask; UInt32 LevelsMask;
UInt32 LevelsStart = 0; UInt32 LevelsStart = 1;
UInt32 LevelsEnd = 22; UInt32 LevelsEnd = 22;
UInt32 langID = 0; UInt32 langID = 0;
unsigned i, ir; unsigned i, ir;
if (GetMethodID() == kZSTD) if (GetMethodID() == kCopy) {
LevelsStart = 0;
LevelsEnd = 0;
LevelsMask = g_Formats[0].LevelsMask;
} else if (GetMethodID() == kZSTD) {
LevelsMask = g_Formats[6].LevelsMask; LevelsMask = g_Formats[6].LevelsMask;
else if (GetMethodID() == kBROTLI) } else if (GetMethodID() == kBROTLI) {
LevelsStart = 0;
LevelsMask = g_Formats[7].LevelsMask; LevelsMask = g_Formats[7].LevelsMask;
else if (GetMethodID() == kLIZARD_M1) { } else if (GetMethodID() == kLIZARD_M1) {
LevelsMask = g_Formats[8].LevelsMask; LevelsMask = g_Formats[8].LevelsMask;
LevelsStart = 10; LevelsStart = 10;
LevelsEnd = 19; LevelsEnd = 19;