[Libreoffice-commits] core.git: filter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 16 05:41:50 UTC 2019


 filter/source/graphicfilter/icgm/elements.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 8718c42d3010e39564b588298a313e516388ce02
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Mar 10 09:55:42 2019 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Mar 16 06:41:30 2019 +0100

    Help cppcheck on filter/icgm/elements + optimize a bit operator =
    
    cppcheck:
    Avoid 'operator=' should return reference to 'this' instance.
    
    Change-Id: Iac146fe31b2cebc8e4f4c74d79ad98625db04637
    Reviewed-on: https://gerrit.libreoffice.org/69004
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/filter/source/graphicfilter/icgm/elements.cxx b/filter/source/graphicfilter/icgm/elements.cxx
index 915edc363630..8061d399537a 100644
--- a/filter/source/graphicfilter/icgm/elements.cxx
+++ b/filter/source/graphicfilter/icgm/elements.cxx
@@ -34,6 +34,9 @@ CGMElements::~CGMElements()
 
 CGMElements& CGMElements::operator=( const CGMElements& rSource )
 {
+    if (this == &rSource)
+        return *this;
+
     sal_uInt32 nIndex;
 
     nVDCIntegerPrecision = rSource.nVDCIntegerPrecision;
@@ -125,7 +128,7 @@ CGMElements& CGMElements::operator=( const CGMElements& rSource )
 
     maHatchMap = rSource.maHatchMap;
     bSegmentCount = rSource.bSegmentCount;
-    return (*this);
+    return *this;
 }
 
 


More information about the Libreoffice-commits mailing list