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 /cocoa/ScintillaCocoa.mm | |
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 'cocoa/ScintillaCocoa.mm')
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 15 |
1 files changed, 3 insertions, 12 deletions
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<int>(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); |