Refresh() has to do some operations even if there is no window available.

This fixes a bug in Diskprobe, thanks to Axel for reporting.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10543 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2004-12-29 11:15:22 +00:00
parent c05649ebef
commit d5aba99a5e
+5 -5
View File
@@ -3232,20 +3232,20 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase,
bool scroll)
{
// TODO: Cleanup
ASSERT(Window() != NULL);
if (!Window())
return;
float saveHeight = fTextRect.Height();
int32 fromLine = LineAt(fromOffset);
int32 toLine = LineAt(toOffset);
int32 saveFromLine = fromLine;
int32 saveToLine = toLine;
float saveLineHeight = LineHeight(fromLine);
BRect bounds = Bounds();
RecalculateLineBreaks(&fromLine, &toLine);
// TODO: Maybe there is still something we can do without a window...
if (!Window())
return;
BRect bounds = Bounds();
float newHeight = fTextRect.Height();
// if the line breaks have changed, force an erase