diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-29 14:16:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:40 +0100 |
commit | fc86fdf6b44ae6814e99dd3b5e878191d63c16a0 (patch) | |
tree | d94bfc4bbd3eb7773047f7a3c2c1b0e8c66dc7dc | |
parent | 0a9ab848a66045043770d8d6a8ca70129e3bd1ce (diff) |
GetProcAddress doesn't work like dlsym with executable's handle
underlying GetProcAddress on windows, unlike dlsym, doesn't search
through all loaded .dlls searching for the symbol when given the
default module. So load the module by name.
Change-Id: I148250c9d8dd5aa2b802581d049533f2c5e83caf
-rw-r--r-- | sw/uiconfig/swriter/ui/linenumbering.ui | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 26 |
2 files changed, 22 insertions, 6 deletions
diff --git a/sw/uiconfig/swriter/ui/linenumbering.ui b/sw/uiconfig/swriter/ui/linenumbering.ui index 35a89652d0f5..045bf88ea802 100644 --- a/sw/uiconfig/swriter/ui/linenumbering.ui +++ b/sw/uiconfig/swriter/ui/linenumbering.ui @@ -207,7 +207,7 @@ </packing> </child> <child> - <object class="SwNumberingTypeListBox" id="formatdropdown"> + <object class="swlo:SwNumberingTypeListBox" id="formatdropdown"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index c45494fce0d6..fdf6a49cb10c 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -26,7 +26,7 @@ * instead of those above. */ -#include <osl/module.h> +#include <osl/module.hxx> #include <vcl/builder.hxx> #include <vcl/button.hxx> #include <vcl/dialog.hxx> @@ -342,6 +342,8 @@ bool VclBuilder::extractModel(const rtl::OString &id, stringmap &rMap) return false; } +extern "C" { static void SAL_CALL thisModule() {} } + Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const rtl::OString &id, stringmap &rMap) { bool bIsPlaceHolder = name.isEmpty(); @@ -472,10 +474,24 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const pWindow = new Window(pParent); else { - rtl::OString sFunction = rtl::OString("make") + name; - customMakeWidget pFunction = (customMakeWidget)osl_getAsciiFunctionSymbol(NULL, sFunction.getStr()); - if (pFunction) - pWindow = (*pFunction)(pParent); + sal_Int32 nDelim = name.indexOf(':'); + if (nDelim != -1) + { + rtl::OUStringBuffer sModule; +#ifdef SAL_DLLPREFIX + sModule.append(SAL_DLLPREFIX); +#endif + sModule.append(rtl::OStringToOUString(name.copy(0, nDelim), RTL_TEXTENCODING_UTF8)); +#ifdef SAL_DLLEXTENSION + sModule.append(SAL_DLLEXTENSION); +#endif + rtl::OUString sFunction(rtl::OStringToOUString(rtl::OString("make") + name.copy(nDelim+1), RTL_TEXTENCODING_UTF8)); + osl::Module aModule; + aModule.loadRelative(&thisModule, sModule.makeStringAndClear()); + customMakeWidget pFunction = (customMakeWidget)aModule.getFunctionSymbol(sFunction); + if (pFunction) + pWindow = (*pFunction)(pParent); + } } if (!pWindow) fprintf(stderr, "TO-DO, implement %s or add a make%s function\n", name.getStr(), name.getStr()); |