Tobias Krais wrote:
Hi together,after testing, I wrote this little test method: -----%<----- public void test() { XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); com.sun.star.frame.XController xController = xModel.getCurrentController(); System.out.println(this.xComponent); System.out.println(xController); XComponent myComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xController); System.out.println(myComp.equals(this.xComponent)); } -----%<----- In my Opinion the last line should return true. Am I right? But for me, it prints false...
To check whether two Java references are to the same UNO object, use com.sun.star.uno.UnoRuntime.areSame instead of java.lang.Object.equals. (And since XController inherits from XComponent, the output you presented in a previous mail, that xController.toString() and myComp.toString() give the same output, as those two *are* the same Java object, is fully correct; there is not much use in queryInterface from derived XController to base XComponent.)
-Stephan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
