Menu

#21 Fatal Alert: ScrollBar.c

open-accepted
nobody
5
2005-07-10
2005-05-11
No

Received the following Fatal Alert several times now:

Fatal Alert
ScrollBar.c, Line:618, Invalid scroll parameter

Was able to reproduce this fault: Launch Plogit.
Select "New Post".
In the Edit Entry screen enter sufficient lines of text
(11 lines) to
make the scroll bar appear. Then backspace over the
last line so that
only 10 lines of text now exist and then scroll up....
Bang! Fatal
Exception occurs.

For Example enter the following text:
1
2
3
4
5
6
7
8
9
0
A

The Scroll bar will appear as you new-line after you
enter the digit
zero. backspace so that the 11 line is erased and the
cursor sits
next to Zero. When you scroll back the Fatal Alert occurs.

BTW, it would be nice if the up/down keys caused the
text to scroll.

Discussion

  • Stacey Marshall

    Stacey Marshall - 2005-05-15

    Logged In: YES
    user_id=671235

    Simple patch, call made to SclSetScrollBar() where
    SclGetScrollBar() was meant to be:

    $ diff -U9 src/util.c.orig src/util.c
    --- src/util.c.orig Sun May 15 22:05:04 2005
    +++ src/util.c Sun May 15 22:06:04 2005
    @@ -71,19 +71,19 @@
    UInt16 blankLines;
    Int16 min, max, value, pageSize;

    if (linesToScroll < 0) {
    blankLines = FldGetNumberOfBlankLines(field);
    FldScrollField(field, -linesToScroll, winUp);

    // if blank lines exist at end of field update scrollbar
    if (blankLines) {
    - SclSetScrollBar(bar, &value, &min, &max, &pageSize);
    + SclGetScrollBar(bar, &value, &min, &max, &pageSize);
    if (blankLines > -linesToScroll)
    max += linesToScroll;
    else
    max -= blankLines;
    SclSetScrollBar(bar, value, min, max, pageSize);
    }
    }
    else if (linesToScroll > 0) {
    FldScrollField(field, linesToScroll, winDown);

     
  • Stacey Marshall

    Stacey Marshall - 2005-05-17

    Logged In: YES
    user_id=671235

    Simple patch, call made to SclSetScrollBar() where
    SclGetScrollBar() was meant to be:

    $ diff -U9 src/util.c.orig src/util.c
    --- src/util.c.orig Sun May 15 22:05:04 2005
    +++ src/util.c Sun May 15 22:06:04 2005
    @@ -71,19 +71,19 @@
    UInt16 blankLines;
    Int16 min, max, value, pageSize;

    if (linesToScroll < 0) {
    blankLines = FldGetNumberOfBlankLines(field);
    FldScrollField(field, -linesToScroll, winUp);

    // if blank lines exist at end of field update scrollbar
    if (blankLines) {
    - SclSetScrollBar(bar, &value, &min, &max, &pageSize);
    + SclGetScrollBar(bar, &value, &min, &max, &pageSize);
    if (blankLines > -linesToScroll)
    max += linesToScroll;
    else
    max -= blankLines;
    SclSetScrollBar(bar, value, min, max, pageSize);
    }
    }
    else if (linesToScroll > 0) {
    FldScrollField(field, linesToScroll, winDown);

     
  • Stacey Marshall

    Stacey Marshall - 2005-07-06

    Logged In: YES
    user_id=671235

    Simple patch, call made to SclSetScrollBar() where
    SclGetScrollBar() was meant to be:

    $ diff -U9 src/util.c.orig src/util.c
    --- src/util.c.orig Sun May 15 22:05:04 2005
    +++ src/util.c Sun May 15 22:06:04 2005
    @@ -71,19 +71,19 @@
    UInt16 blankLines;
    Int16 min, max, value, pageSize;

    if (linesToScroll < 0) {
    blankLines = FldGetNumberOfBlankLines(field);
    FldScrollField(field, -linesToScroll, winUp);

    // if blank lines exist at end of field update scrollbar
    if (blankLines) {
    - SclSetScrollBar(bar, &value, &min, &max, &pageSize);
    + SclGetScrollBar(bar, &value, &min, &max, &pageSize);
    if (blankLines > -linesToScroll)
    max += linesToScroll;
    else
    max -= blankLines;
    SclSetScrollBar(bar, value, min, max, pageSize);
    }
    }
    else if (linesToScroll > 0) {
    FldScrollField(field, linesToScroll, winDown);

     
  • Philip Lowman

    Philip Lowman - 2005-07-10
    • status: open --> open-accepted
     
  • Philip Lowman

    Philip Lowman - 2005-07-10

    Logged In: YES
    user_id=78148

    Thanks for pointing out this bug and fixing it! I merged
    the changes into CVS.

     

Log in to post a comment.