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 <com/sun/star/uno/Any.hxx>
22 #include <unotools/intlwrapper.hxx>
23 #include <tools/stream.hxx>
24 #include <svl/custritm.hxx>
27 // class CntUnencodedStringItem
30 DBG_NAME(CntUnencodedStringItem
)
32 TYPEINIT1_AUTOFACTORY(CntUnencodedStringItem
, SfxPoolItem
)
35 int CntUnencodedStringItem::operator ==(const SfxPoolItem
& rItem
) const
37 DBG_CHKTHIS(CntUnencodedStringItem
, 0);
38 DBG_ASSERT(rItem
.ISA(CntUnencodedStringItem
),
39 "CntUnencodedStringItem::operator ==(): Bad type");
41 == (static_cast< const CntUnencodedStringItem
* >(&rItem
))->
46 int CntUnencodedStringItem::Compare(SfxPoolItem
const & rWith
) const
48 OSL_FAIL("CntUnencodedStringItem::Compare(): No international");
49 DBG_CHKTHIS(CntUnencodedStringItem
, 0);
50 DBG_ASSERT(rWith
.ISA(CntUnencodedStringItem
),
51 "CntUnencodedStringItem::Compare(): Bad type");
52 sal_Int32 nCmp
= m_aValue
.compareTo(
53 static_cast< CntUnencodedStringItem
const * >(&rWith
)->m_aValue
);
54 return (nCmp
== 0) ? 0 : (nCmp
< 0) ? -1 : 1;
58 int CntUnencodedStringItem::Compare(SfxPoolItem
const & rWith
,
59 IntlWrapper
const & rIntlWrapper
)
62 DBG_CHKTHIS(CntUnencodedStringItem
, 0);
63 DBG_ASSERT(rWith
.ISA(CntUnencodedStringItem
),
64 "CntUnencodedStringItem::Compare(): Bad type");
65 return rIntlWrapper
.getCollator()->compareString( m_aValue
,
66 static_cast< CntUnencodedStringItem
const * >(&rWith
)->m_aValue
);
71 CntUnencodedStringItem::GetPresentation(SfxItemPresentation
, SfxMapUnit
,
72 SfxMapUnit
, OUString
& rText
,
73 const IntlWrapper
*) const
75 DBG_CHKTHIS(CntUnencodedStringItem
, 0);
77 return SFX_ITEM_PRESENTATION_NAMELESS
;
81 bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any
& rVal
, sal_uInt8
)
84 rVal
<<= OUString(m_aValue
);
89 bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any
& rVal
,
93 if (rVal
>>= aTheValue
)
98 OSL_FAIL("CntUnencodedStringItem::PutValue(): Wrong type");
103 SfxPoolItem
* CntUnencodedStringItem::Clone(SfxItemPool
*) const
105 DBG_CHKTHIS(CntUnencodedStringItem
, 0);
106 return new CntUnencodedStringItem(*this);
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */