initialize scrollbar parameters to some sensible dummy values.

valgrind reported conditional jumps on uninitialized values
in BufferView.cpp:1920


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2008-04-16 18:18:12 +00:00
parent 2988537f7f
commit bdc6d56cc7
2 changed files with 5 additions and 2 deletions

View File

@ -1602,8 +1602,8 @@ void BufferView::lfunScroll(FuncRequest const & cmd)
{ {
string const scroll_type = cmd.getArg(0); string const scroll_type = cmd.getArg(0);
int const scroll_step = int const scroll_step =
(scroll_type == "line")? d->scrollbarParameters_.single_step (scroll_type == "line") ? d->scrollbarParameters_.single_step
: (scroll_type == "page")? d->scrollbarParameters_.page_step : 0; : (scroll_type == "page") ? d->scrollbarParameters_.page_step : 0;
if (scroll_step == 0) if (scroll_step == 0)
return; return;
string const scroll_quantity = cmd.getArg(1); string const scroll_quantity = cmd.getArg(1);

View File

@ -51,6 +51,9 @@ enum CursorStatus {
/// Scrollbar Parameters. /// Scrollbar Parameters.
struct ScrollbarParameters struct ScrollbarParameters
{ {
ScrollbarParameters()
: min(0), max(1), position(0), single_step(1), page_step(1)
{}
/// Minimum scrollbar position in pixels. /// Minimum scrollbar position in pixels.
int min; int min;
/// Maximum scrollbar position in pixels. /// Maximum scrollbar position in pixels.