diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-10-17 22:20:43 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-10-17 22:22:16 +0200 |
commit | 1d43c71138b6bbc83a7ea592bbeff416002902a5 (patch) | |
tree | f4bf88ce5f4b8571311dc98bcbc54457c69025e0 /lotuswordpro | |
parent | 4e38096b88817576753c70e2b5219c399a941c9b (diff) |
cppcheck fix : 'operator=' should check for assignment to selfw
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfrowstyle.cxx | 23 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfrowstyle.hxx | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx b/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx index d522a0c04db8..5027c7a63645 100644 --- a/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx @@ -100,19 +100,22 @@ void XFRowStyle::ToXml(IXFStream *pStrm) pStrm->EndElement( A2OUSTR("style:style") ); } -XFRowStyle& XFRowStyle::operator=(XFRowStyle& other) +XFRowStyle& XFRowStyle::operator=(XFRowStyle const &other) { - m_fHeight = other.m_fHeight; - m_fMinHeight = other.m_fMinHeight; - m_aBackColor = other.m_aBackColor; + if (this != &other) + { + m_fHeight = other.m_fHeight; + m_fMinHeight = other.m_fMinHeight; + m_aBackColor = other.m_aBackColor; - if( m_pBGImage ) - delete m_pBGImage; + if( m_pBGImage ) + delete m_pBGImage; - if( other.m_pBGImage ) - m_pBGImage = new XFBGImage(*other.m_pBGImage); - else - m_pBGImage = NULL; + if( other.m_pBGImage ) + m_pBGImage = new XFBGImage(*other.m_pBGImage); + else + m_pBGImage = NULL; + } return *this; } diff --git a/lotuswordpro/source/filter/xfilter/xfrowstyle.hxx b/lotuswordpro/source/filter/xfilter/xfrowstyle.hxx index f97aca90fe41..38aa6491a6f5 100644 --- a/lotuswordpro/source/filter/xfilter/xfrowstyle.hxx +++ b/lotuswordpro/source/filter/xfilter/xfrowstyle.hxx @@ -69,7 +69,7 @@ class XFRowStyle : public XFStyle { public: XFRowStyle(); - XFRowStyle& operator=(XFRowStyle& other); + XFRowStyle& operator=(XFRowStyle const &other); public: void SetRowHeight(double height); |