Kaydet (Commit) 64035391 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constfields in ucbhelper

Change-Id: Ic9d59b352dcb771191de963c0f6e90c74647c8b8
Reviewed-on: https://gerrit.libreoffice.org/60983
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 850c575d
...@@ -100,7 +100,7 @@ private: ...@@ -100,7 +100,7 @@ private:
css::uno::WeakReference< css::lang::XConnectionPointContainer > m_oContainerWeakReference; // Reference to container-class!. Don't use Reference<...> css::uno::WeakReference< css::lang::XConnectionPointContainer > m_oContainerWeakReference; // Reference to container-class!. Don't use Reference<...>
// It is a ring-reference => and must be a wekreference! // It is a ring-reference => and must be a wekreference!
OConnectionPointContainerHelper* m_pContainerImplementation; OConnectionPointContainerHelper* m_pContainerImplementation;
css::uno::Type m_aInterfaceType; css::uno::Type const m_aInterfaceType;
css::uno::Reference< css::uno::XInterface > m_xLock; css::uno::Reference< css::uno::XInterface > m_xLock;
}; };
......
...@@ -307,22 +307,22 @@ class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication : ...@@ -307,22 +307,22 @@ class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
public css::lang::XTypeProvider, public css::lang::XTypeProvider,
public css::ucb::XInteractionSupplyAuthentication2 public css::ucb::XInteractionSupplyAuthentication2
{ {
css::uno::Sequence< css::ucb::RememberAuthentication > css::uno::Sequence< css::ucb::RememberAuthentication > const
m_aRememberPasswordModes; m_aRememberPasswordModes;
css::uno::Sequence< css::ucb::RememberAuthentication > css::uno::Sequence< css::ucb::RememberAuthentication > const
m_aRememberAccountModes; m_aRememberAccountModes;
OUString m_aRealm; OUString m_aRealm;
OUString m_aUserName; OUString m_aUserName;
OUString m_aPassword; OUString m_aPassword;
OUString m_aAccount; OUString m_aAccount;
css::ucb::RememberAuthentication m_eRememberPasswordMode; css::ucb::RememberAuthentication m_eRememberPasswordMode;
css::ucb::RememberAuthentication m_eDefaultRememberPasswordMode; css::ucb::RememberAuthentication const m_eDefaultRememberPasswordMode;
css::ucb::RememberAuthentication m_eDefaultRememberAccountMode; css::ucb::RememberAuthentication const m_eDefaultRememberAccountMode;
bool m_bCanSetRealm : 1; bool const m_bCanSetRealm : 1;
bool m_bCanSetUserName : 1; bool const m_bCanSetUserName : 1;
bool m_bCanSetPassword : 1; bool const m_bCanSetPassword : 1;
bool m_bCanSetAccount : 1; bool const m_bCanSetAccount : 1;
bool m_bCanUseSystemCredentials : 1; bool const m_bCanUseSystemCredentials : 1;
bool m_bUseSystemCredentials : 1; bool m_bUseSystemCredentials : 1;
public: public:
......
...@@ -62,7 +62,7 @@ class UCBHELPER_DLLPUBLIC ResultSetImplHelper : ...@@ -62,7 +62,7 @@ class UCBHELPER_DLLPUBLIC ResultSetImplHelper :
protected: protected:
osl::Mutex m_aMutex; osl::Mutex m_aMutex;
css::ucb::OpenCommandArgument2 m_aCommand; css::ucb::OpenCommandArgument2 const m_aCommand;
css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::uno::XComponentContext > m_xContext;
// Resultset #1 // Resultset #1
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet1; css::uno::Reference< css::sdbc::XResultSet > m_xResultSet1;
......
...@@ -52,9 +52,6 @@ struct ResultSetColumnData ...@@ -52,9 +52,6 @@ struct ResultSetColumnData
/** @see ResultSetMetaData::isCaseSensitive */ /** @see ResultSetMetaData::isCaseSensitive */
bool isCaseSensitive; bool isCaseSensitive;
/** @see ResultSetMetaData::getColumnDisplaySize */
sal_Int32 columnDisplaySize;
inline ResultSetColumnData(); inline ResultSetColumnData();
}; };
...@@ -62,8 +59,7 @@ struct ResultSetColumnData ...@@ -62,8 +59,7 @@ struct ResultSetColumnData
// may heavily depend on the behaviour of the default constructor. // may heavily depend on the behaviour of the default constructor.
ResultSetColumnData::ResultSetColumnData() ResultSetColumnData::ResultSetColumnData()
: isCaseSensitive( true ), : isCaseSensitive( true )
columnDisplaySize( 16 )
{ {
} }
......
...@@ -66,7 +66,7 @@ namespace proxydecider_impl ...@@ -66,7 +66,7 @@ namespace proxydecider_impl
class WildCard class WildCard
{ {
private: private:
OString m_aWildString; OString const m_aWildString;
public: public:
explicit WildCard( const OUString& rWildCard ) explicit WildCard( const OUString& rWildCard )
...@@ -80,18 +80,13 @@ public: ...@@ -80,18 +80,13 @@ public:
typedef std::pair< WildCard, WildCard > NoProxyListEntry; typedef std::pair< WildCard, WildCard > NoProxyListEntry;
class HostnameCache class HostnameCache
{ {
typedef std::pair< OUString, OUString > HostListEntry; typedef std::pair< OUString, OUString > HostListEntry;
std::deque< HostListEntry > m_aHostList; std::deque< HostListEntry > m_aHostList;
sal_uInt32 m_nCapacity;
public: public:
explicit HostnameCache()
: m_nCapacity( 256 ) {}
bool get( const OUString & rKey, OUString & rValue ) const bool get( const OUString & rKey, OUString & rValue ) const
{ {
for (auto const& host : m_aHostList) for (auto const& host : m_aHostList)
...@@ -107,8 +102,10 @@ public: ...@@ -107,8 +102,10 @@ public:
void put( const OUString & rKey, const OUString & rValue ) void put( const OUString & rKey, const OUString & rValue )
{ {
if ( m_aHostList.size() == m_nCapacity ) static constexpr sal_uInt32 nCapacity = 256;
m_aHostList.resize( m_nCapacity / 2 );
if ( m_aHostList.size() == nCapacity )
m_aHostList.resize( nCapacity / 2 );
m_aHostList.push_front( HostListEntry( rKey, rValue ) ); m_aHostList.push_front( HostListEntry( rKey, rValue ) );
} }
......
...@@ -42,8 +42,8 @@ namespace ucbhelper_impl ...@@ -42,8 +42,8 @@ namespace ucbhelper_impl
struct PropertyInfo struct PropertyInfo
{ {
const char* pName; const char* pName;
sal_Int32 nHandle; sal_Int32 const nHandle;
sal_Int16 nAttributes; sal_Int16 const nAttributes;
const uno::Type& (*pGetCppuType)(); const uno::Type& (*pGetCppuType)();
}; };
...@@ -143,7 +143,7 @@ struct ResultSet_Impl ...@@ -143,7 +143,7 @@ struct ResultSet_Impl
uno::Reference< css::ucb::XCommandEnvironment > m_xEnv; uno::Reference< css::ucb::XCommandEnvironment > m_xEnv;
uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo; uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo;
uno::Reference< sdbc::XResultSetMetaData > m_xMetaData; uno::Reference< sdbc::XResultSetMetaData > m_xMetaData;
uno::Sequence< beans::Property > m_aProperties; uno::Sequence< beans::Property > const m_aProperties;
rtl::Reference< ResultSetDataSupplier > m_xDataSupplier; rtl::Reference< ResultSetDataSupplier > m_xDataSupplier;
osl::Mutex m_aMutex; osl::Mutex m_aMutex;
std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners; std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners;
......
...@@ -198,16 +198,12 @@ sal_Bool SAL_CALL ResultSetMetaData::isSigned( sal_Int32 /*column*/ ) ...@@ -198,16 +198,12 @@ sal_Bool SAL_CALL ResultSetMetaData::isSigned( sal_Int32 /*column*/ )
// virtual // 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. Gets the normal maximum width in characters for column.
*/ */
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return 16; return 16;
return m_pImpl->m_aColumnData[ column - 1 ].columnDisplaySize;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment