wizards/source/access2base/Application.xba |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 9db25302bfb454dd8f2504e59ca84815f48e5cf4
Author:     Jean-Pierre Ledure <j...@ledure.be>
AuthorDate: Thu Oct 10 12:39:35 2019 +0200
Commit:     Jean-Pierre Ledure <j...@ledure.be>
CommitDate: Thu Oct 10 12:39:35 2019 +0200

    Access2Base - CurrentUser based in PathSubstitution
    
    com.sun.star.util.PathSubstitution service provides
    a "$(username)" variable since LO 5.2
    This technique replaces the use of environment variables
    
    Change-Id: Icca82d88a123312031874d355655d26718fb215b

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      &apos;  CurrentDb               V1.1.0
 REM 
-----------------------------------------------------------------------------------------------------------------------
 Public Function CurrentUser() As String
 
-Const cstWindows = 1
-Const cstUnix = 4
-       Select Case GetGuiType()
-               Case cstWindows
-                       CurrentUser = Environ(&quot;USERNAME&quot;)
-               Case cstUnix
-                       CurrentUser = Environ(&quot;USER&quot;)
-               Case Else
-                       CurrentUser = &quot;&quot;
-       End Select
+Dim oPath As Object, sUser As String
+
+       Set oPath = 
CreateUnoService(&quot;com.sun.star.util.PathSubstitution&quot;)
+       sUser = oPath.getSubstituteVariableValue(&quot;$(username)&quot;)       
        &apos;  New since LibreOffice 5.2
+       CurrentUser = sUser
 
 End Function   &apos;  CurrentUser     V0.9.1
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to