aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-03 23:09:14 +0200
committerEugene Sandulenko2017-08-04 21:54:20 +0200
commita5fa164b8e944a710dda6dd3c58c578ba88f72d9 (patch)
tree53e2c273a3a2708271a6f6dd0383f4e5762c6f71 /graphics
parent951244ac3facbb512966938c0c9acdd1eeb87ff6 (diff)
downloadscummvm-rg350-a5fa164b8e944a710dda6dd3c58c578ba88f72d9.tar.gz
scummvm-rg350-a5fa164b8e944a710dda6dd3c58c578ba88f72d9.tar.bz2
scummvm-rg350-a5fa164b8e944a710dda6dd3c58c578ba88f72d9.zip
GRAPHICS: MACGUI: Bugfixes for selection copying in MacText
Diffstat (limited to 'graphics')
-rw-r--r--graphics/macgui/mactext.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index f2366790ef..64a8ebfd17 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -500,12 +500,12 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
for (int i = startRow; i <= endRow; i++) {
if (i == startRow && i == endRow) {
- for (uint chunk = 0; chunk < _textLines[i].chunks.size() - 1; chunk++) {
+ for (uint chunk = 0; chunk < _textLines[i].chunks.size(); chunk++) {
if (startCol <= 0) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();
- if (endCol <= _textLines[i].chunks[chunk].text.size())
+ if (endCol >= _textLines[i].chunks[chunk].text.size())
res += _textLines[i].chunks[chunk].text;
else
res += Common::String(_textLines[i].chunks[chunk].text.c_str(), endCol);
@@ -513,7 +513,7 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
if (formatted)
res += _textLines[i].chunks[chunk].toString();
- res += Common::String(_textLines[i].chunks[chunk].text.c_str() + startCol);
+ res += Common::String(_textLines[i].chunks[chunk].text.c_str() + startCol, endCol - startCol);
}
startCol -= _textLines[i].chunks[chunk].text.size();
@@ -523,7 +523,7 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
break;
}
} else if (i == startRow && startCol != 0) {
- for (uint chunk = 0; chunk < _textLines[i].chunks.size() - 1; chunk++) {
+ for (uint chunk = 0; chunk < _textLines[i].chunks.size(); chunk++) {
if (startCol <= 0) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();
@@ -539,11 +539,11 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
startCol -= _textLines[i].chunks[chunk].text.size();
}
} else if (i == endRow) {
- for (uint chunk = 0; chunk < _textLines[i].chunks.size() - 1; chunk++) {
+ for (uint chunk = 0; chunk < _textLines[i].chunks.size(); chunk++) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();
- if (endCol <= _textLines[i].chunks[chunk].text.size())
+ if (endCol >= _textLines[i].chunks[chunk].text.size())
res += _textLines[i].chunks[chunk].text;
else
res += Common::String(_textLines[i].chunks[chunk].text.c_str(), endCol);
@@ -554,7 +554,7 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
break;
}
} else {
- for (uint chunk = 0; chunk < _textLines[i].chunks.size() - 1; chunk++) {
+ for (uint chunk = 0; chunk < _textLines[i].chunks.size(); chunk++) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();