LCOV - code coverage report
Current view: top level - svx/source/items - numinf.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 61 0.0 %
Date: 2012-08-25 Functions: 0 19 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 74 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <svx/numinf.hxx>
      30                 :            : 
      31                 :            : // -----------------------------------------------------------------------
      32                 :            : 
      33 [ #  # ][ #  # ]:          0 : TYPEINIT1(SvxNumberInfoItem, SfxPoolItem);
      34                 :            : 
      35                 :            : // class SvxNumberInfoItem -----------------------------------------------
      36                 :            : 
      37                 :            : #define INIT(pNum,eVal,nDouble,rStr)    \
      38                 :            :     SfxPoolItem     ( nId ),            \
      39                 :            :                                         \
      40                 :            :     pFormatter      ( pNum ),           \
      41                 :            :     eValueType      ( eVal ),           \
      42                 :            :     aStringVal      ( rStr ),           \
      43                 :            :     nDoubleVal      ( nDouble ),        \
      44                 :            :     pDelFormatArr   ( NULL ),           \
      45                 :            :     nDelCount       ( 0 )
      46                 :            : 
      47                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( const sal_uInt16 nId ) :
      48                 :            : 
      49         [ #  # ]:          0 :     INIT( NULL, SVX_VALUE_TYPE_UNDEFINED, 0, String() )
      50                 :            : 
      51                 :            : {
      52                 :          0 : }
      53                 :            : 
      54                 :            : // -----------------------------------------------------------------------
      55                 :            : 
      56                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
      57                 :            :                                       const sal_uInt16 nId ) :
      58                 :            : 
      59         [ #  # ]:          0 :     INIT( pNumFormatter, SVX_VALUE_TYPE_UNDEFINED, 0, String() )
      60                 :            : 
      61                 :            : {
      62                 :          0 : }
      63                 :            : 
      64                 :            : // -----------------------------------------------------------------------
      65                 :            : 
      66                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
      67                 :            :                                       const String& rVal, const sal_uInt16 nId ) :
      68                 :            : 
      69         [ #  # ]:          0 :     INIT( pNumFormatter, SVX_VALUE_TYPE_STRING, 0, rVal )
      70                 :            : 
      71                 :            : {
      72                 :          0 : }
      73                 :            : 
      74                 :            : // -----------------------------------------------------------------------
      75                 :            : 
      76                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
      77                 :            :                                       const double& rVal, const sal_uInt16 nId ) :
      78                 :            : 
      79         [ #  # ]:          0 :     INIT( pNumFormatter, SVX_VALUE_TYPE_NUMBER, rVal, String() )
      80                 :            : 
      81                 :            : {
      82                 :          0 : }
      83                 :            : 
      84                 :            : // -----------------------------------------------------------------------
      85                 :            : 
      86                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
      87                 :            :                                       const double& rVal, const String& rValueStr,
      88                 :            :                                       const sal_uInt16 nId ) :
      89                 :            : 
      90         [ #  # ]:          0 :     INIT( pNumFormatter, SVX_VALUE_TYPE_NUMBER, rVal, rValueStr )
      91                 :            : 
      92                 :            : {
      93                 :          0 : }
      94                 :            : 
      95                 :            : #undef INIT
      96                 :            : 
      97                 :            : // -----------------------------------------------------------------------
      98                 :            : 
      99                 :          0 : SvxNumberInfoItem::SvxNumberInfoItem( const SvxNumberInfoItem& rItem ) :
     100                 :            : 
     101                 :          0 :     SfxPoolItem( rItem.Which() ),
     102                 :            : 
     103                 :            :     pFormatter   ( rItem.pFormatter ),
     104                 :            :     eValueType   ( rItem.eValueType ),
     105                 :            :     aStringVal   ( rItem.aStringVal ),
     106                 :            :     nDoubleVal   ( rItem.nDoubleVal ),
     107                 :            :     pDelFormatArr( NULL ),
     108         [ #  # ]:          0 :     nDelCount    ( rItem.nDelCount )
     109                 :            : 
     110                 :            : {
     111         [ #  # ]:          0 :     if ( rItem.nDelCount > 0 )
     112                 :            :     {
     113         [ #  # ]:          0 :         pDelFormatArr = new sal_uInt32[ rItem.nDelCount ];
     114                 :            : 
     115         [ #  # ]:          0 :         for ( sal_uInt16 i = 0; i < rItem.nDelCount; ++i )
     116                 :          0 :             pDelFormatArr[i] = rItem.pDelFormatArr[i];
     117                 :            :     }
     118                 :          0 : }
     119                 :            : 
     120                 :            : // -----------------------------------------------------------------------
     121                 :            : 
     122         [ #  # ]:          0 : SvxNumberInfoItem::~SvxNumberInfoItem()
     123                 :            : {
     124         [ #  # ]:          0 :     if ( pDelFormatArr )
     125         [ #  # ]:          0 :         delete []pDelFormatArr;
     126         [ #  # ]:          0 : }
     127                 :            : 
     128                 :            : //------------------------------------------------------------------------
     129                 :            : 
     130                 :          0 : SfxItemPresentation SvxNumberInfoItem::GetPresentation
     131                 :            : (
     132                 :            :     SfxItemPresentation /*ePres*/,
     133                 :            :     SfxMapUnit          /*eCoreUnit*/,
     134                 :            :     SfxMapUnit          /*ePresUnit*/,
     135                 :            :     String&             rText, const IntlWrapper *
     136                 :            : )   const
     137                 :            : {
     138                 :          0 :     rText.Erase();
     139                 :          0 :     return SFX_ITEM_PRESENTATION_NONE;
     140                 :            : }
     141                 :            : 
     142                 :            : // -----------------------------------------------------------------------
     143                 :            : 
     144                 :          0 : int SvxNumberInfoItem::operator==( const SfxPoolItem& rItem ) const
     145                 :            : {
     146                 :            :     DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal which or type" );
     147                 :            : 
     148                 :          0 :     SvxNumberInfoItem& rOther = (SvxNumberInfoItem&)rItem;
     149                 :            : 
     150                 :          0 :     sal_Bool bEqual = sal_False;
     151                 :            : 
     152         [ #  # ]:          0 :     if ( nDelCount == rOther.nDelCount )
     153                 :            :     {
     154         [ #  # ]:          0 :         if ( nDelCount > 0 )
     155                 :            :         {
     156 [ #  # ][ #  # ]:          0 :             if ( pDelFormatArr != NULL && rOther.pDelFormatArr != NULL )
     157                 :            :             {
     158                 :          0 :                 bEqual = sal_True;
     159                 :            : 
     160 [ #  # ][ #  # ]:          0 :                 for ( sal_uInt16 i = 0; i < nDelCount && bEqual; ++i )
                 [ #  # ]
     161                 :          0 :                     bEqual = ( pDelFormatArr[i] == rOther.pDelFormatArr[i] );
     162                 :            :             }
     163                 :            :         }
     164         [ #  # ]:          0 :         else if ( nDelCount == 0 )
     165 [ #  # ][ #  # ]:          0 :             bEqual = ( pDelFormatArr == NULL && rOther.pDelFormatArr == NULL );
     166                 :            : 
     167                 :            :         bEqual = bEqual &&
     168                 :            :                  pFormatter == rOther.pFormatter &&
     169                 :            :                  eValueType == rOther.eValueType &&
     170                 :            :                  nDoubleVal == rOther.nDoubleVal &&
     171 [ #  # ][ #  # ]:          0 :                  aStringVal == rOther.aStringVal;
         [ #  # ][ #  # ]
                 [ #  # ]
     172                 :            :     }
     173                 :          0 :     return bEqual;
     174                 :            : }
     175                 :            : 
     176                 :            : // -----------------------------------------------------------------------
     177                 :            : 
     178                 :          0 : SfxPoolItem* SvxNumberInfoItem::Clone( SfxItemPool * ) const
     179                 :            : {
     180         [ #  # ]:          0 :     return new SvxNumberInfoItem( *this );
     181                 :            : }
     182                 :            : 
     183                 :            : // Laden/Speichern wird nicht gebraucht!
     184                 :            : // -----------------------------------------------------------------------
     185                 :            : 
     186                 :          0 : SfxPoolItem* SvxNumberInfoItem::Create( SvStream& /*rStream*/, sal_uInt16 ) const
     187                 :            : {
     188         [ #  # ]:          0 :     return new SvxNumberInfoItem( *this );
     189                 :            : }
     190                 :            : 
     191                 :            : // -----------------------------------------------------------------------
     192                 :            : 
     193                 :          0 : SvStream& SvxNumberInfoItem::Store( SvStream &rStream, sal_uInt16 /*nItemVersion*/ ) const
     194                 :            : {
     195                 :          0 :     return rStream;
     196                 :            : }
     197                 :            : 
     198                 :            : // -----------------------------------------------------------------------
     199                 :            : 
     200                 :          0 : void SvxNumberInfoItem::SetDelFormatArray( const sal_uInt32* pData,
     201                 :            :                                            const sal_uInt32 nCount )
     202                 :            : {
     203         [ #  # ]:          0 :     if ( pDelFormatArr )
     204                 :            :     {
     205         [ #  # ]:          0 :         delete []pDelFormatArr;
     206                 :          0 :         pDelFormatArr = NULL;
     207                 :            :     }
     208                 :            : 
     209                 :          0 :     nDelCount = nCount;
     210                 :            : 
     211         [ #  # ]:          0 :     if ( nCount > 0 )
     212                 :            :     {
     213                 :          0 :         pDelFormatArr = new sal_uInt32[ nCount ];
     214                 :            : 
     215         [ #  # ]:          0 :         if ( pData != NULL )
     216                 :            :         {
     217         [ #  # ]:          0 :             for ( sal_uInt16 i = 0; i < nCount; ++i )
     218                 :          0 :                 pDelFormatArr[i] = pData[i];
     219                 :            :         }
     220                 :            :     }
     221                 :          0 : }
     222                 :            : 
     223                 :            : 
     224                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10