Update git submodules
[LibreOffice.git] / svl / source / items / aeitem.cxx
blob9f169c5bd0322d25f2f1dd2e71293b5bdfcf8850
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 <rtl/ustring.hxx>
21 #include <svl/aeitem.hxx>
23 SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which):
24 SfxPoolItem(which)
28 SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
29 SfxPoolItem(rCopy),
30 m_Values(rCopy.m_Values)
34 SfxAllEnumItem::~SfxAllEnumItem()
38 sal_Int32 SfxAllEnumItem::GetTextCount() const
40 return m_Values.size();
43 OUString const & SfxAllEnumItem::GetTextByPos( sal_uInt16 nPos ) const
45 return m_Values[nPos];
48 SfxAllEnumItem* SfxAllEnumItem::Clone( SfxItemPool * ) const
50 return new SfxAllEnumItem(*this);
53 void SfxAllEnumItem::SetTextByPos( sal_uInt16 nPos, const OUString &rText )
55 if (nPos >= m_Values.size())
56 m_Values.resize(nPos);
57 m_Values[nPos] = rText;
60 bool SfxAllEnumItem::operator==( const SfxPoolItem& rCmp ) const
62 if (!SfxPoolItem::operator==(rCmp))
63 return false;
64 const SfxAllEnumItem& rOther = static_cast<const SfxAllEnumItem&>(rCmp);
65 return m_Values == rOther.m_Values;
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */