Kaydet (Commit) c144288a authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Stephan Bergmann

loplugin:singlevalfields in comphelper

Change-Id: I22711d226a266dc00c32beff54398a55c4c9691a
Reviewed-on: https://gerrit.libreoffice.org/26599Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 17189e8e
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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();
};
......
......@@ -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();
......
......@@ -266,7 +266,6 @@ void NavigatorTree::dispose()
pCurrent = Next(pCurrent);
}
m_pReportListener->dispose();
m_pSelectionListener->dispose();
SvTreeListBox::dispose();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment