Ensure valid scroll region when deleting/inserting rows

This commit is contained in:
Bjorn Winckler
2008-07-26 20:06:52 +02:00
parent 8c8db3cd4c
commit 37e3e82f7c
+4 -2
View File
@@ -387,7 +387,8 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
//NSLog(@"deleteLinesFromRow:%d lineCount:%d color:%@", row, count, color);
[self lazyResize:NO];
if (row < 0 || row+count > maxRows)
if (row < 0 || row+count > maxRows || bottom > maxRows || left < 0
|| right > maxColumns)
return;
int total = 1 + bottom - row;
@@ -484,7 +485,8 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
//NSLog(@"insertLinesAtRow:%d lineCount:%d color:%@", row, count, color);
[self lazyResize:NO];
if (row < 0 || row+count > maxRows)
if (row < 0 || row+count > maxRows || bottom > maxRows || left < 0
|| right > maxColumns)
return;
int total = 1 + bottom - row;