Skip to content

Fix UI segmentation fault introduced in #4309 - #4317

Closed
ctrlcctrlv wants to merge 1 commit into
fontforge:masterfrom
ctrlcctrlv:pr4309hotfix
Closed

ctrlcctrlv wants to merge 1 commit into
fontforge:masterfrom
ctrlcctrlv:pr4309hotfix

Conversation

@ctrlcctrlv

Copy link
Copy Markdown
Member

Per #4309 (comment)

Type of change

  • Bug fix

@jtanx

jtanx commented May 3, 2020

Copy link
Copy Markdown
Contributor

Hmm, the segfault is fixed but it looks like the UI doesn't reflect what the setting actually is. e.g. uncheck the FFTM table option, generate. Open the generate dialog again and go to options -> FFTM Table option is checked. But when generating, the FFTM table is omitted. You have to un-check and recheck the option to get the FFTM table generated again.

@skef

skef commented May 3, 2020

Copy link
Copy Markdown
Contributor

I think lines 471-2:

    GGadgetSetChecked(GWidgetGetControl(gw,CID_TTF_FFTMTable),
            (flags&~ttf_flag_noFFTMtable) && which!=0);

Should be something like:

    GGadgetSetChecked(GWidgetGetControl(gw,CID_TTF_FFTMTable),
            !(flags&ttf_flag_noFFTMtable) && which!=0);

but I don't understand how this line isn't overridden by line 510:

    GGadgetSetEnabled(GWidgetGetControl(gw,CID_TTF_FFTMTable),which!=0);

(Or, for that matter, what's going on with lines 505 and 508.)

Actually, maybe I do understand a little. given that ps_flag_nohints follows the same pattern (check off maps to flag on) perhaps line 510 should be replaced by:

    if ( which!=0 && (flags&ttf_flag_noFFTMtable) )
        GGadgetSetChecked(GWidgetGetControl(gw,CID_TTF_FFTMTable), false);

To turn the selection off in that case. But I'm still confused about the relation between the earlier and later calls.

@ctrlcctrlv

Copy link
Copy Markdown
Member Author

Let's just revert. Clearly the changeset is bad. I tested it with Python, and that works, but you're all right that the UI is messed up. Closing, will open a revert PR and merge that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants