Use that function in the dialog builder instead of having explicit code in there to check the names.
For now this simply uses a manually curated list of custom widgets. I used some command line tools to extract the names of custom widgets used in our .ui files, and then filtered out some I guess (hope) will not be needed in a mobile app.
For this to work the custom widgets need to have unique names. Currently that is not the case. Unless I did some mistake, there is just one case of duplicate name, NotebookbarTabControl, which exists both in the sfx and vcl libraries. (I simply filtered out that one, too, for now.)
d6cd273c59c9 Add function to map custom widget name to its function to native-code.py
solenv/bin/native-code.py | 150 ++++++++++++++++++++++++++++++++++++++++++
vcl/source/window/builder.cxx | 21 +-----
2 files changed, 153 insertions(+), 18 deletions(-)