diff options
author | nyamatongwe <devnull@localhost> | 2009-08-14 01:11:59 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-08-14 01:11:59 +0000 |
commit | b281e49f58e4b5172bafdfe995cf305760f3df8e (patch) | |
tree | 2274a32d2285b8d40640d15880eb7c68fa271fe1 | |
parent | 4b45625b8c583e8c36baa91943f963c1f16b98ec (diff) | |
download | scintilla-mirror-b281e49f58e4b5172bafdfe995cf305760f3df8e.tar.gz |
Fixed problem with drag and drop of rectangular selection
to position after selection where position was not adjusted for
removal of every piece of selection.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index a64130266..b490975e8 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2602,15 +2602,14 @@ void ScintillaGTK::DragDataGet(GtkWidget *widget, GdkDragContext *context, sciThis->GetSelection(selection_data, info, &sciThis->drag); } if (context->action == GDK_ACTION_MOVE) { - SelectionPosition selStart = sciThis->SelectionStart(); - SelectionPosition selEnd = sciThis->SelectionEnd(); - if (sciThis->posDrop > selStart) { - if (sciThis->posDrop > selEnd) - sciThis->posDrop.Add(-((selEnd.Position() - selStart.Position()))); - else - sciThis->posDrop = selStart; - sciThis->posDrop = SelectionPosition( - sciThis->pdoc->ClampPositionIntoDocument(sciThis->posDrop.Position())); + for (size_t r=0; r<sciThis->sel.Count(); r++) { + if (sciThis->posDrop >= sciThis->sel.Range(r).Start()) { + if (sciThis->posDrop > sciThis->sel.Range(r).End()) { + sciThis->posDrop.Add(-sciThis->sel.Range(r).Length()); + } else { + sciThis->posDrop.Add(-SelectionRange(sciThis->posDrop, sciThis->sel.Range(r).Start()).Length()); + } + } } sciThis->ClearSelection(); } |