SetFontAndColor() now ignores the offset when the text view is not stylable.

This fixes BTextControl's text staying gray when it was once disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16646 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-03-08 14:48:08 +00:00
parent da9b743b20
commit 318b5ed2cc
@@ -1523,6 +1523,13 @@ BTextView::SetFontAndColor(int32 startOffset, int32 endOffset, const BFont* font
NormalizeFont(&newFont);
}
if (!fStylable) {
// When the text view is not stylable, we always set the whole text's
// style and ignore the offsets
startOffset = 0;
endOffset = fText->Length();
}
// add the style to the style buffer
fStyles->SetStyleRange(startOffset, endOffset, fText->Length(),
fontMode, &newFont, color);