Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / source / ui / misc / stringlistitem.cxx
blobbf95e891c7a39dd44c5a0fc622117fef750bd134
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include "stringlistitem.hxx"
32 //.........................................................................
33 namespace dbaui
35 //.........................................................................
37 using namespace ::com::sun::star::uno;
39 //=========================================================================
40 //= OStringListItem
41 //=========================================================================
42 TYPEINIT1(OStringListItem, SfxPoolItem);
43 //-------------------------------------------------------------------------
44 OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence< ::rtl::OUString >& _rList)
45 :SfxPoolItem(_nWhich)
46 ,m_aList(_rList)
50 //-------------------------------------------------------------------------
51 OStringListItem::OStringListItem(const OStringListItem& _rSource)
52 :SfxPoolItem(_rSource)
53 ,m_aList(_rSource.m_aList)
57 //-------------------------------------------------------------------------
58 int OStringListItem::operator==(const SfxPoolItem& _rItem) const
60 const OStringListItem* pCompare = PTR_CAST(OStringListItem, &_rItem);
61 if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
62 return 0;
64 // compare all strings individually
65 const ::rtl::OUString* pMyStrings = m_aList.getConstArray();
66 const ::rtl::OUString* pCompareStrings = pCompare->m_aList.getConstArray();
68 for (sal_Int32 i=0; i<m_aList.getLength(); ++i, ++pMyStrings, ++pCompareStrings)
69 if (!pMyStrings->equals(*pCompareStrings))
70 return 0;
72 return 1;
75 //-------------------------------------------------------------------------
76 SfxPoolItem* OStringListItem::Clone(SfxItemPool* /* _pPool */) const
78 return new OStringListItem(*this);
81 //.........................................................................
82 } // namespace dbaui
83 //.........................................................................
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */