From f6ad671e48322e34cf23f75ea4abcff008a15e1a 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. --- cocoa/ScintillaCocoa.mm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'cocoa') diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index cf517db2d..98f5bb054 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -984,16 +984,8 @@ void ScintillaCocoa::Paste(bool forceRectangular) pdoc->BeginUndoAction(); ClearSelection(false); - int length = selectedText.Length(); - SelectionPosition selStart = sel.RangeMain().Start(); - if (selectedText.rectangular) - { - PasteRectangular(selStart, selectedText.Data(), length); - } - else - { - InsertPaste(selStart, selectedText.Data(), length); - } + InsertPasteShape(selectedText.Data(), selectedText.Length(), + selectedText.rectangular ? pasteRectangular : pasteStream); pdoc->EndUndoAction(); Redraw(); @@ -1495,8 +1487,7 @@ bool ScintillaCocoa::GetPasteboardData(NSPasteboard* board, SelectionText* selec bool rectangular = bestType == ScintillaRecPboardType; - int len = static_cast(usedLen); - std::string dest = Document::TransformLineEnds((char *)buffer.data(), len, pdoc->eolMode); + std::string dest(buffer.data(), usedLen); selectedText->Copy(dest, pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet , rectangular, false); -- cgit v1.2.3