Kaydet (Commit) 3a5d7836 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

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: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 8e9de1ad
...@@ -96,6 +96,9 @@ public: ...@@ -96,6 +96,9 @@ public:
ComSmart& operator=( const ComSmart<T>& rObj ) ComSmart& operator=( const ComSmart<T>& rObj )
{ {
if(this == &rObj)
return *this;
OwnRelease(); OwnRelease();
m_pInterface = rObj.m_pInterface; m_pInterface = rObj.m_pInterface;
......
...@@ -64,6 +64,9 @@ public: ...@@ -64,6 +64,9 @@ public:
ComSmart& operator=( const ComSmart<T>& rObj ) ComSmart& operator=( const ComSmart<T>& rObj )
{ {
if(this == &rObj)
return *this;
OwnRelease(); OwnRelease();
m_pInterface = rObj.m_pInterface; m_pInterface = rObj.m_pInterface;
......
...@@ -644,6 +644,9 @@ void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens ) ...@@ -644,6 +644,9 @@ void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
FormulaTokenArray& FormulaTokenArray::operator=( const FormulaTokenArray& rArr ) FormulaTokenArray& FormulaTokenArray::operator=( const FormulaTokenArray& rArr )
{ {
if(this == &rArr)
return *this;
Clear(); Clear();
Assign( rArr ); Assign( rArr );
return *this; return *this;
......
...@@ -62,6 +62,9 @@ MzString::~MzString() ...@@ -62,6 +62,9 @@ MzString::~MzString()
MzString &MzString::operator=(const MzString &s) MzString &MzString::operator=(const MzString &s)
{ {
if(this == &s)
return *this;
int n = s.length(); int n = s.length();
if (allocate(n)) if (allocate(n))
{ {
......
...@@ -80,6 +80,9 @@ void ScSubTotalParam::Clear() ...@@ -80,6 +80,9 @@ void ScSubTotalParam::Clear()
ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r ) ScSubTotalParam& ScSubTotalParam::operator=( const ScSubTotalParam& r )
{ {
if(this == &r)
return *this;
nCol1 = r.nCol1; nCol1 = r.nCol1;
nRow1 = r.nRow1; nRow1 = r.nRow1;
nCol2 = r.nCol2; nCol2 = r.nCol2;
......
...@@ -69,6 +69,9 @@ ScRefreshTimer::~ScRefreshTimer() ...@@ -69,6 +69,9 @@ ScRefreshTimer::~ScRefreshTimer()
ScRefreshTimer& ScRefreshTimer::operator=( const ScRefreshTimer& r ) ScRefreshTimer& ScRefreshTimer::operator=( const ScRefreshTimer& r )
{ {
if(this == &r)
return *this;
SetRefreshControl(nullptr); SetRefreshControl(nullptr);
AutoTimer::operator=( r ); AutoTimer::operator=( r );
return *this; return *this;
......
...@@ -60,6 +60,9 @@ SharedString::~SharedString() ...@@ -60,6 +60,9 @@ SharedString::~SharedString()
SharedString& SharedString::operator= ( const SharedString& r ) SharedString& SharedString::operator= ( const SharedString& r )
{ {
if(this == &r)
return *this;
if (mpData) if (mpData)
rtl_uString_release(mpData); rtl_uString_release(mpData);
if (mpDataIgnoreCase) if (mpDataIgnoreCase)
......
...@@ -104,6 +104,9 @@ SwFormat::SwFormat( const SwFormat& rFormat ) : ...@@ -104,6 +104,9 @@ SwFormat::SwFormat( const SwFormat& rFormat ) :
SwFormat &SwFormat::operator=(const SwFormat& rFormat) SwFormat &SwFormat::operator=(const SwFormat& rFormat)
{ {
if(this == &rFormat)
return *this;
m_nWhichId = rFormat.m_nWhichId; m_nWhichId = rFormat.m_nWhichId;
m_nPoolFormatId = rFormat.GetPoolFormatId(); m_nPoolFormatId = rFormat.GetPoolFormatId();
m_nPoolHelpId = rFormat.GetPoolHelpId(); m_nPoolHelpId = rFormat.GetPoolHelpId();
......
...@@ -438,6 +438,9 @@ SwPaM::SwPaM(SwPaM const& rPam, SwPaM *const pRing) ...@@ -438,6 +438,9 @@ SwPaM::SwPaM(SwPaM const& rPam, SwPaM *const pRing)
// @@@ semantic: no copy assignment for super class Ring. // @@@ semantic: no copy assignment for super class Ring.
SwPaM &SwPaM::operator=( const SwPaM &rPam ) SwPaM &SwPaM::operator=( const SwPaM &rPam )
{ {
if(this == &rPam)
return *this;
*m_pPoint = *( rPam.m_pPoint ); *m_pPoint = *( rPam.m_pPoint );
if ( rPam.HasMark() ) if ( rPam.HasMark() )
{ {
......
...@@ -600,6 +600,9 @@ SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc ) ...@@ -600,6 +600,9 @@ SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc )
SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy) SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy)
{ {
if(this == &rCpy)
return *this;
if (rCpy.GetPageDesc()) if (rCpy.GetPageDesc())
RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc())); RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc()));
m_oNumOffset = rCpy.m_oNumOffset; m_oNumOffset = rCpy.m_oNumOffset;
......
...@@ -90,6 +90,9 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) ...@@ -90,6 +90,9 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy )
SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc) SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc)
{ {
if(this == &rSrc)
return *this;
m_StyleName = rSrc.m_StyleName; m_StyleName = rSrc.m_StyleName;
m_NumType = rSrc.m_NumType; m_NumType = rSrc.m_NumType;
m_Master = rSrc.m_Master; m_Master = rSrc.m_Master;
......
...@@ -413,6 +413,9 @@ SwFormatRuby::~SwFormatRuby() ...@@ -413,6 +413,9 @@ SwFormatRuby::~SwFormatRuby()
SwFormatRuby& SwFormatRuby::operator=( const SwFormatRuby& rAttr ) SwFormatRuby& SwFormatRuby::operator=( const SwFormatRuby& rAttr )
{ {
if(this == &rAttr)
return *this;
m_sRubyText = rAttr.m_sRubyText; m_sRubyText = rAttr.m_sRubyText;
m_sCharFormatName = rAttr.m_sCharFormatName; m_sCharFormatName = rAttr.m_sCharFormatName;
m_nCharFormatId = rAttr.m_nCharFormatId; m_nCharFormatId = rAttr.m_nCharFormatId;
......
...@@ -609,6 +609,9 @@ void Task::SetPriority(TaskPriority ePriority) ...@@ -609,6 +609,9 @@ void Task::SetPriority(TaskPriority ePriority)
Task& Task::operator=( const Task& rTask ) Task& Task::operator=( const Task& rTask )
{ {
if(this == &rTask)
return *this;
if ( IsActive() ) if ( IsActive() )
Stop(); Stop();
......
...@@ -281,6 +281,8 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const ...@@ -281,6 +281,8 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
Accelerator& Accelerator::operator=( const Accelerator& rAccel ) Accelerator& Accelerator::operator=( const Accelerator& rAccel )
{ {
if(this == &rAccel)
return *this;
// assign new data // assign new data
maCurKeyCode = vcl::KeyCode(); maCurKeyCode = vcl::KeyCode();
......
...@@ -1166,6 +1166,9 @@ OString Menu::GetHelpId( sal_uInt16 nItemId ) const ...@@ -1166,6 +1166,9 @@ OString Menu::GetHelpId( sal_uInt16 nItemId ) const
Menu& Menu::operator=( const Menu& rMenu ) Menu& Menu::operator=( const Menu& rMenu )
{ {
if(this == &rMenu)
return *this;
// clean up // clean up
Clear(); Clear();
......
...@@ -29,6 +29,9 @@ using namespace psp; ...@@ -29,6 +29,9 @@ using namespace psp;
JobData& JobData::operator=(const JobData& rRight) JobData& JobData::operator=(const JobData& rRight)
{ {
if(this == &rRight)
return *this;
m_nCopies = rRight.m_nCopies; m_nCopies = rRight.m_nCopies;
m_bCollate = rRight.m_bCollate; m_bCollate = rRight.m_bCollate;
m_nLeftMarginAdjust = rRight.m_nLeftMarginAdjust; m_nLeftMarginAdjust = rRight.m_nLeftMarginAdjust;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment