[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - cppuhelper/source
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 22 15:56:44 UTC 2019
cppuhelper/source/servicemanager.cxx | 38 +++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
New commits:
commit 2ba468bc4c29968751c77d69a7c515822222a849
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Mar 22 18:48:41 2019 +0100
Commit: Aron Budea <aron.budea at collabora.com>
CommitDate: Fri Nov 22 16:56:04 2019 +0100
preload: add the ability to disable various components.
Helps filter stupid stuff that makes no sense for online - eg.
reportbuilder or jdbc.
Change-Id: I40e06954c45fdefd21528202f4587ae83eb994c2
Reviewed-on: https://gerrit.libreoffice.org/69567
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/83471
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Aron Budea <aron.budea at collabora.com>
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index a9c06fa1bce9..cf2472b87733 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1843,6 +1843,22 @@ void cppuhelper::ServiceManager::preloadImplementations() {
std::cerr << "preload:";
std::vector<OUString> aReported;
+ std::vector<OUString> aDisabled;
+ OUStringBuffer aDisabledMsg("Disabled: ");
+
+ /// Allow external callers & testers to disable certain components
+ const char *pDisable = getenv("UNODISABLELIBRARY");
+ if (pDisable)
+ {
+ OUString aDisable(pDisable, strlen(pDisable), RTL_TEXTENCODING_UTF8);
+ for (sal_Int32 i = 0; i >= 0; )
+ {
+ OUString tok = aDisable.getToken(0, ' ', i);
+ tok = tok.trim();
+ if (!tok.isEmpty())
+ aDisabled.push_back(tok);
+ }
+ }
// loop all implementations
for (Data::NamedImplementations::const_iterator iterator(
@@ -1856,13 +1872,28 @@ void cppuhelper::ServiceManager::preloadImplementations() {
if (aLibrary.isEmpty())
continue;
+ OUString simplified = simplifyModule(aLibrary);
+ bool bDisabled =
+ std::find(aDisabled.begin(), aDisabled.end(), simplified) != aDisabled.end();
+
if (std::find(aReported.begin(), aReported.end(), aLibrary) == aReported.end())
{
- std::cerr << " " << simplifyModule(aLibrary);
- std::cerr.flush();
+ if (bDisabled)
+ {
+ aDisabledMsg.append(simplified);
+ aDisabledMsg.append(" ");
+ }
+ else
+ {
+ std::cerr << " " << simplified;
+ std::cerr.flush();
+ }
aReported.push_back(aLibrary);
}
+ if (bDisabled)
+ continue;
+
// expand absolute URI implementation component library
aUri = cppu::bootstrap_expandUri(aLibrary);
}
@@ -1992,6 +2023,9 @@ void cppuhelper::ServiceManager::preloadImplementations() {
}
std::cerr << std::endl;
+ std::cerr << aDisabledMsg.makeStringAndClear() << "\n";
+ std::cerr.flush();
+
// Various rather important uno mappings.
static struct {
const char *mpFrom;
More information about the Libreoffice-commits
mailing list