From e0c193fa9291dc5ae0214c049dc6a4784a6dcf51 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 26 Oct 2006 08:10:22 +0000 Subject: [PATCH] add some initialization and some assertion. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15554 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BufferView.C b/src/BufferView.C index 5b31f80b56..ea667c43f9 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -123,7 +123,7 @@ T * getInsetByCode(LCursor & cur, InsetBase::Code code) BufferView::BufferView() - : buffer_(0), wh_(0), + : buffer_(0), wh_(0), width_(0), height_(0), cursor_(*this), multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0), intl_(new Intl) @@ -431,11 +431,14 @@ void BufferView::updateScrollbar() sumh += h2; nh++; } + + BOOST_ASSERT(nh); int const hav = sumh / nh; // More realistic average paragraph height if (hav > wh_) wh_ = hav; + BOOST_ASSERT(h); scrollbarParameters_.height = (parsize + 1) * wh_; scrollbarParameters_.position = anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h)); scrollbarParameters_.lineScrollHeight = int(wh_ * defaultRowHeight() / float(h)); -- 2.39.2