From d4240cac256a9fc8e49e127a602a8ec6e47ba067 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 1 May 2014 10:51:55 +1000 Subject: Consolidate insertion for paste into Editor class and perform line end conversion in Editor. --- gtk/ScintillaGTK.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'gtk') 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(); } } -- cgit v1.2.3