Apache OpenOffice (AOO) Bugzilla – Issue 80044
let an UNO_SET_THROW complement the existing UNO_QUERY_THROW
Last modified: 2007-10-30 18:10:04 UTC
The attached patch implements what has been proposed in http://www.openoffice.org/servlets/ReadMsg?list=interface-discuss&msgNo=703, and discussed in the respective thread (http://www.openoffice.org/servlets/BrowseList?list=interface-discuss&by=thread&from=1501923 - this display is incomplete, since some of the posters use broken mail-news-gateways). That is, it implements a UNO_SET_THROW for the css.uno.Reference template, which allows constructs such as Reference< XFoo > xFoo( xFooSupplier->getFoo(), UNO_SET_THROW ); resp. xFoo.set( xFooSupplier->getFoo(), UNO_SET_THROW );
Created attachment 47093 [details] patch
fs->sb: please review. I would like to commit this to a current CWS of mine, if you don't object.
Created attachment 47096 [details] better patch :-\
1 @since tags missing (see <http://wiki.services.openoffice.org/wiki/UNO_%40since_Tags>). 2 Is template< class interface_type > inline Reference< interface_type >::Reference( const Reference< interface_type > & rRef, ... instead of template< class interface_type > inline Reference< interface_type >::Reference< const Reference & rRef, ... working on all relevant compilers? 3 Please add an explicit comment UDK_3.3 { # OOo 2.4 in util/cppu.map. 4 Tab problems (e.g., in the definition of iset_throw).
Ignore 2 above (the existing code already has constructs like that).
Created attachment 47097 [details] patch, Mk III
new patch: - added since tag (it's confusing to have "UDK 3.2.8" in @since, but UDK_3.3 in cppu.map. Is this correct?) - untabified new code (though this is inconsistent with the existing code, then :) - added comment in map file
@fs: "Is this correct?" Yes, it is, see <http://udk.openoffice.org/common/man/libraryversioning.html>. Not looking at the third patch, I trust you that it is good now. :)
okay, will commit to CWS basmgr03 then. Thanks a lot.
committed to CWS basmgr03
fs-> sb: please verify in CWS basmgr03
@fs: If you tell me where the unit tests are... ;)
Sigh. You could have said you want to have this when you approved the patch, couldn't you? What kind of unit tests do you imagine for this kind of functionality? Something like checkInvalidInterfaceQuery in test_di.cxx?
@fs: I thought it goes without saying. :) No idea what test_di.cxx is, but I would imagine tests of the two functions with null and non-null arguments, added to cppu/qa (see <http://wiki.services.openoffice.org/wiki/Uno/Binary/Modules/CPPU#Tests>).
> No idea what test_di.cxx is, http://wiki.services.openoffice.org/wiki/Uno/Binary/Modules/CPPU#Tests SCNR test_di.cxx seems to contain a rudimentary test for UNO_QUERY_THROW. Okay, I will try to learn an unknown unit test framework and hope to finish this before the CWS comes back from QA :-\ Do you want me to create a new test case file? UNO_SET_THROW doesn't seem to fit into neither test_any.cxx nor test_unotype.cxx.
@fs: If there are already tests for Reference in another cppu test directory outside cppu/qa (probably using a unit test framework you are already familiar with), it is of course OK to add any new tests there. I only mentioned cppu/qa because it should be the canonical place to add any new tests (and, yes, those Reference tests should then go into a new file like test_reference.cxx). (The current mess of tests in the udk modules is definitely unfortunate, but due to historic circumstances and lack of energy to straighten it out completely. As I said, by default, new tests should go into qa sub-directories.)
unit tests added to cppu/qa/test_reference.cxx. Given that the UNO_QUERY_THROW tests are very rudimentary, and use the deprecated test framework, I decided to create the UNO_SET_THROW tests in cppu/qa instead of cppu/tests.
verified
.