Kaydet (Commit) 528b406b authored tarafından Julien Nabet's avatar Julien Nabet

Check for assignment to self for =operator

Change-Id: I88369c1b0c6f261e8350d196b56acdc8f8f61ce8
üst 938824ca
...@@ -134,6 +134,9 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other) : XFStyle(other) ...@@ -134,6 +134,9 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other) : XFStyle(other)
XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other) XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
{ {
// Check for self-assignment
if (this == &other)
return *this;
m_strParentStyleName = other.m_strParentStyleName; m_strParentStyleName = other.m_strParentStyleName;
m_nFlag = other.m_nFlag; m_nFlag = other.m_nFlag;
m_eAlignType = other.m_eAlignType; m_eAlignType = other.m_eAlignType;
......
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