[Libreoffice-commits] core.git: 3 commits - cppuhelper/source
Tor Lillqvist
tml at collabora.com
Wed Jan 10 17:53:51 UTC 2018
cppuhelper/source/servicemanager.cxx | 53 +++++++----------------------------
1 file changed, 11 insertions(+), 42 deletions(-)
New commits:
commit 4a114d62957194ca60bdc9e4f857b36311a9bf22
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Jan 10 19:50:26 2018 +0200
Bin superfluous using declarations
Change-Id: Icf8a2703b7e72f48bde1cc3bc6fd0de2e663a407
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 9f734214b38b..7e2ad4db0440 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -45,9 +45,6 @@
#include "loadsharedlibcomponentfactory.hxx"
-using rtl::OUString;
-using rtl::OString;
-
#include <registry/registry.hxx>
#include <xmlreader/xmlreader.hxx>
commit 35ec045f6e4626c0544aaffbe489dfc142ff2aa8
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Jan 10 19:48:15 2018 +0200
Don't try to preload the KDE4 shell backend as that crashes
Change-Id: I1c1ff4ec7cda00a76bdeb018366afed2187c7ef8
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index a466b65ecb36..9f734214b38b 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1838,6 +1838,13 @@ void cppuhelper::ServiceManager::preloadImplementations() {
if (iterator->second->info->loader == "com.sun.star.loader.SharedLibrary" &&
iterator->second->status != Data::Implementation::STATUS_LOADED)
{
+ // Blacklist some components that are known to fail
+ if (iterator->second->info->name == "com.sun.star.comp.configuration.backend.KDE4Backend")
+ {
+ SAL_INFO("cppuhelper.preload", "Skipping " << iterator->second->info->name);
+ continue;
+ }
+
// load component library
SAL_INFO("cppuhelper.preload", "Loading " << aUri << " for " << iterator->second->info->name);
osl::Module aModule(aUri, SAL_LOADMODULE_NOW | SAL_LOADMODULE_GLOBAL);
commit f9f830ac319aebd940ebcae97e51c24cda54508f
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Jan 10 19:43:56 2018 +0200
Simplify logging in cppuhelper::ServiceManager::preloadImplementations()
Use just SAL_INFO(), with tag "cppuhelper.preload". No unconditional
writes to std::cerr. Also, log the loading attempt beforehand, so that
it is printed before any crash during the loading of a component.
Change-Id: Ifde8be8cb5d18dd88df21c45c906deb575d36960
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 42a0e7e3145a..a466b65ecb36 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -10,7 +10,6 @@
#include <sal/config.h>
#include <algorithm>
-#include <iostream>
#include <cassert>
#include <vector>
@@ -1808,34 +1807,6 @@ cppuhelper::ServiceManager::findServiceImplementation(
return impl;
}
-/// Make a simpler unique name for preload / progress reporting.
-#ifndef DISABLE_DYNLOADING
-static rtl::OUString simplifyModule(const rtl::OUString &uri)
-{
- sal_Int32 nIdx;
- OUStringBuffer edit(uri);
- if ((nIdx = edit.lastIndexOf('/')) > 0)
- edit.remove(0,nIdx+1);
- if ((nIdx = edit.lastIndexOf(':')) > 0)
- edit.remove(0,nIdx+1);
- if ((nIdx = edit.lastIndexOf("lo.so")) > 0)
- edit.truncate(nIdx);
- if ((nIdx = edit.lastIndexOf(".3")) > 0)
- edit.truncate(nIdx);
- if ((nIdx = edit.lastIndexOf("gcc3.so")) > 0)
- edit.truncate(nIdx);
- if ((nIdx = edit.lastIndexOf(".so")) > 0)
- edit.truncate(nIdx);
- if ((nIdx = edit.lastIndexOf("_uno")) > 0)
- edit.truncate(nIdx);
- if ((nIdx = edit.lastIndexOf(".jar")) > 0)
- edit.truncate(nIdx);
- if (edit.indexOf("lib") == 0)
- edit.remove(0,3);
- return edit.makeStringAndClear();
-}
-#endif
-
/// Used only by LibreOfficeKit when used by Online to pre-initialize
void cppuhelper::ServiceManager::preloadImplementations() {
#ifdef DISABLE_DYNLOADING
@@ -1845,9 +1816,6 @@ void cppuhelper::ServiceManager::preloadImplementations() {
osl::MutexGuard g(rBHelper.rMutex);
css::uno::Environment aSourceEnv(css::uno::Environment::getCurrent());
- std::cerr << "preload: ";
- std::vector<OUString> aReported;
-
// loop all implementations
for (Data::NamedImplementations::const_iterator iterator(
data_.namedImplementations.begin());
@@ -1856,11 +1824,6 @@ void cppuhelper::ServiceManager::preloadImplementations() {
try
{
const rtl::OUString &aLibrary = iterator->second->info->uri;
- if (std::find(aReported.begin(), aReported.end(), aLibrary) == aReported.end())
- {
- std::cerr << simplifyModule(aLibrary) << " ";
- aReported.push_back(aLibrary);
- }
// expand absolute URI implementation component library
aUri = cppu::bootstrap_expandUri(aLibrary);
@@ -1876,8 +1839,11 @@ void cppuhelper::ServiceManager::preloadImplementations() {
iterator->second->status != Data::Implementation::STATUS_LOADED)
{
// load component library
+ SAL_INFO("cppuhelper.preload", "Loading " << aUri << " for " << iterator->second->info->name);
osl::Module aModule(aUri, SAL_LOADMODULE_NOW | SAL_LOADMODULE_GLOBAL);
- SAL_INFO("cppuhelper", "loaded component library " << aUri << ( aModule.is() ? " ok" : " no"));
+
+ if (!aModule.is())
+ SAL_WARN("cppuhelper.preload", "Loading " << aUri << " for " << iterator->second->info->name << " failed");
if (aModule.is() &&
!iterator->second->info->environment.isEmpty())
@@ -1963,7 +1929,6 @@ void cppuhelper::ServiceManager::preloadImplementations() {
aModule.release();
}
}
- std::cerr << std::endl;
#endif
}
More information about the Libreoffice-commits
mailing list