diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-22 09:32:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-22 12:54:08 +0200 |
commit | e5e0cc68f70d35e1849aeaf21c0ce68afd6a1f59 (patch) | |
tree | b4bce95d15819feb2c38e183c3ccdcbab76db60c /shell | |
parent | fd56d5fd409c832886bf42a020322e69b6a35d9e (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 'shell')
-rw-r--r-- | shell/source/win32/shlxthandler/ooofilt/propspec.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx index ed44bb8b22b9..f96d363d6542 100644 --- a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx @@ -111,12 +111,16 @@ CFullPropSpec::CFullPropSpec( CFullPropSpec const & src ) : CFullPropSpec & CFullPropSpec::operator=( CFullPropSpec const & Property ) { - // Clean up. - this->CFullPropSpec::~CFullPropSpec(); + if (this != &Property) + { + // Clean up. + this->CFullPropSpec::~CFullPropSpec(); - ::new (this) CFullPropSpec( Property ); + ::new (this) CFullPropSpec( Property ); + } return *this; } + CFullPropSpec::~CFullPropSpec() { if ( _psProperty.ulKind == PRSPEC_LPWSTR && @@ -125,6 +129,7 @@ CFullPropSpec::~CFullPropSpec() CoTaskMemFree( _psProperty.lpwstr ); } } + void CFullPropSpec::SetProperty( PROPID pidProperty ) { if ( _psProperty.ulKind == PRSPEC_LPWSTR && |