merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0331-vba-fix-errobj-errnum.diff
blob37caabde743675fa07cc8017dda65e8d010b793f
1 diff --git basic/source/runtime/runtime.cxx basic/source/runtime/runtime.cxx
2 index 69c75b3..93a8afd 100644
3 --- basic/source/runtime/runtime.cxx
4 +++ basic/source/runtime/runtime.cxx
5 @@ -294,7 +294,6 @@ SbiInstance::SbiInstance( StarBASIC* p )
6 nErl = 0;
7 bReschedule = TRUE;
8 bCompatibility = FALSE;
9 - SbxErrObject::getUnoErrObject()->Clear();
12 SbiInstance::~SbiInstance()
13 diff --git basic/source/runtime/step0.cxx basic/source/runtime/step0.cxx
14 index fa66194..c43931d 100644
15 --- basic/source/runtime/step0.cxx
16 +++ basic/source/runtime/step0.cxx
17 @@ -1132,6 +1132,7 @@ void SbiRuntime::StepNOERROR()
18 pInst->nErr = 0L;
19 pInst->nErl = 0;
20 nError = 0L;
21 + SbxErrObject::getUnoErrObject()->Clear();
22 bError = FALSE;
25 @@ -1140,6 +1141,9 @@ void SbiRuntime::StepNOERROR()
26 void SbiRuntime::StepLEAVE()
28 bRun = FALSE;
29 + // If VBA and we are leaving an ErrorHandler then clear the error ( it's been processed )
30 + if ( bInError && pError )
31 + SbxErrObject::getUnoErrObject()->Clear();
34 void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer
35 diff --git basic/source/runtime/step1.cxx basic/source/runtime/step1.cxx
36 index 57d7f02..d6dc7d0 100644
37 --- basic/source/runtime/step1.cxx
38 +++ basic/source/runtime/step1.cxx
39 @@ -38,6 +38,7 @@
40 #include "iosys.hxx"
41 #include "image.hxx"
42 #include "sbunoobj.hxx"
43 +#include "errobject.hxx"
45 bool checkUnoObjectType( SbUnoObject* refVal,
46 const String& aClass );
47 @@ -374,6 +375,7 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 )
48 pInst->nErr = 0;
49 pInst->nErl = 0;
50 nError = 0;
51 + SbxErrObject::getUnoErrObject()->Clear();
54 // Resume nach Fehlern (+0=statement, 1=next or Label)
55 @@ -394,6 +396,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
57 else
58 pCode = pErrStmnt;
59 + if ( pError ) // current in error handler ( and got a Resume Next statment )
60 + SbxErrObject::getUnoErrObject()->Clear();
62 if( nOp1 > 1 )
63 StepJUMP( nOp1 );