Update to m13
[ooovba.git] / applied_patches / 0425-vba-fix-IsEmpty-api-object.diff
blob2f9e961fa0624d6c75e4714c8f4e9e79bb21585e
1 diff --git basic/source/runtime/methods.cxx basic/source/runtime/methods.cxx
2 index 72219ee..50dcf6b 100644
3 --- basic/source/runtime/methods.cxx
4 +++ basic/source/runtime/methods.cxx
5 @@ -108,6 +108,8 @@ using namespace com::sun::star::script;
6 #include <stdlib.h>
7 #include <ctype.h>
9 +SbxVariable* getDefaultProp( SbxVariable* pRef );
11 #if defined (WIN) || defined (WNT) || defined (OS2)
12 #include <direct.h> // _getdcwd get current work directory, _chdrive
13 #endif
14 @@ -2426,7 +2429,18 @@ RTLFUNC(IsEmpty)
15 if ( rPar.Count() < 2 )
16 StarBASIC::Error( SbERR_BAD_ARGUMENT );
17 else
18 - rPar.Get( 0 )->PutBool( rPar.Get(1)->IsEmpty() );
19 + {
20 + SbxVariable* pVar = NULL;
21 + if( SbiRuntime::isVBAEnabled() )
22 + pVar = getDefaultProp( rPar.Get(1) );
23 + if ( pVar )
24 + {
25 + pVar->Broadcast( SBX_HINT_DATAWANTED );
26 + rPar.Get( 0 )->PutBool( pVar->IsEmpty() );
27 + }
28 + else
29 + rPar.Get( 0 )->PutBool( rPar.Get(1)->IsEmpty() );
30 + }
33 RTLFUNC(IsError)