LCOV - code coverage report
Current view: top level - svl/source/items - ilstitem.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 8 43 18.6 %
Date: 2015-06-13 12:38:46 Functions: 6 16 37.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <com/sun/star/script/Converter.hpp>
      21             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      22             : 
      23             : #include <comphelper/processfactory.hxx>
      24             : 
      25             : #include <svl/ilstitem.hxx>
      26             : 
      27        1882 : TYPEINIT1_AUTOFACTORY(SfxIntegerListItem, SfxPoolItem);
      28             : 
      29           0 : SfxIntegerListItem::SfxIntegerListItem()
      30             : {
      31           0 : }
      32             : 
      33         642 : SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::std::vector < sal_Int32 >& rList )
      34         642 :     : SfxPoolItem( which )
      35             : {
      36         642 :     m_aList.realloc( rList.size() );
      37         642 :     for ( size_t n=0; n<rList.size(); ++n )
      38           0 :         m_aList[n] = rList[n];
      39         642 : }
      40             : 
      41           0 : SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::com::sun::star::uno::Sequence < sal_Int32 >& rList )
      42           0 :     : SfxPoolItem( which )
      43             : {
      44           0 :     m_aList.realloc( rList.getLength() );
      45           0 :     for ( sal_Int32 n=0; n<rList.getLength(); ++n )
      46           0 :         m_aList[n] = rList[n];
      47           0 : }
      48             : 
      49           0 : SfxIntegerListItem::SfxIntegerListItem( const SfxIntegerListItem& rItem )
      50           0 :     : SfxPoolItem( rItem )
      51             : {
      52           0 :     m_aList = rItem.m_aList;
      53           0 : }
      54             : 
      55        1220 : SfxIntegerListItem::~SfxIntegerListItem()
      56             : {
      57        1220 : }
      58             : 
      59           0 : bool SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const
      60             : {
      61           0 :     if ( !rPoolItem.ISA( SfxIntegerListItem ) )
      62           0 :         return false;
      63             : 
      64           0 :     const SfxIntegerListItem rItem = static_cast<const SfxIntegerListItem&>(rPoolItem);
      65           0 :     return rItem.m_aList == m_aList;
      66             : }
      67             : 
      68           0 : SfxPoolItem* SfxIntegerListItem::Clone( SfxItemPool * ) const
      69             : {
      70           0 :     return new SfxIntegerListItem( *this );
      71             : }
      72             : 
      73           0 : bool SfxIntegerListItem::PutValue  ( const com::sun::star::uno::Any& rVal, sal_uInt8 )
      74             : {
      75             :     ::com::sun::star::uno::Reference < ::com::sun::star::script::XTypeConverter > xConverter
      76           0 :             ( ::com::sun::star::script::Converter::create(::comphelper::getProcessComponentContext()) );
      77           0 :     ::com::sun::star::uno::Any aNew;
      78           0 :     try { aNew = xConverter->convertTo( rVal, cppu::UnoType<css::uno::Sequence < sal_Int32 >>::get() ); }
      79           0 :     catch (::com::sun::star::uno::Exception&)
      80             :     {
      81           0 :         return true;
      82             :     }
      83             : 
      84           0 :     return ( aNew >>= m_aList );
      85             : }
      86             : 
      87           0 : bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
      88             : {
      89           0 :     rVal <<= m_aList;
      90           0 :     return true;
      91             : }
      92             : 
      93           0 : void SfxIntegerListItem::GetList( ::std::vector< sal_Int32 >& rList ) const
      94             : {
      95           0 :     rList.reserve( m_aList.getLength() );
      96           0 :     for ( sal_Int32 n=0; n<m_aList.getLength(); ++n )
      97           0 :         rList.push_back( m_aList[n] );
      98           0 : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11