| Summary: | API PathSubstitution: Add substition for username | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Samuel Mehrbrodt (allotropia) <samuel.mehrbrodt> |
| Component: | sdk | Assignee: | Samuel Mehrbrodt (allotropia) <samuel.mehrbrodt> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | samuel.mehrbrodt, sberg.fun |
| Priority: | medium | ||
| Version: | Inherited From OOo | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | target:5.2.0 | ||
| Crash report or crash signature: | Regression By: | ||
|
Description
Samuel Mehrbrodt (allotropia)
2016-03-04 10:05:10 UTC
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.) |