Obsolete raptor 1.4 API
[oi-userland.git] / components / desktop / libreoffice / patches / 66-Err.Raise-fix.patch
blob631f04bb439f14b762dab4207098c3cdf33bea7f
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
3 @@ -511,15 +511,15 @@
5 void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg )
7 - if( !bWatchMode )
8 + if( !bWatchMode && nVBNumber != 0 )
10 - ErrCode n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
11 - if ( !n )
12 - {
13 - n = ErrCode(nVBNumber); // force orig number, probably should have a specific table of vb ( localized ) errors
14 - }
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
20 aErrorMsg = rMsg;
21 - SbiRuntime::translateErrorToVba( n, aErrorMsg );
22 + SbiRuntime::translateErrorToVba( nErr, aErrorMsg );
24 pRun->Error( ERRCODE_BASIC_COMPAT, true/*bVBATranslationAlreadyDone*/ );