LCOV - code coverage report
Current view: top level - svx/source/items - postattr.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 3 48 6.2 %
Date: 2014-11-03 Functions: 3 27 11.1 %
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             : #include "svx/postattr.hxx"
      21             : #include <editeng/itemtype.hxx>
      22             : #include <svx/svxitems.hrc>
      23             : #include <svx/dialmgr.hxx>
      24             : 
      25             : 
      26             : 
      27         202 : TYPEINIT1_FACTORY(SvxPostItAuthorItem, SfxStringItem, new SvxPostItAuthorItem(0));
      28         202 : TYPEINIT1_FACTORY(SvxPostItDateItem, SfxStringItem, new SvxPostItDateItem(0));
      29         202 : TYPEINIT1_FACTORY(SvxPostItTextItem, SfxStringItem, new SvxPostItTextItem(0));
      30             : 
      31           0 : SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich )
      32             : {
      33           0 :     SetWhich( _nWhich );
      34           0 : }
      35             : 
      36             : 
      37             : 
      38           0 : SvxPostItAuthorItem::SvxPostItAuthorItem( const OUString& rAuthor,
      39             :                                           sal_uInt16 _nWhich ) :
      40           0 :     SfxStringItem( _nWhich, rAuthor )
      41             : {
      42           0 : }
      43             : 
      44             : 
      45             : 
      46           0 : bool SvxPostItAuthorItem::GetPresentation
      47             : (
      48             :     SfxItemPresentation ePres,
      49             :     SfxMapUnit          /*eCoreUnit*/,
      50             :     SfxMapUnit          /*ePresUnit*/,
      51             :     OUString&           rText, const IntlWrapper *
      52             : )   const
      53             : {
      54           0 :     switch ( ePres )
      55             :     {
      56             :         case SFX_ITEM_PRESENTATION_NAMELESS:
      57           0 :             rText = GetValue();
      58           0 :             return true;
      59             :         case SFX_ITEM_PRESENTATION_COMPLETE:
      60           0 :             rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
      61           0 :             return true;
      62             :         default: ;//prevent warning
      63             :     }
      64           0 :     return false;
      65             : }
      66             : 
      67             : 
      68             : 
      69           0 : SfxPoolItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const
      70             : {
      71           0 :     return new SvxPostItAuthorItem( *this );
      72             : }
      73             : 
      74           0 : SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich )
      75             : {
      76           0 :     SetWhich( _nWhich );
      77           0 : }
      78             : 
      79             : 
      80             : 
      81           0 : SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, sal_uInt16 _nWhich ) :
      82             : 
      83           0 :     SfxStringItem( _nWhich, rDate )
      84             : {
      85           0 : }
      86             : 
      87             : 
      88             : 
      89           0 : bool SvxPostItDateItem::GetPresentation
      90             : (
      91             :     SfxItemPresentation ePres,
      92             :     SfxMapUnit          /*eCoreUnit*/,
      93             :     SfxMapUnit          /*ePresUnit*/,
      94             :     OUString&           rText, const IntlWrapper *
      95             : )   const
      96             : {
      97           0 :     switch ( ePres )
      98             :     {
      99             :         case SFX_ITEM_PRESENTATION_NAMELESS:
     100           0 :             rText = GetValue();
     101           0 :             return true;
     102             :         case SFX_ITEM_PRESENTATION_COMPLETE:
     103           0 :             rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
     104           0 :             return true;
     105             :         default: ;//prevent warning
     106             :     }
     107           0 :     return false;
     108             : }
     109             : 
     110             : 
     111             : 
     112           0 : SfxPoolItem* SvxPostItDateItem::Clone( SfxItemPool * ) const
     113             : {
     114           0 :     return new SvxPostItDateItem( *this );
     115             : }
     116             : 
     117           0 : SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich )
     118             : {
     119           0 :     SetWhich( _nWhich );
     120           0 : }
     121             : 
     122             : 
     123             : 
     124           0 : SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, sal_uInt16 _nWhich ) :
     125             : 
     126           0 :     SfxStringItem( _nWhich, rText )
     127             : {
     128           0 : }
     129             : 
     130             : 
     131             : 
     132           0 : bool SvxPostItTextItem::GetPresentation
     133             : (
     134             :     SfxItemPresentation ePres,
     135             :     SfxMapUnit          /*eCoreUnit*/,
     136             :     SfxMapUnit          /*ePresUnit*/,
     137             :     OUString&           rText, const IntlWrapper *
     138             : )   const
     139             : {
     140           0 :     switch ( ePres )
     141             :     {
     142             :         case SFX_ITEM_PRESENTATION_NAMELESS:
     143           0 :             rText = GetValue();
     144           0 :             return true;
     145             :         case SFX_ITEM_PRESENTATION_COMPLETE:
     146           0 :             rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
     147           0 :             return true;
     148             :         default: ;//prevent warning
     149             :     }
     150           0 :     return false;
     151             : }
     152             : 
     153             : 
     154             : 
     155           0 : SfxPoolItem* SvxPostItTextItem::Clone( SfxItemPool * ) const
     156             : {
     157           0 :     return new SvxPostItTextItem( *this );
     158             : }
     159             : 
     160             : 
     161             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10