update ooo310-m15
[ooovba.git] / applied_patches / 0364-vba-support-properties-inmodules.diff
blob3ca020eeae5b8e04f6a4f42067ff3e1e5ade95a0
1 diff -rup basic/source/classes/sb.cxx basic.patched/source/classes/sb.cxx
2 --- basic/source/classes/sb.cxx 2008-05-22 09:44:11.000000000 +0100
3 +++ basic/source/classes/sb.cxx 2008-05-23 18:10:51.000000000 +0100
4 @@ -461,72 +461,7 @@ SbClassModuleObject::~SbClassModuleObjec
5 void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
6 const SfxHint& rHint, const TypeId& rHintType )
8 - bool bDone = false;
10 - const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
11 - if( pHint )
12 - {
13 - SbxVariable* pVar = pHint->GetVar();
14 - SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
15 - if( pProcProperty )
16 - {
17 - bDone = true;
19 - if( pHint->GetId() == SBX_HINT_DATAWANTED )
20 - {
21 - String aProcName;
22 - aProcName.AppendAscii( "Property Get " );
23 - aProcName += pProcProperty->GetName();
25 - SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD );
26 - if( pMeth )
27 - {
28 - SbxValues aVals;
29 - aVals.eType = SbxVARIANT;
30 - pMeth->Get( aVals );
31 - pVar->Put( aVals );
32 - }
33 - }
34 - else if( pHint->GetId() == SBX_HINT_DATACHANGED )
35 - {
36 - SbxVariable* pMeth = NULL;
38 - bool bSet = pProcProperty->isSet();
39 - if( bSet )
40 - {
41 - pProcProperty->setSet( false );
43 - String aProcName;
44 - aProcName.AppendAscii( "Property Set " );
45 - aProcName += pProcProperty->GetName();
46 - pMeth = Find( aProcName, SbxCLASS_METHOD );
47 - }
48 - if( !pMeth ) // Let
49 - {
50 - String aProcName;
51 - aProcName.AppendAscii( "Property Let " );
52 - aProcName += pProcProperty->GetName();
53 - pMeth = Find( aProcName, SbxCLASS_METHOD );
54 - }
56 - if( pMeth )
57 - {
58 - // Setup parameters
59 - SbxArrayRef xArray = new SbxArray;
60 - xArray->Put( pMeth, 0 ); // Method as parameter 0
61 - xArray->Put( pVar, 1 );
62 - pMeth->SetParameters( xArray );
64 - SbxValues aVals;
65 - pMeth->Get( aVals );
66 - pMeth->SetParameters( NULL );
67 - }
68 - }
69 - }
70 - }
72 - if( !bDone )
73 - SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
74 + SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
77 SbxVariable* SbClassModuleObject::Find( const XubString& rName, SbxClassType t )
78 diff -rup basic/source/classes/sbxmod.cxx basic.patched/source/classes/sbxmod.cxx
79 --- basic/source/classes/sbxmod.cxx 2008-05-22 09:44:12.000000000 +0100
80 +++ basic.patched/source/classes/sbxmod.cxx 2008-05-23 18:11:36.000000000 +0100
81 @@ -471,6 +471,64 @@ void SbModule::SFX_NOTIFY( SfxBroadcaste
82 SbxVariable* pVar = pHint->GetVar();
83 SbProperty* pProp = PTR_CAST(SbProperty,pVar);
84 SbMethod* pMeth = PTR_CAST(SbMethod,pVar);
85 + SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
86 + if( pProcProperty )
87 + {
88 + if( pHint->GetId() == SBX_HINT_DATAWANTED )
89 + {
90 + String aProcName;
91 + aProcName.AppendAscii( "Property Get " );
92 + aProcName += pProcProperty->GetName();
94 + SbxVariable* pPropMeth = Find( aProcName, SbxCLASS_METHOD );
95 + if( pPropMeth )
96 + {
97 + // Setup parameters
98 + pPropMeth->SetParameters( pVar->GetParameters() );
100 + SbxValues aVals;
101 + aVals.eType = SbxVARIANT;
102 + pPropMeth->Get( aVals );
103 + pVar->Put( aVals );
106 + else if( pHint->GetId() == SBX_HINT_DATACHANGED )
108 + SbxVariable* pPropMeth = NULL;
110 + bool bSet = pProcProperty->isSet();
111 + if( bSet )
113 + pProcProperty->setSet( false );
115 + String aProcName;
116 + aProcName.AppendAscii( "Property Set " );
117 + aProcName += pProcProperty->GetName();
118 + pPropMeth = Find( aProcName, SbxCLASS_METHOD );
120 + if( !pPropMeth ) // Let
122 + String aProcName;
123 + aProcName.AppendAscii( "Property Let " );
124 + aProcName += pProcProperty->GetName();
125 + pPropMeth = Find( aProcName, SbxCLASS_METHOD );
128 + if( pPropMeth )
130 + // Setup parameters
131 + SbxArrayRef xArray = new SbxArray;
132 + xArray->Put( pPropMeth, 0 ); // Method as parameter 0
133 + xArray->Put( pVar, 1 );
134 + pPropMeth->SetParameters( xArray );
136 + SbxValues aVals;
137 + pPropMeth->Get( aVals );
138 + pPropMeth->SetParameters( NULL );
143 if( pProp )
145 if( pProp->GetModule() != this )