LCOV - code coverage report
Current view: top level - svx/inc/svx - xit.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 6 7 85.7 %
Date: 2012-08-25 Functions: 6 8 75.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.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                 :            : #ifndef _SVX_XIT_HXX
      30                 :            : #define _SVX_XIT_HXX
      31                 :            : 
      32                 :            : #include <svl/stritem.hxx>
      33                 :            : #include <svx/xtable.hxx>
      34                 :            : #include <svx/xdef.hxx>
      35                 :            : #include "svx/svxdllapi.h"
      36                 :            : 
      37                 :            : /************************************************************************/
      38                 :            : 
      39                 :            : class SfxItemPool;
      40                 :            : class NameOrIndex;
      41                 :            : 
      42                 :            : typedef sal_Bool (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p2 );
      43                 :            : 
      44                 :            : //-------------------
      45                 :            : // class NameOrIndex
      46                 :            : //-------------------
      47                 :            : class SVX_DLLPUBLIC NameOrIndex : public SfxStringItem
      48                 :            : {
      49                 :            :     sal_Int32    nPalIndex;
      50                 :            : 
      51                 :            : protected:
      52                 :      44402 :     void    Detach()    { nPalIndex = -1; }
      53                 :            : 
      54                 :            : public:
      55                 :            :             TYPEINFO();
      56                 :        300 :             NameOrIndex() { nPalIndex = -1; }
      57                 :            :             NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex);
      58                 :            :             NameOrIndex(sal_uInt16 nWhich,
      59                 :            :                         const String& rName= String());
      60                 :            :             NameOrIndex(sal_uInt16 nWhich, SvStream& rIn);
      61                 :            :             NameOrIndex(const NameOrIndex& rNameOrIndex);
      62         [ -  + ]:     167266 :            ~NameOrIndex() {};
      63                 :            : 
      64                 :            :     virtual int          operator==(const SfxPoolItem& rItem) const;
      65                 :            :     virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
      66                 :            :     virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
      67                 :            :     virtual SvStream&    Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
      68                 :            : 
      69                 :      78823 :             String       GetName() const              { return GetValue();   }
      70                 :        760 :             void         SetName(const String& rName) { SetValue(rName);     }
      71                 :          0 :             sal_Int32        GetIndex() const             { return nPalIndex;    }
      72                 :            :             void         SetIndex(sal_Int32 nIndex)        { nPalIndex = nIndex;  }
      73                 :     113393 :             sal_Bool         IsIndex() const          { return (nPalIndex >= 0); }
      74                 :            : 
      75                 :            :     /** this static checks if the given NameOrIndex item has a unique name for its value.
      76                 :            :         The returned String is a unique name for an item with this value in both given pools.
      77                 :            :         Argument pPool2 can be null.
      78                 :            :         If returned string equals NameOrIndex->GetName(), the name was already unique.
      79                 :            :     */
      80                 :            :     static String CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* pPool2, SvxCompareValueFunc pCompareValueFunc, sal_uInt16 nPrefixResId, const XPropertyListRef &pDefaults );
      81                 :            : };
      82                 :            : 
      83                 :            : #endif
      84                 :            : 
      85                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10