ooo-build r12649 - in trunk: . patches/dev300 patches/vba



Author: noelpwer
Date: Fri May 23 17:20:51 2008
New Revision: 12649
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12649&view=rev

Log:
2008-05-23  Noel Power  <noel power novell com>

        * patches/dev300/apply:
        * patches/vba/vba-support-properties-inmodules.diff: make  properties 
        available for non-class modules, additionally allow paramaters to be 
        supported for Get properties.


Added:
   trunk/patches/vba/vba-support-properties-inmodules.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri May 23 17:20:51 2008
@@ -1586,6 +1586,9 @@
 vba-always-set-defaultprop.diff, n#388049, noelpwer
 #clean up the macro security check, prepare for object/form modules
 vba-check-for-macro.diff
+#make properties available for non class modules
+#also allow paramaters to be supported for Get properties
+vba-support-properties-inmodules.diff
 [ VBAUntested ]
 SectionOwner => noelpwer
 # getting there

Added: trunk/patches/vba/vba-support-properties-inmodules.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-support-properties-inmodules.diff	Fri May 23 17:20:51 2008
@@ -0,0 +1,145 @@
+diff -rup basic/source/classes/sb.cxx basic.patched/source/classes/sb.cxx
+--- basic/source/classes/sb.cxx	2008-05-22 09:44:11.000000000 +0100
++++ basic/source/classes/sb.cxx	2008-05-23 18:10:51.000000000 +0100
+@@ -461,72 +461,7 @@ SbClassModuleObject::~SbClassModuleObjec
+ void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ 						   const SfxHint& rHint, const TypeId& rHintType )
+ {
+-	bool bDone = false;
+-
+-	const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+-	if( pHint )
+-	{
+-		SbxVariable* pVar = pHint->GetVar();
+-		SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
+-		if( pProcProperty )
+-		{
+-			bDone = true;
+-
+-			if( pHint->GetId() == SBX_HINT_DATAWANTED )
+-			{
+-				String aProcName;
+-				aProcName.AppendAscii( "Property Get " );
+-				aProcName += pProcProperty->GetName();
+-
+-				SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD );
+-				if( pMeth )
+-				{
+-					SbxValues aVals;
+-					aVals.eType = SbxVARIANT;
+-					pMeth->Get( aVals );
+-					pVar->Put( aVals );
+-				}
+-			}
+-			else if( pHint->GetId() == SBX_HINT_DATACHANGED )
+-			{
+-				SbxVariable* pMeth = NULL;
+-
+-				bool bSet = pProcProperty->isSet();
+-				if( bSet )
+-				{
+-					pProcProperty->setSet( false );
+-
+-					String aProcName;
+-					aProcName.AppendAscii( "Property Set " );
+-					aProcName += pProcProperty->GetName();
+-					pMeth = Find( aProcName, SbxCLASS_METHOD );
+-				}
+-				if( !pMeth )	// Let
+-				{
+-					String aProcName;
+-					aProcName.AppendAscii( "Property Let " );
+-					aProcName += pProcProperty->GetName();
+-					pMeth = Find( aProcName, SbxCLASS_METHOD );
+-				}
+-
+-				if( pMeth )
+-				{
+-					// Setup parameters
+-					SbxArrayRef xArray = new SbxArray;
+-					xArray->Put( pMeth, 0 );	// Method as parameter 0
+-					xArray->Put( pVar, 1 );
+-					pMeth->SetParameters( xArray );
+-
+-					SbxValues aVals;
+-					pMeth->Get( aVals );
+-					pMeth->SetParameters( NULL );
+-				}
+-			}
+-		}
+-	}
+-
+-	if( !bDone )
+-		SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
++	SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+ }
+ 
+ SbxVariable* SbClassModuleObject::Find( const XubString& rName, SbxClassType t )
+diff -rup basic/source/classes/sbxmod.cxx basic.patched/source/classes/sbxmod.cxx
+--- basic/source/classes/sbxmod.cxx	2008-05-22 09:44:12.000000000 +0100
++++ basic.patched/source/classes/sbxmod.cxx	2008-05-23 18:11:36.000000000 +0100
+@@ -471,6 +471,64 @@ void SbModule::SFX_NOTIFY( SfxBroadcaste
+ 		SbxVariable* pVar = pHint->GetVar();
+ 		SbProperty* pProp = PTR_CAST(SbProperty,pVar);
+ 		SbMethod* pMeth = PTR_CAST(SbMethod,pVar);
++		SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
++		if( pProcProperty )
++		{
++			if( pHint->GetId() == SBX_HINT_DATAWANTED )
++			{
++				String aProcName;
++				aProcName.AppendAscii( "Property Get " );
++				aProcName += pProcProperty->GetName();
++
++				SbxVariable* pPropMeth = Find( aProcName, SbxCLASS_METHOD );
++				if( pPropMeth )
++				{
++					// Setup parameters
++					pPropMeth->SetParameters( pVar->GetParameters() );
++
++					SbxValues aVals;
++					aVals.eType = SbxVARIANT;
++					pPropMeth->Get( aVals );
++					pVar->Put( aVals );
++				}
++			}
++			else if( pHint->GetId() == SBX_HINT_DATACHANGED )
++			{
++				SbxVariable* pPropMeth = NULL;
++
++				bool bSet = pProcProperty->isSet();
++				if( bSet )
++				{
++					pProcProperty->setSet( false );
++
++					String aProcName;
++					aProcName.AppendAscii( "Property Set " );
++					aProcName += pProcProperty->GetName();
++					pPropMeth = Find( aProcName, SbxCLASS_METHOD );
++				}
++				if( !pPropMeth )	// Let
++				{
++					String aProcName;
++					aProcName.AppendAscii( "Property Let " );
++					aProcName += pProcProperty->GetName();
++					pPropMeth = Find( aProcName, SbxCLASS_METHOD );
++				}
++
++				if( pPropMeth )
++				{
++					// Setup parameters
++					SbxArrayRef xArray = new SbxArray;
++					xArray->Put( pPropMeth, 0 );	// Method as parameter 0
++					xArray->Put( pVar, 1 );
++					pPropMeth->SetParameters( xArray );
++
++					SbxValues aVals;
++					pPropMeth->Get( aVals );
++					pPropMeth->SetParameters( NULL );
++				}
++			}
++		}
++
+ 		if( pProp )
+ 		{
+ 			if( pProp->GetModule() != this )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]