[Libreoffice-commits] .: Branch 'libreoffice-3-4' - extensions/source

Noel Power noelp at kemper.freedesktop.org
Thu Oct 27 02:52:53 PDT 2011


 extensions/source/ole/unoconversionutilities.hxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ab802aee181ca6df397ca53e461d5f53808cef9d
Author: Noel Power <noel.power at novell.com>
Date:   Wed Oct 26 17:28:51 2011 +0100

    fix handling of SAFEARRAY(s) returned as variant in olebridge (fdo#38441)
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index 328fec4..99f49c9 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -134,7 +134,7 @@ public:
     /** @exception com.sun.star.lang.IllegalArgumentException
         If rSeq does not contain a sequence then the exception is thrown.
     */
-    SAFEARRAY* 	createUnoSequenceWrapper(const Any& rSeq);
+    VARTYPE createUnoSequenceWrapper(const Any& rSeq, SAFEARRAY*& pOutArray );
     /** @exception com.sun.star.lang.IllegalArgumentException
         If rSeq does not contain a sequence or elemtype has no proper value
         then the exception is thrown.
@@ -779,11 +779,12 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny)
         }
         case TypeClass_SEQUENCE:		// sequence ??? SafeArray descriptor
         {
-            SAFEARRAY* pArray = createUnoSequenceWrapper(rAny);
-            if (pArray)
+            SAFEARRAY* pOutArray = NULL;
+            VARTYPE eArrayType = createUnoSequenceWrapper(rAny, pOutArray );
+            if (pOutArray)
             {
-                V_VT(pVariant) = VT_ARRAY | VT_VARIANT;
-                V_ARRAY(pVariant) = pArray;
+                V_VT(pVariant) = VT_ARRAY | eArrayType;
+                V_ARRAY(pVariant) = pOutArray;
             }
             else
             {
@@ -1295,9 +1296,8 @@ void  UnoConversionUtilities<T>::getElementCountAndTypeOfSequence( const Any& rS
 
 
 template<class T>
-SAFEARRAY* 	UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq)
+VARTYPE UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq,  SAFEARRAY*& pArray)
 {
-    SAFEARRAY* pArray = NULL;
     sal_uInt32 n = 0;
     
     if( rSeq.getValueTypeClass() != TypeClass_SEQUENCE )
@@ -1361,7 +1361,7 @@ SAFEARRAY* 	UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq)
 
     TYPELIB_DANGER_RELEASE( pSeqElementDesc);
         
-    return pArray;	
+    return eTargetElementType;
 }
 
 /* The argument rObj can contain


More information about the Libreoffice-commits mailing list