summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-23 14:30:14 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-24 08:41:01 +0000
commitc144288abe73262178a8fd94baef895e1744c304 (patch)
tree47d6a0ba287de534708333d81f52b8f5de0f7a88
parent17189e8e63254dbe5e4c9c755a4817664e4ee0d5 (diff)
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>
-rw-r--r--comphelper/source/container/containermultiplexer.cxx10
-rw-r--r--comphelper/source/misc/SelectionMultiplex.cxx21
-rw-r--r--include/comphelper/SelectionMultiplex.hxx3
-rw-r--r--include/comphelper/containermultiplexer.hxx4
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx1
5 files changed, 4 insertions, 35 deletions
diff --git a/comphelper/source/container/containermultiplexer.cxx b/comphelper/source/container/containermultiplexer.cxx
index c8fd633a0282..b7e3c93becbe 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 9f853ed28b05..f7122d40b946 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 fa92e3c4f42d..443e81721386 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 fda66f07c96b..39d0c7895ae3 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 da0e0faa5ee9..63c17cfa6c2e 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();
}