Check for assignment to self for =operator
Change-Id: I88369c1b0c6f261e8350d196b56acdc8f8f61ce8
This commit is contained in:
parent
938824ca84
commit
528b406bc2
1 changed files with 3 additions and 0 deletions
|
@ -134,6 +134,9 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other) : XFStyle(other)
|
|||
|
||||
XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
|
||||
{
|
||||
// Check for self-assignment
|
||||
if (this == &other)
|
||||
return *this;
|
||||
m_strParentStyleName = other.m_strParentStyleName;
|
||||
m_nFlag = other.m_nFlag;
|
||||
m_eAlignType = other.m_eAlignType;
|
||||
|
|
Loading…
Reference in a new issue