Executing:
    dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

    fails in our 1.1.4 - but not the stock built version [!?]

Error set from:

(gdb) 
#3  0x441241bc in SbUnoObject::Notify (this=0x8c2ab48, rBC=@0x8b0d9f0, rHint=@0xbfffbda0)
    at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbunoobj.cxx:1950
1950                                            StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, 
(gdb) l
1945                                    {
1946                                            StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2 ) );
1947                                    }
1948                                    catch( IllegalArgumentException& e3)
1949                                    {
1950                                            StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, 
1951                            implGetExceptionMsg( e3, aIllegalArgumentExceptionName ) );
1952                                    }
1953                                    catch( Exception& e4 )
1954                                    {


Breakpoint 2, SbiRuntime::Error (this=0x8c2a868, n=87673) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/runtime.cxx:747
747             if( n )
(gdb) bt
#0  SbiRuntime::Error (this=0x8c2a868, n=87673) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/runtime.cxx:747
#1  0x44153716 in SbiInstance::Error (this=0x8c2a208, n=87673, rMsg=@0xbfffbcb0) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/runtime.cxx:449
#2  0x4410e195 in StarBASIC::Error (n=87673, rMsg=@0xbfffbcb0) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sb.cxx:1228
#3  0x441241bc in SbUnoObject::Notify (this=0x8c2ab48, rBC=@0x8b0d9f0, rHint=@0xbfffbda0)
    at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbunoobj.cxx:1950
#4  0x4040e61b in SfxBroadcaster::Broadcast () from ./libsvl645li.so
#5  0x407759b2 in SbxVariable::Broadcast (this=0x8c2acd8, nHintId=65536) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvar.cxx:183
#6  0x40770021 in SbxValue (this=0x8c2ad28, __vtt_parm=0x408a5188, r=@0x8c2acd8) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvalue.cxx:328
#7  0x4077526a in SbxVariable (this=0x8c2ad28, __vtt_parm=0x408a5184, r=@0x8c2acd8) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvar.cxx:98
#8  0x4415f9fe in SbxMethod (this=0x8c2ad28, r=@0x8c2acd8) at sbxmeth.hxx:74
#9  0x4415c389 in SbiRuntime::FindElement (this=0x8c2a868, pObj=0x8c2ab48, nOp1=32789, nOp2=12, nNotFound=87570, bLocal=0 '\0')
    at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/step2.cxx:223
#10 0x4415d990 in SbiRuntime::StepELEM (this=0x8c2a868, nOp1=32789, nOp2=12) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/step2.cxx:579
#11 0x4415492a in SbiRuntime::Step (this=0x8c2a868) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/runtime.cxx:642
#12 0x44112565 in SbModule::Run (this=0x8ae9c58, pMeth=0x8c2a388) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:687
#13 0x44111a45 in SbModule::Notify (this=0x8ae9c58, rBC=@0x8aef818, rHint=@0xbfffc140) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:444
#14 0x4040e61b in SfxBroadcaster::Broadcast () from ./libsvl645li.so
#15 0x441171d6 in SbMethod::Broadcast (this=0x8aef750, nHintId=65536) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:2163
#16 0x40770a75 in SbxValue::Get (this=0x8aef750, rRes=@0xbfffc1f0) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvalue.cxx:554
#17 0x45e9b8f8 in BasicIDE::RunMethod () from ./libbasctl645li.so



Failure is here:

		fprintf( stderr, "Head of block\n" );
		try
		{
		if( mxUnoAccess.is() )
		{
			fprintf( stderr, "Foo 1\n" );
			Any aRetAny = pMeth->m_xUnoMethod->invoke( getUnoAny(), args );

We get:

"Head of block
Foo 1
About to call method 'executeDispatch'
Caught illegal argument exception"

So - is it some type coercion problem (?)

Breakpoint in 'throw':

#0  0x413b36b5 in __cxa_throw () from /usr/lib/libstdc++.so.5
#1  0x46474b4b in stoc_corefl::IdlInterfaceMethodImpl::invoke () from ./corereflection.uno.so
#2  0x44123f4e in SbUnoObject::Notify (this=0x8b61b40, rBC=@0x8ac0778, rHint=@0xbfffbf00)
    at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbunoobj.cxx:1892
#3  0x4040e61b in SfxBroadcaster::Broadcast () from ./libsvl645li.so
#4  0x407759b2 in SbxVariable::Broadcast (this=0x8b0de48, nHintId=65536) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvar.cxx:183
#5  0x40770021 in SbxValue (this=0x8b4ef08, __vtt_parm=0x408a5188, r=@0x8b0de48) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvalue.cxx:328
#6  0x4077526a in SbxVariable (this=0x8b4ef08, __vtt_parm=0x408a5184, r=@0x8b0de48) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvar.cxx:98
#7  0x4416010a in SbxMethod (this=0x8b4ef08, r=@0x8b0de48) at sbxmeth.hxx:74
#8  0x4415ca95 in SbiRuntime::FindElement (this=0x8b34d08, pObj=0x8b61b40, nOp1=32789, nOp2=12, nNotFound=87570, bLocal=0 '\0')
    at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/step2.cxx:223
#9  0x4415e09c in SbiRuntime::StepELEM (this=0x8b34d08, nOp1=32789, nOp2=12) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/step2.cxx:579
#10 0x44155036 in SbiRuntime::Step (this=0x8b34d08) at /opt/OpenOffice/OOO_1_1_4/basic/source/runtime/runtime.cxx:642
#11 0x44112775 in SbModule::Run (this=0x8aead48, pMeth=0x8b0b0c0) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:687
#12 0x44111c55 in SbModule::Notify (this=0x8aead48, rBC=@0x8b07490, rHint=@0xbfffc2a0) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:444
#13 0x4040e61b in SfxBroadcaster::Broadcast () from ./libsvl645li.so
#14 0x441173e6 in SbMethod::Broadcast (this=0x8aef358, nHintId=65536) at /opt/OpenOffice/OOO_1_1_4/basic/source/classes/sbxmod.cxx:2163
#15 0x40770021 in SbxValue (this=0x8b0a540, __vtt_parm=0x408a5188, r=@0x8aef358) at /opt/OpenOffice/OOO_1_1_4/svtools/source/sbx/sbxvalue.cxx:328
...

Adding code to:

stoc/source/corereflection/criface.cxx /::invoke/:
				if (! bAssign)
				{
+						fprintf(stderr, "Failed to coerce argument %d(/%d) of type %d\n",
+								nPos, nParams, pTD->eTypeClass );

we get:

Failed to coerce argument 4(/5) of type 20 from type 0
    So 'TD->eTypeClass' is 20 == typelib_TypeClass_SEQUENCE
	ie. the destination type is a sequence we want to coerce to ...
    The source type is typelib_TypeClass_VOID ...

[ eTypeClass defined in solver/.../inc/typelib/typeclass.h ]
[ uno_ methods in solver/..../uno/data.h ]

 dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

Try to coerce argument 0(/5) to type 22 [ interface ]
Try to coerce argument 1(/5) to type 12 [ string ]
Try to coerce argument 2(/5) to type 12 [ string ]
Try to coerce argument 3(/5) to type 6  [ long ]
Try to coerce argument 4(/5) to type 20 [ sequence ]
Generic coercion argument 4(/5) from type 0  [ Array() -> Void !? why ? ]

So - the question is why is the 'Array()' not getting converted
properly (?)

Suspicious of sbunoobj.cxx:

Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty )

Some printouts:

sbxToUnoValue to type = com.sun.star.frame.XDispatchProvider
sbxToUnoValue to type = string
sbxToUnoValue to type = string
sbxToUnoValue to type = long
sbxToUnoValue to type = []com.sun.star.beans.PropertyValue
Sequence section ...
Is an SbxDimArray (0) ...

URGH
    So - the real problem is that we create a '0 dimensional array' when
we have no arguments: Array() is 0 dimensional [ Why !? ]

    This patch - appears to fix the symptoms:

--- basic/source/classes/sbunoobj.cxx	12 Oct 2004 10:58:10 -0000	1.25.44.3
+++ basic/source/classes/sbunoobj.cxx	18 Apr 2005 14:58:49 -0000
@@ -1089,9 +1097,10 @@ Any sbxToUnoValue( SbxVariable* pVar, co
 
 				short nDims = pArray->GetDims();
 
 				// Normal case: One dimensional array
 				sal_Int32 nLower, nUpper;
-				if( nDims == 1 && pArray->GetDim32( 1, nLower, nUpper ) )
+				if( ( nDims == 1 && pArray->GetDim32( 1, nLower, nUpper ) ) ||
+					nDims == 0 && (nLower = 0, nUpper = -1, 1) )
 				{
 					sal_Int32 nSeqSize = nUpper - nLower + 1;
 

    ** Diffing between OpenOffice_1_1_3 and OpenOffice_1_1_4 it
_Seems_ that this change introduced this problem:

@@ -980,16 +1087,17 @@ Any sbxToUnoValue( SbxVariable* pVar, co
 				SbxBase* pObj = (SbxBase*)xObj;
 				SbxDimArray* pArray = (SbxDimArray*)pObj;
 
-				// Instanz der geforderten Sequence erzeugen
-				Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( rType );
-				xIdlTargetClass->createObject( aRetVal );
+				short nDims = pArray->GetDims();
 
-				// es muss ein eindimensionales Array sein
+				// Normal case: One dimensional array
 				sal_Int32 nLower, nUpper;
-				if( pArray->GetDims() == 1 && pArray->GetDim32( 1, nLower, nUpper ) )
+				if( nDims == 1 && pArray->GetDim32( 1, nLower, nUpper ) )

    By not initializing the default value of a 0 dimensional array to
the correct type; with the 'createObject' method.


corereflection debug diff:

--- stoc/source/corereflection/criface.cxx	9 Jan 2004 19:01:26 -0000	1.8.38.1
+++ stoc/source/corereflection/criface.cxx	18 Apr 2005 14:59:17 -0000
@@ -690,7 +690,10 @@ Any SAL_CALL IdlInterfaceMethodImpl::inv
 			ppParamTypes[nPos] = 0;
 			TYPELIB_DANGER_GET( ppParamTypes + nPos, pParams[nPos].pTypeRef );
 			typelib_TypeDescription * pTD = ppParamTypes[nPos];
-			
+
+//			fprintf(stderr, "Try to coerce argument %d(/%d) to type %d\n",
+//					nPos, nParams, pTD->eTypeClass );
+
 			ppUnoArgs[nPos] = alloca( pTD->nSize );
 			if (pParams[nPos].bIn)
 			{
@@ -724,6 +727,10 @@ Any SAL_CALL IdlInterfaceMethodImpl::inv
 				{
 					typelib_TypeDescription * pValueTD = 0;
 					TYPELIB_DANGER_GET( &pValueTD, pCppArgs[nPos].getValueTypeRef() );
+
+//					fprintf(stderr, "Generic  coercion argument %d(/%d) from type %d\n",
+//							nPos, nParams, pValueTD->eTypeClass );
+			
 					// construct temp uno val to do proper assignment: todo opt
 					void * pTemp = alloca( pValueTD->nSize );
 					uno_copyAndConvertData(
@@ -734,6 +741,8 @@ Any SAL_CALL IdlInterfaceMethodImpl::inv
 					// assignment does simple conversion
 					bAssign = uno_assignData(
 						ppUnoArgs[nPos], pTD, pTemp, pValueTD, 0, 0, 0 );
+//					if( !bAssign )
+//						fprintf(stderr, "Failed to coerce argument\n" );
 					uno_destructData(
 						pTemp, pValueTD, 0 );
 					TYPELIB_DANGER_RELEASE( pValueTD );
