[Libreoffice-commits] core.git: 3 commits - l10ntools/inc l10ntools/source o3tl/qa

Caolán McNamara caolanm at redhat.com
Mon Sep 12 13:23:20 UTC 2016


 l10ntools/inc/po.hxx            |    1 +
 l10ntools/source/po.cxx         |   15 ++++++++-------
 o3tl/qa/cow_wrapper_clients.cxx |   24 ++++++++++++++++++++++++
 o3tl/qa/cow_wrapper_clients.hxx |    4 ++++
 4 files changed, 37 insertions(+), 7 deletions(-)

New commits:
commit 24731174015d04b7acb5041fdc836dd74f9313a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 12 11:19:39 2016 +0100

    coverity#1371323 Missing move assignment operator
    
    Change-Id: I806cb0a1ede9c025c00fab58a3fd8835887c0a44

diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index ff8567e..ce39259 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -51,6 +51,7 @@ public:
 
                     PoEntry( const PoEntry& rPo );
     PoEntry&        operator=( const PoEntry& rPo );
+    PoEntry&        operator=( PoEntry&& rPo );
 
     OString const &  getSourceFile() const;      ///< Get name of file from which entry is extracted
     OString         getGroupId() const;
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index c604577..81ecdcd 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -283,6 +283,13 @@ PoEntry& PoEntry::operator=(const PoEntry& rPo)
     return *this;
 }
 
+PoEntry& PoEntry::operator=(PoEntry&& rPo)
+{
+    m_pGenPo = std::move(rPo.m_pGenPo);
+    m_bIsInitialized = std::move(rPo.m_bIsInitialized);
+    return *this;
+}
+
 OString const & PoEntry::getSourceFile() const
 {
     assert( m_bIsInitialized );
commit 703ad53629fb8f9002483142f906249e6160b4db
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 12 11:13:35 2016 +0100

    this doesn't need a virtual dtor
    
    Change-Id: I5c628a063fb5309f493729ee4bd7b122a3d2c3d5

diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index f446a2f..c604577 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -37,9 +37,7 @@ private:
     bool       m_bNull;
 
 public:
-                        GenPoEntry();
-    virtual             ~GenPoEntry();
-                        // Default copy constructor and copy operator work well
+    GenPoEntry();
 
     const OString& getReference() const    { return m_sReference; }
     const OString& getMsgCtxt() const      { return m_sMsgCtxt; }
@@ -124,10 +122,6 @@ GenPoEntry::GenPoEntry()
 {
 }
 
-GenPoEntry::~GenPoEntry()
-{
-}
-
 void GenPoEntry::writeToFile(std::ofstream& rOFStream) const
 {
     if ( rOFStream.tellp() != std::ofstream::pos_type( 0 ))
commit 9f3906f1f0c860449b452871f7cb19b77a508eb5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 12 11:11:39 2016 +0100

    coverity#1371178 Missing move assignment operator
    
    Change-Id: Ib7df699269bcacd5dbf64662c47b538aee9235a5

diff --git a/o3tl/qa/cow_wrapper_clients.cxx b/o3tl/qa/cow_wrapper_clients.cxx
index 959bddf..1ede35a 100644
--- a/o3tl/qa/cow_wrapper_clients.cxx
+++ b/o3tl/qa/cow_wrapper_clients.cxx
@@ -56,6 +56,11 @@ cow_wrapper_client2::cow_wrapper_client2( const cow_wrapper_client2& rSrc ) :
 {
 }
 
+cow_wrapper_client2::cow_wrapper_client2( cow_wrapper_client2&& rSrc ) :
+    maImpl( std::move( rSrc.maImpl ) )
+{
+}
+
 cow_wrapper_client2& cow_wrapper_client2::operator=( const cow_wrapper_client2& rSrc )
 {
     maImpl = rSrc.maImpl;
@@ -63,6 +68,13 @@ cow_wrapper_client2& cow_wrapper_client2::operator=( const cow_wrapper_client2&
     return *this;
 }
 
+cow_wrapper_client2& cow_wrapper_client2::operator=( cow_wrapper_client2&& rSrc )
+{
+    maImpl = std::move(rSrc.maImpl);
+
+    return *this;
+}
+
 void cow_wrapper_client2::modify( int nVal )
 {
     maImpl->setValue( nVal );
@@ -122,6 +134,11 @@ cow_wrapper_client3::cow_wrapper_client3( const cow_wrapper_client3& rSrc ) :
 {
 }
 
+cow_wrapper_client3::cow_wrapper_client3( cow_wrapper_client3&& rSrc ) :
+    maImpl( std::move( rSrc.maImpl ) )
+{
+}
+
 cow_wrapper_client3& cow_wrapper_client3::operator=( const cow_wrapper_client3& rSrc )
 {
     maImpl = rSrc.maImpl;
@@ -129,6 +146,13 @@ cow_wrapper_client3& cow_wrapper_client3::operator=( const cow_wrapper_client3&
     return *this;
 }
 
+cow_wrapper_client3& cow_wrapper_client3::operator=( cow_wrapper_client3&& rSrc )
+{
+    maImpl = std::move(rSrc.maImpl);
+
+    return *this;
+}
+
 void cow_wrapper_client3::modify( int nVal )
 {
     maImpl->setValue( nVal );
diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx
index 48b745a..138f496 100644
--- a/o3tl/qa/cow_wrapper_clients.hxx
+++ b/o3tl/qa/cow_wrapper_clients.hxx
@@ -69,7 +69,9 @@ public:
     ~cow_wrapper_client2();
 
     cow_wrapper_client2( const cow_wrapper_client2& );
+    cow_wrapper_client2( cow_wrapper_client2&& );
     cow_wrapper_client2& operator=( const cow_wrapper_client2& );
+    cow_wrapper_client2& operator=( cow_wrapper_client2&& );
 
     void modify( int nVal );
     int  queryUnmodified() const;
@@ -98,7 +100,9 @@ public:
     ~cow_wrapper_client3();
 
     cow_wrapper_client3( const cow_wrapper_client3& );
+    cow_wrapper_client3( cow_wrapper_client3&& );
     cow_wrapper_client3& operator=( const cow_wrapper_client3& );
+    cow_wrapper_client3& operator=( cow_wrapper_client3&& );
 
     void modify( int nVal );
     int  queryUnmodified() const;


More information about the Libreoffice-commits mailing list