summaryrefslogtreecommitdiffstats
path: root/basic/source/runtime/runtime.cxx
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-10-22 20:00:01 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2021-10-25 13:22:09 +0200
commitf9ce4b2d04b58843d7986acd9382864b0b30d617 (patch)
treea0f1ef800cc400547b92e535293cbe514d0320f3 /basic/source/runtime/runtime.cxx
parentUpdate git submodules (diff)
downloadcore-f9ce4b2d04b58843d7986acd9382864b0b30d617.tar.gz
core-f9ce4b2d04b58843d7986acd9382864b0b30d617.zip
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: Id383e03925956056931d199fe86d1b352cf8e4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124075 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basic/source/runtime/runtime.cxx')
-rw-r--r--basic/source/runtime/runtime.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 2d7b988d7647..b6e64fbb3c35 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3754,9 +3754,17 @@ 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