Menu

#664 [wxSmith] Generated code of grid bag sizer creates an assert

Undefined
fixed
nobody
Bug_Report
2021-12-18
2018-04-15
bluehazzard
No

Forum link to description:
http://forums.codeblocks.org/index.php/topic,22570.0.html

summary:
AddGrowableCol and AddGrowableRow functions should be called after the cildren are added to the sizer, else this assert is generated:

src/common/sizer.cpp(1980): assert "!m_colls || idx < (size_t)m_cols" failed in AddGrowableCol(): invalid column index

affected sizer:
wxGridBagSizer

Discussion

  • bluehazzard

    bluehazzard - 2018-04-15

    This bug affects also the generatrion of the preview for the sizer
    So this is a two part bug:
    1) Assert generated by wxSmith
    2) Assert generated by generated code in user application

     
  • bluehazzard

    bluehazzard - 2018-04-15

    Fix for problem 2: generated code

     

    Last edit: bluehazzard 2018-04-15
  • bluehazzard

    bluehazzard - 2018-04-15

    Fix for problem 1: preview code

    There is still an assert if you enter a wrong count of growable cols/rows.

    The fix i would implement, if approved:
    1) Fix the wrong number to the actual number of cols/rows
    2) Give the user a warning he enters the wrong number.

    About 2) i am not sure if this is wanted, because if you are drawing the dialog, not all numbers are correct at all times. So my favourite fix would only be 1). Opinions?

     
    • Teodor Petrov

      Teodor Petrov - 2018-04-29

      For the warning your can use an info window. This won't require a user interaction and doesn't steal focus. It is just informative.

       
  • Teodor Petrov

    Teodor Petrov - 2018-04-29
    • summary: [wxSmith] Generated code of grid sizer creates an assert --> [wxSmith] Generated code of grid bag sizer creates an assert
     
  • Teodor Petrov

    Teodor Petrov - 2018-04-29
    • labels: wxSmith, wxSmithContribItems --> wxSmith, wxSmithContribItems, wx30
     
  • Teodor Petrov

    Teodor Petrov - 2018-04-29

    Both patches are in svn. I'm not closing this, because there wil still be asserts on invalid input.
    Patches forthis problem would be welcome, too.

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-12-18
    • status: open --> fixed
     
  • Miguel Gimenez

    Miguel Gimenez - 2021-12-18

    Remaining part fixed in [r12594]

     

    Related

    Commit: [r12594]


Log in to post a comment.