LibreOffice Module dbaccess (master) 1
stringlistitem.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <stringlistitem.hxx>
21
22namespace dbaui
23{
24using namespace ::com::sun::star::uno;
25
26// OStringListItem
27OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence<OUString>& _rList)
28 : SfxPoolItem(_nWhich)
29 , m_aList(_rList)
30{
31}
32
33OStringListItem::OStringListItem(const OStringListItem& _rSource)
34 : SfxPoolItem(_rSource)
35 , m_aList(_rSource.m_aList)
36{
37}
38
40{
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;
46
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;
51
52 return true;
53}
54
56{
57 return new OStringListItem(*this);
58}
59
60} // namespace dbaui
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<type>SfxPoolItem</type> which transports a sequence of <type scope="rtl">OUString</type>'s
virtual bool operator==(const SfxPoolItem &_rItem) const override
css::uno::Sequence< OUString > m_aList
virtual OStringListItem * Clone(SfxItemPool *_pPool=nullptr) const override
OStringListItem(sal_Int16 nWhich, const css::uno::Sequence< OUString > &_rList)
int i