summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0db7e1010156..1742488a7cf9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7543,6 +7543,23 @@ static void preloadData()
#pragma GCC diagnostic pop
#endif
+ static constexpr OUString preloadComponents[] = {
+ u"private:factory/swriter"_ustr,
+ u"private:factory/scalc"_ustr,
+ u"private:factory/simpress"_ustr,
+ u"private:factory/sdraw"_ustr
+ };
+ // getting the remote LibreOffice service manager
+ uno::Reference<frame::XDesktop2> xCompLoader(frame::Desktop::create(xContext));
+
+ // Preload and close each of the main components once to initialize global state
+ uno::Sequence<css::beans::PropertyValue> szEmptyArgs(0);
+ for (const auto& component : preloadComponents)
+ {
+ auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, szEmptyArgs);
+ xComp->dispose();
+ }
+
// Set user profile's path back to the original one
rtl::Bootstrap::set(u"UserInstallation"_ustr, sUserPath);
}