summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-04-14 08:35:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-04-14 10:39:21 +0200
commit94a7ceae287a7967e8f013d012673e26637c6bb5 (patch)
tree142efe73a90ae4a5664ca09305be492e70087688 /sfx2/source
parent35fc5ef0a759884b24ed8b83cd05702a0fab64cc (diff)
basctl functions cannot be missing here
This is a follow-up to 2d64651e889e55f63c90ded24e63e17eaf52102f "Fix loading of basctl with --enable-mergelibs", removing checks that can never be satisfied. (There is no plausible scenario where basctl would legitimately not be installed. All uses of sfx2::getBasctlFunction are conditional on HAVE_FEATURE_SCRIPTING, and basctl is included in section ooo in Repository.mk together with sfx, so the latter cannot be installed without the former being installed. That is also true for Linux distros like e.g. Fedora, where both libraries are included in the core package.) Two of the redundant checks had been added with c6fc2647c8df5b9a7c41a192f2b78812d1f3656d "coverity#1132691 Dereference null return value" and 5fb8f03be61add8320045471edc55ce3f7c4fa8d "coverity#1224981 Dereference null return value", presumably in a misguided attempt to silence false Coverity warnings. The third check had been added with 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a "initial commit for vba blob ( not including container_control stuff )", for unclear reasons. Change-Id: I4a6137edfe4b51d297b115990e16d910325694af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92143 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/app.cxx5
-rw-r--r--sfx2/source/appl/appserv.cxx2
-rw-r--r--sfx2/source/appl/getbasctlfunction.cxx21
3 files changed, 11 insertions, 17 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index d9509a4a97c0..6844f919c4b2 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -392,7 +392,7 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBas
basicide_handle_basic_error pSymbol = reinterpret_cast<basicide_handle_basic_error>(sfx2::getBasctlFunction("basicide_handle_basic_error"));
// call basicide_handle_basic_error in basctl
- bool bRet = pSymbol && pSymbol( pStarBasic );
+ bool bRet = pSymbol( pStarBasic );
#else
@@ -477,9 +477,6 @@ void SfxApplication::MacroOrganizer(weld::Window* pParent, sal_Int16 nTabId)
#ifndef DISABLE_DYNLOADING
basicide_macro_organizer pSymbol = reinterpret_cast<basicide_macro_organizer>(sfx2::getBasctlFunction("basicide_macro_organizer"));
- if (!pSymbol)
- return;
-
// call basicide_macro_organizer in basctl
pSymbol(pParent, nTabId);
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 3658bb82cf08..912363d7da75 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1216,8 +1216,6 @@ static OUString ChooseMacro(weld::Window* pParent, const Reference<XModel>& rxLi
{
#ifndef DISABLE_DYNLOADING
basicide_choose_macro pSymbol = reinterpret_cast<basicide_choose_macro>(sfx2::getBasctlFunction("basicide_choose_macro"));
- if (!pSymbol)
- return OUString();
#else
#define pSymbol basicide_choose_macro
#endif
diff --git a/sfx2/source/appl/getbasctlfunction.cxx b/sfx2/source/appl/getbasctlfunction.cxx
index e682ae80836c..4f272919174a 100644
--- a/sfx2/source/appl/getbasctlfunction.cxx
+++ b/sfx2/source/appl/getbasctlfunction.cxx
@@ -19,11 +19,12 @@
#include <sal/config.h>
+#include <cassert>
+
#include <config_features.h>
#include <config_options.h>
#include <osl/module.h>
#include <osl/module.hxx>
-#include <sal/log.hxx>
#include <tools/svlibrary.h>
#include "getbasctlfunction.hxx"
@@ -37,22 +38,20 @@ oslGenericFunction sfx2::getBasctlFunction(char const* name)
osl::Module aMod;
// load basctl module
- if (!aMod.loadRelative(
- &thisModule,
+ auto const ok = aMod.loadRelative(
+ &thisModule,
#if ENABLE_MERGELIBS
- SVLIBRARY("merged")
+ SVLIBRARY("merged")
#else
- SVLIBRARY("basctl")
+ SVLIBRARY("basctl")
#endif
- ))
- {
- SAL_WARN("sfx.appl", "cannot load basctl");
- return nullptr;
- }
+ );
+ assert(ok);
+ (void) ok;
// get symbol
auto pSymbol = aMod.getFunctionSymbol(name);
- SAL_WARN_IF(!pSymbol, "sfx.appl", "cannot get basctl function " << name);
+ assert(pSymbol);
aMod.release();
return pSymbol;