summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-12-25 10:51:02 +0000
committerMike Kaganski <mike.kaganski@collabora.com>2022-12-25 11:50:06 +0000
commit5bd5dd4c3ebbb4258fe7c17df1da6b81b016a0e2 (patch)
treea6ee24112168ff37525bf95c6e05d290c133f12b /basic
parent24b969d10cd81e6f5eb438ded075dd330a1cde29 (diff)
Simplify a bit
Change-Id: I2c4df04cc7c57649077f61bfd0bc9fb0e9b42a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144795 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/runtime.cxx13
1 files changed, 2 insertions, 11 deletions
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: