Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "connpoolsettings.hxx"
30 : :
31 : : //........................................................................
32 : : namespace offapp
33 : : {
34 : : //........................................................................
35 : :
36 : : //====================================================================
37 : : //= DriverPooling
38 : : //====================================================================
39 : : //--------------------------------------------------------------------
40 : 0 : DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
41 : : :sName(_rName)
42 : : ,bEnabled(_bEnabled)
43 : 0 : ,nTimeoutSeconds(_nTimeout)
44 : : {
45 : 0 : }
46 : :
47 : : //--------------------------------------------------------------------
48 : 0 : sal_Bool DriverPooling::operator == (const DriverPooling& _rR) const
49 : : {
50 : 0 : return (sName == _rR.sName)
51 : : && (bEnabled == _rR.bEnabled)
52 [ # # ][ # # ]: 0 : && (nTimeoutSeconds == _rR.nTimeoutSeconds);
[ # # ]
53 : : }
54 : :
55 : : //====================================================================
56 : : //= DriverPoolingSettings
57 : : //====================================================================
58 : : //--------------------------------------------------------------------
59 : 0 : DriverPoolingSettings::DriverPoolingSettings()
60 : : {
61 : 0 : }
62 : :
63 : : //====================================================================
64 : : //= DriverPoolingSettingsItem
65 : : //====================================================================
66 [ # # ][ # # ]: 0 : TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
67 : : //--------------------------------------------------------------------
68 : 0 : DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings &_rSettings )
69 : : :SfxPoolItem(_nId)
70 [ # # ]: 0 : ,m_aSettings(_rSettings)
71 : : {
72 : 0 : }
73 : :
74 : : //--------------------------------------------------------------------
75 : 0 : int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
76 : : {
77 [ # # ][ # # ]: 0 : const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
[ # # ]
78 [ # # ]: 0 : if (!pItem)
79 : 0 : return sal_False;
80 : :
81 [ # # ]: 0 : if (m_aSettings.size() != pItem->m_aSettings.size())
82 : 0 : return sal_False;
83 : :
84 : 0 : DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
85 : 0 : DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
86 : 0 : DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
87 [ # # ][ # # ]: 0 : while (aOwn < aOwnEnd)
88 : : {
89 [ # # ][ # # ]: 0 : if (*aOwn != *aForeign)
90 : 0 : return sal_False;
91 : :
92 : 0 : ++aForeign;
93 : 0 : ++aOwn;
94 : : }
95 : :
96 : 0 : return sal_True;
97 : : }
98 : :
99 : : //--------------------------------------------------------------------
100 : 0 : SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
101 : : {
102 [ # # ]: 0 : return new DriverPoolingSettingsItem(Which(), m_aSettings);
103 : : }
104 : :
105 : : //--------------------------------------------------------------------
106 : :
107 : : //........................................................................
108 : : } // namespace offapp
109 : : //........................................................................
110 : :
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|