Issue 24015 - regression: getSubstituteVariableValue broken in 680_m17
Summary: regression: getSubstituteVariableValue broken in 680_m17
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows 2000
: P4 Trivial
Target Milestone: ---
Assignee: ingenstans
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2003-12-31 12:50 UTC by ingenstans
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ingenstans 2003-12-31 12:50:59 UTC
the Basic call to a com.sun.star.PathSubstitution service, which worked fine in 
1.1, has stopped working in 680_m17. 

As an example, try code like this

Sub wontwork
dim oPathSub
oPathSub=createUnoService("com.sun.star.PathSubstitution")
msgBox oPathSub.getVariableValue( "$(work)") 
end sub

works fine in 1.1, though
Comment 1 ingenstans 2004-01-02 09:45:24 UTC
knocked down to P4 by reporter, since it's not that important.
Comment 2 ooo 2004-01-06 13:53:46 UTC
forwarding to responsible engineer
Comment 3 carsten.driesner 2004-01-07 08:03:40 UTC
First of all your example cannot work as is doesn't provide the correct service
name and uses a non-existing method at the com.sun.star.util.XStringSubstitution
interface. Please look at the following code snippet which is correct:

Sub test
dim oPathSub
oPathSub=createUnoService("com.sun.star.util.PathSubstitution")
msgbox oPathSub.getSubstituteVariableValue( "$(work)" )
end sub

I have checked this code snippet with a new src680_m17 installation and the
function returns a correct path to the working directory of the user. If this
service is not useable, OOo won't start as it is mandatory for many functions.

Please verify if the corrected code snippet works with your version. May be your
installation is somewhat broken, but I doubt it as OOo is not able to startup
without this service! Try to open the path tab dialog accessible through "Tools
- Options - OpenOffice - Paths" which uses the PathSubstitution service intensely,
Comment 4 carsten.driesner 2004-01-07 08:08:59 UTC
I asked our API testing to verify your regression report. I hope that someone
from them will also add a comment.
Comment 5 ingenstans 2004-01-07 08:38:47 UTC
OK. I see what this is. But I don't understand it.

First of all, apologies for the typo on my bug report. I was trying to use the 
right service (and it had worked) I just misremembered its name.

What I had been trying was this:
(cut and pasted)

Function getHome
' attempts to return the my documents location
dim oPathSub
dim sMyDocs as string
oPathSub=createUnoService("com.sun.star.util.PathSubstitution")
sMyDocs= oPathSub.getSubstituteVariableValue( "$(work)" )
getHome= sMyDocs
end Function

It returns nothing.

However, your test code, which looks exactly the same, except for being a sub 
not a function --

Sub test
dim oPathSub
oPathSub=createUnoService("com.sun.star.util.PathSubstitution")
msgbox oPathSub.getSubstituteVariableValue( "$(work)" )
end sub


returns what it should.

So I tried this:

sub werble
msgbox("The function returns " + mytest)
end sub

Function mytest
dim oPathSub
dim smytest as string
oPathSub=createUnoService("com.sun.star.util.PathSubstitution")
msgbox ("The sub gives "+ oPathSub.getSubstituteVariableValue( "$(work)" ))
smytest=oPathSub.getSubstituteVariableValue( "$(work)" )
end Function

this gives me one properly filled out message box that says 'The sub returns ...
' and one message box that says 'The function returns [blank])

So the problem seems to be that getSubstituteVariableValue returns something 
that only the msgbox function understands. Or else that I'm doing something 
_really_ stupid. Either way, I don't understand it. 
Comment 6 stephan.wunderlich 2004-01-07 08:53:28 UTC
SW: I just downloaded and installed the version from
http://download.openoffice.org/680/ and the code-snippet 

Sub test
 msgbox getHome
end sub

Function getHome
' attempts to return the my documents location
dim oPathSub
dim sMyDocs as string
oPathSub=createUnoService("com.sun.star.util.PathSubstitution")
sMyDocs=oPathSub.getSubstituteVariableValue( "$(work)" )
getHome=sMyDocs
end Function

shows a messagebox with the working directory.
Comment 7 ingenstans 2004-01-07 11:32:39 UTC
OK. does for me too. Now.

I still don't know what was going on, but thanks for your efforts.
Comment 8 ace_dent 2008-05-17 21:06:50 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Andrew
 
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 9 ace_dent 2008-05-17 23:08:43 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew