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:
ComSmart& operator=( const ComSmart<T>& rObj )
{
if(this == &rObj)
return *this;
OwnRelease();
m_pInterface = rObj.m_pInterface;
......
......@@ -64,6 +64,9 @@ public:
ComSmart& operator=( const ComSmart<T>& rObj )
{
if(this == &rObj)
return *this;
OwnRelease();
m_pInterface = rObj.m_pInterface;
......
......@@ -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;
......
......@@ -62,6 +62,9 @@ MzString::~MzString()
MzString &MzString::operator=(const MzString &s)
{
if(this == &s)
return *this;
int n = s.length();
if (allocate(n))
{
......
......@@ -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;
......
......@@ -69,6 +69,9 @@ ScRefreshTimer::~ScRefreshTimer()
ScRefreshTimer& ScRefreshTimer::operator=( const ScRefreshTimer& r )
{
if(this == &r)
return *this;
SetRefreshControl(nullptr);
AutoTimer::operator=( r );
return *this;
......
......@@ -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)
......
......@@ -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();
......
......@@ -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() )
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -609,6 +609,9 @@ void Task::SetPriority(TaskPriority ePriority)
Task& Task::operator=( const Task& rTask )
{
if(this == &rTask)
return *this;
if ( IsActive() )
Stop();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
......
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