diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-08 15:53:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-09 07:48:18 +0000 |
commit | 389999abdb2d35f8641a6ff2e8984887166d39e2 (patch) | |
tree | 746ae9503700b07bb84938c8899a24aeb8b8fcd8 /include | |
parent | 57998f642de65bdcb72742abd8ab94a26840a31d (diff) |
make comphelper::containerToSequence a little smarter
So we don't have to specify the source and destination type as often.
Change-Id: Id9e286417a1cb246d163cbc3c536b231a4a92624
Reviewed-on: https://gerrit.libreoffice.org/30700
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/sequence.hxx | 9 | ||||
-rw-r--r-- | include/sot/exchange.hxx | 7 | ||||
-rw-r--r-- | include/svtools/transfer.hxx | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx index 7d8209d7a21f..bb1b1e81ba61 100644 --- a/include/comphelper/sequence.hxx +++ b/include/comphelper/sequence.hxx @@ -291,6 +291,15 @@ namespace comphelper return result; } + // this one does better type deduction, but does not allow us to copy into a different element type + template < typename SrcType > + inline css::uno::Sequence< typename SrcType::value_type > containerToSequence( const SrcType& i_Container ) + { + css::uno::Sequence< typename SrcType::value_type > result( i_Container.size() ); + ::std::copy( i_Container.begin(), i_Container.end(), result.getArray() ); + return result; + } + template <typename T> inline css::uno::Sequence<T> containerToSequence( ::std::vector<T> const& v ) diff --git a/include/sot/exchange.hxx b/include/sot/exchange.hxx index f28d47e58c7e..307ffea16bb4 100644 --- a/include/sot/exchange.hxx +++ b/include/sot/exchange.hxx @@ -42,12 +42,7 @@ struct DataFlavorEx : public css::datatransfer::DataFlavor SotClipboardFormatId mnSotId; }; -// JP 23.03.2001 - this struct is only for "hide" the STD of the vetor, -// because our makefile filter all this symbols and so nobody can use -// these struct in any interfacses. -struct DataFlavorExVector : public ::std::vector< DataFlavorEx > -{ -}; +typedef ::std::vector<DataFlavorEx> DataFlavorExVector; SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx index 2eb31595afe1..9213e6754db1 100644 --- a/include/svtools/transfer.hxx +++ b/include/svtools/transfer.hxx @@ -26,6 +26,7 @@ #include <tools/link.hxx> #include <tools/ref.hxx> #include <sot/formats.hxx> +#include <sot/exchange.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase4.hxx> #include <com/sun/star/frame/XTerminateListener.hpp> @@ -51,7 +52,6 @@ class INetBookmark; class INetImage; class FileList; class SotStorageStream; -struct DataFlavorExVector; namespace vcl { class Window; } // Drag&Drop defines |