summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/ui/app/optsitem.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index f2c2414fdb46..1bded3fdac06 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -89,11 +89,14 @@ SdOptionsGeneric::SdOptionsGeneric(SdOptionsGeneric const & rSource)
SdOptionsGeneric& SdOptionsGeneric::operator=(SdOptionsGeneric const & rSource)
{
- maSubTree = rSource.maSubTree;
- mpCfgItem.reset(rSource.mpCfgItem ? new SdOptionsItem(*rSource.mpCfgItem) : nullptr );
- mbImpress = rSource.mbImpress;
- mbInit = rSource.mbInit;
- mbEnableModify = rSource.mbEnableModify;
+ if (this != &rSource)
+ {
+ maSubTree = rSource.maSubTree;
+ mpCfgItem.reset(rSource.mpCfgItem ? new SdOptionsItem(*rSource.mpCfgItem) : nullptr );
+ mbImpress = rSource.mbImpress;
+ mbInit = rSource.mbInit;
+ mbEnableModify = rSource.mbEnableModify;
+ }
return *this;
}