[Libreoffice-commits] core.git: include/unotools unotools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 1 21:16:24 UTC 2018


 include/unotools/options.hxx       |    1 +
 unotools/source/config/options.cxx |   12 ++++++++++++
 2 files changed, 13 insertions(+)

New commits:
commit f780a64a4f62bb7884d9dcfd984dc96ab737b34e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Oct 1 18:01:31 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Oct 1 23:16:00 2018 +0200

    Consistently have both copy functions for utl::ConfigurationBroadcaster
    
    The ctor was added with d1e47b1428abf1732ab4d5e219b210760d4152e0 "enhance
    useuniqueptr loplugin" apparently because it was needed and the implicitly
    declared one stareted to be defined as deleted, while the assignment op was
    left implicitly defined as deleted (presumably because it wasn't needed anyway).
    
    Adding a non-deleted definition of the assignment op probably is a good move
    towards consistency, and was assumed it could help avoid new Clang trunk
    -Werror,-Wdefaulted-function-deleted in derived ConfigItem
    (include/unotools/configitem.hxx), but which appears not to be the case.
    
    And ConfigurationBroadcaster can't easily switch from copy to move semantics, as
    SdOptionsLayoutItem::Clone needs SdOptionsLayoutItem copy ctor needs
    SdOptionsLayout copy ctor needs SdOptionsGeneric copy ctor needs
    SdOptionsItem copy ctor needs utl::ConfigItem copy ctor needs
    utl::ConfigurationBroadcaster copy ctor.
    
    Change-Id: Ie1f4e72eacb9b6b776103c4cf04a959acfa6648f
    Reviewed-on: https://gerrit.libreoffice.org/61208
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/unotools/options.hxx b/include/unotools/options.hxx
index 22a731b501ef..8df85d04858c 100644
--- a/include/unotools/options.hxx
+++ b/include/unotools/options.hxx
@@ -80,6 +80,7 @@ namespace utl {
         ConfigurationBroadcaster();
         ConfigurationBroadcaster(ConfigurationBroadcaster const & );
         virtual ~ConfigurationBroadcaster();
+        ConfigurationBroadcaster & operator =(ConfigurationBroadcaster const & other);
         virtual void BlockBroadcasts( bool bBlock );
     };
 
diff --git a/unotools/source/config/options.cxx b/unotools/source/config/options.cxx
index 11a396287ad8..977f185b42b8 100644
--- a/unotools/source/config/options.cxx
+++ b/unotools/source/config/options.cxx
@@ -42,6 +42,18 @@ ConfigurationBroadcaster::~ConfigurationBroadcaster()
 {
 }
 
+ConfigurationBroadcaster & ConfigurationBroadcaster::operator =(
+    ConfigurationBroadcaster const & other)
+{
+    if (&other != this) {
+        mpList.reset(
+            other.mpList == nullptr ? nullptr : new IMPL_ConfigurationListenerList(*other.mpList));
+        m_nBroadcastBlocked = other.m_nBroadcastBlocked;
+        m_nBlockedHint = other.m_nBlockedHint;
+    }
+    return *this;
+}
+
 void ConfigurationBroadcaster::AddListener( utl::ConfigurationListener* pListener )
 {
     if ( !mpList )


More information about the Libreoffice-commits mailing list