update dev300-m58
[ooovba.git] / svx / source / cui / connpoolsettings.cxx
blobaf588f0b73aa43073b1bff1455978a9d84a2029c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: connpoolsettings.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #ifdef SVX_DLLIMPLEMENTATION
35 #undef SVX_DLLIMPLEMENTATION
36 #endif
37 #include "connpoolsettings.hxx"
39 //........................................................................
40 namespace offapp
42 //........................................................................
44 //====================================================================
45 //= DriverPooling
46 //====================================================================
47 //--------------------------------------------------------------------
48 DriverPooling::DriverPooling()
49 :bEnabled(sal_False)
50 ,nTimeoutSeconds(0)
54 //--------------------------------------------------------------------
55 DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
56 :sName(_rName)
57 ,bEnabled(_bEnabled)
58 ,nTimeoutSeconds(_nTimeout)
62 //--------------------------------------------------------------------
63 sal_Bool DriverPooling::operator == (const DriverPooling& _rR) const
65 return (sName == _rR.sName)
66 && (bEnabled == _rR.bEnabled)
67 && (nTimeoutSeconds == _rR.nTimeoutSeconds);
70 //====================================================================
71 //= DriverPoolingSettings
72 //====================================================================
73 //--------------------------------------------------------------------
74 DriverPoolingSettings::DriverPoolingSettings()
78 //====================================================================
79 //= DriverPoolingSettingsItem
80 //====================================================================
81 TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
82 //--------------------------------------------------------------------
83 DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings )
84 :SfxPoolItem(_nId)
85 ,m_aSettings(_rSettings)
89 //--------------------------------------------------------------------
90 int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
92 const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
93 if (!pItem)
94 return sal_False;
96 if (m_aSettings.size() != pItem->m_aSettings.size())
97 return sal_False;
99 DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
100 DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
101 DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
102 while (aOwn < aOwnEnd)
104 if (*aOwn != *aForeign)
105 return sal_False;
107 ++aForeign;
108 ++aOwn;
111 return sal_True;
114 //--------------------------------------------------------------------
115 SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
117 return new DriverPoolingSettingsItem(Which(), m_aSettings);
120 //--------------------------------------------------------------------
122 //........................................................................
123 } // namespace offapp
124 //........................................................................