summaryrefslogtreecommitdiff
path: root/package/source/zipapi/ZipEnumeration.cxx
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2000-11-29 02:21:56 +0000
committerMartin Gallwey <mtg@openoffice.org>2000-11-29 02:21:56 +0000
commit07c2807484991b45fdd6cb87485d854567f2f87b (patch)
treebb523c478b3fa02cb0e32f2533896d662f7c5aef /package/source/zipapi/ZipEnumeration.cxx
parent81c60a38c4187ad2fc4885eff6dcc28c382bc4f4 (diff)
#80556# bug fixes
Diffstat (limited to 'package/source/zipapi/ZipEnumeration.cxx')
-rw-r--r--package/source/zipapi/ZipEnumeration.cxx29
1 files changed, 12 insertions, 17 deletions
diff --git a/package/source/zipapi/ZipEnumeration.cxx b/package/source/zipapi/ZipEnumeration.cxx
index 033ea87e3c6b..516b320820c1 100644
--- a/package/source/zipapi/ZipEnumeration.cxx
+++ b/package/source/zipapi/ZipEnumeration.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipEnumeration.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obo $ $Date: 2000-11-28 16:11:37 $
+ * last change: $Author: mtg $ $Date: 2000-11-29 03:14:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,30 +72,25 @@ using namespace com::sun::star;
/** Provides an Enumeration over the contents of a Zip file */
-ZipEnumeration::ZipEnumeration( uno::Sequence< package::ZipEntry > &xList)
-: nCurrent(0)
+ZipEnumeration::ZipEnumeration( EntryHash & rNewEntryHash)
+: rEntryHash(rNewEntryHash)
+, aIterator(rEntryHash.begin())
{
- xZipList = xList;
}
-ZipEnumeration::ZipEnumeration( )
-: nCurrent(0)
-{
-}
-
ZipEnumeration::~ZipEnumeration( void )
{
}
sal_Bool SAL_CALL ZipEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
- return (nCurrent < xZipList.getLength());
+ return (aIterator != rEntryHash.end());
}
uno::Any SAL_CALL ZipEnumeration::nextElement() throw (uno::RuntimeException)
{
- if (hasMoreElements() == sal_False)
- throw container::NoSuchElementException();
- uno::Any aElement;
- //aElement <<= uno::Reference < package::ZipEntry > (static_cast <package::ZipEntry > (xZipList[nCurrent++]));
- aElement <<= xZipList[nCurrent++];
- return aElement;
+ uno::Any aAny;
+ if (aIterator == rEntryHash.end())
+ throw (container::NoSuchElementException());
+ aAny <<= (*aIterator).second;
+ aIterator++;
+ return aAny;
}