Ticket #886: textview.patch
File textview.patch, 864 bytes (added by , 18 years ago) |
---|
-
TextView.cpp
1490 1490 NormalizeFont(&newFont); 1491 1491 } 1492 1492 1493 const int32 textLength = fText->Length(); 1494 1493 1495 if (!fStylable) { 1494 1496 // When the text view is not stylable, we always set the whole text's 1495 1497 // style and ignore the offsets 1496 1498 startOffset = 0; 1497 endOffset = fText->Length();1499 endOffset = textLength; 1498 1500 } 1499 1501 1502 // pin offsets at reasonable values 1503 if (startOffset < 0) 1504 startOffset = 0; 1505 else if (startOffset > textLength) 1506 startOffset = textLength; 1507 1508 if (endOffset < 0) 1509 endOffset = 0; 1510 else if (endOffset > textLength) 1511 endOffset = textLength; 1512 1500 1513 // add the style to the style buffer 1501 1514 fStyles->SetStyleRange(startOffset, endOffset, fText->Length(), 1502 1515 fontMode, &newFont, color);