Run the basic below. In 5.1.x both $work and $home return file:///home/<name> In 5.2.x and master $home returns file:///home/<name> and $work returns file:///home/<name>/Documents. This last path is non existing. $workdirurl returns the same in 5.1 and 5.2: $(work)/Documenten Even if the default wrong path in Options > LibreOffice > Paths is /home/<name>/Documents (5.2.x) or /home/<name> (5.1.x) $workdirurl returns just $(work) in master. Sub Main msgbox "work = " & GetFrameworkPath("work") & " "& chr(13) & "home = " & GetFrameworkPath("home") End Sub 'predefinedPathVariables : home, inst, prog, temp, user, work, path, lang, langid, vlang 'instpath, progpath, userpath, insturl, progurl, userurl, workdirurl,baseinsturl, userdataurl, brandbaseurl ' user == userprofile; home == work; workdirurl = myDocuments from LibreOffice Function GetFrameworkPath (sItem$) as String Dim oPathSubst oPathSubst = createUnoService("com.sun.star.util.PathSubstitution") GetFrameworkPath = oPathSubst.getSubstituteVariableValue(sItem) End Function
Needless to say that this default setting causes an non existing path error now and then (iirc I had one when loading templates or so.)
The value of $(work) is taken from the /org.openoffice.Office/Paths/Variables/Work configuration property (defaulting to the home dir if that property is not set; cf. SubstitutePathVariables::GetWorkVariableValue in framework/source/services/substitutepathvars.cxx). On Linux, that configuration property is an "external" property, querying a value from a desktop backend (oor:external="com.sun.star.configuration.backend.DesktopBackend WorkPathVariable", officecfg/registry/data/org/openoffice/Office/Paths.xcu). For GNOME-based desktops: * Until LO 5.0 there was a GConf-based desktop backend that returned the value of XDG_DOCUMENTS_DIR *if that value denoted an existing directory*. (And otherwise, the fallback to the home dir would kick in.) * In LO 5.1, that GConf-based desktop backend has been removed, without replacement (3cf557c12d27f1b2250e69a543136da098112d80 "drop gconf integration as per ESC decision"). So the fallback to the home dir always kicks in. * In LO 5.2, support for XDG_DOCUMENTS_DIR (and XDG_TEMPLATES_DIR) has been added back into the generic Linux desktop backend code (i.e., the code that isn't specific to GNOME but also handles KDE etc.; b5c05876f73c31270bc374e4f481ef1d09a42e5f "Related: rhbz#1065807 recover using xdg templates and documents settings"), *but in a way so that the value of XDG_DOCUMENTS_DIR is always returned, regardless of whether that value denotes an existing directory or not.* (So the home dir fallback does not kick in.) (For KDE-based desktops, prior to LO 5.2 the value had been obtained through a call to KGlobalSettings::documentPath(), and reported back regardless of whether the dir would exist; presumably, the net effect of reading KGlobalSettings::documentPath() vs. XDG_DOCUMENTS_DIR is the same.)
Cor, do you observe this in GNOME-based environments? If yes, backporting the master fix to LO 5.2 is probably useful.
(In reply to Stephan Bergmann from comment #3) > Cor, do you observe this in GNOME-based environments? If yes, backporting > the master fix to LO 5.2 is probably useful. Working with Unity here. That uses quite some from GNOME, so I guess the answer is 'yes'. Thanks for your explanation and fix, Stephan!
(In reply to Stephan Bergmann from comment #2) > (For KDE-based desktops, prior to LO 5.2 the value had been obtained through > a call to KGlobalSettings::documentPath(), and reported back regardless of > whether the dir would exist; presumably, the net effect of reading > KGlobalSettings::documentPath() vs. XDG_DOCUMENTS_DIR is the same.) This claim is wrong. The behavior for KDE-based desktops was not affected.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=15a504308d27dfcb605da320c9231227aca415e1&h=libreoffice-5-2 tdf#101661: Report XDG_{DOCUMENTS,TEMPLATES}_DIR only when it exists It will be available in 5.2.2. 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.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "libreoffice-5-2-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=16d5b5195c2550aaec856376b7016d723f6950b6&h=libreoffice-5-2-1 tdf#101661: Report XDG_{DOCUMENTS,TEMPLATES}_DIR only when it exists It will be available in 5.2.1. 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.