summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-22 09:32:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-22 12:54:08 +0200
commite5e0cc68f70d35e1849aeaf21c0ce68afd6a1f59 (patch)
treeb4bce95d15819feb2c38e183c3ccdcbab76db60c /basic
parentfd56d5fd409c832886bf42a020322e69b6a35d9e (diff)
pvs-studio: V794 The assignment operator should be protected
Change-Id: Ia443a0e61a091d877c8da26bf7d45bf4261f8669 Reviewed-on: https://gerrit.libreoffice.org/62166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxvar.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 3759da581907..ec67be889e3a 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -333,17 +333,20 @@ sal_uInt16 SbxVariable::MakeHashCode( const OUString& rName )
SbxVariable& SbxVariable::operator=( const SbxVariable& r )
{
- SbxValue::operator=( r );
- mpImpl.reset();
- if( r.mpImpl != nullptr )
+ if (this != &r)
{
- mpImpl.reset( new SbxVariableImpl( *r.mpImpl ) );
-#if HAVE_FEATURE_SCRIPTING
- if( mpImpl->m_xComListener.is() )
+ SbxValue::operator=( r );
+ mpImpl.reset();
+ if( r.mpImpl != nullptr )
{
- registerComListenerVariableForBasic( this, mpImpl->m_pComListenerParentBasic );
- }
+ mpImpl.reset( new SbxVariableImpl( *r.mpImpl ) );
+#if HAVE_FEATURE_SCRIPTING
+ if( mpImpl->m_xComListener.is() )
+ {
+ registerComListenerVariableForBasic( this, mpImpl->m_pComListenerParentBasic );
+ }
#endif
+ }
}
return *this;
}