From e5e0cc68f70d35e1849aeaf21c0ce68afd6a1f59 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 22 Oct 2018 09:32:39 +0100 Subject: pvs-studio: V794 The assignment operator should be protected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia443a0e61a091d877c8da26bf7d45bf4261f8669 Reviewed-on: https://gerrit.libreoffice.org/62166 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sd/source/ui/app/optsitem.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sd') 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; } -- cgit v1.2.3