Try the bellow code.
I do'nt get the right path
I got : /opt/libreoffice4.2/program/.. instead of /opt/libreoffice4.2
Function GetRepertoirePath(sInstPath as String) as String 'donne le répertoire correspondant
Dim oPathSubstSrv as Object
Dim sPath as String
sInstPath = "$("+sInstPath+")"
oPathSubstSrv = createUnoService("com.sun.star.util.PathSubstitution")
sPath = ConvertFromUrl(oPathSubstSrv.getSubstituteVariableValue(sInstPath))
GetRepertoirePath = sPath
I reproduce on windows 7/64 with Version: 126.96.36.199
Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b
and Version: 188.8.131.52.0+
Build ID: 5fd90cdd1fdb20ab7f6a2b67c384f0994f09a86b
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-02-21_22:38:15
If you try to get the Program path with $(prog) you get :
C:\Program Files (x86)\LibreOffice 4\program\..\program
I set status to New and Importance to Major because this may cause "hidden" malfunctions in applications.
However there is a workaround :
dim oContext as object
oContext = GetDefaultContext.getByName("/singletons/com.sun.star.util.theOfficeInstallationDirectories")
But what exactly are your problems?
$(inst) is documented to be the "Installation path of the Office," and /opt/libreoffice4.2/program/.. is functionally equivalent to /opt/libreoffice4.2 (though unnecessarily long, but that should be rather harmless).
$(prog) is documented to be the "Program path of the Office," and C:\Program Files (x86)\LibreOffice 4\program\..\program is functionally equivalent to C:\Program Files (x86)\LibreOffice 4\program (though unnecessarily long, but that should be rather harmless).
(In reply to comment #2)
> But what exactly are your problems?
The problem is the change. Programs already written using this statement can not find their functionning context.
I guess if two variables have been defined (since OOo 1.1.2) is that they should give two different results...
May I ask you the question: was this change intended and if so why ?
(In reply to comment #3)
> (In reply to comment #2)
> > But what exactly are your problems?
> The problem is the change. Programs already written using this statement can
> not find their functionning context.
> I guess if two variables have been defined (since OOo 1.1.2) is that they
> should give two different results...
> May I ask you the question: was this change intended and if so why ?
But what change exactly are you talking about? That resolving "$(inst)" and/or "$(path)" give non-shortest results containing ".." segments, or that "$(inst)" and "$(path)" resolve to the same result, or...?
(In reply to comment #4)
> But what change exactly are you talking about?
You're absolutely right !
My mistake : I had just not seen the last ".."
While it would be "intellectually" satisfying not back one level I do not see a malfunction with this syntax.
I add after checking that the result was already the same with LibreOffice 184.108.40.206 for instance.
Sorry for the noise.
I set status to NEEDINFO. Didier can you clarify what are the problems?
Dear Bug Submitter,
This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information.
For more information about our NEEDINFO policy please read the wiki located here:
If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed.
Thank you for helping us make LibreOffice even better for everyone!
Dear Bug Submitter,
Please read this message in its entirety before proceeding.
Your bug report is being closed as INVALID due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided):
a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present
b) Provide easy to reproduce steps – the simpler the better
c) Provide any test case(s) which will help us confirm the problem
d) Provide screenshots of the problem if you think it might help
e) Read all comments and provide any requested information
Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue.
Please do not:
a) respond via email
b) update the version field in the bug or any of the other details on the top section of FDO