Issue 93815 - Custom properties of DocumentInfo are not accessible by BASIC code
Summary: Custom properties of DocumentInfo are not accessible by BASIC code
Status: ACCEPTED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: OOo 3.0 RC1
Hardware: PC Windows XP
: P3 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-12 09:42 UTC by mchris
Modified: 2017-05-20 10:55 UTC (History)
1 user (show)

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


Attachments
A demo text file for this issue. Search the BASIC code. (8.62 KB, application/vnd.oasis.opendocument.text)
2008-09-12 09:44 UTC, mchris
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mchris 2008-09-12 09:42:22 UTC
Try the following code in any OOo document (I've already tried it on Writer
documents and on Base forms):

Sub Main

if ThisComponent.DocumentInfo.PropertySetInfo.hasPropertyByName("MyProperty") then

ThisComponent.DocumentInfo.MyProperty="MyValue"

else

ThisComponent.DocumentInfo.addProperty("MyProperty",193,"MyValue")

endif

print ThisComponent.DocumentInfo.MyProperty ' It prints a null string
REM you have to install XRayTool to run this line
Xray ThisComponent.DocumentInfo
REM XRay tool shows the correct string "MyValue" in "MyProperty" but when you
REM double click on it, it shows a null string (really weird).

End Sub

In conclusion every time I try to access a custom property from DocumentInfo the
program returns a null string. This was not the case with previous versions.

I tried it only on OOo 3 RC1 under Win XP.
Comment 1 mchris 2008-09-12 09:44:07 UTC
Created attachment 56467 [details]
A demo text file for this issue. Search the BASIC code.
Comment 2 mchris 2008-09-15 08:06:25 UTC
I made some tests and I found out that it is more complicated. hasPropertyByName
method always returns true.

I don't know if assignment works because accessing a custom property always
returns a null string but in XRayTool the value is visible.

Please ab, can you investigate what the real problem is and change the description?

thank you.
Comment 3 ab 2008-09-19 13:44:34 UTC
Needs to be evaluated
Comment 4 ab 2008-10-07 15:33:01 UTC
Forgot to set to STARTED, OOo 3.x
Comment 5 mchris 2008-10-07 16:44:03 UTC
Please search the possibility that DocumentInfo service is depreciated in OOo
3.0 SDK. I don't have access to this SDK yet.
Comment 6 Marcus 2017-05-20 10:55:22 UTC
Reset assigne to the default "issues@openoffice.apache.org".