Rony G. Flatscher wrote:
Hi there,

is the "XNameAccess" interface implied, if a service object defines (and is defined to have) the interfaces "com.sun.star.container.XIndexAccess" and/or "com.sun.star.container.XEnumerationAccess"? If so, what would be the rules to apply?

Reason of this question being, that the service "com.sun.star.table.TableCharts" (implemented by "ScChartsObj") does not list "XNameAccess" (nor is it reflected), yet one can use that interface!

If an object O states that it implements service S, and S does not include a given interface X, O may still implement X. The only properties that should hold are:

1 If object O states (XServiceInfo.supportsService/XServiceInfo.getSupportedServiceNames) that it implements service S, and interface X is non-optionally included in S, directly or indirectly via the inclusion of sub-services in the case of old-style services, then O must implement (queryInterace) X, and O must state (XTypeProvider.getTypes) that it implements X or an interface Y for which X is a non-optional direct or indirect base.

2 If object O states (XTypeProvider.getTypes) that it implements interface X, then O must implement (queryInterface) X.

3 If object O implmements (queryInterface) X, and interface Y is a non-optional direct base of X, then O must implement (queryInterface) Y.

That said, there probably are cases where an interface X that logically belongs to a service S has erroneously been omitted from S.

-Stephan

Here the service object:

    xTableCharts: SERVICE|com.sun.star.table.TableCharts|ScChartsObj
com.sun.star.table.XTableCharts|INTERFACE||com.sun.star.table.TableCharts com.sun.star.container.XIndexAccess|INTERFACE||com.sun.star.table.TableCharts com.sun.star.container.XEnumerationAccess|INTERFACE||com.sun.star.table.TableCharts

Here the interfaces explored via reflection:

    xTableCharts-interfaces (via reflection):
    com.sun.star.table.XTableCharts
            com.sun.star.container.XIndexAccess
            com.sun.star.container.XEnumerationAccess

---rony

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

Reply via email to