Hi Bernard, *,

On Fri, Feb 02, 2007 at 01:40:32PM +0100, Bernard Marcelly wrote:
> Message de Christian Lohmaier  date 2007-02-02 12:38 :
> >
> >I got some trouble with the DocumentInfo's properties.
> >file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/star/document/DocumentInfo.html
> >http://api.openoffice.org/docs/common/ref/com/sun/star/document/DocumentInfo.html
> >
> >The properties I can query don't match those that are listed in the
> >reference.
> >[...]
> >You'll get 33 Properties, but not all are listed in the docs, and you 
> >don't get
> >all that are listed in the docs.
> 
> I get 31 properties in a Writer or Calc document.

Hmm. I get 33 - no matter whether I use basic or java. (OOo 2.1 680_m6 (9095) -
Sun provided german build)
And in calc as well the props-Array contains 33 entries.

> You can read them easily in Basic with Xray macro.
>     Xray thisComponent.DocumentInfo

When I set a watch on xprops and have a look at it, it has the 33 properties as
well.

> >(look e.g. for the "Language" property listed in the docs. It is not
> >available. Instead you got a property "CharLocale")
> 
> Language is documented but does not exist.
> CharLocale is not documented in DocumentInfo page, and does not exist in 
> DocumentInfo object.

But why is it included in the poperties then?

It is true that the doc has this property, but it has others as well that are
not included in the set returned.

> CharLocale is directly accessible (with Basic) from the document itself.

Well - that should not be possible in java, but I get it there as well.
 //xtd is XTextDocument
 XDocumentInfoSupplier xdis = (XDocumentInfoSupplier)UnoRuntime.queryInterface(
                                               XDocumentInfoSupplier.class,xtd);
 XDocumentInfo xdi = xdis.getDocumentInfo();
 XPropertySet xps = 
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xdi);
 XPropertySetInfo xpsi = xps.getPropertySetInfo();
 Property[] props = xpsi.getProperties();
 
 for (int i = 0; i < props.length; i++) {
   xText.insertString(xCursor, i +": "+ props[i].Name, false);
 }      

Gives me the same properties as in basic.

But maybe you meant this as a workaround and I got your wrong?

> >Is the problem the documentation? Is the problem in the functionality of
> >the Office?
> >
> Documentation is incorrect. See Issue 26672 created nearly 3 years ago.

That talks about StandaloneDocumentInfo, but I want to query real DocumentInfo
- not sure whether that is still the same 

ciao
Christian
-- 
NP: Bif Naked - Daddy's Getting Married

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to