summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxvar.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 8c5d6571feef..d2c9802c413b 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -282,7 +282,10 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r )
{
SbxValue::operator=( r );
// tdf#144353 - copy information about a missing parameter. See SbiRuntime::SetIsMissing.
- if (r.pInfo && !dynamic_cast<const SbxMethod*>(&r))
+ // We cannot unconditionally assign the data about a variable because we would overwrite
+ // the information about parameters (name, type, flags, and ids). For instance, in the case
+ // where a method will be initialized with a literal.
+ if (!pInfo)
pInfo = r.pInfo;
m_aDeclareClassName = r.m_aDeclareClassName;
m_xComListener = r.m_xComListener;