Fixing #3040 (DeskCalcs textview showing wrong/multiple styles)

* fixed crash in StyleBuffer::SetStyleFromMode() if any of the given pointers
  is NULL (which is perfectly valid)
* BTextView::SetFontAndColor() now syncs the null style before it sets the 
  range, thus making sure that there is only one style if the view is not 
  stylable

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2009-04-30 18:44:26 +00:00
parent d5ad762913
commit 819c98a383
2 changed files with 34 additions and 30 deletions
+1
View File
@@ -1619,6 +1619,7 @@ BTextView::SetFontAndColor(int32 startOffset, int32 endOffset,
endOffset = textLength;
// add the style to the style buffer
fStyles->SyncNullStyle(startOffset);
fStyles->SetStyleRange(startOffset, endOffset, fText->Length(),
fontMode, &newFont, color);