diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-10-26 21:03:41 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-10-27 09:29:34 +0200 |
commit | 7d27e4b0257a8a927d3b59edcd549ff9103cbaa9 (patch) | |
tree | 530de5ddcfa682122b6796063c690747ab3ccd04 /basic/source | |
parent | 12c6b1ef6a824b09778163ec83fc44bb196e65db (diff) |
tdf#57308 - Basic IDE: Watching of a variable does not work
Watching a variable which returns a value from a function always shows
"out of scope" in the watch window of the Basic IDE. In order to resolve
this issue, the name of the variable being watched will be searched also
in the current method instance.
Change-Id: I5ff6ce22067e11d74275eeb82da814da1eebe3db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124239
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 2d7b988d7647..11699093e022 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3754,11 +3754,20 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName ) } if ( !pElem && pMeth ) { - // for statics, set the method's name in front - OUString aMethName = pMeth->GetName() + ":" + rName; - pElem = pMod->Find(aMethName, SbxClassType::DontCare); + const OUString aMethName = pMeth->GetName(); + // tdf#57308 - check if the name is the current method instance + if (pMeth->GetName() == rName) + { + pElem = pMeth; + } + else + { + // for statics, set the method's name in front + pElem = pMod->Find(aMethName + ":" + rName, SbxClassType::DontCare); + } } + // search in parameter list if( !pElem && pMeth ) { |