Check for assignment to self for =operator

Change-Id: I88369c1b0c6f261e8350d196b56acdc8f8f61ce8
This commit is contained in:
Julien Nabet 2012-07-14 19:48:09 +02:00
parent 938824ca84
commit 528b406bc2

View file

@ -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;