Menu

#8 iPane incremented without checking in DoLayout

Unstable_(example)
closed
nobody
General (30)
5
2012-09-19
2006-06-15
No

Hi there,

Seems like a bug'ette has slipped in. Looks like it was
correct in an earlier version but has now fallen foul.

If there is an odd number of panes in a master pane
then there is the possibility for iPane to be
incremented past the end of the pane array. Corrected
by bringing the check against _paneList.Count inside
the loop for the columns (as per the row iteration).
See below.

for ( int colNum = 0; colNum < columns; colNum++ )
{
if ( iPane >= _paneList.Count )
return;

this[iPane].Rect = new RectangleF(           
    innerRect.X + colNum * ( width +

scaledInnerGap ),
innerRect.Y + y,
width,
height );

iPane++;

}

I've attached a corrected MasterPane.cs

Is there a better method for submitting patches?

Cheers,
Brian

Discussion

  • Brian Chappell

    Brian Chappell - 2006-06-16
     
  • John Champion

    John Champion - 2006-06-16

    Logged In: YES
    user_id=957634

    Brian,
    Thanks for catching this. I've put it in the current
    working version. Hopefully I can put out a 4.9.8 update
    soon (but the official 5.0 will still be some time).

    Definitely, using this bug tracker is best. This keeps me
    from forgetting stuff...
    John

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.