Bug 75407 - "com.sun.star.util.PathSubstitution" doesn't retrieve the installation path
Summary: "com.sun.star.util.PathSubstitution" doesn't retrieve the installation path
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.2.1.1 release
Hardware: Other All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-23 18:09 UTC by Dorange-Pattoret Didier
Modified: 2014-10-05 22:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dorange-Pattoret Didier 2014-02-23 18:09:08 UTC
Try the bellow code.
I do'nt get the right path
I got : /opt/libreoffice4.2/program/.. instead of /opt/libreoffice4.2

Sub Essai
	Print GetRepertoirePath("inst") 
End Sub


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
End Function
Comment 1 pierre-yves samyn 2014-02-24 08:26:20 UTC
Hello

I reproduce on windows 7/64 with Version: 4.2.1.1
Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b

and Version: 4.2.3.0.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 :

sub PysDossierInstall

dim oContext as object

oContext = GetDefaultContext.getByName("/singletons/com.sun.star.util.theOfficeInstallationDirectories")
print oContext.OfficeInstallationDirectoryURL

end sub


Regards
Pierre-Yves
Comment 2 Stephan Bergmann 2014-02-24 14:16:35 UTC
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).
Comment 3 pierre-yves samyn 2014-02-24 16:22:10 UTC
(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 ?

Regards
Pierre-Yves
Comment 4 Stephan Bergmann 2014-02-24 17:00:54 UTC
(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...?
Comment 5 pierre-yves samyn 2014-02-25 08:17:17 UTC
Hello

(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 3.5.7.2 for instance.

Sorry for the noise.

I set status to NEEDINFO. Didier can you clarify what are the problems?

Regards
Pierre-Yves
Comment 6 QA Administrators 2014-09-03 21:32:43 UTC
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: 
https://wiki.documentfoundation.org/QA/FDO/NEEDINFO

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!


Warm Regards,
QA Team
Comment 7 QA Administrators 2014-10-05 22:59:51 UTC
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