summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-02-07 12:04:02 +0200
committerNoel Grandin <noel@peralex.com>2016-02-09 13:44:42 +0200
commit383e11040c2b329705d9f161576cf162390b52a7 (patch)
tree8d6dab417ea9836f991eafe6580eea0f2f3a5463 /connectivity/source/drivers/postgresql/pq_xcolumns.cxx
parentf1cb83cef59c3b1d5ee780e8916832483468fab7 (diff)
sequence->vector in postgresql
Change-Id: I57bf8f4404df9f73d9a52c651c9f27784f10c937
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_xcolumns.cxx')
-rw-r--r--connectivity/source/drivers/postgresql/pq_xcolumns.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
index d5d61cae2e98..8d5f271be8f0 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
@@ -62,7 +62,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;
@@ -311,7 +310,7 @@ void Columns::refresh()
String2IntMap map;
- m_values = Sequence< com::sun::star::uno::Any > ();
+ m_values.clear();
int columnIndex = 0;
while( rs->next() )
{
@@ -331,11 +330,9 @@ void Columns::refresh()
// name ) );
{
- const int currentColumnIndex = columnIndex++;
- assert(currentColumnIndex == m_values.getLength());
- m_values.realloc( columnIndex );
- m_values[currentColumnIndex] = makeAny( prop );
- map[ name ] = currentColumnIndex;
+ m_values.push_back( makeAny( prop ) );
+ map[ name ] = columnIndex;
+ ++columnIndex;
}
}
m_name2index.swap( map );
@@ -514,11 +511,11 @@ void Columns::dropByIndex( sal_Int32 index )
::com::sun::star::uno::RuntimeException, std::exception)
{
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( "COLUMNS: 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( ")" );