summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql/pq_tools.hxx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-11-30 15:57:08 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2011-11-30 16:00:13 +0100
commit5f3bd5bed3f5d677208dc1b897b2f21eb5f622bb (patch)
tree7cdece771c2aabbf07616e0b3c7928782e365975 /connectivity/source/drivers/postgresql/pq_tools.hxx
parentc75e15c980714c746a0b4b023cecf486cbe81bdc (diff)
pgsql-sdbc: Robustify against empty arrays, etc
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_tools.hxx')
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx b/connectivity/source/drivers/postgresql/pq_tools.hxx
index a5b7128c45c0..2f6880297ebc 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -197,6 +197,14 @@ public:
void executeUpdate( const rtl::OUString & sql );
};
+template < typename T, typename Allocator > com::sun::star::uno::Sequence<T> sequence_of_vector ( const std::vector<T, Allocator> &vec )
+{
+ if ( vec.size() == 0 )
+ return com::sun::star::uno::Sequence<T>();
+ else
+ return com::sun::star::uno::Sequence<T>( &vec[0], vec.size());
+}
+
}
#endif