bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / options / connpoolsettings.cxx
blobb735076835b75f13b17c7c47aee99c4219ebf0e2
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"
23 namespace offapp
26 DriverPooling::DriverPooling( const OUString& _rName, bool _bEnabled, const sal_Int32 _nTimeout )
27 :sName(_rName)
28 ,bEnabled(_bEnabled)
29 ,nTimeoutSeconds(_nTimeout)
34 bool DriverPooling::operator == (const DriverPooling& _rR) const
36 return (sName == _rR.sName)
37 && (bEnabled == _rR.bEnabled)
38 && (nTimeoutSeconds == _rR.nTimeoutSeconds);
41 DriverPoolingSettings::DriverPoolingSettings()
45 TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
47 DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings &_rSettings )
48 :SfxPoolItem(_nId)
49 ,m_aSettings(_rSettings)
54 bool DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
56 const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
57 if (!pItem)
58 return false;
60 if (m_aSettings.size() != pItem->m_aSettings.size())
61 return false;
63 DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
64 DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
65 DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
66 while (aOwn < aOwnEnd)
68 if (*aOwn != *aForeign)
69 return false;
71 ++aForeign;
72 ++aOwn;
75 return true;
79 SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
81 return new DriverPoolingSettingsItem(Which(), m_aSettings);
87 } // namespace offapp
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */