diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-10-24 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:55 +0300 |
commit | acd742622d1e0daf50ae815bec4ddb2143bafbf5 (patch) | |
tree | 9726a4b8de0935af6c892a2b8d632284f37570c4 /CPP/7zip/UI/FileManager | |
parent | b67ffe691bddceb89b47dd09a60203b77a2b72ed (diff) |
4.56 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager')
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolder.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog2.rc | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/TextPairs.cpp | 27 |
3 files changed, 16 insertions, 17 deletions
diff --git a/CPP/7zip/UI/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp index f6994066..aeb3b333 100755 --- a/CPP/7zip/UI/FileManager/FSFolder.cpp +++ b/CPP/7zip/UI/FileManager/FSFolder.cpp @@ -185,7 +185,6 @@ bool CFSFolder::LoadComments() file.Read(p, (UInt32)length, processedSize); p[length] = 0; s.ReleaseBuffer(); - s.Replace("\r\n", "\n"); if (processedSize != length) return false; file.Close(); @@ -218,7 +217,6 @@ bool CFSFolder::SaveComments() Byte bom [] = { 0xEF, 0xBB, 0xBF, 0x0D, 0x0A }; file.Write(bom , sizeof(bom), processedSize); } - utfString.Replace("\n", "\r\n"); file.Write(utfString, utfString.Length(), processedSize); _commentsAreLoaded = false; return true; diff --git a/CPP/7zip/UI/FileManager/ProgressDialog2.rc b/CPP/7zip/UI/FileManager/ProgressDialog2.rc index 5818dfb3..d505033f 100755 --- a/CPP/7zip/UI/FileManager/ProgressDialog2.rc +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.rc @@ -1,7 +1,7 @@ #include "ProgressDialog2Res.h" #include "../../GuiCommon.rc" -#define xSize2 300 +#define xSize2 320 #define ySize2 98 #define xSize (xSize2 + marg + marg) @@ -18,7 +18,7 @@ #define x0Size 90 #define x1 (marg + x0Size) -#define x1Size 40 +#define x1Size 70 #define x3Size 40 #define x3 (xSize - marg - x3Size) diff --git a/CPP/7zip/UI/FileManager/TextPairs.cpp b/CPP/7zip/UI/FileManager/TextPairs.cpp index 76c97b8c..a149fe37 100755 --- a/CPP/7zip/UI/FileManager/TextPairs.cpp +++ b/CPP/7zip/UI/FileManager/TextPairs.cpp @@ -22,6 +22,11 @@ static bool IsSeparatorChar(wchar_t c) return (c == kSpaceChar || c == kTabChar); } +void RemoveCr(UString &s) +{ + s.Replace(L"\x0D", L""); +} + static UString GetIDString(const wchar_t *srcString, int &finishPos) { UString result; @@ -42,6 +47,7 @@ static UString GetIDString(const wchar_t *srcString, int &finishPos) result += c; } result.Trim(); + RemoveCr(result); return result; } @@ -59,34 +65,28 @@ static UString GetValueString(const wchar_t *srcString, int &finishPos) result += c; } result.Trim(); + RemoveCr(result); return result; } static bool GetTextPairs(const UString &srcString, CObjectVector<CTextPair> &pairs) { pairs.Clear(); - UString srcString2 = srcString; - srcString2.Replace(L"\x0D", L""); - - pairs.Clear(); int pos = 0; - ///////////////////// - // read strings - - if (srcString2.Length() > 0) + if (srcString.Length() > 0) { - if (srcString2[0] == kBOM) + if (srcString[0] == kBOM) pos++; } - while (pos < srcString2.Length()) + while (pos < srcString.Length()) { int finishPos; - UString id = GetIDString((const wchar_t *)srcString2 + pos, finishPos); + UString id = GetIDString((const wchar_t *)srcString + pos, finishPos); pos += finishPos; if (id.IsEmpty()) continue; - UString value = GetValueString((const wchar_t *)srcString2 + pos, finishPos); + UString value = GetValueString((const wchar_t *)srcString + pos, finishPos); pos += finishPos; if (!id.IsEmpty()) { @@ -195,7 +195,7 @@ bool CPairsStorage::ReadFromString(const UString &text) Sort(); else Pairs.Clear(); - return result; + return result; } void CPairsStorage::SaveToString(UString &text) @@ -211,6 +211,7 @@ void CPairsStorage::SaveToString(UString &text) text += L'\"'; text += L' '; text += pair.Value; + text += L'\x0D'; text += L'\n'; } } |