summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-11-02 20:37:02 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-11-24 15:14:48 +0100
commitaed4e00c4f5788253d68502f7d957dbb08f4555b (patch)
tree4c258a11e28367482333c4e6977bfae23d2863b7 /desktop/source
parent53d54929b518e48b307611bb0e2209629a17395f (diff)
UserInstallation may change in kit-mode
So the setting fetched at ctor time for UserInstallation (and BRAND_BASE_DIR) may no longer be true, so expanding variables based on those earlier seen values results in unwanted paths. add XInitialization to SubstitutePathVariables (like done for PathSettings) to allow reiniting these explicitly once. Change-Id: Ia930ea71cb09adc91d6d47ee047c44b24222e8a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175961 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 410f6b50eb44276b1d2095c844244ef4d0ddefaa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177109 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f4e2c39f6d07..4842a9732cee 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -107,6 +107,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/util/thePathSettings.hpp>
+#include <com/sun/star/util/PathSubstitution.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XFlushable.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -8237,12 +8238,20 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
utl::Bootstrap::reloadData();
// Now that bootstrap User/Shared installation paths have been (re)set to the final
- // location, reinitialize the PathSettings so $(userurl)/$(instdir) path variables
- // will be expanded using these newly set paths and not the paths detected during
- // preinit which used unorthodox throwaway temp locations
+ // location, reinitialize the PathSubstitution rules and PathSettings so that
+ // $(userurl)/$(instdir) path variables will be expanded using these newly set
+ // paths and not the paths detected during preinit which used unorthodox throwaway
+ // temp locations
+
+ // First reinitialize the PathSubstitution rules
+ uno::Reference<css::util::XStringSubstitution> xPathSubst(util::PathSubstitution::create(xContext));
+ uno::Reference<lang::XInitialization> xReInitSubstitution(xPathSubst, uno::UNO_QUERY_THROW);
+ xReInitSubstitution->initialize({});
+
+ // PathSettings depend on PathSubstitution rules
uno::Reference<css::util::XPathSettings> xPathSettings = util::thePathSettings::get(xContext);
- uno::Reference<lang::XInitialization> xReInit(xPathSettings, uno::UNO_QUERY_THROW);
- xReInit->initialize({});
+ uno::Reference<lang::XInitialization> xReInitSettings(xPathSettings, uno::UNO_QUERY_THROW);
+ xReInitSettings->initialize({});
}
}