summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--canvas/source/directx/dx_canvashelper.cxx2
-rw-r--r--include/comphelper/sequence.hxx9
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx2
-rw-r--r--vcl/source/gdi/svgdata.cxx3
4 files changed, 12 insertions, 4 deletions
diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx
index c319239808b8..94b9c322b5ea 100644
--- a/canvas/source/directx/dx_canvashelper.cxx
+++ b/canvas/source/directx/dx_canvashelper.cxx
@@ -359,7 +359,7 @@ namespace dxcanvas
aPen.SetMiterLimit( static_cast< Gdiplus::REAL >(strokeAttributes.MiterLimit) );
const ::std::vector< Gdiplus::REAL >& rDashArray(
- ::comphelper::sequenceToContainer< ::std::vector< Gdiplus::REAL > >(
+ ::comphelper::sequenceToContainer< ::std::vector< Gdiplus::REAL >, double >(
strokeAttributes.DashArray ) );
if( !rDashArray.empty() )
{
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index bb1b1e81ba61..68c361c6282f 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -340,6 +340,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 DstType >
+ inline DstType sequenceToContainer( const css::uno::Sequence< typename DstType::value_type >& i_Sequence )
+ {
+ DstType result( i_Sequence.getLength() );
+ ::std::copy( i_Sequence.begin(), i_Sequence.end(), result.begin() );
+ return result;
+ }
+
/** Copy from a Sequence into an existing container
This potentially saves a needless extra copy operation over
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 347129100324..d83c69964079 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -638,7 +638,7 @@ void SAL_CALL PasswordContainer::addPersistent( const OUString& Url, const OUStr
void PasswordContainer::PrivateAdd( const OUString& Url, const OUString& UserName, const Sequence< OUString >& Passwords, char Mode, const Reference< XInteractionHandler >& aHandler ) throw(RuntimeException, std::exception)
{
NamePassRecord aRecord( UserName );
- ::std::vector< OUString > aStorePass = comphelper::sequenceToContainer< std::vector<OUString>, OUString>( Passwords );
+ ::std::vector< OUString > aStorePass = comphelper::sequenceToContainer< std::vector<OUString> >( Passwords );
if( Mode == PERSISTENT_RECORD )
aRecord.SetPersPasswords( EncodePasswords( aStorePass, GetMasterPassword( aHandler ) ) );
diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index 1ec5014a2847..155844fe7b90 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -131,8 +131,7 @@ void SvgData::ensureSequenceAndRange()
{
const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext);
- maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>,
- css::uno::Reference< css::graphic::XPrimitive2D >>(xSvgParser->getDecomposition(myInputStream, maPath));
+ maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xSvgParser->getDecomposition(myInputStream, maPath));
}
catch(const uno::Exception&)
{