[Libreoffice-commits] core.git: connectivity/source include/vcl lotuswordpro/inc lotuswordpro/source sc/source sw/source vcl/opengl vcl/unx

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 10 10:18:55 UTC 2019


 connectivity/source/drivers/ado/Awrapado.cxx       |    9 +--------
 connectivity/source/drivers/dbase/dindexnode.cxx   |   11 ++---------
 include/vcl/ppdparser.hxx                          |    2 +-
 lotuswordpro/inc/xfilter/xfliststyle.hxx           |    2 +-
 lotuswordpro/source/filter/xfilter/xfliststyle.cxx |   21 ---------------------
 sc/source/core/tool/scmatrix.cxx                   |    8 +-------
 sc/source/filter/html/htmlpars.cxx                 |    7 +------
 sw/source/core/layout/pagedesc.cxx                 |    3 +--
 vcl/opengl/texture.cxx                             |   12 ++----------
 vcl/unx/generic/printer/ppdparser.cxx              |    7 -------
 10 files changed, 10 insertions(+), 72 deletions(-)

New commits:
commit adfba503c792fdbd4748d6680c2dd8d8d5bb0d69
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 9 16:43:39 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Apr 10 12:18:24 2019 +0200

    clang-tidy: Silence warnings from WIP unhandled-self-assignment check
    
    Where it can be done by removing useless / duplicate code.
    For XFListStyle I removed the copy operator entirely, because it
    was bugous and it seems not to be used anyway.
    
    Change-Id: Iba0eb0d5c45b42f0e78be466c617acdc1216eb22
    Reviewed-on: https://gerrit.libreoffice.org/70482
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index 1344fed82a66..1fc664f89a5a 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -1549,14 +1549,7 @@ WpBase::WpBase(const WpBase& aWrapper)
 //inline
 WpBase& WpBase::operator=(const WpBase& rhs)
 {
-    if (rhs.pIUnknown != pIUnknown)
-    {
-        if (pIUnknown)
-            pIUnknown->Release();
-        pIUnknown = rhs.pIUnknown;
-        if (pIUnknown)
-            pIUnknown->AddRef();
-    }
+    operator=(rhs.pIUnknown);
     return *this;
 };
 
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 3278f195a369..8b4fd49fb54d 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -850,15 +850,8 @@ void ONDXPagePtr::Clear()
 
 ONDXPagePtr& ONDXPagePtr::operator=(ONDXPagePtr const & rOther)
 {
-    if (rOther.mpPage != nullptr) {
-        rOther.mpPage->AddNextRef();
-    }
-    ONDXPage * pOldObj = mpPage;
-    mpPage = rOther.mpPage;
-    nPagePos = rOther.nPagePos;
-    if (pOldObj != nullptr) {
-        pOldObj->ReleaseRef();
-    }
+    ONDXPagePtr aTemp(rOther);
+    *this = std::move(aTemp);
     return *this;
 }
 
diff --git a/include/vcl/ppdparser.hxx b/include/vcl/ppdparser.hxx
index 19ff9cd7cb76..71a17dcc70f5 100644
--- a/include/vcl/ppdparser.hxx
+++ b/include/vcl/ppdparser.hxx
@@ -237,7 +237,7 @@ class VCL_DLLPUBLIC PPDContext
 public:
     PPDContext();
     PPDContext( const PPDContext& rContext ) { operator=( rContext ); }
-    PPDContext& operator=( const PPDContext& rContext );
+    PPDContext& operator=( const PPDContext& rContext ) = default;
     PPDContext& operator=( PPDContext&& rContext );
 
     void setParser( const PPDParser* );
diff --git a/lotuswordpro/inc/xfilter/xfliststyle.hxx b/lotuswordpro/inc/xfilter/xfliststyle.hxx
index f4abb93a5b10..3cde9644a612 100644
--- a/lotuswordpro/inc/xfilter/xfliststyle.hxx
+++ b/lotuswordpro/inc/xfilter/xfliststyle.hxx
@@ -190,7 +190,7 @@ public:
 
     XFListStyle(const XFListStyle& other);
 
-    XFListStyle& operator=(const XFListStyle& other);
+    XFListStyle& operator=(const XFListStyle& other) = delete;
 
     virtual ~XFListStyle() override;
 
diff --git a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
index 85db3c77a973..5205020784d4 100644
--- a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
@@ -185,27 +185,6 @@ XFListStyle::XFListStyle(const XFListStyle& other):XFStyle(other)
     }
 }
 
-XFListStyle& XFListStyle::operator=(const XFListStyle& other)
-{
-    for( int i=0; i<10; i++ )
-    {
-        const enumXFListLevel type = other.m_pListLevels[i]->m_eListType;
-        if( type == enumXFListLevelNumber )
-        {
-            XFListlevelNumber *pNum = static_cast<XFListlevelNumber*>(m_pListLevels[i].get());
-            m_pListLevels[i].reset(new XFListlevelNumber(*pNum));
-        }
-        else if( type == enumXFListLevelBullet )
-        {
-            XFListLevelBullet *pBullet = static_cast<XFListLevelBullet*>(m_pListLevels[i].get());
-            m_pListLevels[i].reset(new XFListLevelBullet(*pBullet));
-        }
-        else
-            m_pListLevels[i].reset();
-    }
-    return *this;
-}
-
 XFListStyle::~XFListStyle()
 {
 }
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 97822e9909ed..0291c84a04d7 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -2363,13 +2363,7 @@ public:
 
     MatrixOpWrapper( const MatrixOpWrapper& r ) : mrMat(r.mrMat), pos(r.pos), mpOp(r.mpOp) {}
 
-    MatrixOpWrapper& operator= ( const MatrixOpWrapper& r )
-    {
-        mrMat = r.mrMat;
-        pos = r.pos;
-        mpOp = r.mpOp;
-        return *this;
-    }
+    MatrixOpWrapper& operator= ( const MatrixOpWrapper& r ) = default;
 
     void operator()(const MatrixImplType::element_block_node_type& node)
     {
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index bfd2241760b5..c5a95c636e62 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -3005,12 +3005,7 @@ class CSSHandler
 
         MemStr() : mp(nullptr), mn(0) {}
         MemStr(const char* p, size_t n) : mp(p), mn(n) {}
-        MemStr& operator=(const MemStr& r)
-        {
-            mp = r.mp;
-            mn = r.mn;
-            return *this;
-        }
+        MemStr& operator=(const MemStr& r) = default;
     };
 
     MemStr maPropName;  /// current property name.
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 49933eb472fe..2e3a122655e6 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -515,8 +515,7 @@ SwPageDescExt & SwPageDescExt::operator = (const SwPageDesc & rSrc)
 
 SwPageDescExt & SwPageDescExt::operator = (const SwPageDescExt & rSrc)
 {
-    SetPageDesc(rSrc.m_PageDesc);
-
+    operator=(rSrc.m_PageDesc);
     return *this;
 }
 
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 2862cce52352..6536141c8134 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -561,16 +561,8 @@ OpenGLTexture::operator bool() const
 
 OpenGLTexture& OpenGLTexture::operator=(const OpenGLTexture& rTexture)
 {
-    if (rTexture.mpImpl)
-        rTexture.mpImpl->IncreaseRefCount(rTexture.mnSlotNumber);
-
-    if (mpImpl)
-        mpImpl->DecreaseRefCount(mnSlotNumber);
-
-    maRect = rTexture.maRect;
-    mpImpl = rTexture.mpImpl;
-    mnSlotNumber = rTexture.mnSlotNumber;
-
+    OpenGLTexture aTemp(rTexture);
+    *this = std::move(aTemp);
     return *this;
 }
 
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index aa99e3638580..d5b9e7152ffe 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1637,13 +1637,6 @@ PPDContext::PPDContext() :
 {
 }
 
-PPDContext& PPDContext::operator=( const PPDContext& rCopy )
-{
-    m_pParser           = rCopy.m_pParser;
-    m_aCurrentValues    = rCopy.m_aCurrentValues;
-    return *this;
-}
-
 PPDContext& PPDContext::operator=( PPDContext&& rCopy )
 {
     std::swap(m_pParser, rCopy.m_pParser);


More information about the Libreoffice-commits mailing list