Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3613

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/3613/1

Create conversion constructor for Reference

makes UNO code less noisy.

Change-Id: Ib501f462e232ad7eda57e2a74634ea0646877e0f
---
M include/com/sun/star/uno/Reference.h
M sd/source/core/CustomAnimationEffect.cxx
2 files changed, 12 insertions(+), 1 deletion(-)



diff --git a/include/com/sun/star/uno/Reference.h b/include/com/sun/star/uno/Reference.h
index 94551a0..3297abc 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -248,6 +248,17 @@
         @param rRef another reference
     */
     inline Reference( const Reference< interface_type > & rRef ) SAL_THROW(());
+
+    /** Up-casting conversion constructor: Copies interface reference.
+
+        @param rRef another reference
+    */
+    template< class derived_interface_type >
+    inline Reference( const Reference< derived_interface_type > & rRef )
+    {
+        _pInterface = iquery( static_cast< interface_type* >(rRef.get()) );
+    }
+
     /** Constructor: Sets given interface pointer.
 
         @param pInterface an interface pointer
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 21a098f..827bed2 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1022,7 +1022,7 @@
     xAnimate->setFill( AnimationFill::HOLD );
     xAnimate->setTarget( maTarget );
 
-    return Reference< XAnimationNode >( xAnimate, UNO_QUERY_THROW );
+    return xAnimate;
 }
 
 // --------------------------------------------------------------------

-- 
To view, visit https://gerrit.libreoffice.org/3613
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib501f462e232ad7eda57e2a74634ea0646877e0f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Noel Grandin <noelgrandin@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.