summaryrefslogtreecommitdiffstats
path: root/cppuhelper
diff options
context:
space:
mode:
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/servicemanager.cxx38
1 files changed, 36 insertions, 2 deletions
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 765204301e1f..93a060e21fa4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1789,6 +1789,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 (const auto& rEntry : data_.namedImplementations)
@@ -1800,13 +1816,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);
}
@@ -1928,6 +1959,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;