1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <editeng/writingmodeitem.hxx>
21 #include <editeng/eerdll.hxx>
22 #include <editeng/editrids.hrc>
24 using namespace ::com::sun::star::uno
;
25 using namespace ::com::sun::star::text
;
28 TYPEINIT1_FACTORY(SvxWritingModeItem
, SfxUInt16Item
, new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB
, 0));
30 SvxWritingModeItem::SvxWritingModeItem( WritingMode eValue
, sal_uInt16 _nWhich
)
31 : SfxUInt16Item( _nWhich
, (sal_uInt16
)eValue
)
35 SvxWritingModeItem::~SvxWritingModeItem()
39 bool SvxWritingModeItem::operator==( const SfxPoolItem
& rCmp
) const
41 DBG_ASSERT( SfxPoolItem::operator==(rCmp
), "unequal types" );
43 return GetValue() == static_cast<const SvxWritingModeItem
&>(rCmp
).GetValue();
46 SfxPoolItem
* SvxWritingModeItem::Clone( SfxItemPool
* ) const
48 return new SvxWritingModeItem( *this );
51 SfxPoolItem
* SvxWritingModeItem::Create( SvStream
& , sal_uInt16
) const
53 OSL_FAIL("SvxWritingModeItem should not be streamed!");
57 SvStream
& SvxWritingModeItem::Store( SvStream
& rStrm
, sal_uInt16
) const
59 OSL_FAIL("SvxWritingModeItem should not be streamed!");
63 sal_uInt16
SvxWritingModeItem::GetVersion( sal_uInt16
/*nFVer*/ ) const
68 bool SvxWritingModeItem::GetPresentation( SfxItemPresentation
/*ePres*/,
69 SfxMapUnit
/*eCoreMetric*/,
70 SfxMapUnit
/*ePresMetric*/,
72 const IntlWrapper
* ) const
74 rText
= EE_RESSTR(RID_SVXITEMS_FRMDIR_BEGIN
+ GetValue());
78 bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8
)
81 bool bRet
= ( rVal
>>= nVal
);
86 bRet
= rVal
>>= eMode
;
90 nVal
= (sal_Int32
)eMode
;
98 case WritingMode_LR_TB
:
99 case WritingMode_RL_TB
:
100 case WritingMode_TB_RL
:
101 SetValue( (sal_uInt16
)nVal
);
113 bool SvxWritingModeItem::QueryValue( com::sun::star::uno::Any
& rVal
,
116 rVal
<<= (WritingMode
)GetValue();
120 SvxWritingModeItem
& SvxWritingModeItem::operator=( const SvxWritingModeItem
& rItem
)
122 SetValue( rItem
.GetValue() );
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */