summaryrefslogtreecommitdiff
path: root/vcl/source/window/builder.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-11-06 10:17:10 +0200
committerTor Lillqvist <tml@collabora.com>2018-11-06 12:00:55 +0100
commit2bc5ab312b1cdb8c299253a54fecdd3c64319fd2 (patch)
treec185caa1ffff52083b35f121afbf98d87a79404c /vcl/source/window/builder.cxx
parent2a6e3fa7a0d938a7db2d75cabb2341149903437a (diff)
Add function to map custom widget name to its function to native-code.py
Use that function in the dialog builder instead of looking up the function dynamically, which won't work in a Release build as the linker will filter out functions that aren't explicitly referenced. 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 Reviewed-on: https://gerrit.libreoffice.org/62946 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r--vcl/source/window/builder.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index d8b80b5a10a5..b3e88485c743 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1181,6 +1181,10 @@ void VclBuilder::preload()
#endif // DISABLE_DYNLOADING
}
+#if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP
+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,
stringmap &rMap)
{
@@ -1698,12 +1702,12 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
}
else
pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction));
+#elif !HAVE_FEATURE_DESKTOP
+ 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));
-#if !HAVE_FEATURE_DESKTOP
- SAL_WARN_IF(!pFunction, "vcl.layout", "Lookup of " << sFunction << " failed");
- assert(pFunction);
-#endif
#endif
if (pFunction)
{