http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1util_1_1PathSubstitution.html Add a substitution $(username) which is replaced with the current system user.
https://gerrit.libreoffice.org/#/c/22901
To try it out, the following snippet should print the currently logged in user: Sub Main xsubst = createUnoService("com.sun.star.comp.framework.PathSubstitution") print xSubst.getSubstituteVariableValue( "$(username)") End Sub
Where is this supposed to be used?
(In reply to Stephan Bergmann from comment #3) > Where is this supposed to be used? We have a client who wants to set some paths to be not in the user profile, but in a separate directory on another hard drive (because of backup strategy). So for example have the autocorrect data in a folder like D:\DATA\<username>\Office\… Since multiple people use the same pc, the path needs to be individual for each person. Thus the need to replace $(username) with the currently logged in user.
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=16fb0d3d0f68708c183c53bd18660a23970b77fe tdf#98407 PathSubstitution: Add substitution for $(username) It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(Starting with the fix from issue 101898 comment 33, "$(username)" will be substituted for the username only if the username is a complete URL segment. That is, if the username is "USER", <file:///data/USER/office> will be substituted to <file:///data/$(username)/office>, but <file:///data/USERSPACE/office> will remain unchanged.)