diff options
author | Neil <nyamatongwe@gmail.com> | 2014-05-01 10:51:55 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-05-01 10:51:55 +1000 |
commit | d4240cac256a9fc8e49e127a602a8ec6e47ba067 (patch) | |
tree | b95f529ed4a663877831868f4cbce56e65ad1cbe /gtk/ScintillaGTK.cxx | |
parent | 87c435a58c291770bedbc1302a86dacff14cac4f (diff) | |
download | scintilla-mirror-d4240cac256a9fc8e49e127a602a8ec6e47ba067.tar.gz |
Consolidate insertion for paste into Editor class and perform line end
conversion in Editor.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r-- | gtk/ScintillaGTK.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 236778d93..f13686077 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1496,7 +1496,7 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio len--; // Forget the extra '\0' #endif - std::string dest = Document::TransformLineEnds(data, len, pdoc->eolMode); + std::string dest(data, len); if (selectionTypeData == GDK_TARGET_STRING) { if (IsUnicodeMode()) { // Unknown encoding so assume in Latin1 @@ -1537,15 +1537,9 @@ void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) { if (SelectionOfGSD(selection_data) != GDK_SELECTION_PRIMARY) { ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH); } - SelectionPosition selStart = sel.IsRectangular() ? - sel.Rectangular().Start() : - sel.Range(sel.Main()).Start(); - if (selText.rectangular) { - PasteRectangular(selStart, selText.Data(), selText.Length()); - } else { - InsertPaste(selStart, selText.Data(), selText.Length()); - } + InsertPasteShape(selText.Data(), selText.Length(), + selText.rectangular ? pasteRectangular : pasteStream); EnsureCaretVisible(); } } |