summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-17 12:23:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-19 08:44:52 +0200
commitd8ac55e3e53564aca4b0bade5a5b5cb01b4519b1 (patch)
treeeccc16dc658bdcc8c3e47b2656d9481af73f89fb /unotools
parent488db385bd14597b2c14410b855749bc5c5b9441 (diff)
loplugin:constfields in unotools..uui
Change-Id: I9d9cfd107bea9556cbc505e977838fb13bd25e2a Reviewed-on: https://gerrit.libreoffice.org/60573 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configvaluecontainer.cxx2
-rw-r--r--unotools/source/config/defaultoptions.cxx4
-rw-r--r--unotools/source/config/extendedsecurityoptions.cxx2
-rw-r--r--unotools/source/config/fontcfg.cxx8
-rw-r--r--unotools/source/config/lingucfg.cxx2
-rw-r--r--unotools/source/config/optionsdlg.cxx16
-rw-r--r--unotools/source/config/pathoptions.cxx4
-rw-r--r--unotools/source/config/viewoptions.cxx2
-rw-r--r--unotools/source/misc/wincodepage.cxx12
9 files changed, 27 insertions, 25 deletions
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 894e665cf9fc..ce9853aaa0b4 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -43,7 +43,7 @@ namespace utl
struct NodeValueAccessor
{
private:
- OUString sRelativePath; // the relative path of the node
+ OUString const sRelativePath; // the relative path of the node
LocationType eLocationType; // the type of location where the value is stored
void* pLocation; // the pointer to the location
Type aDataType; // the type object pointed to by pLocation
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
index 259cbef80702..a530e06eb628 100644
--- a/unotools/source/config/defaultoptions.cxx
+++ b/unotools/source/config/defaultoptions.cxx
@@ -115,8 +115,8 @@ typedef OUString SvtDefaultOptions_Impl:: *PathStrPtr;
struct PathToDefaultMapping_Impl
{
- SvtPathOptions::Paths _ePath;
- PathStrPtr _pDefaultPath;
+ SvtPathOptions::Paths const _ePath;
+ PathStrPtr const _pDefaultPath;
};
static PathToDefaultMapping_Impl const PathMap_Impl[] =
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index 0d3a6cc61f7b..1eb4fa4ef305 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -85,7 +85,7 @@ class SvtExtendedSecurityOptions_Impl : public ConfigItem
static Sequence< OUString > GetPropertyNames();
- OUString m_aSecureExtensionsSetName;
+ OUString const m_aSecureExtensionsSetName;
SvtExtendedSecurityOptions::OpenHyperlinkMode m_eOpenHyperlinkMode;
};
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index 9dae8a8c79f1..c4b496bba09a 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -466,7 +466,7 @@ static const char* const aImplKillTrailingWithExceptionsList[] =
struct ImplFontAttrWeightSearchData
{
const char* mpStr;
- FontWeight meWeight;
+ FontWeight const meWeight;
};
static ImplFontAttrWeightSearchData const aImplWeightAttrSearchList[] =
@@ -492,7 +492,7 @@ static ImplFontAttrWeightSearchData const aImplWeightAttrSearchList[] =
struct ImplFontAttrWidthSearchData
{
const char* mpStr;
- FontWidth meWidth;
+ FontWidth const meWidth;
};
static ImplFontAttrWidthSearchData const aImplWidthAttrSearchList[] =
@@ -513,7 +513,7 @@ static ImplFontAttrWidthSearchData const aImplWidthAttrSearchList[] =
struct ImplFontAttrTypeSearchData
{
const char* mpStr;
- ImplFontAttrs mnType;
+ ImplFontAttrs const mnType;
};
static ImplFontAttrTypeSearchData const aImplTypeAttrSearchList[] =
@@ -796,7 +796,7 @@ static const char* const pAttribNames[] =
struct enum_convert
{
const char* pName;
- int nEnum;
+ int const nEnum;
};
static const enum_convert pWeightNames[] =
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index e1a035f91b08..42506f20027a 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -212,7 +212,7 @@ static struct NamesToHdl
{
const char *pFullPropName; // full qualified name as used in configuration
const char *pPropName; // property name only (atom) of above
- sal_Int32 nHdl; // numeric handle representing the property
+ sal_Int32 const nHdl; // numeric handle representing the property
}aNamesToHdl[] =
{
{/* 0 */ "General/DefaultLocale", UPN_DEFAULT_LOCALE, UPH_DEFAULT_LOCALE},
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx
index 535ad64b870b..21e583132c92 100644
--- a/unotools/source/config/optionsdlg.cxx
+++ b/unotools/source/config/optionsdlg.cxx
@@ -45,7 +45,7 @@ class SvtOptionsDlgOptions_Impl : public utl::ConfigItem
private:
typedef std::unordered_map< OUString, bool > OptionNodeList;
- OUString m_sPathDelimiter;
+ static constexpr OUStringLiteral g_sPathDelimiter = "/";
OptionNodeList m_aOptionNodeList;
enum NodeType{ NT_Group, NT_Page, NT_Option };
@@ -74,6 +74,11 @@ namespace
class theOptionsDlgOptions_ImplMutex : public rtl::Static<osl::Mutex, theOptionsDlgOptions_ImplMutex>{};
}
+#if !HAVE_CPP_INLINE_VARIABLES
+constexpr OUStringLiteral SvtOptionsDlgOptions_Impl::g_sPathDelimiter;
+#endif
+
+
::osl::Mutex & SvtOptionsDlgOptions_Impl::getInitMutex()
{
return theOptionsDlgOptions_ImplMutex::get();
@@ -81,14 +86,11 @@ namespace
SvtOptionsDlgOptions_Impl::SvtOptionsDlgOptions_Impl()
: ConfigItem( CFG_FILENAME ),
-
- m_sPathDelimiter( "/" ),
m_aOptionNodeList( OptionNodeList() )
-
{
OUString sRootNode( ROOT_NODE );
Sequence< OUString > aNodeSeq = GetNodeNames( sRootNode );
- OUString sNode( sRootNode + m_sPathDelimiter );
+ OUString sNode( sRootNode + g_sPathDelimiter );
sal_uInt32 nCount = aNodeSeq.getLength();
for ( sal_uInt32 n = 0; n < nCount; n++ )
{
@@ -109,7 +111,7 @@ void SvtOptionsDlgOptions_Impl::Notify( const Sequence< OUString >& )
void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eType )
{
- OUString sNode( _rNode + m_sPathDelimiter );
+ OUString sNode( _rNode + g_sPathDelimiter );
OUString sSet;
sal_Int32 nLen = 0;
switch ( _eType )
@@ -154,7 +156,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp
{
for ( sal_uInt32 n = 0; n < static_cast<sal_uInt32>(aNodes.getLength()); ++n )
{
- OUString sSubNodeName( sNodes + m_sPathDelimiter + aNodes[n] );
+ OUString sSubNodeName( sNodes + g_sPathDelimiter + aNodes[n] );
ReadNode( sSubNodeName, _eType == NT_Group ? NT_Page : NT_Option );
}
}
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 91a5bd078590..1c8fdcadc96f 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -87,7 +87,7 @@ class SvtPathOptions_Impl
m_aMapEnumToPropHandle;
VarNameSet m_aSystemPathVarNames;
- OUString m_aEmptyString;
+ OUString const m_aEmptyString;
mutable ::osl::Mutex m_aMutex;
public:
@@ -161,7 +161,7 @@ static std::weak_ptr<SvtPathOptions_Impl> g_pOptions;
struct PropertyStruct
{
const char* pPropName; // The ascii name of the Office path
- SvtPathOptions::Paths ePath; // The enum value used by SvtPathOptions
+ SvtPathOptions::Paths const ePath; // The enum value used by SvtPathOptions
};
struct VarNameAttribute
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index edc7f6c15e21..752f29e4fee6 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -114,7 +114,7 @@ class SvtViewOptionsBase_Impl final
bool bCreateIfMissing);
private:
- OUString m_sListName;
+ OUString const m_sListName;
css::uno::Reference< css::container::XNameAccess > m_xRoot;
css::uno::Reference< css::container::XNameAccess > m_xSet;
diff --git a/unotools/source/misc/wincodepage.cxx b/unotools/source/misc/wincodepage.cxx
index 5a5df8b3ed2e..493476a5b80b 100644
--- a/unotools/source/misc/wincodepage.cxx
+++ b/unotools/source/misc/wincodepage.cxx
@@ -20,9 +20,9 @@ rtl_TextEncoding impl_getWinTextEncodingFromLangStrANSI(const char* pLanguage)
struct LangEncodingDef
{
- const char* mpLangStr;
- decltype(nLangLen) mnLangStrLen;
- rtl_TextEncoding meTextEncoding;
+ const char* const mpLangStr;
+ decltype(nLangLen) const mnLangStrLen;
+ rtl_TextEncoding const meTextEncoding;
};
static LangEncodingDef const aLanguageTab[] =
{
@@ -82,9 +82,9 @@ rtl_TextEncoding impl_getWinTextEncodingFromLangStrOEM(const char* pLanguage)
struct LangEncodingDef
{
- const char* mpLangStr;
- decltype(nLangLen) mnLangStrLen;
- rtl_TextEncoding meTextEncoding;
+ const char* const mpLangStr;
+ decltype(nLangLen) const mnLangStrLen;
+ rtl_TextEncoding const meTextEncoding;
};
static LangEncodingDef const aLanguageTab[] =
{