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

loplugin:staticmethods

Change-Id: I1f6c6d13697aa397067478d6b07429120106e6bd
üst f70d8277
...@@ -140,7 +140,7 @@ css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue( ...@@ -140,7 +140,7 @@ css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue(
void comphelper::detail::ConfigurationWrapper::setPropertyValue( void comphelper::detail::ConfigurationWrapper::setPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, com::sun::star::uno::Any const & value) const OUString const & path, com::sun::star::uno::Any const & value)
{ {
assert(batch.get() != 0); assert(batch.get() != 0);
batch->setPropertyValue(path, value); batch->setPropertyValue(path, value);
...@@ -156,7 +156,7 @@ comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue( ...@@ -156,7 +156,7 @@ comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(
void comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue( void comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, com::sun::star::uno::Any const & value) const OUString const & path, com::sun::star::uno::Any const & value)
{ {
assert(batch.get() != 0); assert(batch.get() != 0);
batch->setPropertyValue(path, value); batch->setPropertyValue(path, value);
...@@ -176,7 +176,7 @@ comphelper::detail::ConfigurationWrapper::getGroupReadOnly( ...@@ -176,7 +176,7 @@ comphelper::detail::ConfigurationWrapper::getGroupReadOnly(
css::uno::Reference< css::container::XHierarchicalNameReplace > css::uno::Reference< css::container::XHierarchicalNameReplace >
comphelper::detail::ConfigurationWrapper::getGroupReadWrite( comphelper::detail::ConfigurationWrapper::getGroupReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path) const OUString const & path)
{ {
assert(batch.get() != 0); assert(batch.get() != 0);
return batch->getGroup(path); return batch->getGroup(path);
...@@ -196,7 +196,7 @@ comphelper::detail::ConfigurationWrapper::getSetReadOnly( ...@@ -196,7 +196,7 @@ comphelper::detail::ConfigurationWrapper::getSetReadOnly(
css::uno::Reference< css::container::XNameContainer > css::uno::Reference< css::container::XNameContainer >
comphelper::detail::ConfigurationWrapper::getSetReadWrite( comphelper::detail::ConfigurationWrapper::getSetReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path) const OUString const & path)
{ {
assert(batch.get() != 0); assert(batch.get() != 0);
return batch->getSet(path); return batch->getSet(path);
......
...@@ -135,11 +135,11 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase ...@@ -135,11 +135,11 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
private: private:
/** Check if LDAP is configured */ /** Check if LDAP is configured */
bool readLdapConfiguration( static bool readLdapConfiguration(
uno::Reference<uno::XComponentContext> const & context, uno::Reference<uno::XComponentContext> const & context,
LdapDefinition * definition, OUString * loggedOnUser); LdapDefinition * definition, OUString * loggedOnUser);
bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess, static bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess,
const OUString& aLdapSetting, const OUString& aLdapSetting,
OUString& aServerParameter); OUString& aServerParameter);
......
...@@ -136,7 +136,7 @@ protected: ...@@ -136,7 +136,7 @@ protected:
std::vector<NPStream*> m_aNPWrapStreams; std::vector<NPStream*> m_aNPWrapStreams;
std::vector<ConnectorInstance*> m_aInstances; std::vector<ConnectorInstance*> m_aInstances;
sal_uLong FillBuffer( char*&, const char*, sal_uLong, va_list ); static sal_uLong FillBuffer( char*&, const char*, sal_uLong, va_list );
public: public:
PluginConnector( int nSocket ); PluginConnector( int nSocket );
virtual ~PluginConnector(); virtual ~PluginConnector();
...@@ -155,7 +155,7 @@ public: ...@@ -155,7 +155,7 @@ public:
std::vector<NPStream*>& getStreamList() { return m_aNPWrapStreams; } std::vector<NPStream*>& getStreamList() { return m_aNPWrapStreams; }
NPError GetNPError( MediatorMessage* pMes ) static NPError GetNPError( MediatorMessage* pMes )
{ {
NPError* pErr = static_cast<NPError*>(pMes->GetBytes()); NPError* pErr = static_cast<NPError*>(pMes->GetBytes());
NPError aErr = *pErr; NPError aErr = *pErr;
......
...@@ -103,7 +103,7 @@ static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reas ...@@ -103,7 +103,7 @@ static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reas
delete [] stream->url; delete [] stream->url;
delete stream; delete stream;
// returns NPError // returns NPError
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
delete pMes; delete pMes;
return aRet; return aRet;
} }
...@@ -141,7 +141,7 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) ...@@ -141,7 +141,7 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window )
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
// returns NPError // returns NPError
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
SAL_WARN_IF(aRet, "extensions.plugin", "geturl returns " << aRet); SAL_WARN_IF(aRet, "extensions.plugin", "geturl returns " << aRet);
delete pMes; delete pMes;
return aRet; return aRet;
...@@ -168,7 +168,7 @@ static NPError l_NPN_GetURLNotify( NPP instance, const char* url, const char* ta ...@@ -168,7 +168,7 @@ static NPError l_NPN_GetURLNotify( NPP instance, const char* url, const char* ta
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
// returns NPError // returns NPError
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
delete pMes; delete pMes;
return aRet; return aRet;
} }
...@@ -192,7 +192,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe ...@@ -192,7 +192,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
// returns a new NPStream and an error // returns a new NPStream and an error
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
if( ! aRet ) if( ! aRet )
{ {
NPStream* pStream = new NPStream; NPStream* pStream = new NPStream;
...@@ -229,7 +229,7 @@ static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* t ...@@ -229,7 +229,7 @@ static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* t
if( ! pMes ) if( ! pMes )
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
delete pMes; delete pMes;
return aRet; return aRet;
} }
...@@ -252,7 +252,7 @@ static NPError l_NPN_PostURL( NPP instance, const char* url, const char* window, ...@@ -252,7 +252,7 @@ static NPError l_NPN_PostURL( NPP instance, const char* url, const char* window,
if( ! pMes ) if( ! pMes )
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
delete pMes; delete pMes;
return aRet; return aRet;
} }
...@@ -293,7 +293,7 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) ...@@ -293,7 +293,7 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList )
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
} }
NPError aRet = pConnector->GetNPError( pMes ); NPError aRet = PluginConnector::GetNPError( pMes );
delete [] pArray; delete [] pArray;
delete pMes; delete pMes;
return aRet; return aRet;
......
...@@ -254,7 +254,7 @@ protected: ...@@ -254,7 +254,7 @@ protected:
private: private:
/* Used to avoid dialup login windows (on platforms we know how to double this) */ /* Used to avoid dialup login windows (on platforms we know how to double this) */
inline bool hasInternetConnection() const static inline bool hasInternetConnection()
{ {
#ifdef WNT #ifdef WNT
return WNT_hasInternetConnection(); return WNT_hasInternetConnection();
......
...@@ -607,7 +607,7 @@ void UpdateHandler::updateState( UpdateState eState ) ...@@ -607,7 +607,7 @@ void UpdateHandler::updateState( UpdateState eState )
OUString UpdateHandler::loadString( const uno::Reference< resource::XResourceBundle >& rBundle, OUString UpdateHandler::loadString( const uno::Reference< resource::XResourceBundle >& rBundle,
sal_Int32 nResourceId ) const sal_Int32 nResourceId )
{ {
OUString sString; OUString sString;
OUString sKey = "string:" + OUString::number( nResourceId ); OUString sKey = "string:" + OUString::number( nResourceId );
......
...@@ -143,9 +143,9 @@ private: ...@@ -143,9 +143,9 @@ private:
void enableControls( short nCtrlState ); void enableControls( short nCtrlState );
void setDownloadBtnLabel( bool bAppendDots ); void setDownloadBtnLabel( bool bAppendDots );
void loadStrings(); void loadStrings();
OUString loadString( const com::sun::star::uno::Reference< com::sun::star::resource::XResourceBundle >& xBundle, static OUString loadString( const com::sun::star::uno::Reference< com::sun::star::resource::XResourceBundle >& xBundle,
sal_Int32 nResourceId ) const; sal_Int32 nResourceId );
OUString substVariables( const OUString &rSource ) const; OUString substVariables( const OUString &rSource ) const;
static void setProperty( com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > &rProps, static void setProperty( com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > &rProps,
const int nIndex, const OUString &rPropName, const com::sun::star::uno::Any &rPropValue ) const int nIndex, const OUString &rPropName, const com::sun::star::uno::Any &rPropValue )
{ rProps[ nIndex ].Name = rPropName; rProps[ nIndex ].Value = rPropValue; } { rProps[ nIndex ].Name = rPropName; rProps[ nIndex ].Value = rPropValue; }
......
...@@ -431,8 +431,8 @@ SvtFileDialog::~SvtFileDialog() ...@@ -431,8 +431,8 @@ SvtFileDialog::~SvtFileDialog()
} }
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));
officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch, m_context); officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch);
officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch, m_context); officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch);
batch->commit(); batch->commit();
} }
......
...@@ -97,36 +97,34 @@ public: ...@@ -97,36 +97,34 @@ public:
com::sun::star::uno::Any getPropertyValue(OUString const & path) const; com::sun::star::uno::Any getPropertyValue(OUString const & path) const;
void setPropertyValue( static void setPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, com::sun::star::uno::Any const & value) OUString const & path, com::sun::star::uno::Any const & value);
const;
com::sun::star::uno::Any getLocalizedPropertyValue( com::sun::star::uno::Any getLocalizedPropertyValue(
OUString const & path) const; OUString const & path) const;
void setLocalizedPropertyValue( static void setLocalizedPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, com::sun::star::uno::Any const & value) OUString const & path, com::sun::star::uno::Any const & value);
const;
com::sun::star::uno::Reference< com::sun::star::uno::Reference<
com::sun::star::container::XHierarchicalNameAccess > com::sun::star::container::XHierarchicalNameAccess >
getGroupReadOnly(OUString const & path) const; getGroupReadOnly(OUString const & path) const;
com::sun::star::uno::Reference< static com::sun::star::uno::Reference<
com::sun::star::container::XHierarchicalNameReplace > com::sun::star::container::XHierarchicalNameReplace >
getGroupReadWrite( getGroupReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path) const; OUString const & path);
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
getSetReadOnly(OUString const & path) const; getSetReadOnly(OUString const & path) const;
com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > static com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >
getSetReadWrite( getSetReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path) const; OUString const & path);
std::shared_ptr< ConfigurationChanges > createChanges() const; std::shared_ptr< ConfigurationChanges > createChanges() const;
...@@ -223,11 +221,9 @@ template< typename T, typename U > struct ConfigurationProperty ...@@ -223,11 +221,9 @@ template< typename T, typename U > struct ConfigurationProperty
/// For nillable properties, U is of type boost::optional<U'>. /// For nillable properties, U is of type boost::optional<U'>.
static void set( static void set(
U const & value, U const & value,
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch)
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context = comphelper::getProcessComponentContext())
{ {
detail::ConfigurationWrapper::get(context).setPropertyValue( comphelper::detail::ConfigurationWrapper::setPropertyValue(
batch, T::path(), detail::Convert< U >::toAny(value)); batch, T::path(), detail::Convert< U >::toAny(value));
} }
...@@ -279,11 +275,9 @@ template< typename T, typename U > struct ConfigurationLocalizedProperty ...@@ -279,11 +275,9 @@ template< typename T, typename U > struct ConfigurationLocalizedProperty
/// For nillable properties, U is of type boost::optional<U'>. /// For nillable properties, U is of type boost::optional<U'>.
static void set( static void set(
U const & value, U const & value,
std::shared_ptr< ConfigurationChanges > const & batch, std::shared_ptr< ConfigurationChanges > const & batch)
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context = comphelper::getProcessComponentContext())
{ {
detail::ConfigurationWrapper::get(context).setLocalizedPropertyValue( comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(
batch, T::path(), detail::Convert< U >::toAny(value)); batch, T::path(), detail::Convert< U >::toAny(value));
} }
...@@ -315,11 +309,9 @@ template< typename T > struct ConfigurationGroup { ...@@ -315,11 +309,9 @@ template< typename T > struct ConfigurationGroup {
/// modifications via the given changes batch. /// modifications via the given changes batch.
static com::sun::star::uno::Reference< static com::sun::star::uno::Reference<
com::sun::star::container::XHierarchicalNameReplace > com::sun::star::container::XHierarchicalNameReplace >
get(std::shared_ptr< ConfigurationChanges > const & batch, get(std::shared_ptr< ConfigurationChanges > const & batch)
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context = comphelper::getProcessComponentContext())
{ {
return detail::ConfigurationWrapper::get(context).getGroupReadWrite( return comphelper::detail::ConfigurationWrapper::getGroupReadWrite(
batch, T::path()); batch, T::path());
} }
...@@ -351,11 +343,9 @@ template< typename T > struct ConfigurationSet { ...@@ -351,11 +343,9 @@ template< typename T > struct ConfigurationSet {
/// modifications via the given changes batch. /// modifications via the given changes batch.
static static
com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >
get(std::shared_ptr< ConfigurationChanges > const & batch, get(std::shared_ptr< ConfigurationChanges > const & batch)
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const & context = comphelper::getProcessComponentContext())
{ {
return detail::ConfigurationWrapper::get(context).getSetReadWrite( return comphelper::detail::ConfigurationWrapper::getSetReadWrite(
batch, T::path()); batch, T::path());
} }
......
...@@ -251,8 +251,8 @@ public: ...@@ -251,8 +251,8 @@ public:
bool HeaderParsed() const { return bHeaderParsed; } bool HeaderParsed() const { return bHeaderParsed; }
INetMIMEMessage* CreateMessage ( static INetMIMEMessage* CreateMessage (
const INetMIMEMessage& rMsg) const; const INetMIMEMessage& rMsg);
// Header fields. // Header fields.
......
...@@ -1672,8 +1672,8 @@ void SfxTemplateManagerDlg::syncRepositories() const ...@@ -1672,8 +1672,8 @@ void SfxTemplateManagerDlg::syncRepositories() const
aNames[i] = maRepositories[i]->maTitle; aNames[i] = maRepositories[i]->maTitle;
} }
officecfg::Office::Common::Misc::TemplateRepositoryUrls::set(aUrls, batch, pContext); officecfg::Office::Common::Misc::TemplateRepositoryUrls::set(aUrls, batch);
officecfg::Office::Common::Misc::TemplateRepositoryNames::set(aNames, batch, pContext); officecfg::Office::Common::Misc::TemplateRepositoryNames::set(aNames, batch);
batch->commit(); batch->commit();
} }
} }
......
...@@ -24,12 +24,12 @@ typedef std::pair<std::string, std::string> PathFilePair; ...@@ -24,12 +24,12 @@ typedef std::pair<std::string, std::string> PathFilePair;
struct IncludesCollection { struct IncludesCollection {
private: private:
DirMap allIncludes; DirMap allIncludes;
PathFilePair split_path(const std::string& filePath); static PathFilePair split_path(const std::string& filePath);
void add_to_collection(const std::string& dirPath); void add_to_collection(const std::string& dirPath);
public: public:
bool exists(std::string filePath); bool exists(std::string filePath);
}; };
......
...@@ -242,7 +242,7 @@ class PageCache_Impl : ...@@ -242,7 +242,7 @@ class PageCache_Impl :
size_t m_nHit; size_t m_nHit;
size_t m_nMissed; size_t m_nMissed;
inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m) static inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m)
{ {
return ((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m)); return ((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m));
} }
......
...@@ -82,7 +82,7 @@ bool SvxAsianConfig::IsKerningWesternTextOnly() const { ...@@ -82,7 +82,7 @@ bool SvxAsianConfig::IsKerningWesternTextOnly() const {
void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { void SvxAsianConfig::SetKerningWesternTextOnly(bool value) {
officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::set( officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::set(
value, impl_->batch, impl_->context); value, impl_->batch);
} }
sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const { sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const {
...@@ -93,7 +93,7 @@ sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const { ...@@ -93,7 +93,7 @@ sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const {
void SvxAsianConfig::SetCharDistanceCompression(sal_Int16 value) { void SvxAsianConfig::SetCharDistanceCompression(sal_Int16 value) {
officecfg::Office::Common::AsianLayout::CompressCharacterDistance::set( officecfg::Office::Common::AsianLayout::CompressCharacterDistance::set(
value, impl_->batch, impl_->context); value, impl_->batch);
} }
css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales()
...@@ -138,7 +138,7 @@ void SvxAsianConfig::SetStartEndChars( ...@@ -138,7 +138,7 @@ void SvxAsianConfig::SetStartEndChars(
assert((startChars == 0) == (endChars == 0)); assert((startChars == 0) == (endChars == 0));
css::uno::Reference< css::container::XNameContainer > set( css::uno::Reference< css::container::XNameContainer > set(
officecfg::Office::Common::AsianLayout::StartEndCharacters::get( officecfg::Office::Common::AsianLayout::StartEndCharacters::get(
impl_->batch, impl_->context)); impl_->batch));
OUString name(toString(locale)); OUString name(toString(locale));
if (startChars == 0) { if (startChars == 0) {
try { try {
......
...@@ -605,7 +605,7 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg) ...@@ -605,7 +605,7 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg)
} }
INetMIMEMessage *INetMIMEMessage::CreateMessage ( INetMIMEMessage *INetMIMEMessage::CreateMessage (
const INetMIMEMessage& rMsg) const const INetMIMEMessage& rMsg)
{ {
return new INetMIMEMessage (rMsg); return new INetMIMEMessage (rMsg);
} }
......
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