From 2d64651e889e55f63c90ded24e63e17eaf52102f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 9 Apr 2020 12:38:50 +0200 Subject: Fix loading of basctl with --enable-mergelibs ...after 40fe721462df5bedacddc8829cefc3d739cf940f "add some more libs to libmerged". (Found when UITest_writer_tests4 failed with > ERROR: test_tdf113252_macro_dialog (tdf113252.tdf113252) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "C:/lo/core/sw/qa/uitest/writer_tests4/tdf113252.py", line 24, in test_tdf113252_macro_dialog > self.ui_test.execute_dialog_through_command(".uno:MacroDialog") > File "C:\lo\core\uitest\uitest\test.py", line 83, in execute_dialog_through_command > raise DialogNotExecutedException(command) > uitest.test.DialogNotExecutedException: Dialog not executed for: .uno:MacroDialog in an --enable-mergelibs build on Windows.) (And while at it, explicitly handle a failed osl::Module::loadRelative call, instead of relying on the following osl::Module::getFunctionSymbol call to fail.) Change-Id: Iaef9da527ed36913596a43ff577e065b03a73612 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91961 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sfx2/source/appl/appserv.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 459d482cbf68..77896317eb5a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -18,7 +18,7 @@ */ #include - +#include #include #include #include @@ -1220,7 +1220,18 @@ static OUString ChooseMacro(weld::Window* pParent, const Reference& rxLi osl::Module aMod; // load basctl module - aMod.loadRelative(&thisModule, SVLIBRARY("basctl")); + if (!aMod.loadRelative( + &thisModule, +#if ENABLE_MERGELIBS + SVLIBRARY("merged") +#else + SVLIBRARY("basctl") +#endif + )) + { + SAL_WARN("sfx.appl", "cannot load basctl"); + return ""; + } // get symbol basicide_choose_macro pSymbol = reinterpret_cast(aMod.getFunctionSymbol("basicide_choose_macro")); -- cgit