diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Archive/Nsis/NsisHandler.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/CPP/7zip/Archive/Nsis/NsisHandler.cpp b/CPP/7zip/Archive/Nsis/NsisHandler.cpp index 7a512b7..7ce2e8e 100644 --- a/CPP/7zip/Archive/Nsis/NsisHandler.cpp +++ b/CPP/7zip/Archive/Nsis/NsisHandler.cpp | |||
@@ -73,7 +73,7 @@ static void AddDictProp(AString &s, UInt32 val) | |||
73 | if ((val & ((1 << 20) - 1)) == 0) { val >>= 20; c = 'm'; } | 73 | if ((val & ((1 << 20) - 1)) == 0) { val >>= 20; c = 'm'; } |
74 | else if ((val & ((1 << 10) - 1)) == 0) { val >>= 10; c = 'k'; } | 74 | else if ((val & ((1 << 10) - 1)) == 0) { val >>= 10; c = 'k'; } |
75 | s.Add_UInt32(val); | 75 | s.Add_UInt32(val); |
76 | s += c; | 76 | s.Add_Char(c); |
77 | } | 77 | } |
78 | 78 | ||
79 | static AString GetMethod(bool useFilter, NMethodType::EEnum method, UInt32 dict) | 79 | static AString GetMethod(bool useFilter, NMethodType::EEnum method, UInt32 dict) |
@@ -87,7 +87,7 @@ static AString GetMethod(bool useFilter, NMethodType::EEnum method, UInt32 dict) | |||
87 | s += ((unsigned)method < Z7_ARRAY_SIZE(kMethods)) ? kMethods[(unsigned)method] : kUnknownMethod; | 87 | s += ((unsigned)method < Z7_ARRAY_SIZE(kMethods)) ? kMethods[(unsigned)method] : kUnknownMethod; |
88 | if (method == NMethodType::kLZMA) | 88 | if (method == NMethodType::kLZMA) |
89 | { | 89 | { |
90 | s += ':'; | 90 | s.Add_Colon(); |
91 | AddDictProp(s, dict); | 91 | AddDictProp(s, dict); |
92 | } | 92 | } |
93 | return s; | 93 | return s; |
@@ -105,7 +105,7 @@ AString CHandler::GetMethod(NMethodType::EEnum method, bool useItemFilter, UInt3 | |||
105 | s += (method < Z7_ARRAY_SIZE(kMethods)) ? kMethods[method] : kUnknownMethod; | 105 | s += (method < Z7_ARRAY_SIZE(kMethods)) ? kMethods[method] : kUnknownMethod; |
106 | if (method == NMethodType::kLZMA) | 106 | if (method == NMethodType::kLZMA) |
107 | { | 107 | { |
108 | s += ':'; | 108 | s.Add_Colon(); |
109 | s += GetStringForSizeValue(_archive.IsSolid ? _archive.DictionarySize: dictionary); | 109 | s += GetStringForSizeValue(_archive.IsSolid ? _archive.DictionarySize: dictionary); |
110 | } | 110 | } |
111 | return s; | 111 | return s; |
@@ -427,8 +427,7 @@ Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems, | |||
427 | 427 | ||
428 | extractCallback->SetTotal(totalSize + solidPosMax); | 428 | extractCallback->SetTotal(totalSize + solidPosMax); |
429 | 429 | ||
430 | CLocalProgress *lps = new CLocalProgress; | 430 | CMyComPtr2_Create<ICompressProgressInfo, CLocalProgress> lps; |
431 | CMyComPtr<ICompressProgressInfo> progress = lps; | ||
432 | lps->Init(extractCallback, !_archive.IsSolid); | 431 | lps->Init(extractCallback, !_archive.IsSolid); |
433 | 432 | ||
434 | if (_archive.IsSolid) | 433 | if (_archive.IsSolid) |
@@ -559,7 +558,7 @@ Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems, | |||
559 | } | 558 | } |
560 | else | 559 | else |
561 | { | 560 | { |
562 | HRESULT res = _archive.Decoder.SetToPos(pos, progress); | 561 | HRESULT res = _archive.Decoder.SetToPos(pos, lps); |
563 | if (res != S_OK) | 562 | if (res != S_OK) |
564 | { | 563 | { |
565 | if (res != S_FALSE) | 564 | if (res != S_FALSE) |
@@ -620,7 +619,7 @@ Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems, | |||
620 | writeToTemp1 ? &tempBuf : NULL, | 619 | writeToTemp1 ? &tempBuf : NULL, |
621 | is_PatchedUninstaller, item.PatchSize, | 620 | is_PatchedUninstaller, item.PatchSize, |
622 | is_PatchedUninstaller ? NULL : (ISequentialOutStream *)realOutStream, | 621 | is_PatchedUninstaller ? NULL : (ISequentialOutStream *)realOutStream, |
623 | progress, | 622 | lps, |
624 | curPacked, curUnpacked32); | 623 | curPacked, curUnpacked32); |
625 | curUnpacked = curUnpacked32; | 624 | curUnpacked = curUnpacked32; |
626 | if (_archive.IsSolid) | 625 | if (_archive.IsSolid) |
@@ -665,7 +664,7 @@ Z7_COM7F_IMF(CHandler::Extract(const UInt32 *indices, UInt32 numItems, | |||
665 | writeToTemp ? &tempBuf2 : NULL, | 664 | writeToTemp ? &tempBuf2 : NULL, |
666 | false, 0, | 665 | false, 0, |
667 | realOutStream, | 666 | realOutStream, |
668 | progress, | 667 | lps, |
669 | curPacked2, curUnpacked2); | 668 | curPacked2, curUnpacked2); |
670 | curPacked += curPacked2; | 669 | curPacked += curPacked2; |
671 | if (!_archive.IsSolid) | 670 | if (!_archive.IsSolid) |