summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-25 17:12:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-26 10:59:42 +0200
commitd9b6f4fd38da9f875b78f6ff365bcb16fb2c8e8b (patch)
tree7d38b04189cfa4fd4f4f91324fc6c95f360f080c /unotools
parent084f454e8caa2d9e43f7bdea098538bfb87423d8 (diff)
loplugin:constmethods in unotools
Change-Id: I13df4e184a826682f34a1d9e974b601397ba4a3d Reviewed-on: https://gerrit.libreoffice.org/43865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/accessibility/accessiblerelationsethelper.cxx16
-rw-r--r--unotools/source/config/eventcfg.cxx8
-rw-r--r--unotools/source/config/extendedsecurityoptions.cxx4
-rw-r--r--unotools/source/config/historyoptions.cxx4
-rw-r--r--unotools/source/config/lingucfg.cxx6
-rw-r--r--unotools/source/config/moduleoptions.cxx2
-rw-r--r--unotools/source/config/syslocaleoptions.cxx6
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx4
-rw-r--r--unotools/source/i18n/textsearch.cxx2
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx2
10 files changed, 27 insertions, 27 deletions
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 6456085f55a0..07456acf43ac 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -36,14 +36,14 @@ public:
AccessibleRelationSetHelperImpl(const AccessibleRelationSetHelperImpl& rImpl);
/// @throws uno::RuntimeException
- sal_Int32 getRelationCount( );
+ sal_Int32 getRelationCount() const;
/// @throws lang::IndexOutOfBoundsException
/// @throws uno::RuntimeException
- AccessibleRelation getRelation( sal_Int32 nIndex );
+ AccessibleRelation getRelation( sal_Int32 nIndex ) const;
/// @throws uno::RuntimeException
- bool containsRelation( sal_Int16 aRelationType );
+ bool containsRelation( sal_Int16 aRelationType ) const;
/// @throws uno::RuntimeException
- AccessibleRelation getRelationByType( sal_Int16 aRelationType );
+ AccessibleRelation getRelationByType( sal_Int16 aRelationType ) const;
/// @throws uno::RuntimeException
void AddRelation(const AccessibleRelation& rRelation);
@@ -60,26 +60,26 @@ AccessibleRelationSetHelperImpl::AccessibleRelationSetHelperImpl(const Accessibl
{
}
-sal_Int32 AccessibleRelationSetHelperImpl::getRelationCount( )
+sal_Int32 AccessibleRelationSetHelperImpl::getRelationCount() const
{
return maRelations.size();
}
-AccessibleRelation AccessibleRelationSetHelperImpl::getRelation( sal_Int32 nIndex )
+AccessibleRelation AccessibleRelationSetHelperImpl::getRelation( sal_Int32 nIndex ) const
{
if ((nIndex < 0) || (static_cast<sal_uInt32>(nIndex) >= maRelations.size()))
throw lang::IndexOutOfBoundsException();
return maRelations[nIndex];
}
-bool AccessibleRelationSetHelperImpl::containsRelation( sal_Int16 aRelationType )
+bool AccessibleRelationSetHelperImpl::containsRelation( sal_Int16 aRelationType ) const
{
AccessibleRelation defaultRelation; // default is INVALID
AccessibleRelation relationByType = getRelationByType(aRelationType);
return relationByType.RelationType != defaultRelation.RelationType;
}
-AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 aRelationType )
+AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 aRelationType ) const
{
sal_Int32 nCount(getRelationCount());
sal_Int32 i(0);
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index 2a8dc2034822..b998e820f28b 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -113,8 +113,8 @@ public:
/// @throws css::uno::RuntimeException
static css::uno::Type SAL_CALL getElementType( );
/// @throws css::uno::RuntimeException
- bool SAL_CALL hasElements( );
- OUString GetEventName( GlobalEventId nID );
+ bool SAL_CALL hasElements() const;
+ OUString const & GetEventName( GlobalEventId nID ) const;
};
@@ -141,7 +141,7 @@ GlobalEventConfig_Impl::~GlobalEventConfig_Impl()
assert(!IsModified()); // should have been committed
}
-OUString GlobalEventConfig_Impl::GetEventName( GlobalEventId nIndex )
+OUString const & GlobalEventConfig_Impl::GetEventName( GlobalEventId nIndex ) const
{
return m_supportedEvents[nIndex];
}
@@ -306,7 +306,7 @@ Type SAL_CALL GlobalEventConfig_Impl::getElementType( )
return cppu::UnoType<Sequence<beans::PropertyValue>>::get();
}
-bool SAL_CALL GlobalEventConfig_Impl::hasElements( )
+bool SAL_CALL GlobalEventConfig_Impl::hasElements() const
{
return m_eventBindingHash.empty();
}
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index 46841d3dad01..2d1279c95f52 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -72,7 +72,7 @@ class SvtExtendedSecurityOptions_Impl : public ConfigItem
virtual void Notify( const Sequence< OUString >& seqPropertyNames ) override;
- SvtExtendedSecurityOptions::OpenHyperlinkMode GetOpenHyperlinkMode() { return m_eOpenHyperlinkMode;}
+ SvtExtendedSecurityOptions::OpenHyperlinkMode GetOpenHyperlinkMode() const { return m_eOpenHyperlinkMode;}
private:
virtual void ImplCommit() override;
@@ -265,7 +265,7 @@ SvtExtendedSecurityOptions::~SvtExtendedSecurityOptions()
// public method
-SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions::GetOpenHyperlinkMode()
+SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions::GetOpenHyperlinkMode() const
{
MutexGuard aGuard( GetInitMutex() );
return m_pImpl->GetOpenHyperlinkMode();
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index e12403f77784..d867f768d9bf 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -69,7 +69,7 @@ public:
SvtHistoryOptions_Impl();
/// Returns the maximum size of the internal lists, ie. the capacity not the size.
- sal_uInt32 GetCapacity(EHistoryType eHistory);
+ sal_uInt32 GetCapacity(EHistoryType eHistory) const;
/// Clear the specified history list.
void Clear(EHistoryType eHistory);
@@ -121,7 +121,7 @@ SvtHistoryOptions_Impl::SvtHistoryOptions_Impl()
}
}
-sal_uInt32 SvtHistoryOptions_Impl::GetCapacity(EHistoryType eHistory)
+sal_uInt32 SvtHistoryOptions_Impl::GetCapacity(EHistoryType eHistory) const
{
uno::Reference<beans::XPropertySet> xListAccess(m_xCommonXCU, uno::UNO_QUERY);
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 6be5e6ce8824..5e2bab397cf3 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -831,12 +831,12 @@ SvtLinguConfigItem & SvtLinguConfig::GetConfigItem()
return *pCfgItem;
}
-uno::Sequence< OUString > SvtLinguConfig::GetNodeNames( const OUString &rNode )
+uno::Sequence< OUString > SvtLinguConfig::GetNodeNames( const OUString &rNode ) const
{
return GetConfigItem().GetNodeNames( rNode );
}
-uno::Sequence< uno::Any > SvtLinguConfig::GetProperties( const uno::Sequence< OUString > &rNames )
+uno::Sequence< uno::Any > SvtLinguConfig::GetProperties( const uno::Sequence< OUString > &rNames ) const
{
return GetConfigItem().GetProperties(rNames);
}
@@ -1008,7 +1008,7 @@ uno::Sequence< OUString > SvtLinguConfig::GetDisabledDictionaries() const
}
std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionariesByFormat(
- const OUString &rFormatName )
+ const OUString &rFormatName ) const
{
std::vector< SvtLinguConfigDictionaryEntry > aRes;
if (rFormatName.isEmpty())
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 3d92b72cfe1d..12e0eefe6a81 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -1120,7 +1120,7 @@ css::uno::Sequence < OUString > SvtModuleOptions::GetAllServiceNames()
return m_pImpl->GetAllServiceNames();
}
-OUString SvtModuleOptions::GetDefaultModuleName()
+OUString SvtModuleOptions::GetDefaultModuleName() const
{
OUString aModule;
if (m_pImpl->IsModuleInstalled(SvtModuleOptions::EModule::WRITER))
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index d9d15a391c2e..4eadf6d3aa54 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -107,8 +107,8 @@ public:
void SetIgnoreLanguageChange( bool bSet);
bool IsReadOnly( SvtSysLocaleOptions::EOption eOption ) const;
- const LanguageTag& GetRealLocale() { return m_aRealLocale; }
- const LanguageTag& GetRealUILocale() { return m_aRealUILocale; }
+ const LanguageTag& GetRealLocale() const { return m_aRealLocale; }
+ const LanguageTag& GetRealUILocale() const { return m_aRealUILocale; }
};
#define ROOTNODE_SYSLOCALE "Setup/L10N"
@@ -555,7 +555,7 @@ SvtSysLocaleOptions::~SvtSysLocaleOptions()
pImpl.reset();
}
-bool SvtSysLocaleOptions::IsModified()
+bool SvtSysLocaleOptions::IsModified() const
{
MutexGuard aGuard( GetMutex() );
return pImpl->IsModified();
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 09e5c186f517..3ae1ac104f70 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -662,7 +662,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl()
void LocaleDataWrapper::scanCurrFormatImpl( const OUString& rCode,
sal_Int32 nStart, sal_Int32& nSign, sal_Int32& nPar,
- sal_Int32& nNum, sal_Int32& nBlank, sal_Int32& nSym )
+ sal_Int32& nNum, sal_Int32& nBlank, sal_Int32& nSym ) const
{
nSign = nPar = nNum = nBlank = nSym = -1;
const sal_Unicode* const pStr = rCode.getStr();
@@ -901,7 +901,7 @@ DateOrder LocaleDataWrapper::getLongDateOrder() const
return (DateOrder) nLongDateOrder;
}
-DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode )
+DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) const
{
// Only some european versions were translated, the ones with different
// keyword combinations are:
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 06def7e5d8ed..f1191f43c6c0 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -307,7 +307,7 @@ bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart,
return bRet;
}
-void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const SearchResult& rResult )
+void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const SearchResult& rResult ) const
{
if( rResult.subRegExpressions > 0 )
{
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 3b55739003c8..4df84af0cb6a 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -395,7 +395,7 @@ OUString TempFile::GetFileName() const
return aTmp;
}
-OUString const & TempFile::GetURL()
+OUString const & TempFile::GetURL() const
{
assert(!aName.isEmpty() && "TempFile::GetURL failed: unit test is leaking temp files, add the ucpfile1 component!");
return aName;