basic/source/runtime/runtime.cxx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
New commits: commit 5bd5dd4c3ebbb4258fe7c17df1da6b81b016a0e2 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Dec 25 10:51:02 2022 +0000 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Dec 25 11:50:06 2022 +0000 Simplify a bit Change-Id: I2c4df04cc7c57649077f61bfd0bc9fb0e9b42a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144795 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 6a15cb1606e6..3ef617d06e49 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -114,11 +114,8 @@ private: bool SbiRuntime::isVBAEnabled() { - bool bResult = false; SbiInstance* pInst = GetSbData()->pInst; - if ( pInst && GetSbData()->pInst->pRun ) - bResult = pInst->pRun->bVBAEnabled; - return bResult; + return pInst && pInst->pRun && pInst->pRun->bVBAEnabled; } void StarBASIC::SetVBAEnabled( bool bEnabled ) @@ -131,13 +128,7 @@ void StarBASIC::SetVBAEnabled( bool bEnabled ) bool StarBASIC::isVBAEnabled() const { - if ( bDocBasic ) - { - if( SbiRuntime::isVBAEnabled() ) - return true; - return bVBAEnabled; - } - return false; + return bDocBasic && (bVBAEnabled || SbiRuntime::isVBAEnabled()); } struct SbiArgv { // Argv stack: