From 01e63caf83e2762c076de5745c18ba667ff4a9bd Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 22 Apr 2010 02:02:55 +0000 Subject: [PATCH] When creating a new pose, the index offset at which it was inserted in list mode was never passed back. Consequently, when creating a new folder via the cmd+N shortcut (which immediately goes into edit mode), the TextWidget for editing would appear at the wrong location. Fixes ticket #5774. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36408 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 9 ++++++--- src/kits/tracker/PoseView.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 1f305220a3..06d90d2bce 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -1653,7 +1653,7 @@ BPoseView::AddPosesThreadValid(const entry_ref *ref) const void BPoseView::AddPoseToList(PoseList *list, bool visibleList, bool insertionSort, - BPose *pose, BRect &viewBounds, float &listViewScrollBy, bool forceDraw) + BPose *pose, BRect &viewBounds, float &listViewScrollBy, bool forceDraw, int32 *indexPtr) { int32 poseIndex = list->CountItems(); @@ -1732,6 +1732,9 @@ BPoseView::AddPoseToList(PoseList *list, bool visibleList, bool insertionSort, if (viewBounds.Intersects(poseBounds)) SynchronousUpdate(poseBounds); } + + if (indexPtr) + *indexPtr = poseIndex; } @@ -1793,11 +1796,11 @@ BPoseView::CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count, case kListMode: { AddPoseToList(fPoseList, !fFiltering, insertionSort, pose, - viewBounds, listViewScrollBy, forceDraw); + viewBounds, listViewScrollBy, forceDraw, &poseIndex); if (fFiltering && FilterPose(pose)) { AddPoseToList(fFilteredPoseList, true, insertionSort, pose, - viewBounds, listViewScrollBy, forceDraw); + viewBounds, listViewScrollBy, forceDraw, &poseIndex); } break; diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h index 78747a84fc..36e2c1ce2b 100644 --- a/src/kits/tracker/PoseView.h +++ b/src/kits/tracker/PoseView.h @@ -446,7 +446,7 @@ class BPoseView : public BView { void AddPoseToList(PoseList *list, bool visibleList, bool insertionSort, BPose *pose, BRect &viewBounds, float &listViewScrollBy, - bool forceDraw); + bool forceDraw, int32 *indexPtr = NULL); BPose *CreatePose(Model *, PoseInfo *, bool insertionSort = true, int32 *index = 0, BRect *boundsPtr = 0, bool forceDraw = true); virtual void CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count,