From d5aba99a5e27c8824c24891b0229c55be74d2b89 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 29 Dec 2004 11:15:22 +0000 Subject: [PATCH] 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 --- src/kits/interface/BTextView/TextView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/BTextView/TextView.cpp b/src/kits/interface/BTextView/TextView.cpp index 5bd66696d4..9c3aea874e 100644 --- a/src/kits/interface/BTextView/TextView.cpp +++ b/src/kits/interface/BTextView/TextView.cpp @@ -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