summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2001-02-05 12:21:38 +0000
committerJörg Budischewski <jbu@openoffice.org>2001-02-05 12:21:38 +0000
commita59da1d7a694912429800be82fc9901513d98610 (patch)
tree6ce7da9d43d0885c48d4fbc85805a7b41a998aef /cppuhelper
parent6e70a6c156d031f879c3d60d0dd619227dba33f2 (diff)
added a convenience method to remove the current iteration from the interfaceiterator
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/interfacecontainer.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/cppuhelper/source/interfacecontainer.cxx b/cppuhelper/source/interfacecontainer.cxx
index 18856a8f139f..51e989540852 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: interfacecontainer.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jbu $ $Date: 2000-09-29 08:48:07 $
+ * last change: $Author: jbu $ $Date: 2001-02-05 13:21:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -189,6 +189,23 @@ XInterface * OInterfaceIteratorHelper::next()
return 0;
}
+void OInterfaceIteratorHelper::remove()
+{
+ if( bIsList )
+ {
+ OSL_ASSERT( nRemain >= 0 &&
+ nRemain < ((const Sequence< Reference< XInterface > >*)pData)->getLength() );
+ XInterface * p =
+ ((const Sequence< Reference< XInterface > >*)pData)->getConstArray()[nRemain].get();
+ rCont.removeInterface( * reinterpret_cast< const Reference< XInterface > * >( &p ) );
+ }
+ else
+ {
+ OSL_ASSERT( 0 == nRemain );
+ rCont.removeInterface( * reinterpret_cast< const Reference< XInterface > * >(&pData));
+ }
+}
+
//===================================================================
//===================================================================
//===================================================================