From 951244ac3facbb512966938c0c9acdd1eeb87ff6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 3 Aug 2017 22:50:25 +0200 Subject: WAGE: Use MacTextWindow code for copying to clipboard --- engines/wage/gui-console.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'engines') diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp index 53ccb55233..56c111ed5b 100644 --- a/engines/wage/gui-console.cpp +++ b/engines/wage/gui-console.cpp @@ -373,37 +373,7 @@ void Gui::drawInput() { } void Gui::actionCopy() { - if (_selectionStartX == -1) - return; - - int startX = _selectionStartX; - int startY = _selectionStartY; - int endX = _selectionEndX; - int endY = _selectionEndY; - - if (startY > endY) { - SWAP(startX, endX); - SWAP(endX, endY); - } - - _clipboard.clear(); - - for (int i = startY; i <= endY; i++) { - if (startY == endY) { - _clipboard = Common::String(&_lines[i].c_str()[startX], &_lines[i].c_str()[endX]); - break; - } - - if (i == startY) { - _clipboard += &_lines[i].c_str()[startX]; - _clipboard += '\n'; - } else if (i == endY) { - _clipboard += Common::String(_lines[i].c_str(), &_lines[i].c_str()[endX]); - } else { - _clipboard += _lines[i]; - _clipboard += '\n'; - } - } + _clipboard = _consoleWindow->getSelection(); _menu->enableCommand(kMenuEdit, kMenuActionPaste, true); } -- cgit v1.2.3