diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-17 12:23:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-19 08:44:52 +0200 |
commit | d8ac55e3e53564aca4b0bade5a5b5cb01b4519b1 (patch) | |
tree | eccc16dc658bdcc8c3e47b2656d9481af73f89fb | |
parent | 488db385bd14597b2c14410b855749bc5c5b9441 (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>
-rw-r--r-- | include/unotools/configitem.hxx | 2 | ||||
-rw-r--r-- | include/unotools/intlwrapper.hxx | 2 | ||||
-rw-r--r-- | include/unotools/streamhelper.hxx | 2 | ||||
-rw-r--r-- | include/unotools/tempfile.hxx | 2 | ||||
-rw-r--r-- | include/unotools/transliterationwrapper.hxx | 2 | ||||
-rw-r--r-- | include/unotools/viewoptions.hxx | 4 | ||||
-rw-r--r-- | unotools/source/config/configvaluecontainer.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/defaultoptions.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/extendedsecurityoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 8 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/optionsdlg.cxx | 16 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/viewoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/misc/wincodepage.cxx | 12 | ||||
-rw-r--r-- | unoxml/source/dom/document.cxx | 2 | ||||
-rw-r--r-- | unoxml/source/rdf/librdf_repository.cxx | 2 | ||||
-rw-r--r-- | uui/source/fltdlg.cxx | 2 | ||||
-rw-r--r-- | uui/source/logindlg.hxx | 4 | ||||
-rw-r--r-- | uui/source/passworddlg.hxx | 2 |
20 files changed, 40 insertions, 38 deletions
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx index 302fa0bdde5b..e49e7a552709 100644 --- a/include/unotools/configitem.hxx +++ b/include/unotools/configitem.hxx @@ -77,7 +77,7 @@ namespace utl m_xHierarchyAccess; css::uno::Reference< css::util::XChangesListener > xChangeLstnr; - ConfigItemMode m_nMode; + ConfigItemMode const m_nMode; bool m_bIsModified; bool m_bEnableInternalNotification; sal_Int16 m_nInValueChange; diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx index ffcb3313b349..cf1ea94682f4 100644 --- a/include/unotools/intlwrapper.hxx +++ b/include/unotools/intlwrapper.hxx @@ -48,7 +48,7 @@ class UNOTOOLS_DLLPUBLIC IntlWrapper { private: - LanguageTag maLanguageTag; + LanguageTag const maLanguageTag; css::uno::Reference< css::uno::XComponentContext > m_xContext; std::unique_ptr<LocaleDataWrapper> pLocaleData; diff --git a/include/unotools/streamhelper.hxx b/include/unotools/streamhelper.hxx index 3758aec86286..99e9e708aa97 100644 --- a/include/unotools/streamhelper.hxx +++ b/include/unotools/streamhelper.hxx @@ -38,7 +38,7 @@ class UNOTOOLS_DLLPUBLIC OInputStreamHelper : public cppu::WeakImplHelper<css::i ::osl::Mutex m_aMutex; SvLockBytesRef m_xLockBytes; sal_uInt64 m_nActPos; - sal_Int32 m_nAvailable; // this is typically the chunk(buffer) size + sal_Int32 const m_nAvailable; // this is typically the chunk(buffer) size public: OInputStreamHelper(const SvLockBytesRef& _xLockBytes, diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx index a70f7d277fbf..57f0fef8a940 100644 --- a/include/unotools/tempfile.hxx +++ b/include/unotools/tempfile.hxx @@ -48,7 +48,7 @@ class UNOTOOLS_DLLPUBLIC TempFile OUString aName; std::unique_ptr<SvStream> pStream; - bool bIsDirectory; + bool const bIsDirectory; bool bKillingFileEnabled; public: diff --git a/include/unotools/transliterationwrapper.hxx b/include/unotools/transliterationwrapper.hxx index 0726d6caf139..7afdbf44411e 100644 --- a/include/unotools/transliterationwrapper.hxx +++ b/include/unotools/transliterationwrapper.hxx @@ -39,7 +39,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper { css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans; LanguageTag aLanguageTag; - TransliterationFlags nType; + TransliterationFlags const nType; mutable bool bFirstCall; TransliterationWrapper( const TransliterationWrapper& ) = delete; diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx index 83bc1922b965..0948925756d2 100644 --- a/include/unotools/viewoptions.hxx +++ b/include/unotools/viewoptions.hxx @@ -235,8 +235,8 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions : public utl::detail::Op /// specify which list of views in configuration is used! This can't be a static value!!! /// ... because we need this value to work with right static data container. - EViewType m_eViewType; - OUString m_sViewName; + EViewType const m_eViewType; + OUString const m_sViewName; /*Attention 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[] = { diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 4e904a899d3e..69a15862501a 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -340,7 +340,7 @@ namespace DOM // IO context functions for libxml2 interaction typedef struct { Reference< XOutputStream > stream; - bool allowClose; + bool const allowClose; } IOContext; extern "C" { diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 3352eba9acba..b4e6e266cd2c 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -405,7 +405,7 @@ private: NamedGraphMap_t m_NamedGraphs; /// type conversion helper - stateless - librdf_TypeConverter m_TypeConverter; + librdf_TypeConverter const m_TypeConverter; /// set of xml:ids of elements with xhtml:content ::std::set< OUString > m_RDFaXHTMLContentSet; diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx index 2911acb03b22..100f0e90bcb2 100644 --- a/uui/source/fltdlg.cxx +++ b/uui/source/fltdlg.cxx @@ -168,7 +168,7 @@ class StringCalculator : public ::cppu::WeakImplHelper< css::util::XStringWidth } private: - weld::Widget* m_pDevice; + weld::Widget* const m_pDevice; }; /*-************************************************************************************************************ diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx index e96d11ae72a8..adfa31246e77 100644 --- a/uui/source/logindlg.hxx +++ b/uui/source/logindlg.hxx @@ -53,8 +53,8 @@ class LoginDialog : public weld::GenericDialogController std::unique_ptr<weld::CheckButton> m_xSavePasswdBtn; std::unique_ptr<weld::CheckButton> m_xUseSysCredsCB; std::unique_ptr<weld::Button> m_xOKBtn; - OUString m_server; - OUString m_realm; + OUString const m_server; + OUString const m_realm; void HideControls_Impl( LoginFlags nFlags ); void EnableUseSysCredsControls_Impl( bool bUseSysCredsEnabled ); diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx index 6da3ad4c49b7..f376fb90a752 100644 --- a/uui/source/passworddlg.hxx +++ b/uui/source/passworddlg.hxx @@ -31,7 +31,7 @@ class PasswordDialog : public weld::GenericDialogController std::unique_ptr<weld::Entry> m_xEDConfirmPassword; std::unique_ptr<weld::Button> m_xOKBtn; sal_uInt16 nMinLen; - OUString aPasswdMismatch; + OUString const aPasswdMismatch; DECL_LINK(OKHdl_Impl, weld::Button&, void); |