[Libreoffice-commits] core.git: embeddedobj/source embedserv/source formula/source hwpfilter/source sc/source svl/source sw/source vcl/source vcl/unx

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 9 23:06:45 UTC 2019


 embeddedobj/source/msole/olecomponent.cxx    |    3 +++
 embedserv/source/inprocserv/smartpointer.hxx |    3 +++
 formula/source/core/api/token.cxx            |    3 +++
 hwpfilter/source/mzstring.cxx                |    3 +++
 sc/source/core/data/subtotalparam.cxx        |    3 +++
 sc/source/core/tool/refreshtimer.cxx         |    3 +++
 svl/source/misc/sharedstring.cxx             |    3 +++
 sw/source/core/attr/format.cxx               |    3 +++
 sw/source/core/crsr/pam.cxx                  |    3 +++
 sw/source/core/layout/atrfrm.cxx             |    3 +++
 sw/source/core/layout/pagedesc.cxx           |    3 +++
 sw/source/core/txtnode/fmtatr2.cxx           |    3 +++
 vcl/source/app/scheduler.cxx                 |    3 +++
 vcl/source/window/accel.cxx                  |    2 ++
 vcl/source/window/menu.cxx                   |    3 +++
 vcl/unx/generic/printer/jobdata.cxx          |    3 +++
 16 files changed, 47 insertions(+)

New commits:
commit 3a5d78365dd172881c16c03e67f2d170ffc6d7d4
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 9 16:44:34 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Apr 10 01:06:19 2019 +0200

    clang-tidy: Fix suspicious catches of WIP unhandled-self-assignment check
    
    Change-Id: I1cb16b180f4cc5bf4d65485f03c44a06414d3580
    Reviewed-on: https://gerrit.libreoffice.org/70481
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 06f24c9b080c..33b9586173d8 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -96,6 +96,9 @@ public:
 
     ComSmart& operator=( const ComSmart<T>& rObj )
     {
+        if(this == &rObj)
+            return *this;
+
         OwnRelease();
 
         m_pInterface = rObj.m_pInterface;
diff --git a/embedserv/source/inprocserv/smartpointer.hxx b/embedserv/source/inprocserv/smartpointer.hxx
index 2cd19610762c..38750e79ae6d 100644
--- a/embedserv/source/inprocserv/smartpointer.hxx
+++ b/embedserv/source/inprocserv/smartpointer.hxx
@@ -64,6 +64,9 @@ public:
 
     ComSmart& operator=( const ComSmart<T>& rObj )
     {
+        if(this == &rObj)
+            return *this;
+
         OwnRelease();
 
         m_pInterface = rObj.m_pInterface;
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index a80897c280fb..8069863ca503 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -644,6 +644,9 @@ void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
 
 FormulaTokenArray& FormulaTokenArray::operator=( const FormulaTokenArray& rArr )
 {
+    if(this == &rArr)
+        return *this;
+
     Clear();
     Assign( rArr );
     return *this;
diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx
index 96250aa45774..1ffba2d6558d 100644
--- a/hwpfilter/source/mzstring.cxx
+++ b/hwpfilter/source/mzstring.cxx
@@ -62,6 +62,9 @@ MzString::~MzString()
 
 MzString &MzString::operator=(const MzString &s)
 {
+    if(this == &s)
+        return *this;
+
     int n = s.length();
     if (allocate(n))
     {
diff --git a/sc/source/core/data/subtotalparam.cxx b/sc/source/core/data/subtotalparam.cxx
index b4a36aaaf748..5b91e1580f21 100644
--- a/sc/source/core/data/subtotalparam.cxx
+++ b/sc/source/core/data/subtotalparam.cxx
@@ -80,6 +80,9 @@ void ScSubTotalParam::Clear()
 
 ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r )
 {
+    if(this == &r)
+        return *this;
+
     nCol1           = r.nCol1;
     nRow1           = r.nRow1;
     nCol2           = r.nCol2;
diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx
index 72ff16679af6..c466febcee24 100644
--- a/sc/source/core/tool/refreshtimer.cxx
+++ b/sc/source/core/tool/refreshtimer.cxx
@@ -69,6 +69,9 @@ ScRefreshTimer::~ScRefreshTimer()
 
 ScRefreshTimer& ScRefreshTimer::operator=( const ScRefreshTimer& r )
 {
+    if(this == &r)
+        return *this;
+
     SetRefreshControl(nullptr);
     AutoTimer::operator=( r );
     return *this;
diff --git a/svl/source/misc/sharedstring.cxx b/svl/source/misc/sharedstring.cxx
index d3b10af4ddb4..97c22aa72942 100644
--- a/svl/source/misc/sharedstring.cxx
+++ b/svl/source/misc/sharedstring.cxx
@@ -60,6 +60,9 @@ SharedString::~SharedString()
 
 SharedString& SharedString::operator= ( const SharedString& r )
 {
+    if(this == &r)
+        return *this;
+
     if (mpData)
         rtl_uString_release(mpData);
     if (mpDataIgnoreCase)
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index da052acfef0d..af0ebc16bc1c 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -104,6 +104,9 @@ SwFormat::SwFormat( const SwFormat& rFormat ) :
 
 SwFormat &SwFormat::operator=(const SwFormat& rFormat)
 {
+    if(this == &rFormat)
+        return *this;
+
     m_nWhichId = rFormat.m_nWhichId;
     m_nPoolFormatId = rFormat.GetPoolFormatId();
     m_nPoolHelpId = rFormat.GetPoolHelpId();
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index f188f65f5791..c13b7979e501 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -438,6 +438,9 @@ SwPaM::SwPaM(SwPaM const& rPam, SwPaM *const pRing)
 // @@@ semantic: no copy assignment for super class Ring.
 SwPaM &SwPaM::operator=( const SwPaM &rPam )
 {
+    if(this == &rPam)
+        return *this;
+
     *m_pPoint = *( rPam.m_pPoint );
     if ( rPam.HasMark() )
     {
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 9a3020681f9f..7c77560c8e33 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -600,6 +600,9 @@ SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc )
 
 SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy)
 {
+    if(this == &rCpy)
+        return *this;
+
     if (rCpy.GetPageDesc())
         RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc()));
     m_oNumOffset = rCpy.m_oNumOffset;
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index c1559e115600..49933eb472fe 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -90,6 +90,9 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy )
 
 SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc)
 {
+    if(this == &rSrc)
+        return *this;
+
     m_StyleName = rSrc.m_StyleName;
     m_NumType = rSrc.m_NumType;
     m_Master = rSrc.m_Master;
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 3252141d8692..42980e3f7733 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -413,6 +413,9 @@ SwFormatRuby::~SwFormatRuby()
 
 SwFormatRuby& SwFormatRuby::operator=( const SwFormatRuby& rAttr )
 {
+    if(this == &rAttr)
+        return *this;
+
     m_sRubyText = rAttr.m_sRubyText;
     m_sCharFormatName = rAttr.m_sCharFormatName;
     m_nCharFormatId = rAttr.m_nCharFormatId;
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index c2a3b07d4d3a..23bba5d7a25e 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -609,6 +609,9 @@ void Task::SetPriority(TaskPriority ePriority)
 
 Task& Task::operator=( const Task& rTask )
 {
+    if(this == &rTask)
+        return *this;
+
     if ( IsActive() )
         Stop();
 
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 3a5e31baf8d2..0b16a053730f 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -281,6 +281,8 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
 
 Accelerator& Accelerator::operator=( const Accelerator& rAccel )
 {
+    if(this == &rAccel)
+        return *this;
 
     // assign new data
     maCurKeyCode    = vcl::KeyCode();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 9d7c5cc9e3d2..516d5930d183 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1166,6 +1166,9 @@ OString Menu::GetHelpId( sal_uInt16 nItemId ) const
 
 Menu& Menu::operator=( const Menu& rMenu )
 {
+    if(this == &rMenu)
+        return *this;
+
     // clean up
     Clear();
 
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 8f2b0018ca07..02d10cf48077 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -29,6 +29,9 @@ using namespace psp;
 
 JobData& JobData::operator=(const JobData& rRight)
 {
+    if(this == &rRight)
+        return *this;
+
     m_nCopies               = rRight.m_nCopies;
     m_bCollate              = rRight.m_bCollate;
     m_nLeftMarginAdjust     = rRight.m_nLeftMarginAdjust;


More information about the Libreoffice-commits mailing list