Apache OpenOffice (AOO) Bugzilla – Issue 72499
uno::Reference does not permit up-casting
Last modified: 2013-02-07 22:00:52 UTC
Using the uno::Reference as a pointer abstraction, it is not possible to e.g. assign uno::Reference<B> to uno::Reference<A>, even if A is a baseclass of B. To-be-attached patch adds this functionality (and works around a few ambiguities resulting from that change)
Created attachment 41371 [details] Proposed patch
Setting a target.
Having only a quick glance at the patch: - we don't require boost for the SDK, thus including boost headers isn't allowed - removing the conversion operator to Reference<XInterface> const& and adding a member function template: this will create temporaries (requiring a pair of acquire()/release() calls) in cases where currently Reference<XInterface> const& doesn't. I can't foresee whether this is a performance problem or not. Can we safely keep the conversion operator? We would avoid running into that potential problem then.
@dbo: to item 1) - what's then the recommended way to configure those things at compile time? to item 2) - I don't see any (obvious) way how to keep that operator, because stuff becomes ambiguous then. Regarding performance, I'll naturally run performance tests before upstreaming such changes.
1: Wouldn't be one known compiler that can handle template friends be sufficient? Every other compiler would use the public _pInterface member, but we will still break on that compiler. 2: you are right.
To prevent frustration among patch writers, all issues of type PATCH are monitored for extended inactivity periods, see <http://eis.services.openoffice.org/patchreport/irt_index.html> and <http://eis.services.openoffice.org/patchreport/iit_index.html>. Please proceed with this issue in an appropriate way, to satisfy the statistics and avoid frustration. Thanks. [http://wiki.services.openoffice.org/wiki/Uno/Misc/InactivePatchIssueReminder]
done.
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset to default assignee.