diff options
author | nyamatongwe <unknown> | 2009-08-14 01:11:59 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2009-08-14 01:11:59 +0000 |
commit | abd743906f40d2a5fe74862795977842a7f797b2 (patch) | |
tree | 2274a32d2285b8d40640d15880eb7c68fa271fe1 | |
parent | f7736b95cb8c764d5031b92308a87d502f7f0ae6 (diff) | |
download | scintilla-mirror-abd743906f40d2a5fe74862795977842a7f797b2.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(); } |