summaryrefslogtreecommitdiff
path: root/unotools/source/config/optionsdlg.cxx
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/source/config/optionsdlg.cxx
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/source/config/optionsdlg.cxx')
-rw-r--r--unotools/source/config/optionsdlg.cxx16
1 files changed, 9 insertions, 7 deletions
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 );
}
}