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 <rtl/ustring.hxx>
21 #include <svl/aeitem.hxx>
26 SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which
):
31 SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem
&rCopy
):
33 m_Values(rCopy
.m_Values
)
37 SfxAllEnumItem::~SfxAllEnumItem()
41 sal_Int32
SfxAllEnumItem::GetTextCount() const
43 return m_Values
.size();
46 OUString
const & SfxAllEnumItem::GetTextByPos( sal_uInt16 nPos
) const
48 return m_Values
[nPos
];
51 SfxAllEnumItem
* SfxAllEnumItem::Clone( SfxItemPool
* ) const
53 return new SfxAllEnumItem(*this);
56 void SfxAllEnumItem::SetTextByPos( sal_uInt16 nPos
, const OUString
&rText
)
58 if (nPos
>= m_Values
.size())
59 m_Values
.resize(nPos
);
60 m_Values
[nPos
] = rText
;
63 bool SfxAllEnumItem::operator==( const SfxPoolItem
& rCmp
) const
65 if (!SfxPoolItem::operator==(rCmp
))
67 const SfxAllEnumItem
& rOther
= static_cast<const SfxAllEnumItem
&>(rCmp
);
68 return m_Values
== rOther
.m_Values
;
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */