1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
30 // include ---------------------------------------------------------------
33 #include <editeng/writingmodeitem.hxx>
34 #include <editeng/eerdll.hxx>
35 #include <editeng/editrids.hrc>
37 using namespace ::com::sun::star::uno
;
38 using namespace ::com::sun::star::text
;
41 TYPEINIT1_FACTORY(SvxWritingModeItem
, SfxUInt16Item
, new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB
, 0));
43 SvxWritingModeItem::SvxWritingModeItem( WritingMode eValue
, sal_uInt16 _nWhich
)
44 : SfxUInt16Item( _nWhich
, (sal_uInt16
)eValue
)
48 SvxWritingModeItem::~SvxWritingModeItem()
52 int SvxWritingModeItem::operator==( const SfxPoolItem
& rCmp
) const
54 DBG_ASSERT( SfxPoolItem::operator==(rCmp
), "unequal types" );
56 return GetValue() == ((SvxWritingModeItem
&)rCmp
).GetValue();
59 SfxPoolItem
* SvxWritingModeItem::Clone( SfxItemPool
* ) const
61 return new SvxWritingModeItem( *this );
64 SfxPoolItem
* SvxWritingModeItem::Create( SvStream
& , sal_uInt16
) const
66 OSL_FAIL("SvxWritingModeItem should not be streamed!");
70 SvStream
& SvxWritingModeItem::Store( SvStream
& rStrm
, sal_uInt16
) const
72 OSL_FAIL("SvxWritingModeItem should not be streamed!");
76 sal_uInt16
SvxWritingModeItem::GetVersion( sal_uInt16
/*nFVer*/ ) const
81 SfxItemPresentation
SvxWritingModeItem::GetPresentation( SfxItemPresentation ePres
,
82 SfxMapUnit
/*eCoreMetric*/,
83 SfxMapUnit
/*ePresMetric*/,
85 const IntlWrapper
* ) const
87 SfxItemPresentation eRet
= ePres
;
90 case SFX_ITEM_PRESENTATION_NONE
:
94 case SFX_ITEM_PRESENTATION_NAMELESS
:
95 case SFX_ITEM_PRESENTATION_COMPLETE
:
96 rText
= EE_RESSTR(RID_SVXITEMS_FRMDIR_BEGIN
+ GetValue());
100 eRet
= SFX_ITEM_PRESENTATION_NONE
;
105 bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8
)
108 bool bRet
= ( rVal
>>= nVal
);
113 bRet
= rVal
>>= eMode
;
117 nVal
= (sal_Int32
)eMode
;
125 case WritingMode_LR_TB
:
126 case WritingMode_RL_TB
:
127 case WritingMode_TB_RL
:
128 SetValue( (sal_uInt16
)nVal
);
140 bool SvxWritingModeItem::QueryValue( com::sun::star::uno::Any
& rVal
,
143 rVal
<<= (WritingMode
)GetValue();
147 SvxWritingModeItem
& SvxWritingModeItem::operator=( const SvxWritingModeItem
& rItem
)
149 SetValue( rItem
.GetValue() );
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */