summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql/pq_xusers.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_xusers.cxx')
-rw-r--r--connectivity/source/drivers/postgresql/pq_xusers.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_xusers.cxx b/connectivity/source/drivers/postgresql/pq_xusers.cxx
index 6b8f2f517394..6169ce323be6 100644
--- a/connectivity/source/drivers/postgresql/pq_xusers.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xusers.cxx
@@ -56,7 +56,6 @@ using com::sun::star::uno::UNO_QUERY;
using com::sun::star::uno::Type;
using com::sun::star::uno::XInterface;
using com::sun::star::uno::Reference;
-using com::sun::star::uno::Sequence;
using com::sun::star::uno::RuntimeException;
using com::sun::star::container::NoSuchElementException;
@@ -98,7 +97,7 @@ void Users::refresh()
String2IntMap map;
- m_values = Sequence< com::sun::star::uno::Any > ( );
+ m_values.clear();
sal_Int32 tableIndex = 0;
while( rs->next() )
{
@@ -111,11 +110,9 @@ void Users::refresh()
st.NAME , makeAny(xRow->getString( TABLE_INDEX_CATALOG+1) ) );
{
- const int currentTableIndex = tableIndex++;
- assert(currentTableIndex == m_values.getLength());
- m_values.realloc( tableIndex );
- m_values[currentTableIndex] = makeAny( prop );
- map[ name ] = currentTableIndex;
+ m_values.push_back( makeAny( prop ) );
+ map[ name ] = tableIndex;
+ ++tableIndex;
}
}
m_name2index.swap( map );
@@ -173,11 +170,11 @@ void Users::dropByIndex( sal_Int32 index )
{
osl::MutexGuard guard( m_refMutex->mutex );
- if( index < 0 || index >= m_values.getLength() )
+ if( index < 0 || index >= (sal_Int32)m_values.size() )
{
OUStringBuffer buf( 128 );
buf.append( "USERS: Index out of range (allowed 0 to " );
- buf.append( (sal_Int32) (m_values.getLength() -1) );
+ buf.append( (sal_Int32) (m_values.size() -1) );
buf.append( ", got " );
buf.append( index );
buf.append( ")" );