1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_editeng.hxx"
26 
27 
28 #include <editeng/charhiddenitem.hxx>
29 #include <editeng/editrids.hrc>
30 #include <editeng/eerdll.hxx>
31 
32 TYPEINIT1_FACTORY(SvxCharHiddenItem, SfxBoolItem, new SvxCharHiddenItem(sal_False, 0));
33 
34 /*-- 16.12.2003 15:24:25---------------------------------------------------
35 
36   -----------------------------------------------------------------------*/
SvxCharHiddenItem(const sal_Bool bHidden,const sal_uInt16 nId)37 SvxCharHiddenItem::SvxCharHiddenItem( const sal_Bool bHidden, const sal_uInt16 nId ) :
38     SfxBoolItem( nId, bHidden )
39 {
40 }
41 /*-- 16.12.2003 15:24:25---------------------------------------------------
42 
43   -----------------------------------------------------------------------*/
Clone(SfxItemPool *) const44 SfxPoolItem* SvxCharHiddenItem::Clone( SfxItemPool * ) const
45 {
46     return new SvxCharHiddenItem( *this );
47 }
48 /*-- 16.12.2003 15:24:25---------------------------------------------------
49 
50   -----------------------------------------------------------------------*/
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const51 SfxItemPresentation SvxCharHiddenItem::GetPresentation
52 (
53     SfxItemPresentation ePres,
54     SfxMapUnit          /*eCoreUnit*/,
55     SfxMapUnit          /*ePresUnit*/,
56     XubString&          rText, const IntlWrapper * /*pIntl*/
57 )   const
58 {
59     switch ( ePres )
60     {
61         case SFX_ITEM_PRESENTATION_NONE:
62             rText.Erase();
63             return ePres;
64         case SFX_ITEM_PRESENTATION_NAMELESS:
65         case SFX_ITEM_PRESENTATION_COMPLETE:
66         {
67             sal_uInt16 nId = RID_SVXITEMS_CHARHIDDEN_FALSE;
68 
69             if ( GetValue() )
70                 nId = RID_SVXITEMS_CHARHIDDEN_TRUE;
71             rText = EE_RESSTR(nId);
72             return ePres;
73         }
74         default: ; //prevent warning
75     }
76     return SFX_ITEM_PRESENTATION_NONE;
77 }
78 
79