LCOV - code coverage report
Current view: top level - svx/source/items - postattr.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 57 5.3 %
Date: 2012-08-25 Functions: 3 27 11.1 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 48 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/postattr.hxx"
      30                 :            : #include <editeng/itemtype.hxx>
      31                 :            : #include <svx/svxitems.hrc>
      32                 :            : #include <svx/dialmgr.hxx>
      33                 :            : 
      34                 :            : // -----------------------------------------------------------------------
      35                 :            : 
      36 [ #  # ][ #  # ]:        183 : TYPEINIT1_FACTORY(SvxPostItAuthorItem, SfxStringItem, new SvxPostItAuthorItem(0));
                 [ #  # ]
      37 [ #  # ][ #  # ]:        183 : TYPEINIT1_FACTORY(SvxPostItDateItem, SfxStringItem, new SvxPostItDateItem(0));
                 [ #  # ]
      38 [ #  # ][ #  # ]:        183 : TYPEINIT1_FACTORY(SvxPostItTextItem, SfxStringItem, new SvxPostItTextItem(0));
                 [ #  # ]
      39                 :            : 
      40                 :            : // class SvxPostItAuthorItem ---------------------------------------------
      41                 :            : 
      42                 :          0 : SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich )
      43                 :            : {
      44                 :          0 :     SetWhich( _nWhich );
      45                 :          0 : }
      46                 :            : 
      47                 :            : // -----------------------------------------------------------------------
      48                 :            : 
      49                 :          0 : SvxPostItAuthorItem::SvxPostItAuthorItem( const XubString& rAuthor,
      50                 :            :                                           sal_uInt16 _nWhich ) :
      51                 :          0 :     SfxStringItem( _nWhich, rAuthor )
      52                 :            : {
      53                 :          0 : }
      54                 :            : 
      55                 :            : //------------------------------------------------------------------------
      56                 :            : 
      57                 :          0 : SfxItemPresentation SvxPostItAuthorItem::GetPresentation
      58                 :            : (
      59                 :            :     SfxItemPresentation ePres,
      60                 :            :     SfxMapUnit          /*eCoreUnit*/,
      61                 :            :     SfxMapUnit          /*ePresUnit*/,
      62                 :            :     XubString&          rText, const IntlWrapper *
      63                 :            : )   const
      64                 :            : {
      65   [ #  #  #  # ]:          0 :     switch ( ePres )
      66                 :            :     {
      67                 :            :         case SFX_ITEM_PRESENTATION_NONE:
      68                 :          0 :             rText.Erase();
      69                 :          0 :             return SFX_ITEM_PRESENTATION_NONE;
      70                 :            :         case SFX_ITEM_PRESENTATION_NAMELESS:
      71                 :          0 :             rText = GetValue();
      72                 :          0 :             return SFX_ITEM_PRESENTATION_NAMELESS;
      73                 :            :         case SFX_ITEM_PRESENTATION_COMPLETE:
      74 [ #  # ][ #  # ]:          0 :             rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE);
      75                 :          0 :             rText += GetValue();
      76                 :          0 :             return SFX_ITEM_PRESENTATION_COMPLETE;
      77                 :            :         default: ;//prevent warning
      78                 :            :     }
      79                 :          0 :     return SFX_ITEM_PRESENTATION_NONE;
      80                 :            : }
      81                 :            : 
      82                 :            : // -----------------------------------------------------------------------
      83                 :            : 
      84                 :          0 : SfxPoolItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const
      85                 :            : {
      86         [ #  # ]:          0 :     return new SvxPostItAuthorItem( *this );
      87                 :            : }
      88                 :            : 
      89                 :            : // class SvxPostItDateItem -----------------------------------------------
      90                 :            : 
      91                 :          0 : SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich )
      92                 :            : {
      93                 :          0 :     SetWhich( _nWhich );
      94                 :          0 : }
      95                 :            : 
      96                 :            : // -----------------------------------------------------------------------
      97                 :            : 
      98                 :          0 : SvxPostItDateItem::SvxPostItDateItem( const XubString& rDate, sal_uInt16 _nWhich ) :
      99                 :            : 
     100                 :          0 :     SfxStringItem( _nWhich, rDate )
     101                 :            : {
     102                 :          0 : }
     103                 :            : 
     104                 :            : //------------------------------------------------------------------------
     105                 :            : 
     106                 :          0 : SfxItemPresentation SvxPostItDateItem::GetPresentation
     107                 :            : (
     108                 :            :     SfxItemPresentation ePres,
     109                 :            :     SfxMapUnit          /*eCoreUnit*/,
     110                 :            :     SfxMapUnit          /*ePresUnit*/,
     111                 :            :     XubString&          rText, const IntlWrapper *
     112                 :            : )   const
     113                 :            : {
     114   [ #  #  #  # ]:          0 :     switch ( ePres )
     115                 :            :     {
     116                 :            :         case SFX_ITEM_PRESENTATION_NONE:
     117                 :          0 :             rText.Erase();
     118                 :          0 :             return SFX_ITEM_PRESENTATION_NONE;
     119                 :            :         case SFX_ITEM_PRESENTATION_NAMELESS:
     120                 :          0 :             rText = GetValue();
     121                 :          0 :             return SFX_ITEM_PRESENTATION_NAMELESS;
     122                 :            :         case SFX_ITEM_PRESENTATION_COMPLETE:
     123 [ #  # ][ #  # ]:          0 :             rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE);
     124                 :          0 :             rText += GetValue();
     125                 :          0 :             return SFX_ITEM_PRESENTATION_COMPLETE;
     126                 :            :         default: ;//prevent warning
     127                 :            :     }
     128                 :          0 :     return SFX_ITEM_PRESENTATION_NONE;
     129                 :            : }
     130                 :            : 
     131                 :            : // -----------------------------------------------------------------------
     132                 :            : 
     133                 :          0 : SfxPoolItem* SvxPostItDateItem::Clone( SfxItemPool * ) const
     134                 :            : {
     135         [ #  # ]:          0 :     return new SvxPostItDateItem( *this );
     136                 :            : }
     137                 :            : 
     138                 :            : // class SvxPostItTextItem -----------------------------------------------
     139                 :            : 
     140                 :          0 : SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich )
     141                 :            : {
     142                 :          0 :     SetWhich( _nWhich );
     143                 :          0 : }
     144                 :            : 
     145                 :            : // -----------------------------------------------------------------------
     146                 :            : 
     147                 :          0 : SvxPostItTextItem::SvxPostItTextItem( const XubString& rText, sal_uInt16 _nWhich ) :
     148                 :            : 
     149                 :          0 :     SfxStringItem( _nWhich, rText )
     150                 :            : {
     151                 :          0 : }
     152                 :            : 
     153                 :            : //------------------------------------------------------------------------
     154                 :            : 
     155                 :          0 : SfxItemPresentation SvxPostItTextItem::GetPresentation
     156                 :            : (
     157                 :            :     SfxItemPresentation ePres,
     158                 :            :     SfxMapUnit          /*eCoreUnit*/,
     159                 :            :     SfxMapUnit          /*ePresUnit*/,
     160                 :            :     XubString&          rText, const IntlWrapper *
     161                 :            : )   const
     162                 :            : {
     163   [ #  #  #  # ]:          0 :     switch ( ePres )
     164                 :            :     {
     165                 :            :         case SFX_ITEM_PRESENTATION_NONE:
     166                 :          0 :             rText.Erase();
     167                 :          0 :             return SFX_ITEM_PRESENTATION_NONE;
     168                 :            :         case SFX_ITEM_PRESENTATION_NAMELESS:
     169                 :          0 :             rText = GetValue();
     170                 :          0 :             return SFX_ITEM_PRESENTATION_NAMELESS;
     171                 :            :         case SFX_ITEM_PRESENTATION_COMPLETE:
     172 [ #  # ][ #  # ]:          0 :             rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE);
     173                 :          0 :             rText += GetValue();
     174                 :          0 :             return SFX_ITEM_PRESENTATION_COMPLETE;
     175                 :            :         default: ;//prevent warning
     176                 :            :     }
     177                 :          0 :     return SFX_ITEM_PRESENTATION_NONE;
     178                 :            : }
     179                 :            : 
     180                 :            : // -----------------------------------------------------------------------
     181                 :            : 
     182                 :          0 : SfxPoolItem* SvxPostItTextItem::Clone( SfxItemPool * ) const
     183                 :            : {
     184         [ #  # ]:          0 :     return new SvxPostItTextItem( *this );
     185                 :            : }
     186                 :            : 
     187                 :            : 
     188                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10