Fix GNU C++ version check
[LibreOffice.git] / dbaccess / source / ui / misc / stringlistitem.cxx
blobea50c99e04c27e8275f856e882027b291829becd
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 <stringlistitem.hxx>
22 namespace dbaui
24 using namespace ::com::sun::star::uno;
26 // OStringListItem
27 OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence<OUString>& _rList)
28 : SfxPoolItem(_nWhich, SfxItemType::OStringListItemType)
29 , m_aList(_rList)
33 OStringListItem::OStringListItem(const OStringListItem& _rSource)
34 : SfxPoolItem(_rSource)
35 , m_aList(_rSource.m_aList)
39 bool OStringListItem::operator==(const SfxPoolItem& _rItem) const
41 if (!SfxPoolItem::operator==(_rItem))
42 return false;
43 const OStringListItem* pCompare = static_cast<const OStringListItem*>(&_rItem);
44 if (pCompare->m_aList.getLength() != m_aList.getLength())
45 return false;
47 // compare all strings individually
48 for (sal_Int32 i = 0; i < m_aList.getLength(); ++i)
49 if (m_aList[i] != pCompare->m_aList[i])
50 return false;
52 return true;
55 OStringListItem* OStringListItem::Clone(SfxItemPool* /* _pPool */) const
57 return new OStringListItem(*this);
60 } // namespace dbaui
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */