svx/source/tbxctrls/tbcontrl.cxx  |   14 +++---
 sw/source/core/fields/authfld.cxx |   78 +++++++++++++++++++-------------------
 2 files changed, 46 insertions(+), 46 deletions(-)

New commits:
commit 6b8d8e4476fd5d640126cad39e70c68763c48f37
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 13:48:56 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 3 20:30:29 2024 +0200

    replace createFromAscii with OUString literals in SwAuthorityField
    
    Change-Id: Ifcbdd1bbab68e177e11a7e48cb1ed2eb2f2b53a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167069
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/fields/authfld.cxx 
b/sw/source/core/fields/authfld.cxx
index b3ec935847a1..a8da2323f7d4 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -721,42 +721,42 @@ void SwAuthorityField::dumpAsXml(xmlTextWriterPtr 
pWriter) const
     (void)xmlTextWriterEndElement(pWriter);
 }
 
-const char* const aFieldNames[] =
-{
-    "Identifier",
-    "BibiliographicType",
-    "Address",
-    "Annote",
-    "Author",
-    "Booktitle",
-    "Chapter",
-    "Edition",
-    "Editor",
-    "Howpublished",
-    "Institution",
-    "Journal",
-    "Month",
-    "Note",
-    "Number",
-    "Organizations",
-    "Pages",
-    "Publisher",
-    "School",
-    "Series",
-    "Title",
-    "Report_Type",
-    "Volume",
-    "Year",
-    "URL",
-    "Custom1",
-    "Custom2",
-    "Custom3",
-    "Custom4",
-    "Custom5",
-    "ISBN",
-    "LocalURL",
-    "TargetType",
-    "TargetURL",
+constexpr OUString aFieldNames[]
+{
+    u"Identifier"_ustr,
+    u"BibiliographicType"_ustr,
+    u"Address"_ustr,
+    u"Annote"_ustr,
+    u"Author"_ustr,
+    u"Booktitle"_ustr,
+    u"Chapter"_ustr,
+    u"Edition"_ustr,
+    u"Editor"_ustr,
+    u"Howpublished"_ustr,
+    u"Institution"_ustr,
+    u"Journal"_ustr,
+    u"Month"_ustr,
+    u"Note"_ustr,
+    u"Number"_ustr,
+    u"Organizations"_ustr,
+    u"Pages"_ustr,
+    u"Publisher"_ustr,
+    u"School"_ustr,
+    u"Series"_ustr,
+    u"Title"_ustr,
+    u"Report_Type"_ustr,
+    u"Volume"_ustr,
+    u"Year"_ustr,
+    u"URL"_ustr,
+    u"Custom1"_ustr,
+    u"Custom2"_ustr,
+    u"Custom3"_ustr,
+    u"Custom4"_ustr,
+    u"Custom5"_ustr,
+    u"ISBN"_ustr,
+    u"LocalURL"_ustr,
+    u"TargetType"_ustr,
+    u"TargetURL"_ustr,
 };
 
 void SwAuthEntry::dumpAsXml(xmlTextWriterPtr pWriter) const
@@ -766,7 +766,7 @@ void SwAuthEntry::dumpAsXml(xmlTextWriterPtr pWriter) const
     for (int i = 0; i < AUTH_FIELD_END; ++i)
     {
         (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_aAuthField"));
-        (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("key"), 
BAD_CAST(aFieldNames[i]));
+        (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("key"), 
BAD_CAST(aFieldNames[i].toUtf8().getStr()));
         (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(m_aAuthFields[i].toUtf8().getStr()));
         (void)xmlTextWriterEndElement(pWriter);
     }
@@ -784,7 +784,7 @@ bool    SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 
/*nWhichId*/ ) const
     PropertyValue* pValues = aRet.getArray();
     for(int i = 0; i < AUTH_FIELD_END; ++i)
     {
-        pValues[i].Name = OUString::createFromAscii(aFieldNames[i]);
+        pValues[i].Name = aFieldNames[i];
         const OUString& sField = 
m_xAuthEntry->GetAuthorField(static_cast<ToxAuthorityField>(i));
         if(i == AUTH_FIELD_AUTHORITY_TYPE)
             pValues[i].Value <<= sal_Int16(sField.toInt32());
@@ -799,7 +799,7 @@ bool    SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 
/*nWhichId*/ ) const
 static sal_Int32 lcl_Find(std::u16string_view rFieldName)
 {
     for(sal_Int32 i = 0; i < AUTH_FIELD_END; ++i)
-        if(o3tl::equalsAscii(rFieldName, aFieldNames[i]))
+        if(aFieldNames[i] == rFieldName)
             return i;
     return -1;
 }
commit 85c116f590f1455a6204ee9fbbf7da9fd855f001
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 13:43:12 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 3 20:30:14 2024 +0200

    replace createFromAscii with OUString literals in svx
    
    Change-Id: I9bb7884048f3cc7ef795f7a79dc566fc8fe77e7d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167063
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 71d7726fbc3b..85d38fd0556e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3050,13 +3050,13 @@ struct SvxStyleToolBoxControl::Impl
 // mapping table from bound items. BE CAREFUL this table must be in the
 // same order as the uno commands bound to the slots SID_STYLE_FAMILY1..n
 // MAX_FAMILIES must also be correctly set!
-static const char* StyleSlotToStyleCommand[MAX_FAMILIES] =
+constexpr OUString StyleSlotToStyleCommand[MAX_FAMILIES] =
 {
-    ".uno:CharStyle",
-    ".uno:ParaStyle",
-    ".uno:FrameStyle",
-    ".uno:PageStyle",
-    ".uno:TemplateFamily5"
+    u".uno:CharStyle"_ustr,
+    u".uno:ParaStyle"_ustr,
+    u".uno:FrameStyle"_ustr,
+    u".uno:PageStyle"_ustr,
+    u".uno:TemplateFamily5"_ustr
 };
 
 SvxStyleToolBoxControl::SvxStyleToolBoxControl()
@@ -3090,7 +3090,7 @@ void SAL_CALL SvxStyleToolBoxControl::initialize(const 
Sequence<Any>& rArguments
     {
         m_xBoundItems[i] = new SfxStyleControllerItem_Impl( xDispatchProvider,
                                                             
SID_STYLE_FAMILY_START + i,
-                                                            
OUString::createFromAscii( StyleSlotToStyleCommand[i] ),
+                                                            
StyleSlotToStyleCommand[i],
                                                             *this );
         pFamilyState[i]  = nullptr;
     }

Reply via email to