Re: [api-dev] Re: Usage of UNO_QUERY_THROW
Frank Schönheit - Sun Microsystems Germany schrieb: Hi Daniel, What happens if UNO_QUERY_THROW is used instead? ... What is the reason you have introduced UNO_SET_THROW? It spares the queryInterface call. For a pattern like Reference< XFoo > xFoo = xBar->getSomeFoo(); // ensure that xFoo is not NULL, which would be a violation // of xBar's constraint ... it just felt wrong (since potentially too expensive) to do Reference< XFoo > xFoo( xBar->getSomeFoo(), UNO_QUERY_THROW ); UNO_SET_THROW is cheaper in this case. Ok, understood. Thanks. Daniel - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Re: Usage of UNO_QUERY_THROW
Hi Daniel, > What happens if UNO_QUERY_THROW is used instead? > ... > What is the reason you have introduced UNO_SET_THROW? It spares the queryInterface call. For a pattern like Reference< XFoo > xFoo = xBar->getSomeFoo(); // ensure that xFoo is not NULL, which would be a violation // of xBar's constraint ... it just felt wrong (since potentially too expensive) to do Reference< XFoo > xFoo( xBar->getSomeFoo(), UNO_QUERY_THROW ); UNO_SET_THROW is cheaper in this case. Ciao Frank -- - Frank Schönheit, Software Engineer frank.schoenh...@sun.com - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Base http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Re: Usage of UNO_QUERY_THROW
Frank Schönheit schrieb: Hi Michael, so i thought, what the heck is UNO_SET_THROW? it seems to do the same thing as UNO_QUERY_THROW, except it does not query, it only checks for NULL. hmm, according to opengrok's mere 50 results, i'm not the only one who never heard of it... http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1092 I know that hardly anybody cares about *announcing* interface changes/extensions in interface-announce, but that even nobody cares to *read* this list ... :-\ Thanks for the pointer, I remember I have read it but didn't need it for a long time, so I have forgotten. Shame on me. What happens if UNO_QUERY_THROW is used instead? As far as I can see, "Reference< interface_type >::Reference( XInterface * pInterface, UnoReference_QueryThrow )" calls "Reference< interface_type >::iquery_throw( XInterface * pInterface )" which calls "BaseReference::iquery_throw( XInterface* pInterface, const Type & rType )" which calls "BaseReference::iquery( XInterface * pInterface, const Type & rType )" which returns 0. So, iquery_throw will throw too. What is the reason you have introduced UNO_SET_THROW? Regards Daniel - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Re: Usage of UNO_QUERY_THROW
Hi Michael, > so i thought, what the heck is UNO_SET_THROW? > it seems to do the same thing as UNO_QUERY_THROW, except it does not > query, it only checks for NULL. > hmm, according to opengrok's mere 50 results, i'm not the only one who > never heard of it... http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1092 I know that hardly anybody cares about *announcing* interface changes/extensions in interface-announce, but that even nobody cares to *read* this list ... :-\ Ciao Frank - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Re: Usage of UNO_QUERY_THROW
On 11/12/2008 20:57, Frank Schönheit - Sun Microsystems Germany wrote: Hi Daniel, Ah, by studying the sources, I learned that it should be uno::Reference< XSomething > xS2( xS1, uno::UNO_SET_THROW ); Right? Right. so i thought, what the heck is UNO_SET_THROW? it seems to do the same thing as UNO_QUERY_THROW, except it does not query, it only checks for NULL. hmm, according to opengrok's mere 50 results, i'm not the only one who never heard of it... michael -- "And I don't need to waste my time with a computer just because I am a computer scientist. [Medical researchers are not required to suffer from the diseases they investigate.]" -- Edsger W. Dijkstra - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org