Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / options / connpoolsettings.cxx
blob89753ae934b70fc73a3d4414333a7e961e44661a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "connpoolsettings.hxx"
22 //........................................................................
23 namespace offapp
25 //........................................................................
27 //====================================================================
28 //= DriverPooling
29 //====================================================================
30 //--------------------------------------------------------------------
31 DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
32 :sName(_rName)
33 ,bEnabled(_bEnabled)
34 ,nTimeoutSeconds(_nTimeout)
38 //--------------------------------------------------------------------
39 sal_Bool DriverPooling::operator == (const DriverPooling& _rR) const
41 return (sName == _rR.sName)
42 && (bEnabled == _rR.bEnabled)
43 && (nTimeoutSeconds == _rR.nTimeoutSeconds);
46 //====================================================================
47 //= DriverPoolingSettings
48 //====================================================================
49 //--------------------------------------------------------------------
50 DriverPoolingSettings::DriverPoolingSettings()
54 //====================================================================
55 //= DriverPoolingSettingsItem
56 //====================================================================
57 TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
58 //--------------------------------------------------------------------
59 DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings &_rSettings )
60 :SfxPoolItem(_nId)
61 ,m_aSettings(_rSettings)
65 //--------------------------------------------------------------------
66 int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
68 const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
69 if (!pItem)
70 return sal_False;
72 if (m_aSettings.size() != pItem->m_aSettings.size())
73 return sal_False;
75 DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
76 DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
77 DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
78 while (aOwn < aOwnEnd)
80 if (*aOwn != *aForeign)
81 return sal_False;
83 ++aForeign;
84 ++aOwn;
87 return sal_True;
90 //--------------------------------------------------------------------
91 SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
93 return new DriverPoolingSettingsItem(Which(), m_aSettings);
96 //--------------------------------------------------------------------
98 //........................................................................
99 } // namespace offapp
100 //........................................................................
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */