Issue 63271

Summary: macro:///Tools.UCB.LoadDataFromFile needs minor change
Product: App Dev Reporter: ms2 <m.santhoff>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description ms2 2006-03-16 17:55:58 UTC
In the macro library "Tools.UCB" the function "LoadDataFromFile" should
be changed like this:

<now>
Function LoadDataFromFile(FilePath as String, DataList()) as Boolean
	...
	oFile = oUcb.OpenFileReadWrite(FilePath)
	oInputStream.SetInputStream(oFile.GetInputStream)
	...
</now>

<new>
Function LoadDataFromFile(FilePath as String, DataList()) as Boolean
	...
	oFile = oUcb.OpenFileRead(FilePath)     
	oInputStream.SetInputStream(oFile) 
	...
</new>

because on Unix like operating systems the ordinary user has no right to
open files not owned by himself for writing.

Use case:
I wanted to open the file:

<OpenOffice.org1.1.3>/share/psprint/psprint.conf

for making a list of names of predefined printers. I couldn't because the
file is owned by root. With this modification it works and the function
is universally usable for macro writers.

I haven't found the place where it is used from originally, so the spot
in some autopilot or the like making this function necessary should be checked
for regression. From reading the code of the function I see no problem, only
read access is done.
Comment 1 stephan.wunderlich 2006-03-17 09:38:06 UTC
sw->ih: this is your area methinks
Comment 2 nospam 2006-08-09 09:51:38 UTC
IH->ms2: you have already provided a solution - so I think you can fix this.
Comment 3 ms2 2006-11-15 03:19:58 UTC
ms2 -> IH

No, sorry. I cannot do that because I have no write access to the sources. I'm
not a developer but a user and macro programmer.

Please forward to the responsible Decveloper for the tools macro library.
Comment 4 hartsambatchvolv 2010-11-11 02:40:10 UTC
Created attachment 74073
Comment 5 Rob Weir 2013-07-30 02:40:35 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.