kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #15688
Re: [PATCH] IsSingleLine() assertions failing in eeschema, pcbnew, and PCB calculator
Patch applied in product branch r5259. Thank you for your contribution
to KiCad.
Cheers,
Wayne
On 11/3/2014 6:07 AM, Blair Bonnett wrote:
> Hi all,
>
> I've been getting the assertion "IsSingleLine() failed in GetEditable():
> shouldn't be called for multiline" in a number of places. This is caused
> by a textbox->SetMaxLength() call which GTK doesn't allow on multi-line
> text boxes. According to [1] earlier versions of GTK did the check and
> ignored the request rather than asserting on it.
>
> There are two bugs on the tracker [2,3] reporting this assertion in
> different places, and with the aid of grep I've found several other
> occurrences:
>
> Eeschema:
>
> * Adding or editing a net label
> * Electrical rules checker
> * Plotting the schematic
>
> PCB calculator:
>
> * On opening the calculator
>
> Pcbnew:
>
> * Change footprints (from the footprint properties dialog)
> * Adding or editing text (not designators etc)
>
> The source for all of these is in files generated by wxFormBuilder. The
> attached patch fixes this by removing the call from the relevant
> *_base.cpp files and changing the maxlength property to be empty rather
> than zero in the corresponding .fpb files.
>
> In all cases, the argument to SetMaxLength is zero. According to the
> wxWidgets docs [4], "if len is 0, the previously set max length limit,
> if any, is discarded and the user may enter as much text as the
> underlying native text control widget supports (typically at least
> 32Kb)". Since the calls this patch removes are being made on
> initialisation, I imagine there is no pre-existing length limit, and
> therefore no side-effects on non-GTK backends in removing the calls.
> Additionally, JP Charras made an identical change to fix a dialog in
> revision 4912 which has not been reverted so I assume this fix is OK.
> However, if somebody who is in a position to confirm this can do so that
> would be appreciated.
>
> A number of other dialogs which use multi-line textboxes are OK -- I'm
> not sure if they have been manually fixed previously, or were created
> with a newer version of wxFormBuilder which no longer outputs this code.
> The discussion in [1] decides it is a wxFB bug but I'm not sure if it
> was accepted as such and fixed.
>
> Suggested commit message if accepted:
>
> """
> Remove calls to SetMaxLength() on multi-line textboxes (fixes
> lp:1168902, fixes lp:1167345).
>
> This fixes a number of assertions when using wxGTK, and has no
> side-effects on other backends.
> """
>
> Cheers
> Blair
>
> [1]: http://trac.wxwidgets.org/ticket/14594#comment:2
> [2]: https://bugs.launchpad.net/kicad/+bug/1168902
> [3]: https://bugs.launchpad.net/kicad/+bug/1167345
> [4]:
> http://docs.wxwidgets.org/3.0/classwx_text_entry.html#a5b9dea0d1adeb9cc14309600de6aff50
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References