summaryrefslogtreecommitdiff
path: root/unotools/source
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-09-05 08:05:12 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-09-05 08:05:12 +0000
commit50b694c8e10d94e967aae802720eb01e3349a134 (patch)
tree514238be14f2358e986050de67a497a7fb060760 /unotools/source
parente2f04fae289737f6b33f0e38f9bc1746f5eeac03 (diff)
INTEGRATION: CWS hr18 (1.1.252); FILE MERGED
2005/08/15 13:33:08 hr 1.1.252.2: #i53224#: OEventListenerAdapter::stopComponentListening(): fix dispose loop, 2nd try 2005/08/11 16:23:46 hr 1.1.252.1: #53224#: OEventListenerAdapter::stopComponentListening(): fix dispose loop
Diffstat (limited to 'unotools/source')
-rw-r--r--unotools/source/misc/eventlisteneradapter.cxx35
1 files changed, 13 insertions, 22 deletions
diff --git a/unotools/source/misc/eventlisteneradapter.cxx b/unotools/source/misc/eventlisteneradapter.cxx
index a2d9d229d38b..cf76151474c4 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: eventlisteneradapter.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-04-19 16:13:35 $
+ * last change: $Author: rt $ $Date: 2005-09-05 09:05:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,24 +169,23 @@ namespace utl
//---------------------------------------------------------------------
void OEventListenerAdapter::stopComponentListening( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComp )
{
- for ( ::std::vector< void* >::iterator aDisposeLoop = m_pImpl->aListeners.begin();
- aDisposeLoop != m_pImpl->aListeners.end();
- ++aDisposeLoop
- )
+ if ( m_pImpl->aListeners.empty() )
+ return;
+
+ ::std::vector< void* >::iterator dispose = m_pImpl->aListeners.begin();
+ do
{
- OEventListenerImpl* pListenerImpl = static_cast< OEventListenerImpl* >(*aDisposeLoop);
- if (pListenerImpl->getComponent().get() == _rxComp.get())
+ OEventListenerImpl* pListenerImpl = static_cast< OEventListenerImpl* >( *dispose );
+ if ( pListenerImpl->getComponent().get() == _rxComp.get() )
{
- ::std::vector< void* >::iterator aPrevious(aDisposeLoop);
- --aPrevious;
-
pListenerImpl->dispose();
pListenerImpl->release();
- m_pImpl->aListeners.erase(aDisposeLoop);
-
- aDisposeLoop = aPrevious;
+ dispose = m_pImpl->aListeners.erase( dispose );
}
+ else
+ ++dispose;
}
+ while ( dispose != m_pImpl->aListeners.end() );
}
//---------------------------------------------------------------------
@@ -221,11 +220,3 @@ namespace utl
//.........................................................................
} // namespace utl
//.........................................................................
-
-/*************************************************************************
- * history:
- * $Log: not supported by cvs2svn $
- *
- * Revision 1.0 19.04.01 16:26:16 fs
- ************************************************************************/
-