LibreOffice Module cui (master)  1
connpoolsettings.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include "connpoolsettings.hxx"
21 
22 
23 namespace offapp
24 {
25 
26  DriverPooling::DriverPooling( const OUString& _rName )
27  :sName(_rName)
28  ,bEnabled(false)
29  ,nTimeoutSeconds(120)
30  {
31  }
32 
33 
35  {
36  return (sName == _rR.sName)
37  && (bEnabled == _rR.bEnabled)
38  && (nTimeoutSeconds == _rR.nTimeoutSeconds);
39  }
40 
42  {
43  }
44 
45 
47  :SfxPoolItem(_nId)
48  ,m_aSettings(_rSettings)
49  {
50  }
51 
52 
53  bool DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
54  {
55  assert(SfxPoolItem::operator==(_rCompare));
56  const DriverPoolingSettingsItem* pItem = static_cast<const DriverPoolingSettingsItem*>( &_rCompare );
57 
58  if (m_aSettings.size() != pItem->m_aSettings.size())
59  return false;
60 
62  for (auto const& ownSetting : m_aSettings)
63  {
64  if (ownSetting != *aForeign)
65  return false;
66 
67  ++aForeign;
68  }
69 
70  return true;
71  }
72 
74  {
75  return new DriverPoolingSettingsItem(*this);
76  }
77 
78 
79 } // namespace offapp
80 
81 
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DriverSettings::const_iterator const_iterator
DriverPooling(const OUString &_rName)
virtual DriverPoolingSettingsItem * Clone(SfxItemPool *pPool=nullptr) const override
const char * sName
virtual bool operator==(const SfxPoolItem &) const override
DriverPoolingSettingsItem(sal_uInt16 _nId, const DriverPoolingSettings &_rSettings)
bool operator==(const DriverPooling &_rR) const
::comphelper::NamedValueCollection m_aSettings
const_iterator begin() const