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