LCOV - code coverage report
Current view: top level - include/svl - cintitem.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 43 43 100.0 %
Date: 2014-04-11 Functions: 20 24 83.3 %
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_CINTITEM_HXX
      21             : #define INCLUDED_SVL_CINTITEM_HXX
      22             : 
      23             : #include <svl/svldllapi.h>
      24             : #include <tools/debug.hxx>
      25             : #include <svl/poolitem.hxx>
      26             : 
      27             : class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
      28             : {
      29             :     sal_uInt8 m_nValue;
      30             : 
      31             : public:
      32             :     TYPEINFO_OVERRIDE();
      33             : 
      34        1371 :     CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
      35        1371 :         SfxPoolItem(which), m_nValue(nTheValue) {}
      36             : 
      37       11134 :     CntByteItem(const CntByteItem & rItem):
      38       11134 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
      39       11134 :     {}
      40             : 
      41       12307 :     virtual ~CntByteItem() {}
      42             : 
      43             :     virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
      44             : 
      45             :     using SfxPoolItem::Compare;
      46             :     virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
      47             : 
      48             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
      49             :                                                 SfxMapUnit, SfxMapUnit,
      50             :                                                 OUString & rText,
      51             :                                                 const IntlWrapper * = 0)
      52             :         const SAL_OVERRIDE;
      53             : 
      54             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
      55             :                             sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
      56             : 
      57             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
      58             :                           sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
      59             : 
      60             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
      61             : 
      62             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
      63             : 
      64             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
      65             : 
      66             :     virtual sal_uInt8 GetMin() const;
      67             : 
      68             :     virtual sal_uInt8 GetMax() const;
      69             : 
      70             :     virtual SfxFieldUnit GetUnit() const;
      71             : 
      72       31977 :     sal_uInt8 GetValue() const { return m_nValue; }
      73             : 
      74             :     inline void SetValue(sal_uInt8 nTheValue);
      75             : };
      76             : 
      77          13 : inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
      78             : {
      79             :     DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
      80          13 :     m_nValue = nTheValue;
      81          13 : }
      82             : 
      83             : class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
      84             : {
      85             :     sal_uInt16 m_nValue;
      86             : 
      87             : public:
      88             :     TYPEINFO_OVERRIDE();
      89             : 
      90      289724 :     CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
      91      289724 :         SfxPoolItem(which), m_nValue(nTheValue)
      92      289724 :     {}
      93             : 
      94             :     CntUInt16Item(sal_uInt16 which, SvStream & rStream);
      95             : 
      96      235986 :     CntUInt16Item(const CntUInt16Item & rItem):
      97      235986 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
      98      235986 :     {}
      99             : 
     100      515216 :     virtual ~CntUInt16Item() {}
     101             : 
     102             :     virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
     103             : 
     104             :     using SfxPoolItem::Compare;
     105             :     virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
     106             : 
     107             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     108             :                                                 SfxMapUnit, SfxMapUnit,
     109             :                                                 OUString & rText,
     110             :                                                 const IntlWrapper * = 0)
     111             :         const SAL_OVERRIDE;
     112             : 
     113             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     114             :                             sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
     115             : 
     116             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     117             :                           sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
     118             : 
     119             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
     120             : 
     121             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
     122             : 
     123             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
     124             : 
     125             :     virtual sal_uInt16 GetMin() const;
     126             : 
     127             :     virtual sal_uInt16 GetMax() const;
     128             : 
     129             :     virtual SfxFieldUnit GetUnit() const;
     130             : 
     131     5894712 :     sal_uInt16 GetValue() const { return m_nValue; }
     132             : 
     133             :     inline void SetValue(sal_uInt16 nTheValue);
     134             : };
     135             : 
     136       29949 : inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
     137             : {
     138             :     DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
     139       29949 :     m_nValue = nTheValue;
     140       29949 : }
     141             : 
     142             : class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
     143             : {
     144             :     sal_Int32 m_nValue;
     145             : 
     146             : public:
     147             :     TYPEINFO_OVERRIDE();
     148             : 
     149      391588 :     CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
     150      391588 :         SfxPoolItem(which), m_nValue(nTheValue)
     151      391588 :     {}
     152             : 
     153             :     CntInt32Item(sal_uInt16 which, SvStream & rStream);
     154             : 
     155       57663 :     CntInt32Item(const CntInt32Item & rItem):
     156       57663 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
     157       57663 :     {}
     158             : 
     159      429353 :     virtual ~CntInt32Item() {}
     160             : 
     161             :     virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
     162             : 
     163             :     using SfxPoolItem::Compare;
     164             :     virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
     165             : 
     166             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     167             :                                                 SfxMapUnit, SfxMapUnit,
     168             :                                                 OUString & rText,
     169             :                                                 const IntlWrapper * = 0)
     170             :         const SAL_OVERRIDE;
     171             : 
     172             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     173             :                             sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
     174             : 
     175             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     176             :                           sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
     177             : 
     178             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
     179             : 
     180             :     virtual SvStream & Store(SvStream &, sal_uInt16) const SAL_OVERRIDE;
     181             : 
     182             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
     183             : 
     184             :     virtual sal_Int32 GetMin() const;
     185             : 
     186             :     virtual sal_Int32 GetMax() const;
     187             : 
     188             :     virtual SfxFieldUnit GetUnit() const;
     189             : 
     190     5677590 :     sal_Int32 GetValue() const { return m_nValue; }
     191             : 
     192             :     inline void SetValue(sal_Int32 nTheValue);
     193             : };
     194             : 
     195       18272 : inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
     196             : {
     197             :     DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
     198       18272 :     m_nValue = nTheValue;
     199       18272 : }
     200             : 
     201             : class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
     202             : {
     203             :     sal_uInt32 m_nValue;
     204             : 
     205             : public:
     206             :     TYPEINFO_OVERRIDE();
     207             : 
     208       28151 :     CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
     209       28151 :         SfxPoolItem(which), m_nValue(nTheValue)
     210       28151 :     {}
     211             : 
     212             :     CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
     213             : 
     214        5067 :     CntUInt32Item(const CntUInt32Item & rItem):
     215        5067 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
     216        5067 :     {}
     217             : 
     218       30915 :     virtual ~CntUInt32Item() {}
     219             : 
     220             :     virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
     221             : 
     222             :     using SfxPoolItem::Compare;
     223             :     virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
     224             : 
     225             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     226             :                                                 SfxMapUnit, SfxMapUnit,
     227             :                                                 OUString & rText,
     228             :                                                 const IntlWrapper * = 0)
     229             :         const SAL_OVERRIDE;
     230             : 
     231             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     232             :                             sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
     233             : 
     234             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     235             :                           sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
     236             : 
     237             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
     238             : 
     239             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
     240             : 
     241             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
     242             : 
     243             :     virtual sal_uInt32 GetMin() const;
     244             : 
     245             :     virtual sal_uInt32 GetMax() const;
     246             : 
     247             :     virtual SfxFieldUnit GetUnit() const;
     248             : 
     249      115069 :     sal_uInt32 GetValue() const { return m_nValue; }
     250             : 
     251             :     inline void SetValue(sal_uInt32 nTheValue);
     252             : };
     253             : 
     254         218 : inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
     255             : {
     256             :     DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
     257         218 :     m_nValue = nTheValue;
     258         218 : }
     259             : 
     260             : #endif // INCLUDED_SVL_CINTITEM_HXX
     261             : 
     262             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10