[Libreoffice-commits] .: lotuswordpro/source

Julien Nabet serval2412 at kemper.freedesktop.org
Mon Oct 17 13:21:44 PDT 2011


 lotuswordpro/source/filter/xfilter/xfrowstyle.cxx |   23 ++++++++++++----------
 lotuswordpro/source/filter/xfilter/xfrowstyle.hxx |    2 -
 2 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 1d43c71138b6bbc83a7ea592bbeff416002902a5
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Oct 17 22:20:43 2011 +0200

    cppcheck fix : 'operator=' should check for assignment to selfw

diff --git a/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx b/lotuswordpro/source/filter/xfilter/xfrowstyle.cxx
index d522a0c..5027c7a 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 f97aca9..38aa649 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);


More information about the Libreoffice-commits mailing list