diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-26 10:47:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-27 08:29:41 +0200 |
commit | 64035391ebe8810520a214a3ae0aeb4c1b039819 (patch) | |
tree | db220d97ef387f32c3441db882942cdca5ed5d8d /ucbhelper | |
parent | 850c575d67162a97c1b7acd4fb75c32d0884e7b9 (diff) |
loplugin:constfields in ucbhelper
Change-Id: Ic9d59b352dcb771191de963c0f6e90c74647c8b8
Reviewed-on: https://gerrit.libreoffice.org/60983
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/client/proxydecider.cxx | 13 | ||||
-rw-r--r-- | ucbhelper/source/provider/resultset.cxx | 6 | ||||
-rw-r--r-- | ucbhelper/source/provider/resultsetmetadata.cxx | 8 |
3 files changed, 10 insertions, 17 deletions
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index 0f5bd69553b7..31e26055ffcf 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -66,7 +66,7 @@ namespace proxydecider_impl class WildCard { private: - OString m_aWildString; + OString const m_aWildString; public: explicit WildCard( const OUString& rWildCard ) @@ -80,18 +80,13 @@ public: typedef std::pair< WildCard, WildCard > NoProxyListEntry; - class HostnameCache { typedef std::pair< OUString, OUString > HostListEntry; std::deque< HostListEntry > m_aHostList; - sal_uInt32 m_nCapacity; public: - explicit HostnameCache() - : m_nCapacity( 256 ) {} - bool get( const OUString & rKey, OUString & rValue ) const { for (auto const& host : m_aHostList) @@ -107,8 +102,10 @@ public: void put( const OUString & rKey, const OUString & rValue ) { - if ( m_aHostList.size() == m_nCapacity ) - m_aHostList.resize( m_nCapacity / 2 ); + static constexpr sal_uInt32 nCapacity = 256; + + if ( m_aHostList.size() == nCapacity ) + m_aHostList.resize( nCapacity / 2 ); m_aHostList.push_front( HostListEntry( rKey, rValue ) ); } diff --git a/ucbhelper/source/provider/resultset.cxx b/ucbhelper/source/provider/resultset.cxx index c482332909c4..4ed85d478550 100644 --- a/ucbhelper/source/provider/resultset.cxx +++ b/ucbhelper/source/provider/resultset.cxx @@ -42,8 +42,8 @@ namespace ucbhelper_impl struct PropertyInfo { const char* pName; - sal_Int32 nHandle; - sal_Int16 nAttributes; + sal_Int32 const nHandle; + sal_Int16 const nAttributes; const uno::Type& (*pGetCppuType)(); }; @@ -143,7 +143,7 @@ struct ResultSet_Impl uno::Reference< css::ucb::XCommandEnvironment > m_xEnv; uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo; uno::Reference< sdbc::XResultSetMetaData > m_xMetaData; - uno::Sequence< beans::Property > m_aProperties; + uno::Sequence< beans::Property > const m_aProperties; rtl::Reference< ResultSetDataSupplier > m_xDataSupplier; osl::Mutex m_aMutex; std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners; diff --git a/ucbhelper/source/provider/resultsetmetadata.cxx b/ucbhelper/source/provider/resultsetmetadata.cxx index 4f99af2cae39..3666fa802f9b 100644 --- a/ucbhelper/source/provider/resultsetmetadata.cxx +++ b/ucbhelper/source/provider/resultsetmetadata.cxx @@ -198,16 +198,12 @@ sal_Bool SAL_CALL ResultSetMetaData::isSigned( sal_Int32 /*column*/ ) // virtual -sal_Int32 SAL_CALL ResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) +sal_Int32 SAL_CALL ResultSetMetaData::getColumnDisplaySize( sal_Int32 /*column*/ ) { /* Gets the normal maximum width in characters for column. */ - - if ( ( column < 1 ) || ( column > m_aProps.getLength() ) ) - return 16; - - return m_pImpl->m_aColumnData[ column - 1 ].columnDisplaySize; + return 16; } |