diff options
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/access2base/Application.xba | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba index 3bc2837aac2a..91ca6aca9081 100644 --- a/wizards/source/access2base/Application.xba +++ b/wizards/source/access2base/Application.xba @@ -812,16 +812,11 @@ End Function ' CurrentDb V1.1.0 REM ----------------------------------------------------------------------------------------------------------------------- Public Function CurrentUser() As String -Const cstWindows = 1 -Const cstUnix = 4 - Select Case GetGuiType() - Case cstWindows - CurrentUser = Environ("USERNAME") - Case cstUnix - CurrentUser = Environ("USER") - Case Else - CurrentUser = "" - End Select +Dim oPath As Object, sUser As String + + Set oPath = CreateUnoService("com.sun.star.util.PathSubstitution") + sUser = oPath.getSubstituteVariableValue("$(username)") ' New since LibreOffice 5.2 + CurrentUser = sUser End Function ' CurrentUser V0.9.1 |