Issue 93815

Summary: Custom properties of DocumentInfo are not accessible by BASIC code
Product: General Reporter: mchris <mchris>
Component: scriptingAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: czeslaw.wolanski, issues
Version: OOo 3.0 RC1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
A demo text file for this issue. Search the BASIC code.
none
info: SDK 3.0 and online reference none

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".
Comment 7 Czesław Wolański 2022-07-23 14:52:48 UTC
Checking the issue with three versions:
- in 2.4.3 the program works as expected by the reporter
- in 3.0.0 it returns a null string indeed
- interestingly, in 4.1.12 it returns "MyValue".

The 3.0 SDK documentation states that the DocumentInfo service
is deprecated and recommends using the DocumentProperties service instead.
The online IDL reference provides the same information
(cf. the attached file).


Fixing the code in line with the new specs gives the desired effect.
Thus I see no real defect in this issue.
Comment 8 Czesław Wolański 2022-07-23 14:53:59 UTC
Created attachment 87140 [details]
info: SDK 3.0 and online reference