Issue 80044 - let an UNO_SET_THROW complement the existing UNO_QUERY_THROW
Summary: let an UNO_SET_THROW complement the existing UNO_QUERY_THROW
Status: CLOSED FIXED
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.4
Assignee: Stephan Bergmann
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 21:12 UTC by Frank Schönheit
Modified: 2007-10-30 18:10 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch (8.21 KB, patch)
2007-07-25 21:12 UTC, Frank Schönheit
no flags Details | Diff
better patch :-\ (8.28 KB, patch)
2007-07-26 07:15 UTC, Frank Schönheit
no flags Details | Diff
patch, Mk III (8.41 KB, patch)
2007-07-26 08:55 UTC, Frank Schönheit
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2007-07-25 21:12:16 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 );
Comment 1 Frank Schönheit 2007-07-25 21:12:55 UTC
Created attachment 47093 [details]
patch
Comment 2 Frank Schönheit 2007-07-25 21:13:32 UTC
fs->sb: please review. I would like to commit this to a current CWS of mine, if
you don't object.
Comment 3 Frank Schönheit 2007-07-26 07:15:34 UTC
Created attachment 47096 [details]
better patch :-\
Comment 4 Stephan Bergmann 2007-07-26 07:59:13 UTC
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).
Comment 5 Stephan Bergmann 2007-07-26 08:01:17 UTC
Ignore 2 above (the existing code already has constructs like that).
Comment 6 Frank Schönheit 2007-07-26 08:55:40 UTC
Created attachment 47097 [details]
patch, Mk III
Comment 7 Frank Schönheit 2007-07-26 08:57:43 UTC
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
Comment 8 Stephan Bergmann 2007-07-26 09:30:22 UTC
@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.  :)
Comment 9 Frank Schönheit 2007-07-26 09:44:55 UTC
okay, will commit to CWS basmgr03 then. Thanks a lot.
Comment 10 Frank Schönheit 2007-07-29 20:40:19 UTC
committed to CWS basmgr03
Comment 11 Frank Schönheit 2007-09-13 20:41:32 UTC
fs-> sb: please verify in CWS basmgr03
Comment 12 Stephan Bergmann 2007-09-14 07:58:57 UTC
@fs: If you tell me where the unit tests are...  ;)
Comment 13 Frank Schönheit 2007-09-14 21:02:13 UTC
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?
Comment 14 Stephan Bergmann 2007-09-17 08:09:39 UTC
@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>).
Comment 15 Frank Schönheit 2007-09-17 08:52:51 UTC
> 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.
Comment 16 Stephan Bergmann 2007-09-17 09:01:10 UTC
@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.)
Comment 17 Frank Schönheit 2007-09-17 09:28:47 UTC
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.
Comment 18 Stephan Bergmann 2007-09-17 09:44:08 UTC
verified
Comment 19 Stephan Bergmann 2007-10-30 18:10:04 UTC
.