From a9fa3927cb385ab1788576cd991e2b3eb85373e1 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 1 Sep 2012 15:06:26 +0200 Subject: [PATCH] Fixed issue #1371: Log window does not always remember column order correctly Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Git/GitStatusListCtrl.h | 3 +-- src/TortoiseProc/GitStatusListCtrlHelpers.cpp | 10 +++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 0f8d7070b..aea66e3e5 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -37,6 +37,7 @@ Released: unreleased * Fixed issue #1076: Error trying to delete remote branch named 1.0.0 * Fixed issue #1375: Wrong default action on dialog to delete references * Fixed issue #1378: Ignoring a file into info/exclude with seperate .git directory failed + * Fixed issue #1371: Log window does not always remember column order correctly = Release 1.7.12.0 = Released: 2012-08-10 diff --git a/src/Git/GitStatusListCtrl.h b/src/Git/GitStatusListCtrl.h index ff3cc31c2..a326245c1 100644 --- a/src/Git/GitStatusListCtrl.h +++ b/src/Git/GitStatusListCtrl.h @@ -215,10 +215,9 @@ public: // visible item - otherwise the 'invisible' columns are not at the far left // anymore and we get all kinds of redrawing problems. && (header->pitem) - && (header->pitem->iOrder > GetInvisibleCount())) + && (header->pitem->iOrder >= GetInvisibleCount())) { ColumnMoved (header->iItem, header->pitem->iOrder); - *pResult = FALSE; } } diff --git a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp index 8b84b33a0..dfb1bfbac 100644 --- a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp +++ b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp @@ -321,15 +321,11 @@ void ColumnManager::ColumnMoved (int column, int position) size_t visiblePosition = static_cast(position); size_t columnCount = gridColumnOrder.size(); - for (; (visiblePosition < columnCount) - && !columns[gridColumnOrder[visiblePosition]].visible - ; ++visiblePosition ) - { - } - int next = -1; - if (visiblePosition != columnCount) + if (visiblePosition < columnCount - 1) { + // the new position (visiblePosition) is the column id w/o the moved column + gridColumnOrder.erase(std::find(gridColumnOrder.begin(), gridColumnOrder.end(), index)); next = gridColumnOrder[visiblePosition]; } -- 2.11.4.GIT