LCOV - code coverage report
Current view: top level - sw/inc - fmtsrnd.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 12 13 92.3 %
Date: 2012-08-25 Functions: 11 12 91.7 %
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                 :            : #ifndef _FMTSRND_HXX
      29                 :            : #define _FMTSRND_HXX
      30                 :            : 
      31                 :            : #include "swdllapi.h"
      32                 :            : #include <hintids.hxx>
      33                 :            : #include <format.hxx>
      34                 :            : #include <svl/eitem.hxx>
      35                 :            : 
      36                 :            : #include <fmtsrndenum.hxx>
      37                 :            : class IntlWrapper;
      38                 :            : 
      39                 :            : // SwFmtSurround: How document content under the frame shall behave.
      40         [ -  + ]:       2475 : class SW_DLLPUBLIC SwFmtSurround: public SfxEnumItem
      41                 :            : {
      42                 :            :     sal_Bool    bAnchorOnly :1;
      43                 :            :     sal_Bool    bContour    :1;
      44                 :            :     sal_Bool    bOutside    :1;
      45                 :            : public:
      46                 :            :     SwFmtSurround( SwSurround eNew = SURROUND_PARALLEL );
      47                 :            :     SwFmtSurround( const SwFmtSurround & );
      48                 :            :     inline SwFmtSurround &operator=( const SwFmtSurround &rCpy );
      49                 :            : 
      50                 :            :     // "Pure virtual Methods" of SfxPoolItem.
      51                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
      52                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
      53                 :            :     virtual sal_uInt16          GetValueCount() const;
      54                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      55                 :            :                                     SfxMapUnit eCoreMetric,
      56                 :            :                                     SfxMapUnit ePresMetric,
      57                 :            :                                     String &rText,
      58                 :            :                                     const IntlWrapper*    pIntl = 0 ) const;
      59                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
      60                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
      61                 :            : 
      62                 :            : 
      63                 :       6910 :     SwSurround GetSurround()const { return SwSurround( GetValue() ); }
      64                 :       3969 :     sal_Bool    IsAnchorOnly()  const { return bAnchorOnly; }
      65                 :       5272 :     sal_Bool    IsContour()     const { return bContour; }
      66                 :         20 :     sal_Bool    IsOutside()     const { return bOutside; }
      67                 :          0 :     void    SetSurround  ( SwSurround eNew ){ SfxEnumItem::SetValue( sal_uInt16( eNew ) ); }
      68                 :         40 :     void    SetAnchorOnly( sal_Bool bNew )      { bAnchorOnly = bNew; }
      69                 :        172 :     void    SetContour( sal_Bool bNew )         { bContour = bNew; }
      70                 :        161 :     void    SetOutside( sal_Bool bNew )         { bOutside = bNew; }
      71                 :            : };
      72                 :            : 
      73                 :            : inline SwFmtSurround &SwFmtSurround::operator=( const SwFmtSurround &rCpy )
      74                 :            : {
      75                 :            :     bAnchorOnly = rCpy.IsAnchorOnly();
      76                 :            :     bContour = rCpy.IsContour();
      77                 :            :     bOutside = rCpy.IsOutside();
      78                 :            :     SfxEnumItem::SetValue( rCpy.GetValue() );
      79                 :            :     return *this;
      80                 :            : }
      81                 :            : 
      82                 :      13046 : inline const SwFmtSurround &SwAttrSet::GetSurround(sal_Bool bInP) const
      83                 :      13046 :     { return (const SwFmtSurround&)Get( RES_SURROUND,bInP); }
      84                 :            : 
      85                 :      13046 : inline const SwFmtSurround &SwFmt::GetSurround(sal_Bool bInP) const
      86                 :      13046 :     { return aSet.GetSurround(bInP); }
      87                 :            : 
      88                 :            : #endif
      89                 :            : 
      90                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10