LCOV - code coverage report
Current view: top level - include/svl - intitem.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 33 43 76.7 %
Date: 2014-11-03 Functions: 26 32 81.2 %
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             : #ifndef INCLUDED_SVL_INTITEM_HXX
      21             : #define INCLUDED_SVL_INTITEM_HXX
      22             : 
      23             : #include <svl/svldllapi.h>
      24             : #include <svl/cintitem.hxx>
      25             : 
      26             : 
      27       49664 : class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
      28             : {
      29             : public:
      30             :     TYPEINFO_OVERRIDE();
      31             : 
      32        3268 :     explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
      33        3268 :         CntByteItem(which, nValue) {}
      34             : 
      35             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
      36             : 
      37           0 :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
      38           0 :     { return new SfxByteItem(*this); }
      39             : };
      40             : 
      41             : class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
      42             : {
      43             :     sal_Int16 m_nValue;
      44             : 
      45             : public:
      46             :     TYPEINFO_OVERRIDE();
      47             : 
      48      717073 :     explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
      49      717073 :         SfxPoolItem(which), m_nValue(nTheValue)
      50      717073 :     {}
      51             : 
      52             :     SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
      53             : 
      54       66732 :     SfxInt16Item(const SfxInt16Item & rItem):
      55       66732 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
      56       66732 :     {}
      57             : 
      58      843463 :     virtual ~SfxInt16Item() {}
      59             : 
      60             :     virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
      61             : 
      62             :     using SfxPoolItem::Compare;
      63             :     virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
      64             : 
      65             :     virtual bool GetPresentation(SfxItemPresentation,
      66             :                                                 SfxMapUnit, SfxMapUnit,
      67             :                                                 OUString & rText,
      68             :                                                 const IntlWrapper * = 0)
      69             :         const SAL_OVERRIDE;
      70             : 
      71             :     virtual bool QueryValue( com::sun::star::uno::Any& rVal,
      72             :                              sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
      73             : 
      74             :     virtual bool PutValue( const com::sun::star::uno::Any& rVal,
      75             :                            sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
      76             : 
      77             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
      78             : 
      79             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
      80             : 
      81             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
      82             : 
      83             :     virtual sal_Int16 GetMin() const;
      84             : 
      85             :     virtual sal_Int16 GetMax() const;
      86             : 
      87             :     virtual SfxFieldUnit GetUnit() const;
      88             : 
      89     4745266 :     sal_Int16 GetValue() const { return m_nValue; }
      90             : 
      91             :     inline void SetValue(sal_Int16 nTheValue);
      92             : };
      93             : 
      94       24241 : inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
      95             : {
      96             :     DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
      97       24241 :     m_nValue = nTheValue;
      98       24241 : }
      99             : 
     100             : 
     101     1554918 : class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
     102             : {
     103             : public:
     104             :     TYPEINFO_OVERRIDE();
     105             : 
     106      607235 :     explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
     107      607235 :         CntUInt16Item(which, nValue) {}
     108             : 
     109           0 :     SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
     110           0 :         CntUInt16Item(which, rStream) {}
     111             : 
     112           0 :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
     113           0 :     { return new SfxUInt16Item(Which(), rStream); }
     114             : 
     115      121409 :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
     116      121409 :     { return new SfxUInt16Item(*this); }
     117             : };
     118             : 
     119             : 
     120     1094191 : class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
     121             : {
     122             : public:
     123             :     TYPEINFO_OVERRIDE();
     124             : 
     125      971069 :     explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
     126      971069 :         CntInt32Item(which, nValue) {}
     127             : 
     128         512 :     SfxInt32Item(sal_uInt16 which, SvStream & rStream):
     129         512 :         CntInt32Item(which, rStream) {}
     130             : 
     131         512 :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
     132         512 :     { return new SfxInt32Item(Which(), rStream); }
     133             : 
     134        1320 :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
     135        1320 :     { return new SfxInt32Item(*this); }
     136             : 
     137             : };
     138             : 
     139             : 
     140      167852 : class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
     141             : {
     142             : public:
     143             :     TYPEINFO_OVERRIDE();
     144             : 
     145       73449 :     explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
     146       73449 :         CntUInt32Item(which, nValue) {}
     147             : 
     148           0 :     SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
     149           0 :         CntUInt32Item(which, rStream) {}
     150             : 
     151           0 :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
     152           0 :     { return new SfxUInt32Item(Which(), rStream); }
     153             : 
     154       12003 :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
     155       12003 :     { return new SfxUInt32Item(*this); }
     156             : };
     157             : 
     158             : #endif // INCLUDED_SVL_INTITEM_HXX
     159             : 
     160             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10