diff options
author | Noel Grandin <noel@peralex.com> | 2015-12-03 12:03:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-12-03 13:57:23 +0200 |
commit | e6721d2d17f5f34dcac14c3379521bb7fb6b8c03 (patch) | |
tree | bba3964ac2a6dd225d8087aa01594ea717d2a359 /svl | |
parent | ea297dd2020c03673745428381e8a2b11b83f23b (diff) |
uno::Sequence->std::vector in SfxIntegerListItem
Change-Id: Icdbb361feea2ebee74f9d0a906bdd3c2882443e8
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/ilstitem.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index ca2acb7a3da6..c020901e583b 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <svl/ilstitem.hxx> @@ -33,24 +34,22 @@ SfxIntegerListItem::SfxIntegerListItem() SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::std::vector < sal_Int32 >& rList ) : SfxPoolItem( which ) + , m_aList( rList ) { - m_aList.realloc( rList.size() ); - for ( size_t n=0; n<rList.size(); ++n ) - m_aList[n] = rList[n]; } SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const css::uno::Sequence < sal_Int32 >& rList ) : SfxPoolItem( which ) { - m_aList.realloc( rList.getLength() ); + m_aList.resize( rList.getLength() ); for ( sal_Int32 n=0; n<rList.getLength(); ++n ) m_aList[n] = rList[n]; } SfxIntegerListItem::SfxIntegerListItem( const SfxIntegerListItem& rItem ) : SfxPoolItem( rItem ) + , m_aList( rItem.m_aList ) { - m_aList = rItem.m_aList; } SfxIntegerListItem::~SfxIntegerListItem() @@ -82,20 +81,17 @@ bool SfxIntegerListItem::PutValue ( const css::uno::Any& rVal, sal_uInt8 ) return true; } - return ( aNew >>= m_aList ); + css::uno::Sequence<sal_Int32> aTempSeq; + bool bRet = aNew >>= aTempSeq; + if (bRet) + m_aList = comphelper::sequenceToContainer<std::vector<sal_Int32>>(aTempSeq); + return bRet; } bool SfxIntegerListItem::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const { - rVal <<= m_aList; + rVal <<= comphelper::containerToSequence(m_aList); return true; } -void SfxIntegerListItem::GetList( ::std::vector< sal_Int32 >& rList ) const -{ - rList.reserve( m_aList.getLength() ); - for ( sal_Int32 n=0; n<m_aList.getLength(); ++n ) - rList.push_back( m_aList[n] ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |