diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-11-06 10:17:10 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-11-06 10:37:47 +0200 |
commit | d6cd273c59c976c085d68e9f171a09bf018b0039 (patch) | |
tree | 49b7b17bbd7f807a2b67e727ccdf95d908714b96 /vcl | |
parent | de016544e7fd243d7f922b06c7fd11aadd9f0324 (diff) |
Add function to map custom widget name to its function to native-code.py
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.)
Change-Id: I29bbf6dfef2b3bde03acfc322495d051a7f275a8
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/builder.cxx | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index b4c38ca77d30..e3c317099000 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1490,12 +1490,7 @@ void VclBuilder::preload() } #if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP - -VCL_BUILDER_FACTORY_EXTERN(CustomPropertiesControl); -VCL_BUILDER_FACTORY_EXTERN(RefButton); -VCL_BUILDER_FACTORY_EXTERN(RefEdit); -VCL_BUILDER_FACTORY_EXTERN(ScRefButtonEx); - +extern "C" VclBuilder::customMakeWidget lo_get_custom_widget_func(const char* name); #endif VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &name, const OString &id, @@ -2051,18 +2046,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction)); #elif !HAVE_FEATURE_DESKTOP - if (false) - ; // Just so that all the other condition line pairs look the same - else if (sFunction == "makeCustomPropertiesControl") - pFunction = makeCustomPropertiesControl; - else if (sFunction == "makeRefButton") - pFunction = makeRefButton; - else if (sFunction == "makeRefEdit") - pFunction = makeRefEdit; - else if (sFunction == "makeScRefButtonEx") - pFunction = makeScRefButtonEx; - - SAL_WARN_IF(!pFunction, "vcl.layout", "Missing case for " << sFunction); + pFunction = lo_get_custom_widget_func(sFunction.toUtf8().getStr()); + SAL_WARN_IF(!pFunction, "vcl.layout", "Could not find " << sFunction); assert(pFunction); #else pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData)); |