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

loplugin:constfields in unotools..uui

Change-Id: I9d9cfd107bea9556cbc505e977838fb13bd25e2a
Reviewed-on: https://gerrit.libreoffice.org/60573
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 488db385
......@@ -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;
......
......@@ -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;
......
......@@ -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,
......
......@@ -48,7 +48,7 @@ class UNOTOOLS_DLLPUBLIC TempFile
OUString aName;
std::unique_ptr<SvStream>
pStream;
bool bIsDirectory;
bool const bIsDirectory;
bool bKillingFileEnabled;
public:
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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[] =
......
......@@ -85,7 +85,7 @@ class SvtExtendedSecurityOptions_Impl : public ConfigItem
static Sequence< OUString > GetPropertyNames();
OUString m_aSecureExtensionsSetName;
OUString const m_aSecureExtensionsSetName;
SvtExtendedSecurityOptions::OpenHyperlinkMode m_eOpenHyperlinkMode;
};
......
......@@ -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[] =
......
......@@ -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},
......
......@@ -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 );
}
}
......
......@@ -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
......
......@@ -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;
......
......@@ -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[] =
{
......
......@@ -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" {
......
......@@ -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;
......
......@@ -168,7 +168,7 @@ class StringCalculator : public ::cppu::WeakImplHelper< css::util::XStringWidth
}
private:
weld::Widget* m_pDevice;
weld::Widget* const m_pDevice;
};
/*-************************************************************************************************************
......
......@@ -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 );
......
......@@ -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);
......
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