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 | f6ad671e48322e34cf23f75ea4abcff008a15e1a (patch) | |
tree | 00c94093fdb057662841a189463d58be2f2741c8 /gtk/ScintillaGTK.cxx | |
parent | 928306bf07dace37ace9eb053b87599ee47145e8 (diff) | |
download | scintilla-mirror-f6ad671e48322e34cf23f75ea4abcff008a15e1a.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(); } } |