GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / svl / source / items / custritm.cxx
blobebbba99427ac8c330d5a5fa61b01bd7735eae5e6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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)
34 // virtual
35 int CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const
37 DBG_CHKTHIS(CntUnencodedStringItem, 0);
38 DBG_ASSERT(rItem.ISA(CntUnencodedStringItem),
39 "CntUnencodedStringItem::operator ==(): Bad type");
40 return m_aValue
41 == (static_cast< const CntUnencodedStringItem * >(&rItem))->
42 m_aValue;
45 // virtual
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;
57 // virtual
58 int CntUnencodedStringItem::Compare(SfxPoolItem const & rWith,
59 IntlWrapper const & rIntlWrapper)
60 const
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 );
69 // virtual
70 SfxItemPresentation
71 CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit,
72 SfxMapUnit, OUString & rText,
73 const IntlWrapper *) const
75 DBG_CHKTHIS(CntUnencodedStringItem, 0);
76 rText = m_aValue;
77 return SFX_ITEM_PRESENTATION_NAMELESS;
80 // virtual
81 bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8)
82 const
84 rVal <<= OUString(m_aValue);
85 return true;
88 // virtual
89 bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal,
90 sal_uInt8)
92 OUString aTheValue;
93 if (rVal >>= aTheValue)
95 m_aValue = aTheValue;
96 return true;
98 OSL_FAIL("CntUnencodedStringItem::PutValue(): Wrong type");
99 return false;
102 // virtual
103 SfxPoolItem * CntUnencodedStringItem::Clone(SfxItemPool *) const
105 DBG_CHKTHIS(CntUnencodedStringItem, 0);
106 return new CntUnencodedStringItem(*this);
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */