summaryrefslogtreecommitdiff
path: root/editors/openoffice.org-vcltesttool/files/cws-npower7.diff
blob: cf8ccac2d39ed7fc7f6437a76620929162a9d360 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
cvs diff: Diffing basic
cvs diff: Diffing basic/inc
cvs diff: Diffing basic/inc/basic
Index: basic/inc/basic/basmgr.hxx
===================================================================
RCS file: /cvs/script/basic/inc/basic/basmgr.hxx,v
retrieving revision 1.2
retrieving revision 1.2.12.1
diff -u -p -r1.2 -r1.2.12.1
--- basic/inc/basic/basmgr.hxx	11 Apr 2007 12:50:02 -0000	1.2
+++ basic/inc/basic/basmgr.hxx	2 May 2007 09:44:21 -0000	1.2.12.1
@@ -167,6 +167,7 @@ private:
 	String				aName;
 	String				maStorageName;
 	BOOL				bBasMgrModified;
+	BOOL				mbDocMgr;
 
 	BasicManagerImpl*	mpImpl;
 
@@ -190,8 +191,8 @@ protected:
 
 public:
 					TYPEINFO();
-                    BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL );
-					BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL );
+                    BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL, BOOL bDocMgr = FALSE );
+					BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL, BOOL bDocMgr = FALSE );
 
     /** deletes the given BasicManager instance
 
Index: basic/inc/basic/sbstar.hxx
===================================================================
RCS file: /cvs/script/basic/inc/basic/sbstar.hxx,v
retrieving revision 1.2
retrieving revision 1.2.12.1
diff -u -p -r1.2 -r1.2.12.1
--- basic/inc/basic/sbstar.hxx	11 Apr 2007 12:52:47 -0000	1.2
+++ basic/inc/basic/sbstar.hxx	2 May 2007 09:44:21 -0000	1.2.12.1
@@ -81,6 +81,7 @@ class StarBASIC : public SbxObject
 	Link			aBreakHdl;			// Breakpoint-Handler
 	BOOL			bNoRtl;				// TRUE: RTL nicht durchsuchen
 	BOOL			bBreak;				// TRUE: Break, sonst Step
+	BOOL			bDocBasic;
 	BasicLibInfo*	pLibInfo;			// Infoblock fuer Basic-Manager
 	SbLanguageMode	eLanguageMode;		// LanguageMode des Basic-Objekts
 protected:
@@ -104,7 +105,7 @@ public:
 	SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1);
 	TYPEINFO();
 
-	StarBASIC( StarBASIC* pParent = NULL );
+	StarBASIC( StarBASIC* pParent = NULL, BOOL bIsDocBasic = FALSE );
 
 	// #51727 SetModified ueberladen, damit der Modified-
 	// Zustand nicht an den Parent weitergegeben wird.
@@ -203,6 +204,7 @@ public:
 	static void StaticEnableReschedule( BOOL bReschedule );
 
 	SbxObjectRef getRTL( void ) { return pRtl; }
+	BOOL IsDocBasic() { return bDocBasic; }
 };
 
 #ifndef __SB_SBSTARBASICREF_HXX
Index: basic/inc/basic/sbx.hxx
===================================================================
RCS file: /cvs/script/basic/inc/basic/sbx.hxx,v
retrieving revision 1.2
retrieving revision 1.2.12.1
diff -u -p -r1.2 -r1.2.12.1
--- basic/inc/basic/sbx.hxx	11 Apr 2007 12:53:21 -0000	1.2
+++ basic/inc/basic/sbx.hxx	2 May 2007 09:44:42 -0000	1.2.12.1
@@ -263,6 +263,7 @@ class SbxDimArray : public SbxArray
 	SbxDim* pFirst, *pLast;         // Links fuer Dimension-Tabelle
 	short   nDim;                   // Anzahl Dimensionen
 	void   AddDimImpl32( INT32, INT32, BOOL bAllowSize0 );
+	bool mbHasFixedSize;
 protected:
 	USHORT  Offset( const short* );
 	UINT32  Offset32( const INT32* );
@@ -302,6 +303,8 @@ public:
 	void   AddDim32( INT32, INT32 );
 	void   unoAddDim32( INT32, INT32 );
 	BOOL   GetDim32( INT32, INT32&, INT32& ) const;
+        bool hasFixedSize() { return mbHasFixedSize; };
+        void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; };
 };
 
 #endif
cvs diff: Diffing basic/inc/pch
cvs diff: Diffing basic/prj
cvs diff: Diffing basic/source
cvs diff: Diffing basic/source/app
cvs diff: Diffing basic/source/basmgr
Index: basic/source/basmgr/basicmanagerrepository.cxx
===================================================================
RCS file: /cvs/script/basic/source/basmgr/basicmanagerrepository.cxx,v
retrieving revision 1.4
retrieving revision 1.4.14.1
diff -u -p -r1.4 -r1.4.14.1
--- basic/source/basmgr/basicmanagerrepository.cxx	15 Mar 2007 15:37:48 -0000	1.4
+++ basic/source/basmgr/basicmanagerrepository.cxx	2 May 2007 09:44:21 -0000	1.4.14.1
@@ -491,7 +491,7 @@ namespace basic
 		    SotStorageRef xDummyStor = new SotStorage( ::rtl::OUString() );
             pBasicManager = new BasicManager( *xDummyStor, String() /* TODO/LATER: xStorage */,
 															    pAppBasic,
-															    &aAppBasicDir );
+															    &aAppBasicDir, TRUE );
 		    if ( pBasicManager->HasErrors() )
 		    {
 			    // handle errors
@@ -517,7 +517,7 @@ namespace basic
 		    // create new BASIC-manager
 		    StarBASIC* pBasic = new StarBASIC( pAppBasic );
 		    pBasic->SetFlag( SBX_EXTSEARCH );
-		    pBasicManager = new BasicManager( pBasic );
+		    pBasicManager = new BasicManager( pBasic, NULL, TRUE );
 	    }
 
         // knit the containers with the BasicManager
Index: basic/source/basmgr/basmgr.cxx
===================================================================
RCS file: /cvs/script/basic/source/basmgr/basmgr.cxx,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -p -r1.39 -r1.39.2.1
--- basic/source/basmgr/basmgr.cxx	26 Apr 2007 08:32:47 -0000	1.39
+++ basic/source/basmgr/basmgr.cxx	2 May 2007 09:44:21 -0000	1.39.2.1
@@ -685,7 +685,7 @@ void BasicLibInfo::CalcRelStorageName( c
 	else
 		SetRelStorageName( String() );
 }
-BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib, String* pLibPath )
+BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib, String* pLibPath, BOOL bDocMgr ) : mbDocMgr( bDocMgr )
 {
 	DBG_CTOR( BasicManager, 0 );
 
@@ -714,7 +714,7 @@ BasicManager::BasicManager( SotStorage& 
 		if ( !pStdLib )
 		{
 			// Sollte eigentlich nie passieren, aber dann wenigstens nicht abstuerzen...
-			pStdLib = new StarBASIC;
+			pStdLib = new StarBASIC( NULL, mbDocMgr );
 			BasicLibInfo* pStdLibInfo = pLibs->GetObject( 0 );
 			if ( !pStdLibInfo )
 				pStdLibInfo = CreateLibInfo();
@@ -895,7 +895,7 @@ void BasicManager::SetLibraryContainerIn
     InsertGlobalUNOConstant( "DialogLibraries", makeAny( mpImpl->maContainerInfo.mxDialogCont ) );
 }
 
-BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath )
+BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath, BOOL bDocMgr ) : mbDocMgr( bDocMgr )
 {
 	DBG_CTOR( BasicManager, 0 );
 	Init();
@@ -936,7 +936,7 @@ void BasicManager::ImpMgrNotLoaded( cons
 
 	// Eine STD-Lib erzeugen, sonst macht es Peng!
 	BasicLibInfo* pStdLibInfo = CreateLibInfo();
-	pStdLibInfo->SetLib( new StarBASIC );
+	pStdLibInfo->SetLib( new StarBASIC( NULL, mbDocMgr ) );
     StarBASICRef xStdLib = pStdLibInfo->GetLib();
 	xStdLib->SetName( String::CreateFromAscii(szStdLibName) );
 	pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) );
@@ -948,7 +948,7 @@ void BasicManager::ImpMgrNotLoaded( cons
 void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib )
 {
 	BasicLibInfo* pStdLibInfo = CreateLibInfo();
-	StarBASIC* pStdLib = new StarBASIC( pParentFromStdLib );
+	StarBASIC* pStdLib = new StarBASIC( pParentFromStdLib, mbDocMgr );
 	pStdLibInfo->SetLib( pStdLib );
 	pStdLib->SetName( String::CreateFromAscii(szStdLibName) );
 	pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) );
@@ -1237,7 +1237,7 @@ BOOL BasicManager::ImpLoadLibary( BasicL
 				if ( !bInfosOnly )
 				{
 					if ( !pLibInfo->GetLib().Is() )
-						pLibInfo->SetLib( new StarBASIC( GetStdLib() ) );
+						pLibInfo->SetLib( new StarBASIC( GetStdLib(), mbDocMgr ) );
 					xBasicStream->SetBufferSize( 1024 );
 					xBasicStream->Seek( STREAM_SEEK_TO_BEGIN );
 					bLoaded = ImplLoadBasic( *xBasicStream, pLibInfo->GetLibRef() );
@@ -1660,7 +1660,7 @@ StarBASIC* BasicManager::CreateLib( cons
 		return 0;
 
 	BasicLibInfo* pLibInfo = CreateLibInfo();
-	StarBASIC* pNew = new StarBASIC( GetStdLib() );
+	StarBASIC* pNew = new StarBASIC( GetStdLib(), mbDocMgr );
 	GetStdLib()->Insert( pNew );
 	pNew->SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE );
 	pLibInfo->SetLib( pNew );
@@ -1718,7 +1718,7 @@ StarBASIC* BasicManager::CreateLibForLib
 		return 0;
 
 	BasicLibInfo* pLibInfo = CreateLibInfo();
-	StarBASIC* pNew = new StarBASIC( GetStdLib() );
+	StarBASIC* pNew = new StarBASIC( GetStdLib(), mbDocMgr );
 	GetStdLib()->Insert( pNew );
 	pNew->SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE );
 	pLibInfo->SetLib( pNew );
cvs diff: Diffing basic/source/classes
Index: basic/source/classes/sb.cxx
===================================================================
RCS file: /cvs/script/basic/source/classes/sb.cxx,v
retrieving revision 1.31
retrieving revision 1.31.2.1
diff -u -p -r1.31 -r1.31.2.1
--- basic/source/classes/sb.cxx	26 Apr 2007 08:33:02 -0000	1.31
+++ basic/source/classes/sb.cxx	2 May 2007 09:44:21 -0000	1.31.2.1
@@ -660,8 +660,8 @@ SbModule* SbClassFactory::FindClass( con
 
 ////////////////////////////////////////////////////////////////////////////
 
-StarBASIC::StarBASIC( StarBASIC* p )
-	: SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) )
+StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic  )
+	: SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic )
 {
 	SetParent( p );
 	pLibInfo = NULL;
Index: basic/source/classes/sbunoobj.cxx
===================================================================
RCS file: /cvs/script/basic/source/classes/sbunoobj.cxx,v
retrieving revision 1.46
retrieving revision 1.46.6.5
diff -u -p -r1.46 -r1.46.6.5
--- basic/source/classes/sbunoobj.cxx	29 Jan 2007 15:05:07 -0000	1.46
+++ basic/source/classes/sbunoobj.cxx	9 May 2007 15:49:15 -0000	1.46.6.5
@@ -110,6 +110,9 @@ using namespace rtl;
 #include<runtime.hxx>
 
 #include<math.h>
+#include <hash_map>
+#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
+#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
 
 TYPEINIT1(SbUnoMethod,SbxMethod)
 TYPEINIT1(SbUnoProperty,SbxProperty)
@@ -130,6 +133,7 @@ static String ID_DBG_METHODS( RTL_CONSTA
 static String aIllegalArgumentExceptionName
     ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.IllegalArgumentException" ) );
 static OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") );
+static OUString defaultNameSpace( RTL_CONSTASCII_USTRINGPARAM("org.openoffice") );
 
 // Gets the default property for an uno object. Note: There is some 
 // redirection built in. The property name specifies the name
@@ -1510,6 +1514,50 @@ String getBasicObjectTypeName( SbxObject
 	return aName;
 }
 
+bool checkUnoObjectType( SbUnoObject* pUnoObj, 
+	const String& aClass )
+{
+	bool result = false;
+	Any aToInspectObj = pUnoObj->getUnoAny();
+	TypeClass eType = aToInspectObj.getValueType().getTypeClass();
+	if( eType != TypeClass_INTERFACE )
+		return false;
+	const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
+	Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY );
+	if( xTypeProvider.is() )
+	{
+		Sequence< Type > aTypeSeq = xTypeProvider->getTypes();
+		const Type* pTypeArray = aTypeSeq.getConstArray();
+		UINT32 nIfaceCount = aTypeSeq.getLength();
+		for( UINT32 j = 0 ; j < nIfaceCount ; j++ )
+		{
+			const Type& rType = pTypeArray[j];
+
+			Reference<XIdlClass> xClass = TypeToIdlClass( rType );
+			if( !xClass.is() )
+			{
+				DBG_ERROR("failed to get XIdlClass for type");
+				break;
+			}
+			OUString sClassName = xClass->getName();
+			OSL_TRACE("Checking if object implements %s",
+				OUStringToOString( defaultNameSpace + aClass, 
+					RTL_TEXTENCODING_UTF8 ).getStr() );
+			// although interfaces in the org.openoffice.vba namespace
+			// obey the idl rules and have a leading X, in basic we
+			// want to be able to do something like
+			// 'dim wrkbooks as WorkBooks'
+			// so test assumes the 'X' has been dropped
+			sal_Int32 indexLastDot = sClassName.lastIndexOf('.');
+			if ( indexLastDot > -1 && sClassName.copy( indexLastDot + 1).equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("X") ) + aClass ) )
+			{
+				result = true;
+				break;
+			}
+		}
+	}		
+	return result;
+}
 
 // Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces
 String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
@@ -3066,6 +3114,83 @@ void RTL_Impl_EqualUnoObjects( StarBASIC
 		refVar->PutBool( TRUE );
 }
 
+typedef std::hash_map< OUString, std::vector< OUString >, OUStringHash, ::std::equal_to< OUString > > ModuleHash;
+
+
+// helper wrapper function to interact with TypeProvider and
+// XTypeDescriptionEnumerationAccess.
+// if it fails for whatever reason 
+// returned Reference<> be null e.g. .is() will be false
+
+Reference< XTypeDescriptionEnumeration > 
+getTypeDescriptorEnumeration( const OUString& sSearchRoot,
+	const Sequence< TypeClass >& types, TypeDescriptionSearchDepth depth )
+{
+	Reference< XTypeDescriptionEnumeration > xEnum;
+	Reference< XTypeDescriptionEnumerationAccess> xTypeEnumAccess( getTypeProvider_Impl(), UNO_QUERY );
+	if ( xTypeEnumAccess.is() )
+	{
+		try
+		{
+			xEnum = xTypeEnumAccess->createTypeDescriptionEnumeration(
+				sSearchRoot, types, depth );
+		}
+		catch( NoSuchTypeNameException& /*nstne*/ ) {}
+		catch( InvalidTypeNameException& /*nstne*/ ) {}
+	}
+	return xEnum;
+}
+
+typedef std::hash_map< OUString, Any, OUStringHash, ::std::equal_to< OUString > > VBAConstantsHash;
+
+SbxVariable* getVBAConstant( const String& rName )
+{
+	SbxVariable* pConst = NULL;
+	static VBAConstantsHash aConstCache;	
+	static bool isInited = false;
+	if ( !isInited )
+	{
+		Sequence< TypeClass > types(1);
+		types[ 0 ] = TypeClass_CONSTANTS;
+		Reference< XTypeDescriptionEnumeration > xEnum = getTypeDescriptorEnumeration( defaultNameSpace, types, TypeDescriptionSearchDepth_INFINITE  );
+
+		if ( !xEnum.is() )
+			return NULL;	
+
+		while ( xEnum->hasMoreElements() )
+		{
+			Reference< XConstantsTypeDescription > xConstants( xEnum->nextElement(), UNO_QUERY );
+			if ( xConstants.is() )
+			{
+				Sequence< Reference< XConstantTypeDescription > > aConsts = xConstants->getConstants();
+				Reference< XConstantTypeDescription >* pSrc = aConsts.getArray();
+				sal_Int32 nLen = aConsts.getLength();
+				for ( sal_Int32 index =0;  index<nLen; ++pSrc, ++index )
+				{
+					Reference< XConstantTypeDescription >& rXConst =
+						*pSrc;
+					OUString sFullName = rXConst->getName();
+					sal_Int32 indexLastDot = sFullName.lastIndexOf('.');
+					OUString sLeafName;
+					if ( indexLastDot > -1 )
+						sLeafName = sFullName.copy( indexLastDot + 1);
+					aConstCache[ sLeafName.toAsciiLowerCase() ] = rXConst->getConstantValue();	
+				}
+			}
+		}
+		isInited = true;
+	}
+	OUString sKey( rName );
+	VBAConstantsHash::const_iterator it = aConstCache.find( sKey.toAsciiLowerCase() );
+	if ( it != aConstCache.end() )
+	{
+		pConst = new SbxVariable( SbxVARIANT );
+		pConst->SetName( rName );
+		unoToSbxValue( pConst, it->second );
+	}
+	return pConst;	
+}
+
 // Funktion, um einen globalen Bezeichner im
 // UnoScope zu suchen und fuer Sbx zu wrappen
 SbxVariable* findUnoClass( const String& rName )
Index: basic/source/classes/sbxmod.cxx
===================================================================
RCS file: /cvs/script/basic/source/classes/sbxmod.cxx,v
retrieving revision 1.36
retrieving revision 1.36.42.3
diff -u -p -r1.36 -r1.36.42.3
--- basic/source/classes/sbxmod.cxx	3 Nov 2006 15:10:25 -0000	1.36
+++ basic/source/classes/sbxmod.cxx	2 May 2007 09:44:42 -0000	1.36.42.3
@@ -166,7 +166,8 @@ static const char* strListBasicKeyWords[
 	"integer",
 	"is",
 	"let",
-	"lib"
+	"lib",
+	"like",
 	"line",
 	"line input",
 	"local",
@@ -544,7 +545,8 @@ void SbModule::SetSource32( const ::rtl:
 				if( eCurTok == OPTION )
 				{
 					eCurTok = aTok.Next();
-					if( eCurTok == COMPATIBLE )
+					if( eCurTok == COMPATIBLE 
+					|| ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) && ( aTok.GetDbl()== 1 ) ) )
 						aTok.SetCompatible( true );
 				}
 			}
@@ -756,7 +758,10 @@ USHORT SbModule::Run( SbMethod* pMeth )
 				pRt->pNext->block();
 			pINST->pRun = pRt;
 			if ( SbiRuntime ::isVBAEnabled() )
+                        {
 				pINST->EnableCompatibility( TRUE );
+				pRt->SetVBAEnabled( true );
+                        }
 			while( pRt->Step() ) {}
 			if( pRt->pNext )
 				pRt->pNext->unblock();
cvs diff: Diffing basic/source/comp
Index: basic/source/comp/codegen.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/codegen.cxx,v
retrieving revision 1.16
retrieving revision 1.16.42.1
diff -u -p -r1.16 -r1.16.42.1
--- basic/source/comp/codegen.cxx	3 Nov 2006 15:11:02 -0000	1.16
+++ basic/source/comp/codegen.cxx	2 May 2007 09:45:21 -0000	1.16.42.1
@@ -135,7 +135,7 @@ void SbiCodeGen::Save()
 	// OPTION EXPLICIT-Flag uebernehmen
 	if( pParser->bExplicit )
 		p->SetFlag( SBIMG_EXPLICIT );
-	if( pParser->bVBASupportOn )
+	if( pParser->IsVBASupportOn() )
 		p->SetFlag( SBIMG_VBASUPPORT );
 	
 	int nIfaceCount = 0;
Index: basic/source/comp/dim.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/dim.cxx,v
retrieving revision 1.26
retrieving revision 1.26.42.2
diff -u -p -r1.26 -r1.26.42.2
--- basic/source/comp/dim.cxx	1 Nov 2006 16:13:55 -0000	1.26
+++ basic/source/comp/dim.cxx	2 May 2007 09:44:56 -0000	1.26.42.2
@@ -203,6 +203,10 @@ void SbiParser::DefVar( SbiOpcode eOp, B
     	if( eCurTok == GLOBAL )
             bPersistantGlobal = TRUE;
     }
+	// behavior in VBA is that a module scope variable's lifetime is 
+	// tied to the document. e.g. a module scope variable is global
+   	if(  GetBasic()->IsDocBasic() && bVBASupportOn && !pProc ) 
+		bPersistantGlobal = TRUE;
 	// PRIVATE ist Synonym fuer DIM
 	// _CONST_?
 	BOOL bConst = FALSE;
@@ -334,7 +338,7 @@ void SbiParser::DefVar( SbiOpcode eOp, B
 			{
 				case SbGLOBAL:	eOp2 = bPersistantGlobal ? _GLOBAL_P : _GLOBAL; 
                                 goto global;
-				case SbPUBLIC:	eOp2 = _PUBLIC;
+				case SbPUBLIC:	eOp2 = bPersistantGlobal ? _PUBLIC_P : _PUBLIC;
 								// AB 9.7.97, #40689, kein eigener Opcode mehr
 								/*
 								if( bStatic )
@@ -439,7 +443,14 @@ void SbiParser::DefVar( SbiOpcode eOp, B
 				{
 					SbiExpression aExpr( this, *pDef, NULL );
 					aExpr.Gen();
-					aGen.Gen( _ERASE );
+					if ( bVBASupportOn )
+						// delete the array but
+						// clear the variable ( this
+						// allows the processing of
+						// the param to happen as normal without errors ( ordinary ERASE just clears the array )
+						aGen.Gen( _ERASE_CLEAR );
+					else
+						aGen.Gen( _ERASE );
 				}
 				else if( eOp == _REDIMP )
 				{
Index: basic/source/comp/exprnode.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/exprnode.cxx,v
retrieving revision 1.16
retrieving revision 1.16.48.1
diff -u -p -r1.16 -r1.16.48.1
--- basic/source/comp/exprnode.cxx	12 Oct 2006 14:34:58 -0000	1.16
+++ basic/source/comp/exprnode.cxx	16 Feb 2007 17:14:15 -0000	1.16.48.1
@@ -244,7 +244,7 @@ void SbiExprNode::CollectBits()
 
 void SbiExprNode::FoldConstants()
 {
-	if( IsOperand() ) return;
+	if( IsOperand() || eTok == LIKE ) return;
 	pLeft->FoldConstants();
 	if( pRight )
 	{
Index: basic/source/comp/parser.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/parser.cxx,v
retrieving revision 1.19
retrieving revision 1.19.42.2
diff -u -p -r1.19 -r1.19.42.2
--- basic/source/comp/parser.cxx	2 Nov 2006 16:32:13 -0000	1.19
+++ basic/source/comp/parser.cxx	2 May 2007 09:45:21 -0000	1.19.42.2
@@ -152,7 +152,6 @@ SbiParser::SbiParser( StarBASIC* pb, SbM
 	bSingleLineIf =
 	bExplicit = FALSE;
 	bClassModule = FALSE;
-	bVBASupportOn = FALSE;
 	pPool	 = &aPublics;
 	for( short i = 0; i < 26; i++ )
 		eDefTypes[ i ] = SbxVARIANT;    // Kein expliziter Defaulttyp
@@ -609,7 +608,12 @@ void SbiParser::Set()
 		// ( its necessary for vba objects where set is object
 		// specific and also doesn't involve processing default params )
 		if( pDef->GetTypeId() )
-			aGen.Gen( _SETCLASS, pDef->GetTypeId() );
+		{
+			if ( bVBASupportOn )
+				aGen.Gen( _VBASETCLASS, pDef->GetTypeId() );
+			else
+				aGen.Gen( _SETCLASS, pDef->GetTypeId() );
+		}
 		else
 		{
 			if ( bVBASupportOn )
Index: basic/source/comp/scanner.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/scanner.cxx,v
retrieving revision 1.23
retrieving revision 1.23.42.1
diff -u -p -r1.23 -r1.23.42.1
--- basic/source/comp/scanner.cxx	2 Nov 2006 11:02:47 -0000	1.23
+++ basic/source/comp/scanner.cxx	2 May 2007 09:45:21 -0000	1.23.42.1
@@ -53,6 +53,7 @@
 #include <unotools/charclass.hxx>
 #endif
 
+#include <runtime.hxx>
 
 SbiScanner::SbiScanner( const ::rtl::OUString& rBuf, StarBASIC* p ) : aBuf( rBuf )
 {
@@ -76,6 +77,7 @@ SbiScanner::SbiScanner( const ::rtl::OUS
 	bSymbol  =
 	bUsedForHilite =
 	bCompatible = 
+	bVBASupportOn = 
 	bPrevLineExtentsComment = FALSE;
 	bHash    =
 	bErrors  = TRUE;
@@ -424,7 +426,11 @@ BOOL SbiScanner::NextSym()
 				if( *pLine != cSep || cSep == ']' ) break;
 			} else aError = cSep, GenError( SbERR_EXPECTED );
 		}
-		aSym = aLine.copy( n, nCol - n - 1 );
+		// If VBA Interop then doen't eat the [] chars	
+		if ( cSep == ']' && bVBASupportOn )
+			aSym = aLine.copy( n - 1, nCol - n  + 1);
+		else
+			aSym = aLine.copy( n, nCol - n - 1 );
 		// Doppelte Stringbegrenzer raus
 		String s( cSep );
 		s += cSep;
Index: basic/source/comp/token.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/token.cxx,v
retrieving revision 1.21
retrieving revision 1.21.48.1
diff -u -p -r1.21 -r1.21.48.1
--- basic/source/comp/token.cxx	12 Oct 2006 14:28:11 -0000	1.21
+++ basic/source/comp/token.cxx	16 Feb 2007 17:14:15 -0000	1.21.48.1
@@ -130,6 +130,7 @@ static TokenTable aTokTable_Basic [] = {
 	{ IS,		"Is" },
 	{ LET,		"Let" },
 	{ LIB,		"Lib" },
+	{ LIKE,		"Like" },
 	{ LINE,		"Line" },
 	{ LINEINPUT,"Line Input" },
 	{ LOCAL,	"Local" },
cvs diff: Diffing basic/source/inc
Index: basic/source/inc/opcodes.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/opcodes.hxx,v
retrieving revision 1.11
retrieving revision 1.11.42.3
diff -u -p -r1.11 -r1.11.42.3
--- basic/source/inc/opcodes.hxx	2 Nov 2006 16:32:24 -0000	1.11
+++ basic/source/inc/opcodes.hxx	2 May 2007 09:45:22 -0000	1.11.42.3
@@ -99,6 +99,7 @@ enum SbiOpcode {
 	_REDIMP_ERASE,		// Copies array to be later used by REDIM PRESERVE before erasing it
 	_INITFOREACH,
 	_VBASET,            // VBA-like Set
+	_ERASE_CLEAR,       // Erase array and clear variable
 	SbOP0_END,
 
 	// Alle Opcodes mit einem Operanden
@@ -132,6 +133,7 @@ enum SbiOpcode {
 	_BASED,          	// TOS wird um BASE erhoeht, BASE davor gepusht (+base)
 	// Typanpassung im Argv
 	_ARGTYP,          	// Letzten Parameter in Argv konvertieren (+Typ)
+	_VBASETCLASS,       // VBA-like Set
 	SbOP1_END,
 
 	// Alle Opcodes mit zwei Operanden
@@ -164,6 +166,7 @@ enum SbiOpcode {
 	_FIND_G,        	// Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P
     _DCREATE_REDIMP,	// Objekt-Array redimensionieren (+StringId+StringID)
 	_FIND_CM,        	// Search inside a class module (CM) to enable global search in time
+	_PUBLIC_P, 			//  Module global Variable (persisted between calls)(+StringID+Typ)
 	SbOP2_END
 
 };
Index: basic/source/inc/parser.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/parser.hxx,v
retrieving revision 1.10
retrieving revision 1.10.42.1
diff -u -p -r1.10 -r1.10.42.1
--- basic/source/inc/parser.hxx	1 Nov 2006 16:15:58 -0000	1.10
+++ basic/source/inc/parser.hxx	2 May 2007 09:45:22 -0000	1.10.42.1
@@ -94,7 +94,6 @@ public:
 	BOOL		  bText;			// OPTION COMPARE TEXT
 	BOOL          bExplicit; 		// TRUE: OPTION EXPLICIT
 	BOOL          bClassModule;		// TRUE: OPTION ClassModule
-	BOOL          bVBASupportOn;		// TRUE: OPTION VBASupport 1 otherwise default False
 	IfaceVector   aIfaceVector;		// Holds all interfaces implemented by a class module
 	SbxDataType   eDefTypes[26];	// DEFxxx-Datentypen
 
Index: basic/source/inc/runtime.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/runtime.hxx,v
retrieving revision 1.33
retrieving revision 1.33.42.4
diff -u -p -r1.33 -r1.33.42.4
--- basic/source/inc/runtime.hxx	2 Nov 2006 16:32:35 -0000	1.33
+++ basic/source/inc/runtime.hxx	2 May 2007 09:44:56 -0000	1.33.42.4
@@ -360,6 +360,7 @@ class SbiRuntime
 	BOOL          bError;           // TRUE: Fehler behandeln
 	BOOL          bInError;         // TRUE: in einem Fehler-Handler
 	BOOL          bBlocked;         // TRUE: blocked by next call level, #i48868
+	BOOL          bVBAEnabled;            
 	USHORT		  nFlags;			// Debugging-Flags
 	SbError		  nError;           // letzter Fehler
 	USHORT		  nOps;				// Opcode-Zaehler
@@ -429,6 +430,8 @@ class SbiRuntime
 	// #115829
 	bool implIsClass( SbxObject* pObj, const String& aClass );
 
+	void StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt = false );
+
 	// Die nachfolgenden Routinen werden vom Single Stepper
 	// gerufen und implementieren die einzelnen Opcodes
 	void StepNOP(),     StepEXP(),      StepMUL(),      StepDIV();
@@ -447,7 +450,7 @@ class SbiRuntime
 	void StepNOERROR(), StepCHANNEL(),  StepCHANNEL0(),	StepPRINT();
 	void StepPRINTF(),	StepWRITE(),    StepRENAME(),   StepPROMPT();
 	void StepRESTART(), StepEMPTY(),    StepLEAVE();
-	void StepLSET(),	StepRSET(),		StepREDIMP_ERASE();
+	void StepLSET(),	StepRSET(),		StepREDIMP_ERASE(), 	StepERASE_CLEAR();
 	// Alle Opcodes mit einem Operanden
 	void StepLOADNC( UINT32 ),  StepLOADSC( UINT32 ),   StepLOADI( UINT32 );
 	void StepARGN( UINT32 ),	StepBASED( UINT32 ),	StepPAD( UINT32 );
@@ -455,11 +458,11 @@ class SbiRuntime
 	void StepJUMPF( UINT32 ),   StepONJUMP( UINT32 );
 	void StepGOSUB( UINT32 ),   StepRETURN( UINT32 );
 	void StepTESTFOR( UINT32 ), StepCASETO( UINT32 ),   StepERRHDL( UINT32 );
-	void StepRESUME( UINT32 ),  StepSETCLASS( UINT32 ),	StepTESTCLASS( UINT32 ), StepLIB( UINT32 );
+	void StepRESUME( UINT32 ),  StepSETCLASS( UINT32 ),	StepVBASETCLASS( UINT32 ),	StepTESTCLASS( UINT32 ), StepLIB( UINT32 );
 	bool checkClass_Impl( const SbxVariableRef& refVal, const String& aClass, bool bRaiseErrors );
 	void StepCLOSE( UINT32 ),   StepPRCHAR( UINT32 ),   StepARGTYP( UINT32 );
 	// Alle Opcodes mit zwei Operanden
-	void StepRTL( UINT32, UINT32 ),		StepPUBLIC( UINT32, UINT32 );		
+	void StepRTL( UINT32, UINT32 ),		StepPUBLIC( UINT32, UINT32 ),	StepPUBLIC_P( UINT32, UINT32 );		
 	void StepPUBLIC_Impl( UINT32, UINT32, bool bUsedForClassModule );
 	void StepFIND( UINT32, UINT32 ),    StepELEM( UINT32, UINT32 );
 	void StepGLOBAL( UINT32, UINT32 ),  StepLOCAL( UINT32, UINT32 );
@@ -472,6 +475,7 @@ class SbiRuntime
 	void StepDCREATE_REDIMP(UINT32,UINT32), StepDCREATE_IMPL(UINT32,UINT32);
 	void StepFIND_CM( UINT32, UINT32 );
 public:
+	void          SetVBAEnabled( bool bEnabled ) { bVBAEnabled = bEnabled; };            
 	USHORT		GetImageFlag( USHORT n ) const;
 	USHORT		GetBase();
 	xub_StrLen  nLine,nCol1,nCol2;	// aktuelle Zeile, Spaltenbereich
Index: basic/source/inc/scanner.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/scanner.hxx,v
retrieving revision 1.10
retrieving revision 1.10.176.1
diff -u -p -r1.10 -r1.10.176.1
--- basic/source/inc/scanner.hxx	29 Sep 2005 18:41:38 -0000	1.10
+++ basic/source/inc/scanner.hxx	2 May 2007 09:45:22 -0000	1.10.176.1
@@ -79,7 +79,8 @@ protected:
 	BOOL   bHash;						// TRUE: # eingelesen
 	BOOL   bError;						// TRUE: Fehler generieren
 	BOOL   bUsedForHilite;				// TRUE: Nutzung fuer Highlighting
-	BOOL   bCompatible; 				// TRUE: OPTION Compatible
+	BOOL   bCompatible; 				// TRUE: OPTION Compatibl
+	BOOL   bVBASupportOn;				// TRUE: OPTION VBASupport 1 otherwise default False
 	BOOL   bPrevLineExtentsComment;		// TRUE: Previous line is comment and ends on "... _"
 
 	void   GenError( SbError );
@@ -91,6 +92,8 @@ public:
 	BOOL  IsHash()					{ return bHash;   }
 	BOOL  IsCompatible()			{ return bCompatible; }
 	void  SetCompatible( bool b )	{ bCompatible = b; }		// #118206
+	BOOL  IsVBASupportOn()			{ return bVBASupportOn; }
+	void  SetVBASupportOn( bool b )	{ bVBASupportOn = b; }
 	BOOL  WhiteSpace()				{ return bSpaces; }
 	short GetErrors()				{ return nErrors; }
 	short GetLine()					{ return nLine;   }
cvs diff: Diffing basic/source/runtime
Index: basic/source/runtime/runtime.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/runtime.cxx,v
retrieving revision 1.35
retrieving revision 1.35.6.4
diff -u -p -r1.35 -r1.35.6.4
--- basic/source/runtime/runtime.cxx	29 Jan 2007 15:05:41 -0000	1.35
+++ basic/source/runtime/runtime.cxx	2 May 2007 09:44:22 -0000	1.35.6.4
@@ -153,6 +153,7 @@ SbiRuntime::pStep0 SbiRuntime::aStep0[] 
 	&SbiRuntime::StepREDIMP_ERASE,// Copy array object for REDIMP
 	&SbiRuntime::StepINITFOREACH,// Init for each loop
 	&SbiRuntime::StepVBASET,// vba-like set statement
+	&SbiRuntime::StepERASE_CLEAR,// vba-like set statement
 };
 
 SbiRuntime::pStep1 SbiRuntime::aStep1[] = {	// Alle Opcodes mit einem Operanden
@@ -181,6 +182,7 @@ SbiRuntime::pStep1 SbiRuntime::aStep1[] 
 	&SbiRuntime::StepLIB,  		// Lib fuer Declare-Call (+StringId)
 	&SbiRuntime::StepBASED,	  	// TOS wird um BASE erhoeht, BASE davor gepusht
 	&SbiRuntime::StepARGTYP,	  	// Letzten Parameter in Argv konvertieren (+Typ)
+	&SbiRuntime::StepVBASETCLASS,// vba-like set statement
 };
 
 SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// Alle Opcodes mit zwei Operanden
@@ -209,6 +211,7 @@ SbiRuntime::pStep2 SbiRuntime::aStep2[] 
 	&SbiRuntime::StepFIND_G,    	// Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P
 	&SbiRuntime::StepDCREATE_REDIMP, // Objekt-Array redimensionieren (+StringID+StringID)
 	&SbiRuntime::StepFIND_CM,    // Search inside a class module (CM) to enable global search in time
+	&SbiRuntime::StepPUBLIC_P,    // Search inside a class module (CM) to enable global search in time
 };
 
 
@@ -538,6 +541,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, Sb
 #endif
 	pRefSaveList = NULL;
 	pItemStoreList = NULL;
+	bVBAEnabled = isVBAEnabled();
 }
 
 SbiRuntime::~SbiRuntime()
Index: basic/source/runtime/step0.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/step0.cxx,v
retrieving revision 1.28
retrieving revision 1.27.42.7
diff -u -p -r1.28 -r1.27.42.7
--- basic/source/runtime/step0.cxx	26 Apr 2007 08:33:37 -0000	1.28
+++ basic/source/runtime/step0.cxx	2 May 2007 09:45:35 -0000	1.27.42.7
@@ -49,7 +49,11 @@
 #include <sb.hrc>
 #include <basrid.hxx>
 #include "sbunoobj.hxx"
+#include "image.hxx"
 #include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/util/SearchOptions.hdl>
+#include <vcl/svapp.hxx>
+#include <unotools/textsearch.hxx>
 
 #include <algorithm>
 
@@ -64,7 +68,6 @@ void SbiRuntime::StepArith( SbxOperator 
 	TOSMakeTemp();
 	SbxVariable* p2 = GetTOS();
 
-	bool bVBAInterop =  SbiRuntime::isVBAEnabled(); 
 
 	// This could & should be moved to the MakeTempTOS() method in runtime.cxx
 	// In the code which this is cut'npaste from there is a check for a ref
@@ -74,7 +77,7 @@ void SbiRuntime::StepArith( SbxOperator 
 	// here we alway seem to have a refcount of 1. Also it seems that
 	// MakeTempTOS is called for other operation, so I hold off for now
 	// until I have a better idea
-	if ( bVBAInterop
+	if ( bVBAEnabled
 		&& ( p2->GetType() == SbxOBJECT || p2->GetType() == SbxVARIANT )
 	)
 	{
@@ -110,6 +113,40 @@ void SbiRuntime::StepCompare( SbxOperato
 {
 	SbxVariableRef p1 = PopVar();
 	SbxVariableRef p2 = PopVar();
+
+	// Make sure objects with default params have 
+	// values ( and type ) set as appropriate
+	SbxDataType p1Type = p1->GetType(); 
+	SbxDataType p2Type = p2->GetType(); 
+	if ( p1Type == p2Type )
+	{
+		if ( p1Type == SbxEMPTY )
+		{
+			p1->Broadcast( SBX_HINT_DATAWANTED );
+			p2->Broadcast( SBX_HINT_DATAWANTED );
+		}
+		// if both sides are an object and have default props
+		// then we need to use the default props
+		// we don't need to worry if only one side ( lhs, rhs ) is an 
+		// object ( object side will get coerced to correct type in 
+		// Compare )
+		else if ( p1Type ==  SbxOBJECT )
+		{
+			SbxVariable* pDflt = getDefaultProp( p1 );
+			if ( pDflt )
+			{
+				p1 = pDflt;
+				p1->Broadcast( SBX_HINT_DATAWANTED );
+			}
+			pDflt = getDefaultProp( p2 );
+			if ( pDflt )
+			{
+				p2 = pDflt;
+				p2->Broadcast( SBX_HINT_DATAWANTED );
+			}
+		}
+
+	}
 #ifndef WIN
 	static SbxVariable* pTRUE = NULL;
 	static SbxVariable* pFALSE = NULL;
@@ -166,9 +203,116 @@ void SbiRuntime::StepGT()		{ StepCompare
 void SbiRuntime::StepLE()		{ StepCompare( SbxLE );		}
 void SbiRuntime::StepGE()		{ StepCompare( SbxGE );		}
 
+namespace
+{
+	bool NeedEsc(sal_Unicode cCode)
+	{
+		String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()"));
+		return (STRING_NOTFOUND != sEsc.Search(cCode));
+	}
+
+	String VBALikeToRegexp(const String &rIn)
+	{
+		String sResult;
+		const sal_Unicode *start = rIn.GetBuffer();
+		const sal_Unicode *end = start + rIn.Len();
+
+		int seenright = 0;
+
+		sResult.Append('^');
+
+		while (start < end) 
+		{
+			switch (*start)
+			{
+				case '?':
+					sResult.Append('.');
+					start++;
+					break;
+				case '*':
+					sResult.Append(String(RTL_CONSTASCII_USTRINGPARAM(".*")));
+					start++;
+					break;
+				case '#':
+					sResult.Append(String(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
+					start++;
+					break;
+				case ']':
+					sResult.Append('\\');
+					sResult.Append(*start++);
+					break;
+				case '[':
+					sResult.Append(*start++);
+					seenright = 0;
+					while (start < end && !seenright)
+					{
+						switch (*start)
+						{
+							case '[':
+							case '?':
+							case '*':
+							sResult.Append('\\');
+							sResult.Append(*start);
+								break;
+							case ']':
+							sResult.Append(*start);
+								seenright = 1;
+								break;
+							case '!':
+								sResult.Append('^');
+								break;
+							default:
+							if (NeedEsc(*start))
+									sResult.Append('\\');
+							sResult.Append(*start);
+								break;
+						}
+						start++;
+					}
+					break;
+				default:
+					if (NeedEsc(*start))
+						sResult.Append('\\');
+					sResult.Append(*start++);
+			}
+		}
+
+		sResult.Append('$');
+
+		return sResult;
+	}
+}
+
 void SbiRuntime::StepLIKE()
 {
-	StarBASIC::FatalError( SbERR_NOT_IMPLEMENTED );
+    SbxVariableRef refVar1 = PopVar();
+    SbxVariableRef refVar2 = PopVar();
+
+    String pattern = VBALikeToRegexp(refVar1->GetString());
+    String value = refVar2->GetString();
+
+    com::sun::star::util::SearchOptions aSearchOpt;
+
+    aSearchOpt.algorithmType = com::sun::star::util::SearchAlgorithms_REGEXP;
+
+    aSearchOpt.Locale = Application::GetSettings().GetLocale();
+    aSearchOpt.searchString = pattern;
+
+    int bTextMode(1);
+    bool bCompatibility = ( pINST && pINST->IsCompatibility() );
+    if( bCompatibility )
+        bTextMode = GetImageFlag( SBIMG_COMPARETEXT );
+
+    if( bTextMode )
+        aSearchOpt.transliterateFlags |= com::sun::star::i18n::TransliterationModules_IGNORE_CASE;
+
+    SbxVariable* pRes = new SbxVariable;
+    utl::TextSearch aSearch(aSearchOpt);
+    xub_StrLen nStart=0, nEnd=value.Len();
+    int bRes = aSearch.SearchFrwrd(value, &nStart, &nEnd);
+    pRes->PutBool( bRes != 0 );
+
+    PushVar( pRes );
 }
 
 // TOS und TOS-1 sind beides Objektvariable und enthalten den selben Pointer
@@ -244,14 +388,13 @@ void SbiRuntime::StepPUT()
 		n = refVar->GetFlags();
 		refVar->SetFlag( SBX_WRITE );
 	}
-	bool bVBAInterop =  SbiRuntime::isVBAEnabled(); 
 
 	// if left side arg is an object or variant and right handside isn't 
 	// either an object or a variant then try and see if a default 
 	// property exists.
 	// to use e.g. Range{"A1") = 34
 	// could equate to Range("A1").Value = 34 
-	if ( bVBAInterop )
+	if ( bVBAEnabled )
 	{
 		if ( refVar->GetType() == SbxOBJECT  ) 
 		{
@@ -269,7 +412,7 @@ void SbiRuntime::StepPUT()
 
 	*refVar = *refVal;
 	// lhs is a property who's value is currently null
-	if ( !bVBAInterop || ( bVBAInterop && refVar->GetType() != SbxEMPTY ) )
+	if ( !bVBAEnabled || ( bVBAEnabled && refVar->GetType() != SbxEMPTY ) )
 	// #67607 Uno-Structs kopieren
 		checkUnoStructCopy( refVal, refVar );
 	if( bFlagsChanged )
@@ -402,7 +545,7 @@ void SbiRuntime::StepSET()
 {
 	SbxVariableRef refVal = PopVar();
 	SbxVariableRef refVar = PopVar();
-	StepSET_Impl( refVal, refVar, SbiRuntime::isVBAEnabled() ); // this is really assigment
+	StepSET_Impl( refVal, refVar, bVBAEnabled ); // this is really assigment
 }
 
 void SbiRuntime::StepVBASET()
@@ -525,6 +668,8 @@ void SbiRuntime::DimImpl( SbxVariableRef
 				if( ub < lb )
 					Error( SbERR_OUT_OF_RANGE ), ub = lb;
 				pArray->AddDim32( lb, ub );
+				if ( lb != ub )
+					pArray->setHasFixedSize( true );
 			}
 		}
 		else
@@ -693,27 +838,51 @@ void SbiRuntime::StepREDIMP_ERASE()
 		refVar->SetType( SbxEMPTY );
 }
 
+void lcl_clearImpl( SbxVariableRef& refVar, SbxDataType& eType )
+{
+	USHORT nSavFlags = refVar->GetFlags();
+	refVar->ResetFlag( SBX_FIXED );
+	refVar->SetType( SbxDataType(eType & 0x0FFF) );
+	refVar->SetFlags( nSavFlags );
+	refVar->Clear();
+}
 
-// Variable loeschen
-// TOS = Variable
-
-void SbiRuntime::StepERASE()
+void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
 {
-	SbxVariableRef refVar = PopVar();
 	SbxDataType eType = refVar->GetType();
 	if( eType & SbxARRAY )
 	{
+		if ( bVBAEnabled )
+		{
+			SbxBase* pElemObj = refVar->GetObject();
+			SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+			bool bClearValues = true;
+			if( pDimArray )
+			{
+				if ( pDimArray->hasFixedSize() )
+				{
+					// Clear all Value(s)
+					pDimArray->SbxArray::Clear();
+					bClearValues = false;
+				}
+				else
+					pDimArray->Clear(); // clear Dims
+			}
+			if ( bClearValues )
+			{
+				SbxArray* pArray = PTR_CAST(SbxArray,pElemObj);
+				if ( pArray )
+					pArray->Clear();
+			}				
+		}
+		else
 		// AB 2.4.1996
 		// Arrays haben bei Erase nach VB ein recht komplexes Verhalten. Hier
 		// werden zunaechst nur die Typ-Probleme bei REDIM (#26295) beseitigt:
 		// Typ hart auf den Array-Typ setzen, da eine Variable mit Array
 		// SbxOBJECT ist. Bei REDIM entsteht dann ein SbxOBJECT-Array und
 		// der ursruengliche Typ geht verloren -> Laufzeitfehler
-		USHORT nSavFlags = refVar->GetFlags();
-		refVar->ResetFlag( SBX_FIXED );
-		refVar->SetType( SbxDataType(eType & 0x0FFF) );
-		refVar->SetFlags( nSavFlags );
-		refVar->Clear();
+			lcl_clearImpl( refVar, eType );
 	}
 	else
 	if( refVar->IsFixed() )
@@ -722,6 +891,23 @@ void SbiRuntime::StepERASE()
 		refVar->SetType( SbxEMPTY );
 }
 
+// Variable loeschen
+// TOS = Variable
+
+void SbiRuntime::StepERASE()
+{
+	SbxVariableRef refVar = PopVar();
+	lcl_eraseImpl( refVar, bVBAEnabled );
+}
+
+void SbiRuntime::StepERASE_CLEAR()
+{
+	SbxVariableRef refVar = PopVar();
+	lcl_eraseImpl( refVar, bVBAEnabled );
+	SbxDataType eType = refVar->GetType();
+	lcl_clearImpl( refVar, eType );
+}
+
 // Einrichten eines Argvs
 // nOp1 bleibt so -> 1. Element ist Returnwert
 
Index: basic/source/runtime/step1.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/step1.cxx,v
retrieving revision 1.16
retrieving revision 1.16.42.1
diff -u -p -r1.16 -r1.16.42.1
--- basic/source/runtime/step1.cxx	3 Nov 2006 15:10:48 -0000	1.16
+++ basic/source/runtime/step1.cxx	27 Feb 2007 18:29:10 -0000	1.16.42.1
@@ -44,6 +44,9 @@
 #include "image.hxx"
 #include "sbunoobj.hxx"
 
+bool checkUnoObjectType( SbUnoObject* refVal, 
+	const String& aClass );
+
 // Laden einer numerischen Konstanten (+ID)
 
 void SbiRuntime::StepLOADNC( UINT32 nOp1 )
@@ -476,9 +479,18 @@ bool SbiRuntime::checkClass_Impl( const 
 		{
 			if( !implIsClass( pObj, aClass ) )
 			{
-				if( bRaiseErrors )
-					Error( SbERR_INVALID_USAGE_OBJECT );
-				bOk = false;
+				if ( bVBAEnabled && pObj->IsA( TYPE(SbUnoObject) ) )
+				{
+					SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+					bOk = checkUnoObjectType( pUnoObj, aClass );
+				}
+				else
+					bOk = false;
+				if ( !bOk )
+				{
+					if( bRaiseErrors )
+						Error( SbERR_INVALID_USAGE_OBJECT );
+				}
 			}
 			else
 			{
@@ -490,14 +502,17 @@ bool SbiRuntime::checkClass_Impl( const 
 	}
 	else
 	{
-		if( bRaiseErrors )
-			Error( SbERR_NEEDS_OBJECT );
-		bOk = false;
+		if ( !bVBAEnabled )
+		{
+			if( bRaiseErrors )
+				Error( SbERR_NEEDS_OBJECT );
+			bOk = false;
+		}
 	}
 	return bOk;
 }
 
-void SbiRuntime::StepSETCLASS( UINT32 nOp1 )
+void SbiRuntime::StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt )
 {
 	SbxVariableRef refVal = PopVar();
 	SbxVariableRef refVar = PopVar();
@@ -505,7 +520,17 @@ void SbiRuntime::StepSETCLASS( UINT32 nO
 
 	bool bOk = checkClass_Impl( refVal, aClass, true );
 	if( bOk )
-		StepSET_Impl( refVal, refVar );
+		StepSET_Impl( refVal, refVar, bHandleDflt ); // don't do handle dflt prop for a "proper" set
+}
+
+void SbiRuntime::StepVBASETCLASS( UINT32 nOp1 )
+{
+	StepSETCLASS_impl( nOp1, false );
+}
+
+void SbiRuntime::StepSETCLASS( UINT32 nOp1 )
+{
+	StepSETCLASS_impl( nOp1, true );
 }
 
 void SbiRuntime::StepTESTCLASS( UINT32 nOp1 )
Index: basic/source/runtime/step2.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/step2.cxx,v
retrieving revision 1.29
retrieving revision 1.27.42.5
diff -u -p -r1.29 -r1.27.42.5
--- basic/source/runtime/step2.cxx	27 Apr 2007 09:16:12 -0000	1.29
+++ basic/source/runtime/step2.cxx	2 May 2007 09:44:56 -0000	1.27.42.5
@@ -54,6 +54,8 @@
 using namespace com::sun::star::container;
 using namespace com::sun::star::lang;
 
+SbxVariable* getVBAConstant( const String& rName );
+
 const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
 const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
 //  i#i68894# 
@@ -113,8 +115,6 @@ SbxVariable* SbiRuntime::FindElement
 	( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError nNotFound, BOOL bLocal )
 {
 	
-	bool bIsVBAInterOp = SbiRuntime::isVBAEnabled(); 
-
 	SbxVariable* pElem = NULL;
 	if( !pObj )
 	{
@@ -126,6 +126,24 @@ SbxVariable* SbiRuntime::FindElement
 		BOOL bFatalError = FALSE;
 		SbxDataType t = (SbxDataType) nOp2;
 		String aName( pImg->GetString( static_cast<short>( nOp1 & 0x7FFF ) ) );
+		bool bIsVBAInterOp = SbiRuntime::isVBAEnabled(); 
+		// Hacky capture of Evaluate [] syntax
+		// this should be tackled I feel at the pcode level
+		if ( bIsVBAInterOp && aName.Search('[') == 0 ) 
+		{
+			// emulate pcode here
+			StepARGC();
+			// psuedo StepLOADSC
+			String sArg = aName.Copy( 1, aName.Len() - 2 );
+			SbxVariable* p = new SbxVariable;
+			p->PutString( sArg );
+			PushVar( p );
+			//
+			StepARGV();
+			nOp1 = nOp1 | 0x8000; // indicate params are present
+			aName = String::CreateFromAscii("Evaluate");
+		}
+
 		if( bLocal )
 			pElem = refLocals->Find( aName, SbxCLASS_DONTCARE );
 		if( !pElem )
@@ -156,25 +174,24 @@ SbxVariable* SbiRuntime::FindElement
 
 				// i#i68894# if VBAInterOp favour searching vba globals 
 				// over searching for uno classess
-				if ( bIsVBAInterOp )
+				if ( bVBAEnabled )
 				{
 					// Try Find in VBA symbols space
 					pElem = VBAFind( aName, SbxCLASS_DONTCARE );
 					if ( pElem )
 						bSetName = false; // don't overwrite uno name
+					else
+						pElem = getVBAConstant( aName );
 				}
-				else
-				{				
-					// #72382 VORSICHT! Liefert jetzt wegen unbekannten
-					// Modulen IMMER ein Ergebnis!
-					SbxVariable* pUnoClass = findUnoClass( aName );
-					if( pUnoClass )
-					{
-						pElem = new SbxVariable( t );
-						SbxValues aRes( SbxOBJECT );
-						aRes.pObj = pUnoClass;
-						pElem->SbxVariable::Put( aRes );
-					}
+				// #72382 VORSICHT! Liefert jetzt wegen unbekannten
+				// Modulen IMMER ein Ergebnis!
+				SbxVariable* pUnoClass = findUnoClass( aName );
+				if( pUnoClass )
+				{
+					pElem = new SbxVariable( t );
+					SbxValues aRes( SbxOBJECT );
+					aRes.pObj = pUnoClass;
+					pElem->SbxVariable::Put( aRes );
 				}
 
 				// #62939 Wenn eine Uno-Klasse gefunden wurde, muss
@@ -523,7 +540,7 @@ SbxVariable* SbiRuntime::CheckArray( Sbx
                     {
                         Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue();
                         Reference< XIndexAccess > xIndexAccess( x, UNO_QUERY );
-                        if ( !SbiRuntime::isVBAEnabled() )
+                        if ( !bVBAEnabled )
                         {
                             // Haben wir Index-Access?
                             if( xIndexAccess.is() )
@@ -1121,6 +1138,14 @@ void SbiRuntime::StepPUBLIC( UINT32 nOp1
 	StepPUBLIC_Impl( nOp1, nOp2, false );
 }
 
+void SbiRuntime::StepPUBLIC_P( UINT32 nOp1, UINT32 nOp2 )
+{
+    // Creates module variable that isn't reinitialised when
+    // between invocations ( for VBASupport & document basic only )
+    if( pMod->pImage->bFirstInit )
+	StepPUBLIC( nOp1, nOp2 );
+}
+
 // Einrichten einer globalen Variablen (+StringID+Typ)
 
 void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 )
cvs diff: Diffing basic/source/sample
cvs diff: Diffing basic/source/sbx
Index: basic/source/sbx/sbxarray.cxx
===================================================================
RCS file: /cvs/script/basic/source/sbx/sbxarray.cxx,v
retrieving revision 1.6
retrieving revision 1.6.48.3
diff -u -p -r1.6 -r1.6.48.3
--- basic/source/sbx/sbxarray.cxx	12 Oct 2006 14:31:56 -0000	1.6
+++ basic/source/sbx/sbxarray.cxx	27 Apr 2007 14:32:16 -0000	1.6.48.3
@@ -40,6 +40,7 @@
 #include <tools/stream.hxx>
 #endif
 #include "sbx.hxx"
+#include "runtime.hxx"
 #include <vector>
 using namespace std;
 
@@ -593,7 +594,7 @@ void SbxArray::PutDirect( SbxVariable* p
 //
 //////////////////////////////////////////////////////////////////////////
 
-SbxDimArray::SbxDimArray( SbxDataType t ) : SbxArray( t )
+SbxDimArray::SbxDimArray( SbxDataType t ) : SbxArray( t ), mbHasFixedSize( false )
 {
 	pFirst = pLast = NULL;
 	nDim = 0;
@@ -618,6 +619,7 @@ SbxDimArray& SbxDimArray::operator=( con
 			AddDim32( p->nLbound, p->nUbound );
 			p = p->pNext;
 		}
+		this->mbHasFixedSize = rArray.mbHasFixedSize;
 	}
 	return *this;
 }
@@ -793,7 +795,7 @@ void SbxDimArray::Put32( SbxVariable* p,
 
 UINT32 SbxDimArray::Offset32( SbxArray* pPar )
 {
-	if( nDim == 0 || !pPar )
+	if( nDim == 0 || !pPar || ( ( nDim != ( pPar->Count() - 1 ) ) && SbiRuntime::isVBAEnabled() ) )
 	{
 		SetError( SbxERR_BOUNDS ); return 0;
 	}
Index: basic/source/sbx/sbxvalue.cxx
===================================================================
RCS file: /cvs/script/basic/source/sbx/sbxvalue.cxx,v
retrieving revision 1.8
retrieving revision 1.8.48.1
diff -u -p -r1.8 -r1.8.48.1
--- basic/source/sbx/sbxvalue.cxx	12 Oct 2006 14:34:49 -0000	1.8
+++ basic/source/sbx/sbxvalue.cxx	16 Feb 2007 17:08:55 -0000	1.8.48.1
@@ -64,7 +64,7 @@
 #include "sbx.hxx"
 #include "sbxconv.hxx"
 #include <math.h>
-
+#include "runtime.hxx"
 // AB 29.10.99 Unicode
 #ifndef _USE_NO_NAMESPACE
 using namespace rtl;
@@ -1125,6 +1125,8 @@ BOOL SbxValue::Convert( SbxDataType eTo 
 
 BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
 {
+	bool bVBAInterop =  SbiRuntime::isVBAEnabled(); 
+
 	SbxDataType eThisType = GetType();
 	SbxDataType eOpType = rOp.GetType();
 	SbxError eOld = GetError();
@@ -1138,14 +1140,16 @@ BOOL SbxValue::Compute( SbxOperator eOp,
 	else if( eThisType == SbxNULL || eOpType == SbxNULL )
 		SetType( SbxNULL );
 	// Sonderregel 2: Ist ein Operand Empty, ist das Ergebnis der 2. Operand
-	else if( eThisType == SbxEMPTY )
+	else if( eThisType == SbxEMPTY 
+	&& !bVBAInterop 
+	)
 		*this = rOp;
 	// 13.2.96: Nicht schon vor Get auf SbxEMPTY pruefen
 	else
 	{
 		SbxValues aL, aR;
 		bool bDecimal = false;
-		if( eThisType == SbxSTRING || eOp == SbxCAT )
+		if( eThisType == SbxSTRING || eOp == SbxCAT || ( bVBAInterop && ( eOpType == SbxSTRING ) && (  eOp == SbxPLUS ) ) )
 		{
 			if( eOp == SbxCAT || eOp == SbxPLUS )
 			{
@@ -1203,7 +1207,10 @@ BOOL SbxValue::Compute( SbxOperator eOp,
 			if( rOp.Get( aR ) )
 			{
 				if( rOp.GetType() == SbxEMPTY )
-					goto Lbl_OpIsEmpty;
+				{
+					if ( !bVBAInterop || ( bVBAInterop && ( eOp != SbxNOT  ) ) )
+						goto Lbl_OpIsEmpty;
+				}
 				if( Get( aL ) ) switch( eOp )
 				{
 					case SbxIDIV:
@@ -1392,7 +1399,10 @@ BOOL SbxValue::Compute( SbxOperator eOp,
 			if( rOp.Get( aR ) )
 			{
 				if( rOp.GetType() == SbxEMPTY )
-					goto Lbl_OpIsEmpty;
+				{
+					if ( !bVBAInterop || ( bVBAInterop && ( eOp != SbxNEG ) ) )
+						goto Lbl_OpIsEmpty;
+				}
 				if( Get( aL ) )
 				{
 					switch( eOp )
@@ -1442,6 +1452,8 @@ Lbl_OpIsEmpty:
 
 BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
 {
+	bool bVBAInterop =  SbiRuntime::isVBAEnabled(); 
+
 	BOOL bRes = FALSE;
 	SbxError eOld = GetError();
 	if( eOld != SbxERR_OK )
@@ -1458,10 +1470,13 @@ BOOL SbxValue::Compare( SbxOperator eOp,
 	// Sonderregel 2: Wenn beide Variant sind und einer ist numerisch,
 	// und der andere ein String, ist num < str
 	else if( !IsFixed() && !rOp.IsFixed()
-	 && ( rOp.GetType() == SbxSTRING && GetType() != SbxSTRING && IsNumeric() ) )
+	 && ( rOp.GetType() == SbxSTRING && GetType() != SbxSTRING && IsNumeric() ) && !bVBAInterop 
+	)
 		bRes = BOOL( eOp == SbxLT || eOp == SbxLE || eOp == SbxNE );
 	else if( !IsFixed() && !rOp.IsFixed()
-	 && ( GetType() == SbxSTRING && rOp.GetType() != SbxSTRING && rOp.IsNumeric() ) )
+	 && ( GetType() == SbxSTRING && rOp.GetType() != SbxSTRING && rOp.IsNumeric() ) 
+&& !bVBAInterop 
+	)
 		bRes = BOOL( eOp == SbxGT || eOp == SbxGE || eOp == SbxNE );
 	else
 	{
cvs diff: Diffing basic/source/uno
cvs diff: Diffing basic/util
cvs diff: Diffing basic/util/defs
cvs diff: Diffing basic/win
cvs diff: Diffing basic/win/res
cvs diff: Diffing basic/workben
cvs diff: Diffing config_office
Index: config_office/configure.in
===================================================================
RCS file: /cvs/tools/config_office/configure.in,v
retrieving revision 1.201
retrieving revision 1.201.2.1
diff -u -p -r1.201 -r1.201.2.1
--- config_office/configure.in	25 Apr 2007 15:53:53 -0000	1.201
+++ config_office/configure.in	3 May 2007 11:09:38 -0000	1.201.2.1
@@ -41,20 +41,21 @@ AC_ARG_ENABLE(lockdown,
 [  --enable-lockdown       Enables the gconf integration work in OOo
 ],,)
 AC_ARG_ENABLE(vba,
-[  --enable-vba           Enables the vba compatibility feature
+[  --disable-vba           disables the vba compatibility feature
 ],,)
 AC_ARG_WITH(vba-package-format,
 [  --with-vba-package-format   specify package format for vba compatibility api.
-                          Default "builtin" means the api component and 
+                          Specifying  "builtin" means the api component and 
                           associated type library are  part of the installation set.
-                          Specifying "extsn" creates an uno extension that is
+                          Specifying "extn" creates an uno extension that is
                           part of the installation set ( located in the program 
                           directory ) that MUST be optionly registered using
                           either the unopkg executeable or the extension manager
                           gui.
-                          
-                          Usage: --with-package-format="builtin" or
-                                 --with-package-format="extsn"
+                         
+                          Note: "extn" is the defualt. 
+                          Usage: --with-vba-package-format="builtin" or
+                                 --with-vba-package-format="extn"
 ],,)              
 AC_ARG_ENABLE(pch,
 [  --enable-pch            Enables the use of precompiledr C/C++ header files
@@ -1605,13 +1606,13 @@ fi
 dnl ===================================================================
 dnl Check if we are to enable vba macro interoperability feature
 dnl ===================================================================
-AC_MSG_CHECKING([whether to enable vba feature])
-if test -n "$enable_vba" && test "$enable_vba" = "yes"; then
+AC_MSG_CHECKING([whether to disable vba feature])
+if test -n "$enable_vba" && test "$enable_vba" = "no"; then
    AC_MSG_RESULT([yes])
-   ENABLE_VBA=YES
-else
    ENABLE_VBA=NO
+else
    AC_MSG_RESULT([no])
+   ENABLE_VBA=YES
 fi
 AC_SUBST(ENABLE_VBA)
 
@@ -1630,11 +1631,14 @@ if test "$ENABLE_VBA" = "YES"; then
       fi
  
    else
-      VBA_EXTENSION=NO
-      AC_MSG_RESULT([build into installset])
+      VBA_EXTENSION=YES
+      AC_MSG_RESULT([defaulting to build as uno extension])
    fi
-   AC_SUBST(VBA_EXTENSION)
+else
+      VBA_EXTENSION=NO
 fi
+AC_SUBST(VBA_EXTENSION)
+
 dnl ===================================================================
 dnl Check the whether vba need to be delivered as an uno package or part
 dnl of the install
cvs diff: Diffing config_office/guw
cvs diff: Diffing sc
cvs diff: Diffing sc/addin
cvs diff: Diffing sc/addin/datefunc
cvs diff: Diffing sc/addin/inc
cvs diff: Diffing sc/addin/rot13
cvs diff: Diffing sc/addin/util
cvs diff: Diffing sc/inc
cvs diff: Diffing sc/inc/pch
cvs diff: Diffing sc/prj
cvs diff: Diffing sc/qa
cvs diff: Diffing sc/qa/complex
cvs diff: Diffing sc/qa/complex/dataPilot
cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests
cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/beans
cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/container
cvs diff: Diffing sc/qa/complex/dataPilot/interfaceTests/sheet
cvs diff: Diffing sc/qa/complex/sc
cvs diff: Diffing sc/qa/unoapi
cvs diff: Diffing sc/qa/unoapi/testdocuments
cvs diff: Diffing sc/sdi
cvs diff: Diffing sc/source
cvs diff: Diffing sc/source/core
cvs diff: Diffing sc/source/core/data
cvs diff: Diffing sc/source/core/inc
cvs diff: Diffing sc/source/core/src
cvs diff: Diffing sc/source/core/tool
cvs diff: Diffing sc/source/filter
cvs diff: Diffing sc/source/filter/dif
cvs diff: Diffing sc/source/filter/excel
cvs diff: Diffing sc/source/filter/ftools
cvs diff: Diffing sc/source/filter/html
cvs diff: Diffing sc/source/filter/inc
cvs diff: Diffing sc/source/filter/lotus
cvs diff: Diffing sc/source/filter/qpro
cvs diff: Diffing sc/source/filter/rtf
cvs diff: Diffing sc/source/filter/starcalc
cvs diff: Diffing sc/source/filter/xcl97
cvs diff: Diffing sc/source/filter/xml
cvs diff: Diffing sc/source/ui
cvs diff: Diffing sc/source/ui/Accessibility
cvs diff: Diffing sc/source/ui/app
cvs diff: Diffing sc/source/ui/attrdlg
cvs diff: Diffing sc/source/ui/cctrl
cvs diff: Diffing sc/source/ui/dbgui
cvs diff: Diffing sc/source/ui/docshell
cvs diff: Diffing sc/source/ui/drawfunc
cvs diff: Diffing sc/source/ui/formdlg
cvs diff: Diffing sc/source/ui/inc
cvs diff: Diffing sc/source/ui/miscdlgs
cvs diff: Diffing sc/source/ui/namedlg
cvs diff: Diffing sc/source/ui/navipi
cvs diff: Diffing sc/source/ui/optdlg
cvs diff: Diffing sc/source/ui/pagedlg
cvs diff: Diffing sc/source/ui/src
cvs diff: Diffing sc/source/ui/styleui
cvs diff: Diffing sc/source/ui/undo
cvs diff: Diffing sc/source/ui/unoobj
cvs diff: Diffing sc/source/ui/vba
Index: sc/source/ui/vba/vbaapplication.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/vbaapplication.cxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -r1.2 -r1.2.2.1
--- sc/source/ui/vba/vbaapplication.cxx	25 Apr 2007 16:00:39 -0000	1.2
+++ sc/source/ui/vba/vbaapplication.cxx	18 May 2007 12:38:29 -0000	1.2.2.1
@@ -293,7 +293,7 @@ void SAL_CALL 
 ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::RuntimeException)
 {
     rtl::OUString sText;
-    sal_Bool bDefault;
+    sal_Bool bDefault = sal_False;
 	uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
     uno::Reference< task::XStatusIndicatorSupplier > xStatusIndicatorSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
     uno::Reference< task::XStatusIndicator > xStatusIndicator( xStatusIndicatorSupplier->getStatusIndicator(), uno::UNO_QUERY_THROW );
@@ -426,7 +426,7 @@ ScVbaApplication::GoTo( const uno::Any& 
     
     if( Scroll.hasValue() )
     {
-        sal_Bool aScroll;
+        sal_Bool aScroll = sal_False;
         if( Scroll >>= aScroll )
         {
             bScroll = aScroll;
Index: sc/source/ui/vba/vbahelper.hxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/vbahelper.hxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -r1.2 -r1.2.2.1
--- sc/source/ui/vba/vbahelper.hxx	25 Apr 2007 16:07:33 -0000	1.2
+++ sc/source/ui/vba/vbahelper.hxx	3 May 2007 11:16:34 -0000	1.2.2.1
@@ -38,8 +38,8 @@
 #include <com/sun/star/frame/XModel.hpp>
 #include <docsh.hxx>
 
-#define css com::sun::star
-#define oo org::openoffice
+namespace css = ::com::sun::star;
+
 namespace org 
 {
 	namespace openoffice 
@@ -69,6 +69,8 @@ namespace org 
 	}
 }
 
+namespace oo = org::openoffice;
+
 #ifdef DEBUG
 #  define SC_VBA_FIXME(a) OSL_TRACE( a )
 #  define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ ))
Index: sc/source/ui/vba/vbarange.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -r1.2 -r1.2.2.1
--- sc/source/ui/vba/vbarange.cxx	25 Apr 2007 16:10:29 -0000	1.2
+++ sc/source/ui/vba/vbarange.cxx	18 May 2007 12:38:29 -0000	1.2.2.1
@@ -487,7 +487,7 @@ CellValueSetter::processValue( const uno
 	{
 		case  uno::TypeClass_BOOLEAN:
 		{
-			sal_Bool bState;
+			sal_Bool bState = sal_False;
 			if ( aValue >>= bState 	 )
 			{
 				uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW );
@@ -2318,7 +2318,7 @@ ScVbaRange::setHidden( const uno::Any& _
 		return;
 	}
 
-	sal_Bool bHidden;
+	sal_Bool bHidden = sal_False;
 	if ( !(_hidden >>= bHidden) )
 		throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to extract param for Hidden property" ) ), uno::Reference< uno::XInterface >() ); 
 
Index: sc/source/ui/vba/vbaworksheets.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/vba/vbaworksheets.cxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -r1.2 -r1.2.2.1
--- sc/source/ui/vba/vbaworksheets.cxx	25 Apr 2007 16:14:08 -0000	1.2
+++ sc/source/ui/vba/vbaworksheets.cxx	17 May 2007 16:12:07 -0000	1.2.2.1
@@ -227,7 +227,7 @@ ScVbaWorksheets::getVisible() throw (uno
 void SAL_CALL 
 ScVbaWorksheets::setVisible( const uno::Any& _visible ) throw (uno::RuntimeException)
 {
-	sal_Bool bState;
+	sal_Bool bState = sal_False;
 	if ( _visible >>= bState )
 	{
 		uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW );
cvs diff: Diffing sc/source/ui/view
cvs diff: Diffing sc/uiconfig
cvs diff: Diffing sc/uiconfig/scalc
cvs diff: Diffing sc/uiconfig/scalc/accelerator
cvs diff: Diffing sc/uiconfig/scalc/accelerator/de
cvs diff: Diffing sc/uiconfig/scalc/accelerator/en-GB
cvs diff: Diffing sc/uiconfig/scalc/accelerator/en-US
cvs diff: Diffing sc/uiconfig/scalc/accelerator/es
cvs diff: Diffing sc/uiconfig/scalc/accelerator/fr
cvs diff: Diffing sc/uiconfig/scalc/menubar
cvs diff: Diffing sc/uiconfig/scalc/statusbar
cvs diff: Diffing sc/uiconfig/scalc/toolbar
cvs diff: Diffing sc/util
Index: sc/util/makefile.mk
===================================================================
RCS file: /cvs/sc/sc/util/makefile.mk,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -p -r1.39 -r1.39.2.1
--- sc/util/makefile.mk	25 Apr 2007 16:15:20 -0000	1.39
+++ sc/util/makefile.mk	3 May 2007 09:00:47 -0000	1.39.2.1
@@ -278,6 +278,7 @@ DEF9NAME=$(SHL9TARGET)
 
 SHL9STDLIBS= \
 		$(CPPUHELPERLIB) \
+		$(VCLLIB) \
 		$(CPPULIB) \
 		$(COMPHELPERLIB) \
 		$(SVLIB) \
@@ -294,6 +295,12 @@ SHL9STDLIBS= \
 SHL9DEPN=$(SHL1TARGETN) $(SHL8TARGETN)
 SHL9LIBS=$(SLB)$/$(TARGET_VBA).lib
 
+.IF "$(GUI)"=="UNX" || "$(GUI)"=="MAC"
+    LIBCOMPNAME=$(LOCAL_COMMON_OUT)$/lib/lib$(SHL9TARGET)$(DLLPOST)
+.ELSE
+    LIBCOMPNAME=$(COMMONBIN)$/$(SHL9TARGET)$(DLLPOST)
+.ENDIF
+
 .ENDIF
  
 
cvs diff: Diffing sc/util/defs
cvs diff: Diffing sc/workben
cvs diff: Diffing sc/xml
cvs diff: Diffing svx
cvs diff: Diffing svx/doc
cvs diff: Diffing svx/doc/UML
cvs diff: Diffing svx/inc
cvs diff: Diffing svx/inc/pch
cvs diff: Diffing svx/inc/svx
cvs diff: Diffing svx/inc/svx/sdr
cvs diff: Diffing svx/inc/svx/sdr/animation
cvs diff: Diffing svx/inc/svx/sdr/contact
cvs diff: Diffing svx/inc/svx/sdr/event
cvs diff: Diffing svx/inc/svx/sdr/mixer
cvs diff: Diffing svx/inc/svx/sdr/overlay
cvs diff: Diffing svx/inc/svx/sdr/properties
cvs diff: Diffing svx/prj
cvs diff: Diffing svx/qa
cvs diff: Diffing svx/qa/unoapi
cvs diff: Diffing svx/qa/unoapi/testdocuments
cvs diff: Diffing svx/res
cvs diff: Diffing svx/sdi
cvs diff: Diffing svx/source
cvs diff: Diffing svx/source/accessibility
cvs diff: Diffing svx/source/customshapes
cvs diff: Diffing svx/source/dialog
cvs diff: Diffing svx/source/editeng
cvs diff: Diffing svx/source/engine3d
cvs diff: Diffing svx/source/fmcomp
cvs diff: Diffing svx/source/form
cvs diff: Diffing svx/source/gallery2
cvs diff: Diffing svx/source/gengal
cvs diff: Diffing svx/source/inc
cvs diff: Diffing svx/source/init
cvs diff: Diffing svx/source/intro
cvs diff: Diffing svx/source/items
cvs diff: Diffing svx/source/mnuctrls
cvs diff: Diffing svx/source/msfilter
Index: svx/source/msfilter/svxmsbas.cxx
===================================================================
RCS file: /cvs/graphics/svx/source/msfilter/svxmsbas.cxx,v
retrieving revision 1.20
retrieving revision 1.20.4.1
diff -u -p -r1.20 -r1.20.4.1
--- svx/source/msfilter/svxmsbas.cxx	25 Apr 2007 16:18:00 -0000	1.20
+++ svx/source/msfilter/svxmsbas.cxx	2 May 2007 09:16:56 -0000	1.20.4.1
@@ -368,8 +368,14 @@ BOOL SvxImportMSVBasic::ImportCode_Impl(
                         break;
                 }
 				static ::rtl::OUString sVBAOption( RTL_CONSTASCII_USTRINGPARAM( "Option VBASupport 1\n" ) ); 
+				static ::rtl::OUString sClassOption( RTL_CONSTASCII_USTRINGPARAM( "Option ClassModule\n" ) ); 
 				if ( !bAsComment )
+				{
 					modeTypeComment = modeTypeComment + sVBAOption;
+					if ( mType == Class )
+						modeTypeComment = modeTypeComment + sClassOption;
+
+				}
 
 				String sModule(sBasicModule); //#i52606# no need to split Macros in 64KB blocks any more!
 				String sTemp;
cvs diff: Diffing svx/source/options
cvs diff: Diffing svx/source/outliner
cvs diff: Diffing svx/source/sdr
cvs diff: Diffing svx/source/sdr/animation
cvs diff: Diffing svx/source/sdr/contact
cvs diff: Diffing svx/source/sdr/event
cvs diff: Diffing svx/source/sdr/mixer
cvs diff: Diffing svx/source/sdr/overlay
cvs diff: Diffing svx/source/sdr/properties
cvs diff: Diffing svx/source/src
cvs diff: Diffing svx/source/stbctrls
cvs diff: Diffing svx/source/svdraw
cvs diff: Diffing svx/source/svrtf
cvs diff: Diffing svx/source/svxlink
cvs diff: Diffing svx/source/tbxctrls
cvs diff: Diffing svx/source/toolbars
cvs diff: Diffing svx/source/unodialogs
cvs diff: Diffing svx/source/unodialogs/inc
cvs diff: Diffing svx/source/unodialogs/textconversiondlgs
cvs diff: Diffing svx/source/unodraw
cvs diff: Diffing svx/source/unoedit
cvs diff: Diffing svx/source/unogallery
cvs diff: Diffing svx/source/xml
cvs diff: Diffing svx/source/xoutdev
cvs diff: Diffing svx/uiconfig
cvs diff: Diffing svx/uiconfig/accelerator
cvs diff: Diffing svx/uiconfig/accelerator/en-US
cvs diff: Diffing svx/uiconfig/accelerator/es
cvs diff: Diffing svx/util
cvs diff: Diffing svx/util/defs
cvs diff: Diffing svx/workben
cvs diff: Diffing svx/workben/msview
cvs diff: Diffing svx/xml
cvs diff: Diffing scp2
cvs diff: Diffing scp2/inc
cvs diff: Diffing scp2/macros
cvs diff: Diffing scp2/prj
cvs diff: Diffing scp2/source
cvs diff: Diffing scp2/source/activex
cvs diff: Diffing scp2/source/base
cvs diff: Diffing scp2/source/calc
cvs diff: Diffing scp2/source/canvas
cvs diff: Diffing scp2/source/crashrep
cvs diff: Diffing scp2/source/draw
cvs diff: Diffing scp2/source/gnome
cvs diff: Diffing scp2/source/graphicfilter
cvs diff: Diffing scp2/source/impress
cvs diff: Diffing scp2/source/javafilter
cvs diff: Diffing scp2/source/kde
cvs diff: Diffing scp2/source/lingu
cvs diff: Diffing scp2/source/math
cvs diff: Diffing scp2/source/onlineupdate
cvs diff: Diffing scp2/source/ooo
Index: scp2/source/ooo/file_ooo.scp
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/file_ooo.scp,v
retrieving revision 1.188
retrieving revision 1.188.2.1
diff -u -p -r1.188 -r1.188.2.1
--- scp2/source/ooo/file_ooo.scp	25 Apr 2007 16:18:52 -0000	1.188
+++ scp2/source/ooo/file_ooo.scp	3 May 2007 11:09:39 -0000	1.188.2.1
@@ -1830,6 +1830,13 @@ File gid_File_Rdb_TypesVba
     Styles = (PACKED, OVERWRITE, PATCH);
     Name = "oovbaapi.rdb";
 End
+#else
+File gid_File_ExtnVba
+    TXT_FILE_BODY;
+    Dir = gid_Dir_Program;
+    Styles = (PACKED, OVERWRITE, PATCH);
+    Name = "vbaapi.oxt";
+End
 #endif
 #endif
 
cvs diff: Diffing scp2/source/python
cvs diff: Diffing scp2/source/quickstart
cvs diff: Diffing scp2/source/sdkoo
cvs diff: Diffing scp2/source/testtool
cvs diff: Diffing scp2/source/ure
cvs diff: Diffing scp2/source/winexplorerext
cvs diff: Diffing scp2/source/writer
cvs diff: Diffing scp2/source/xsltfilter
cvs diff: Diffing scp2/util