loplugin:singlevalfields in comphelper

Change-Id: I22711d226a266dc00c32beff54398a55c4c9691a
Reviewed-on: https://gerrit.libreoffice.org/26599
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
diff --git a/comphelper/source/container/containermultiplexer.cxx b/comphelper/source/container/containermultiplexer.cxx
index c8fd633..b7e3c93 100644
--- a/comphelper/source/container/containermultiplexer.cxx
+++ b/comphelper/source/container/containermultiplexer.cxx
@@ -90,7 +90,6 @@ namespace comphelper
            const  Reference< XContainer >& _rxContainer)
        :m_xContainer(_rxContainer)
        ,m_pListener(_pListener)
        ,m_nLockCount(0)
    {
        if (m_pListener)
            m_pListener->setAdapter(this);
@@ -138,8 +137,7 @@ namespace comphelper
        if (m_pListener)
        {
             // tell the listener
            if (!locked())
                m_pListener->_disposing(_rSource);
            m_pListener->_disposing(_rSource);
            // disconnect the listener
            if ( m_pListener )
                m_pListener->setAdapter(nullptr);
@@ -152,21 +150,21 @@ namespace comphelper

    void SAL_CALL OContainerListenerAdapter::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException, std::exception)
    {
        if (m_pListener && !locked())
        if (m_pListener)
            m_pListener->_elementInserted(_rEvent);
    }


    void SAL_CALL OContainerListenerAdapter::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException, std::exception)
    {
        if (m_pListener && !locked())
        if (m_pListener)
            m_pListener->_elementRemoved(_rEvent);
    }


    void SAL_CALL OContainerListenerAdapter::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException, std::exception)
    {
        if (m_pListener && !locked())
        if (m_pListener)
            m_pListener->_elementReplaced(_rEvent);
    }

diff --git a/comphelper/source/misc/SelectionMultiplex.cxx b/comphelper/source/misc/SelectionMultiplex.cxx
index 9f853ed..f7122d4 100644
--- a/comphelper/source/misc/SelectionMultiplex.cxx
+++ b/comphelper/source/misc/SelectionMultiplex.cxx
@@ -32,8 +32,6 @@ using namespace ::com::sun::star::view;

OSelectionChangeListener::~OSelectionChangeListener()
{
    if (m_pAdapter)
        m_pAdapter->dispose();
}


@@ -65,7 +63,6 @@ OSelectionChangeMultiplexer::OSelectionChangeMultiplexer(OSelectionChangeListene
            :m_xSet(_rxSet)
            ,m_pListener(_pListener)
            ,m_nLockCount(0)
            ,m_bListening(false)
{
    m_pListener->setAdapter(this);
    osl_atomic_increment(&m_refCount);
@@ -94,23 +91,6 @@ void OSelectionChangeMultiplexer::unlock()
}


void OSelectionChangeMultiplexer::dispose()
{
    if (m_bListening)
    {
        Reference< XSelectionChangeListener> xPreventDelete(this);

        m_xSet->removeSelectionChangeListener(xPreventDelete);

        m_pListener->setAdapter(nullptr);

        m_pListener = nullptr;
        m_bListening = false;

        m_xSet = nullptr;
    }
}

// XEventListener

void SAL_CALL OSelectionChangeMultiplexer::disposing( const  EventObject& _rSource) throw( RuntimeException, std::exception)
@@ -126,7 +106,6 @@ void SAL_CALL OSelectionChangeMultiplexer::disposing( const  EventObject& _rSour
    }

    m_pListener = nullptr;
    m_bListening = false;

    m_xSet = nullptr;
}
diff --git a/include/comphelper/SelectionMultiplex.hxx b/include/comphelper/SelectionMultiplex.hxx
index fa92e3c..443e817 100644
--- a/include/comphelper/SelectionMultiplex.hxx
+++ b/include/comphelper/SelectionMultiplex.hxx
@@ -70,7 +70,6 @@ namespace comphelper
        css::uno::Reference< css::view::XSelectionSupplier>  m_xSet;
        OSelectionChangeListener*                            m_pListener;
        sal_Int32                                            m_nLockCount;
        bool                                                 m_bListening        : 1;

        OSelectionChangeMultiplexer(const OSelectionChangeMultiplexer&) = delete;
        OSelectionChangeMultiplexer& operator=(const OSelectionChangeMultiplexer&) = delete;
@@ -91,8 +90,6 @@ namespace comphelper
        void        unlock();
        /// get the lock count
        sal_Int32   locked() const { return m_nLockCount; }

        void dispose();
    };


diff --git a/include/comphelper/containermultiplexer.hxx b/include/comphelper/containermultiplexer.hxx
index fda66f0..39d0c78 100644
--- a/include/comphelper/containermultiplexer.hxx
+++ b/include/comphelper/containermultiplexer.hxx
@@ -76,7 +76,6 @@ namespace comphelper
        css::uno::Reference< css::container::XContainer >
                                m_xContainer;
        OContainerListener*     m_pListener;
        sal_Int32               m_nLockCount;

        virtual ~OContainerListenerAdapter();

@@ -92,9 +91,6 @@ namespace comphelper
        virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) throw(css::uno::RuntimeException, std::exception) override;
        virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) throw(css::uno::RuntimeException, std::exception) override;

        // locking the multiplexer
        sal_Int32   locked() const { return m_nLockCount; }

        /// dispose the object. No multiplexing anymore
        void        dispose();

diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index da0e0fa..63c17cf 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -266,7 +266,6 @@ void NavigatorTree::dispose()
        pCurrent = Next(pCurrent);
    }
    m_pReportListener->dispose();
    m_pSelectionListener->dispose();
    SvTreeListBox::dispose();
}