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

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'far2l/src/mix/format.cpp')
-rw-r--r--far2l/src/mix/format.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/far2l/src/mix/format.cpp b/far2l/src/mix/format.cpp
index 2a36f985..653ac059 100644
--- a/far2l/src/mix/format.cpp
+++ b/far2l/src/mix/format.cpp
@@ -80,18 +80,14 @@ void BaseFormat::Put(LPCWSTR Data, size_t Length)
FARString OutStr(Data, Length);
- size_t Count = _Cells ? OutStr.CellsCount() : OutStr.GetLength();
+ const size_t Count = _Cells ? OutStr.CellsCount() : OutStr.GetLength();
- if (_Align == fmt::A_RIGHT)
+ if (_Expand > Count)
{
- for(;Count < _Expand; ++Count)
- {
- OutStr.Insert(0, _FillChar);
- }
- }
- else if (_Expand > Count)
- {
- OutStr.Append(_FillChar, _Expand - Count);
+ if (_Align == fmt::A_RIGHT)
+ OutStr.Insert(0, _FillChar, _Expand - Count);
+ else
+ OutStr.Append(_FillChar, _Expand - Count);
}
Commit(OutStr);