2010-10-12 15:59:03 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-10-05 09:09:48 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 15:13:44 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 06:18:52 +00:00
|
|
|
|
2000-10-05 09:09:48 +00:00
|
|
|
#include "stringlistitem.hxx"
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//= OStringListItem
|
|
|
|
//=========================================================================
|
|
|
|
TYPEINIT1(OStringListItem, SfxPoolItem);
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence< ::rtl::OUString >& _rList)
|
|
|
|
:SfxPoolItem(_nWhich)
|
|
|
|
,m_aList(_rList)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
OStringListItem::OStringListItem(const OStringListItem& _rSource)
|
|
|
|
:SfxPoolItem(_rSource)
|
|
|
|
,m_aList(_rSource.m_aList)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
int OStringListItem::operator==(const SfxPoolItem& _rItem) const
|
|
|
|
{
|
|
|
|
const OStringListItem* pCompare = PTR_CAST(OStringListItem, &_rItem);
|
|
|
|
if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// compare all strings individually
|
|
|
|
const ::rtl::OUString* pMyStrings = m_aList.getConstArray();
|
|
|
|
const ::rtl::OUString* pCompareStrings = pCompare->m_aList.getConstArray();
|
|
|
|
|
|
|
|
for (sal_Int32 i=0; i<m_aList.getLength(); ++i, ++pMyStrings, ++pCompareStrings)
|
|
|
|
if (!pMyStrings->equals(*pCompareStrings))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
SfxPoolItem* OStringListItem::Clone(SfxItemPool* /* _pPool */) const
|
|
|
|
{
|
|
|
|
return new OStringListItem(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|
|
|
|
|
2010-10-12 15:59:03 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|