robofab-developers/robofab — pull request #14 by anthrotype (2014-07-29 15:46:53+00:00)
Title: fix for GetValue('list') returning the wrong index value in FLS v5.2.1

As some have already noticed (see links below), from Fontlab Studio v5.2.x, the `GetValue` method of the `Dialog` class returns a 'wrong' index value from the specified list (`LISTCONTROL` type).

If the selected index is `n`, FontLab will return `n-1`. For example, when the index is `1`, it returns `0`; when it's `2`, it returns `1`, and so on.
Moreover, if the selection is empty, FontLab v5.2 returns `-2`, while the old v5.0 would return `None`.

I know all this may sound as 'legacy' – but it's a fact that all the macros that use, say, SelectFont() are basically broken in FontLab 5.2, which is bad, I think.

I could only test this issue in Fontlab 5.2.1 rev4868, but it may have probably started at an earlier revision.

Cheers,

Cosimo