CtrlLib: ArrayCtrl fixed DnD of last item

git-svn-id: svn://ultimatepp.org/upp/trunk@7834 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-29 15:15:26 +00:00
parent c4785ff1ae
commit a5f1c53b30

View file

@ -2807,13 +2807,17 @@ void ArrayCtrl::InsertDrop(int line, const Vector< Vector<Value> >& data, PasteC
if(data.GetCount() == 0)
return;
if(d.GetAction() == DND_MOVE && self) {
for(int i = GetCount() - 1; i >= 0; i--) {
if(IsSel(i)) {
Remove(i); // Optimize!
if(i < line)
line--;
if(IsMultiSelect())
for(int i = GetCount() - 1; i >= 0; i--) {
if(IsSel(i)) {
Remove(i); // Optimize!
if(i < line)
line--;
}
}
}
else
if(IsCursor())
Remove(GetCursor());
KillCursor();
d.SetAction(DND_COPY);
}