1 --- a/basic/source/runtime/runtime.cxx 2022-10-28 13:47:11.791947574 +0000
2 +++ b/basic/source/runtime/runtime.cxx 2022-10-28 13:45:28.945491775 +0000
5 void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg )
8 + if( !bWatchMode && nVBNumber != 0 )
10 - ErrCode n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
13 - n = ErrCode(nVBNumber); // force orig number, probably should have a specific table of vb ( localized ) errors
15 + nErr = ERRCODE_NONE;
16 + if( static_cast< sal_uInt32 >(nVBNumber) <= 0xFFFF)
17 + nErr = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
18 + if ( nErr == ERRCODE_NONE ) // GetSfxFromVBError returns ERRCODE_NONE if it can't find that error number
19 + nErr = ErrCode(nVBNumber); // force orig number, probably should have a specific table of vb ( localized ) errors
21 - SbiRuntime::translateErrorToVba( n, aErrorMsg );
22 + SbiRuntime::translateErrorToVba( nErr, aErrorMsg );
24 pRun->Error( ERRCODE_BASIC_COMPAT, true/*bVBATranslationAlreadyDone*/ );