aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-05-01 10:51:55 +1000
committerNeil <nyamatongwe@gmail.com>2014-05-01 10:51:55 +1000
commitd4240cac256a9fc8e49e127a602a8ec6e47ba067 (patch)
treeb95f529ed4a663877831868f4cbce56e65ad1cbe /cocoa
parent87c435a58c291770bedbc1302a86dacff14cac4f (diff)
downloadscintilla-mirror-d4240cac256a9fc8e49e127a602a8ec6e47ba067.tar.gz
Consolidate insertion for paste into Editor class and perform line end
conversion in Editor.
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/ScintillaCocoa.mm15
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);