summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2006-03-06 09:13:10 +0000
committerRüdiger Timm <rt@openoffice.org>2006-03-06 09:13:10 +0000
commit56df932f66a436719f15b4f431307fc58106a115 (patch)
tree8b26eb4361edac353328377165a7c8e044556a7a /comphelper
parent8248b410cbd5286d0ef104c3f35c76069d9fadb4 (diff)
INTEGRATION: CWS dbo510 (1.9.24); FILE MERGED
2006/02/15 10:11:59 dbo 1.9.24.2: #i59034# making containerToSequence() vector overload robust for non-pro 2005/11/01 21:55:58 dbo 1.9.24.1: optimizing containerToSequence( std::vector )
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/inc/comphelper/sequence.hxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/comphelper/inc/comphelper/sequence.hxx b/comphelper/inc/comphelper/sequence.hxx
index 4b9a9b686227..8a0967a8eade 100644
--- a/comphelper/inc/comphelper/sequence.hxx
+++ b/comphelper/inc/comphelper/sequence.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sequence.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 02:39:01 $
+ * last change: $Author: rt $ $Date: 2006-03-06 10:13:10 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -53,6 +53,8 @@
#include "comphelper/comphelperdllapi.h"
#endif
+#include <vector>
+
//.........................................................................
namespace comphelper
{
@@ -308,6 +310,14 @@ namespace comphelper
return result;
}
+ template <typename T>
+ inline ::com::sun::star::uno::Sequence<T> containerToSequence(
+ ::std::vector<T> const& v )
+ {
+ return ::com::sun::star::uno::Sequence<T>(
+ v.empty() ? 0 : &v[0], static_cast<sal_Int32>(v.size()) );
+ }
+
//-------------------------------------------------------------------------
/** Copy from a Sequence into a container
@@ -344,5 +354,6 @@ namespace comphelper
} // namespace comphelper
//.........................................................................
+
#endif // _COMPHELPER_SEQUENCE_HXX_