Hi,

released under LGPLv3

-- Kenneth
From 240f4ce00923fe9487518378972d80e893506d56 Mon Sep 17 00:00:00 2001
From: An Leenders <an@Fluffy.(none)>
Date: Tue, 25 Jan 2011 17:37:59 +0100
Subject: [PATCH] cpp cleanliness: check for assignment to self

---
 extensions/source/abpilot/datasourcehandling.cxx |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index 7da3a77..18108bf 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -357,9 +357,11 @@ namespace abp
     //---------------------------------------------------------------------
     ODataSource& ODataSource::operator=( const ODataSource& _rSource )
     {
-        delete m_pImpl;
-        m_pImpl = new ODataSourceImpl( *_rSource.m_pImpl );
-
+        if( this != &_rSource )
+        {
+            delete m_pImpl;
+            m_pImpl = new ODataSourceImpl( *_rSource.m_pImpl );
+        }
         return *this;
     }
 
-- 
1.7.1

From 4fcdd7f98c2ab2e92fffd9cdcecff1cce714a2c9 Mon Sep 17 00:00:00 2001
From: An Leenders <an@Fluffy.(none)>
Date: Tue, 25 Jan 2011 17:38:19 +0100
Subject: [PATCH] cpp cleanliness: check for assignment to self

---
 svtools/source/control/ruler.cxx |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 340aac4..88e8923 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -193,6 +193,9 @@ ImplRulerData::~ImplRulerData()
 
 ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData )
 {
+    if( this == &rData )
+        return *this;
+
     delete[] pLines;
     delete[] pArrows;
     delete[] pBorders;
-- 
1.7.1

From d42e5db08ce1b5dea39e84fe7239e8c89253a458 Mon Sep 17 00:00:00 2001
From: An Leenders <an@Fluffy.(none)>
Date: Tue, 25 Jan 2011 17:38:06 +0100
Subject: [PATCH] cpp cleanliness: check for assignment to self

---
 lotuswordpro/source/filter/xfilter/xfcell.cxx |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lotuswordpro/source/filter/xfilter/xfcell.cxx b/lotuswordpro/source/filter/xfilter/xfcell.cxx
index b68eddf..cf5ee7d 100644
--- a/lotuswordpro/source/filter/xfilter/xfcell.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfcell.cxx
@@ -95,6 +95,9 @@ XFCell::XFCell(const XFCell& other) : XFContentContainer(other)
 
 XFCell&	XFCell::operator=(const XFCell& other)
 {
+    if( this == &other )
+        return *this;
+
     if( m_pSubTable )
         delete m_pSubTable;
 
-- 
1.7.1

From a2c337bb90947e87dc861ad9f6e36036abe26af2 Mon Sep 17 00:00:00 2001
From: An Leenders <an@Fluffy.(none)>
Date: Tue, 25 Jan 2011 17:38:27 +0100
Subject: [PATCH] cpp cleanliness: check for assignment to self

---
 sw/source/filter/ww8/ww8scan.cxx |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index e05eb2e..13e9f91 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2723,6 +2723,9 @@ WW8PLCFx_Fc_FKP::WW8Fkp::Entry::Entry(const Entry &rEntry)
 WW8PLCFx_Fc_FKP::WW8Fkp::Entry&
     WW8PLCFx_Fc_FKP::WW8Fkp::Entry::operator=(const Entry &rEntry)
 {
+    if (this == &rEntry)
+        return *this;
+
     if (mbMustDelete)
         delete[] mpData;
 
-- 
1.7.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to