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

clang-tidy: Silence warnings from WIP unhandled-self-assignment check

Where it can be done by removing useless / duplicate code.
For XFListStyle I removed the copy operator entirely, because it
was bugous and it seems not to be used anyway.

Change-Id: Iba0eb0d5c45b42f0e78be466c617acdc1216eb22
Reviewed-on: https://gerrit.libreoffice.org/70482Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 835ddd98
......@@ -1549,14 +1549,7 @@ WpBase::WpBase(const WpBase& aWrapper)
//inline
WpBase& WpBase::operator=(const WpBase& rhs)
{
if (rhs.pIUnknown != pIUnknown)
{
if (pIUnknown)
pIUnknown->Release();
pIUnknown = rhs.pIUnknown;
if (pIUnknown)
pIUnknown->AddRef();
}
operator=(rhs.pIUnknown);
return *this;
};
......
......@@ -850,15 +850,8 @@ void ONDXPagePtr::Clear()
ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr const & rOther)
{
if (rOther.mpPage != nullptr) {
rOther.mpPage->AddNextRef();
}
ONDXPage * pOldObj = mpPage;
mpPage = rOther.mpPage;
nPagePos = rOther.nPagePos;
if (pOldObj != nullptr) {
pOldObj->ReleaseRef();
}
ONDXPagePtr aTemp(rOther);
*this = std::move(aTemp);
return *this;
}
......
......@@ -237,7 +237,7 @@ class VCL_DLLPUBLIC PPDContext
public:
PPDContext();
PPDContext( const PPDContext& rContext ) { operator=( rContext ); }
PPDContext& operator=( const PPDContext& rContext );
PPDContext& operator=( const PPDContext& rContext ) = default;
PPDContext& operator=( PPDContext&& rContext );
void setParser( const PPDParser* );
......
......@@ -190,7 +190,7 @@ public:
XFListStyle(const XFListStyle& other);
XFListStyle& operator=(const XFListStyle& other);
XFListStyle& operator=(const XFListStyle& other) = delete;
virtual ~XFListStyle() override;
......
......@@ -185,27 +185,6 @@ XFListStyle::XFListStyle(const XFListStyle& other):XFStyle(other)
}
}
XFListStyle& XFListStyle::operator=(const XFListStyle& other)
{
for( int i=0; i<10; i++ )
{
const enumXFListLevel type = other.m_pListLevels[i]->m_eListType;
if( type == enumXFListLevelNumber )
{
XFListlevelNumber *pNum = static_cast<XFListlevelNumber*>(m_pListLevels[i].get());
m_pListLevels[i].reset(new XFListlevelNumber(*pNum));
}
else if( type == enumXFListLevelBullet )
{
XFListLevelBullet *pBullet = static_cast<XFListLevelBullet*>(m_pListLevels[i].get());
m_pListLevels[i].reset(new XFListLevelBullet(*pBullet));
}
else
m_pListLevels[i].reset();
}
return *this;
}
XFListStyle::~XFListStyle()
{
}
......
......@@ -2363,13 +2363,7 @@ public:
MatrixOpWrapper( const MatrixOpWrapper& r ) : mrMat(r.mrMat), pos(r.pos), mpOp(r.mpOp) {}
MatrixOpWrapper& operator= ( const MatrixOpWrapper& r )
{
mrMat = r.mrMat;
pos = r.pos;
mpOp = r.mpOp;
return *this;
}
MatrixOpWrapper& operator= ( const MatrixOpWrapper& r ) = default;
void operator()(const MatrixImplType::element_block_node_type& node)
{
......
......@@ -3005,12 +3005,7 @@ class CSSHandler
MemStr() : mp(nullptr), mn(0) {}
MemStr(const char* p, size_t n) : mp(p), mn(n) {}
MemStr& operator=(const MemStr& r)
{
mp = r.mp;
mn = r.mn;
return *this;
}
MemStr& operator=(const MemStr& r) = default;
};
MemStr maPropName; /// current property name.
......
......@@ -515,8 +515,7 @@ SwPageDescExt & SwPageDescExt::operator = (const SwPageDesc & rSrc)
SwPageDescExt & SwPageDescExt::operator = (const SwPageDescExt & rSrc)
{
SetPageDesc(rSrc.m_PageDesc);
operator=(rSrc.m_PageDesc);
return *this;
}
......
......@@ -561,16 +561,8 @@ OpenGLTexture::operator bool() const
OpenGLTexture& OpenGLTexture::operator=(const OpenGLTexture& rTexture)
{
if (rTexture.mpImpl)
rTexture.mpImpl->IncreaseRefCount(rTexture.mnSlotNumber);
if (mpImpl)
mpImpl->DecreaseRefCount(mnSlotNumber);
maRect = rTexture.maRect;
mpImpl = rTexture.mpImpl;
mnSlotNumber = rTexture.mnSlotNumber;
OpenGLTexture aTemp(rTexture);
*this = std::move(aTemp);
return *this;
}
......
......@@ -1637,13 +1637,6 @@ PPDContext::PPDContext() :
{
}
PPDContext& PPDContext::operator=( const PPDContext& rCopy )
{
m_pParser = rCopy.m_pParser;
m_aCurrentValues = rCopy.m_aCurrentValues;
return *this;
}
PPDContext& PPDContext::operator=( PPDContext&& rCopy )
{
std::swap(m_pParser, rCopy.m_pParser);
......
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