diff options
Diffstat (limited to 'basic/source/runtime/runtime.cxx')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index c8131460accf..f111c65fdb52 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1337,14 +1337,12 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) // I dumbly follow the pattern :-/ if ( bVBAEnabled && ( p1->IsNull() || p2->IsNull() ) ) { - static SbxVariable* pNULL = nullptr; - - if( !pNULL ) - { - pNULL = new SbxVariable; - pNULL->PutNull(); - pNULL->AddFirstRef(); - } + static SbxVariable* pNULL = [&]() { + SbxVariable* p = new SbxVariable; + p->PutNull(); + p->AddFirstRef(); + return p; + }(); PushVar( pNULL ); } else if( p2->Compare( eOp, *p1 ) ) |