aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui/mactextwindow.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-03 22:50:01 +0200
committerEugene Sandulenko2017-08-04 21:54:20 +0200
commit23649e8d87bf2c1d8c93fa0c4a6502285b258429 (patch)
treebb1e573839ee5fbee1db80ae21b61c7136ce50ce /graphics/macgui/mactextwindow.cpp
parent66f59aa893449596298a2cee1d8f761bcf8cc9bd (diff)
downloadscummvm-rg350-23649e8d87bf2c1d8c93fa0c4a6502285b258429.tar.gz
scummvm-rg350-23649e8d87bf2c1d8c93fa0c4a6502285b258429.tar.bz2
scummvm-rg350-23649e8d87bf2c1d8c93fa0c4a6502285b258429.zip
GRAPHICS: MACGUI: Initial code for copying selection to clipboard
Diffstat (limited to 'graphics/macgui/mactextwindow.cpp')
-rw-r--r--graphics/macgui/mactextwindow.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index 9d1de2f129..fb75f41cc5 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -212,6 +212,20 @@ void MacTextWindow::drawSelection() {
}
}
+Common::String MacTextWindow::getSelection(bool formatted) {
+ if (_selectedText.endY == -1)
+ return Common::String("");
+
+ SelectedText s = _selectedText;
+
+ if (s.startY > s.endY) {
+ SWAP(s.startRow, s.endRow);
+ SWAP(s.startCol, s.endCol);
+ }
+
+ return _mactext->getTextChunk(s.startRow, s.startCol, s.endRow, s.endCol, formatted);
+}
+
bool MacTextWindow::processEvent(Common::Event &event) {
/*WindowClick click =*/ isInBorder(event.mouse.x, event.mouse.y);