1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_cui.hxx"
26 
27 #include "connpoolsettings.hxx"
28 
29 //........................................................................
30 namespace offapp
31 {
32 //........................................................................
33 
34 	//====================================================================
35 	//= DriverPooling
36 	//====================================================================
37 	//--------------------------------------------------------------------
DriverPooling(const String & _rName,sal_Bool _bEnabled,const sal_Int32 _nTimeout)38 	DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
39 		:sName(_rName)
40 		,bEnabled(_bEnabled)
41 		,nTimeoutSeconds(_nTimeout)
42 	{
43 	}
44 
45 	//--------------------------------------------------------------------
operator ==(const DriverPooling & _rR) const46 	sal_Bool DriverPooling::operator == (const DriverPooling& _rR) const
47 	{
48 		return	(sName == _rR.sName)
49 			&&	(bEnabled == _rR.bEnabled)
50 			&&	(nTimeoutSeconds == _rR.nTimeoutSeconds);
51 	}
52 
53 	//====================================================================
54 	//= DriverPoolingSettings
55 	//====================================================================
56 	//--------------------------------------------------------------------
DriverPoolingSettings()57 	DriverPoolingSettings::DriverPoolingSettings()
58 	{
59 	}
60 
61 	//====================================================================
62 	//= DriverPoolingSettingsItem
63 	//====================================================================
TYPEINIT1(DriverPoolingSettingsItem,SfxPoolItem)64 	TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
65 	//--------------------------------------------------------------------
66 	DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings )
67 		:SfxPoolItem(_nId)
68 		,m_aSettings(_rSettings)
69 	{
70 	}
71 
72 	//--------------------------------------------------------------------
operator ==(const SfxPoolItem & _rCompare) const73 	int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
74 	{
75 		const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
76 		if (!pItem)
77 			return sal_False;
78 
79 		if (m_aSettings.size() != pItem->m_aSettings.size())
80 			return sal_False;
81 
82 		DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
83 		DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
84 		DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
85 		while (aOwn < aOwnEnd)
86 		{
87 			if (*aOwn != *aForeign)
88 				return sal_False;
89 
90 			++aForeign;
91 			++aOwn;
92 		}
93 
94 		return sal_True;
95 	}
96 
97 	//--------------------------------------------------------------------
Clone(SfxItemPool *) const98 	SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
99 	{
100 		return new DriverPoolingSettingsItem(Which(), m_aSettings);
101 	}
102 
103 	//--------------------------------------------------------------------
104 
105 //........................................................................
106 }	// namespace offapp
107 //........................................................................
108 
109 
110