[Libreoffice-commits] .: fileaccess/source
Joseph Powers
jpowers at kemper.freedesktop.org
Thu Dec 16 23:36:09 PST 2010
fileaccess/source/FileAccess.cxx | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 282c235527fd6b457079ac4149ea19845b44f0ee
Author: Joseph Powers <jpowers27 at cox.net>
Date: Thu Dec 16 23:35:59 2010 -0800
Remove DECLARE_LIST( StringList_Impl, rtl::OUString* )
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index 0435e13..08b7092 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,6 +62,8 @@
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
+#include <vector>
+
#define IMPLEMENTATION_NAME "com.sun.star.comp.ucb.SimpleFileAccess"
#define SERVICE_NAME "com.sun.star.ucb.SimpleFileAccess"
@@ -76,6 +78,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::container;
+using ::std::vector;
+
namespace io_FileAccess
{
@@ -523,8 +527,7 @@ DateTime OFileAccess::getDateTimeModified( const rtl::OUString& FileURL )
return aDateTime;
}
-
-DECLARE_LIST( StringList_Impl, rtl::OUString* )
+typedef vector< rtl::OUString* > StringList_Impl;
Sequence< rtl::OUString > OFileAccess::getFolderContents( const rtl::OUString& FolderURL, sal_Bool bIncludeFolders )
throw(CommandAbortedException, Exception, RuntimeException)
@@ -551,7 +554,7 @@ Sequence< rtl::OUString > OFileAccess::getFolderContents( const rtl::OUString& F
if ( xResultSet.is() )
{
- pFiles = new StringList_Impl;
+ pFiles = new StringList_Impl();
Reference< com::sun::star::ucb::XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
while ( xResultSet->next() )
@@ -559,21 +562,22 @@ Sequence< rtl::OUString > OFileAccess::getFolderContents( const rtl::OUString& F
rtl::OUString aId = xContentAccess->queryContentIdentifierString();
INetURLObject aURL( aId, INET_PROT_FILE );
rtl::OUString* pFile = new rtl::OUString( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- pFiles->Insert( pFile, LIST_APPEND );
+ pFiles->push_back( pFile );
}
}
if ( pFiles )
{
- ULONG nCount = pFiles->Count();
+ size_t nCount = pFiles->size();
Sequence < rtl::OUString > aRet( nCount );
rtl::OUString* pRet = aRet.getArray();
- for ( USHORT i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- rtl::OUString* pFile = pFiles->GetObject(i);
+ rtl::OUString* pFile = pFiles->at( i );
pRet[i] = *( pFile );
delete pFile;
}
+ pFiles->clear();
delete pFiles;
return aRet;
}
More information about the Libreoffice-commits
mailing list