include/unotools/compatibility.hxx       |   11 ++---------
 sw/source/ui/config/optcomp.cxx          |    4 ++--
 unotools/source/config/compatibility.cxx |    4 ++--
 3 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit d14ab85a4446279e24aa6b6d5e8bfedb48ccdfe1
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jul 26 10:44:16 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jul 26 20:49:25 2021 +0200

    convert these into constants
    
    Change-Id: Ie3e3b497cfeb8c9e9456fb86a04f409658116e1b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119513
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 3c025224ea1b..ba8de4e784b5 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -75,15 +75,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
 
         static OUString getName( const Index rIdx );
 
-        static OUString getUserEntryName()
-        {
-            return "_user";
-        }
-
-        static OUString getDefaultEntryName()
-        {
-            return "_default";
-        }
+        static constexpr OUStringLiteral USER_ENTRY_NAME = u"_user";
+        static constexpr OUStringLiteral DEFAULT_ENTRY_NAME = u"_default";
 
         static Index getIndex( std::u16string_view rName )
         {
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 8a57f054abca..bea377047ae9 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -219,8 +219,8 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 
         const OUString sEntryName = aEntry.getValue<OUString>( 
SvtCompatibilityEntry::Index::Name );
 
-        const bool bIsUserEntry    = ( sEntryName == 
SvtCompatibilityEntry::getUserEntryName() );
-        const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::getDefaultEntryName() );
+        const bool bIsUserEntry    = ( sEntryName == 
SvtCompatibilityEntry::USER_ENTRY_NAME );
+        const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
 
         aEntry.setDefaultEntry( bIsDefaultEntry );
 
diff --git a/unotools/source/config/compatibility.cxx 
b/unotools/source/config/compatibility.cxx
index 5556a0a231d4..c3ac4b6c532a 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -186,7 +186,7 @@ 
SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN
 
         m_aOptions.push_back( aItem );
 
-        if ( !bDefaultFound && aItem.getValue<OUString>( 
SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::getDefaultEntryName() )
+        if ( !bDefaultFound && aItem.getValue<OUString>( 
SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME )
         {
             SvtSysLocale aSysLocale;
             css::lang::Locale aLocale = 
aSysLocale.GetLanguageTag().getLocale();
@@ -209,7 +209,7 @@ void SvtCompatibilityOptions_Impl::AppendItem( const 
SvtCompatibilityEntry& aIte
     m_aOptions.push_back( aItem );
 
     // default item reset?
-    if ( aItem.getValue<OUString>( SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::getDefaultEntryName() )
+    if ( aItem.getValue<OUString>( SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME )
         m_aDefOptions = aItem;
 
     SetModified();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to