cui/source/customize/CustomNotebookbarGenerator.cxx |    2 
 cui/source/dialogs/toolbarmodedlg.cxx               |    8 +--
 include/unotools/confignode.hxx                     |    5 -
 sfx2/source/appl/appserv.cxx                        |    6 +-
 sfx2/source/notebookbar/SfxNotebookBar.cxx          |    4 -
 sfx2/source/sidebar/ResourceManager.cxx             |   12 ++--
 svl/source/items/srchitem.cxx                       |   52 ++++++++------------
 7 files changed, 38 insertions(+), 51 deletions(-)

New commits:
commit 017045b6545a56c5980c63c80e04a80d502b21bb
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed May 8 19:54:10 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun May 12 12:58:21 2024 +0200

    replace createFromAscii with OUString literals in SvxSearchItem
    
    Change-Id: Ie1dc68bd5c5550718103f9ecbbb2fa707c950ee3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167529
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 6aa7c36ddca2..5f37d07b7674 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -62,38 +62,30 @@ SfxPoolItem* SvxSearchItem::CreateDefault() { return new  
SvxSearchItem(0);}
 static Sequence< OUString > lcl_GetNotifyNames()
 {
     // names of transliteration relevant properties
-    static const char* aTranslitNames[] =
+    return
     {
-        "IsMatchCase",                          //  0
-        "Japanese/IsMatchFullHalfWidthForms",   //  1
-        "Japanese/IsMatchHiraganaKatakana",     //  2
-        "Japanese/IsMatchContractions",         //  3
-        "Japanese/IsMatchMinusDashCho-on",      //  4
-        "Japanese/IsMatchRepeatCharMarks",      //  5
-        "Japanese/IsMatchVariantFormKanji",     //  6
-        "Japanese/IsMatchOldKanaForms",         //  7
-        "Japanese/IsMatch_DiZi_DuZu",           //  8
-        "Japanese/IsMatch_BaVa_HaFa",           //  9
-        "Japanese/IsMatch_TsiThiChi_DhiZi",     // 10
-        "Japanese/IsMatch_HyuIyu_ByuVyu",       // 11
-        "Japanese/IsMatch_SeShe_ZeJe",          // 12
-        "Japanese/IsMatch_IaIya",               // 13
-        "Japanese/IsMatch_KiKu",                // 14
-        "Japanese/IsIgnorePunctuation",         // 15
-        "Japanese/IsIgnoreWhitespace",          // 16
-        "Japanese/IsIgnoreProlongedSoundMark",  // 17
-        "Japanese/IsIgnoreMiddleDot",           // 18
-        "IsIgnoreDiacritics_CTL",               // 19
-        "IsIgnoreKashida_CTL"                   // 20
+        u"IsMatchCase"_ustr,                          //  0
+        u"Japanese/IsMatchFullHalfWidthForms"_ustr,   //  1
+        u"Japanese/IsMatchHiraganaKatakana"_ustr,     //  2
+        u"Japanese/IsMatchContractions"_ustr,         //  3
+        u"Japanese/IsMatchMinusDashCho-on"_ustr,      //  4
+        u"Japanese/IsMatchRepeatCharMarks"_ustr,      //  5
+        u"Japanese/IsMatchVariantFormKanji"_ustr,     //  6
+        u"Japanese/IsMatchOldKanaForms"_ustr,         //  7
+        u"Japanese/IsMatch_DiZi_DuZu"_ustr,           //  8
+        u"Japanese/IsMatch_BaVa_HaFa"_ustr,           //  9
+        u"Japanese/IsMatch_TsiThiChi_DhiZi"_ustr,     // 10
+        u"Japanese/IsMatch_HyuIyu_ByuVyu"_ustr,       // 11
+        u"Japanese/IsMatch_SeShe_ZeJe"_ustr,          // 12
+        u"Japanese/IsMatch_IaIya"_ustr,               // 13
+        u"Japanese/IsMatch_KiKu"_ustr,                // 14
+        u"Japanese/IsIgnorePunctuation"_ustr,         // 15
+        u"Japanese/IsIgnoreWhitespace"_ustr,          // 16
+        u"Japanese/IsIgnoreProlongedSoundMark"_ustr,  // 17
+        u"Japanese/IsIgnoreMiddleDot"_ustr,           // 18
+        u"IsIgnoreDiacritics_CTL"_ustr,               // 19
+        u"IsIgnoreKashida_CTL"_ustr                   // 20
     };
-
-    const int nCount = SAL_N_ELEMENTS( aTranslitNames );
-    Sequence< OUString > aNames( nCount );
-    OUString* pNames = aNames.getArray();
-    for (sal_Int32 i = 0;  i < nCount;  ++i)
-        pNames[i] = OUString::createFromAscii( aTranslitNames[i] );
-
-    return aNames;
 }
 
 
commit 1ffe136bc2951c3be5005c1bc304ca7b9742fd78
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed May 8 11:33:18 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun May 12 12:58:12 2024 +0200

    replace createFromAscii with OUString literals in OConfigurationNode
    
    Change-Id: I487828fd11e1b22da2cc651b413f0744bf43b6d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167526
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx 
b/cui/source/customize/CustomNotebookbarGenerator.cxx
index d14de28de1ee..e1851a72506a 100644
--- a/cui/source/customize/CustomNotebookbarGenerator.cxx
+++ b/cui/source/customize/CustomNotebookbarGenerator.cxx
@@ -276,7 +276,7 @@ void CustomNotebookbarGenerator::setCustomizedUIItem(const 
Sequence<OUString>& r
     const utl::OConfigurationNode 
aModeNode(aModesNode.openNode(rNotebookbarConfigType));
 
     css::uno::Any aUIItemProperties(rUIItemProperties);
-    aModeNode.setNodeValue("UIItemProperties", aUIItemProperties);
+    aModeNode.setNodeValue(u"UIItemProperties"_ustr, aUIItemProperties);
     aAppNode.commit();
 }
 
diff --git a/cui/source/dialogs/toolbarmodedlg.cxx 
b/cui/source/dialogs/toolbarmodedlg.cxx
index fed0f053bf4f..25cd4a7b9ac0 100644
--- a/cui/source/dialogs/toolbarmodedlg.cxx
+++ b/cui/source/dialogs/toolbarmodedlg.cxx
@@ -194,13 +194,13 @@ IMPL_LINK(ToolbarmodeDialog, OnApplyClick, weld::Button&, 
rButton, void)
             const utl::OConfigurationTreeRoot aAppNode(
                 xContext, 
u"org.openoffice.Office.UI.ToolbarMode/Applications/"_ustr, true);
             if (sCurrentApp != "Writer")
-                aAppNode.setNodeValue("Writer/Active", css::uno::Any(sCmd));
+                aAppNode.setNodeValue(u"Writer/Active"_ustr, 
css::uno::Any(sCmd));
             if (sCurrentApp != "Calc")
-                aAppNode.setNodeValue("Calc/Active", css::uno::Any(sCmd));
+                aAppNode.setNodeValue(u"Calc/Active"_ustr, 
css::uno::Any(sCmd));
             if (sCurrentApp != "Impress")
-                aAppNode.setNodeValue("Impress/Active", css::uno::Any(sCmd));
+                aAppNode.setNodeValue(u"Impress/Active"_ustr, 
css::uno::Any(sCmd));
             if (sCurrentApp != "Draw")
-                aAppNode.setNodeValue("Draw/Active", css::uno::Any(sCmd));
+                aAppNode.setNodeValue(u"Draw/Active"_ustr, 
css::uno::Any(sCmd));
             aAppNode.commit();
         };
     }
diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx
index bd8d13d4420e..b38e3306ef74 100644
--- a/include/unotools/confignode.hxx
+++ b/include/unotools/confignode.hxx
@@ -115,11 +115,6 @@ namespace utl
         */
         bool            setNodeValue(const OUString& _rPath, const 
css::uno::Any& _rValue) const noexcept;
 
-        bool            setNodeValue( const char* _pAsciiPath, const 
css::uno::Any& _rValue ) const
-        {
-            return setNodeValue( OUString::createFromAscii( _pAsciiPath ), 
_rValue );
-        }
-
         /// return the names of the existing children
         css::uno::Sequence< OUString >
                             getNodeNames() const noexcept;
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 461bdd87f01c..8816c83a69b2 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -905,7 +905,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
                 }
 
                 // Save new toolbar mode for a current module
-                aAppNode.setNodeValue( "Active", Any( aNewName ) );
+                aAppNode.setNodeValue( u"Active"_ustr, Any( aNewName ) );
                 aAppNode.commit();
             }
 
@@ -1082,7 +1082,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 
                             if ( aCommandArg == aCurrentMode )
                             {
-                                aModeNode.setNodeValue( "UserToolbars", Any( 
aBackup ) );
+                                aModeNode.setNodeValue( u"UserToolbars"_ustr, 
Any( aBackup ) );
                                 break;
                             }
                         }
@@ -1210,7 +1210,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
                 if (aAppNode.isValid())
                 {
                     bool isLocked = 
comphelper::getBOOL(aAppNode.getNodeValue(u"Locked"_ustr));
-                    aAppNode.setNodeValue("Locked", Any(!isLocked));
+                    aAppNode.setNodeValue(u"Locked"_ustr, Any(!isLocked));
                     aAppNode.commit();
                     //TODO: apply immediately w/o restart needed
                     SolarMutexGuard aGuard;
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 2709b4ec3f84..7b2f7a1969ee 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -389,7 +389,7 @@ void 
SfxNotebookBar::ResetActiveToolbarModeToDefault(vcl::EnumContext::Applicati
     if ( !aAppNode.isValid() )
         return;
 
-    aAppNode.setNodeValue( "Active", Any( u"Default"_ustr ) );
+    aAppNode.setNodeValue( u"Active"_ustr, Any( u"Default"_ustr ) );
     aAppNode.commit();
 }
 
@@ -668,7 +668,7 @@ void SfxNotebookBar::ToggleMenubar()
     {
         utl::OConfigurationTreeRoot aRoot(lcl_getCurrentImplConfigRoot());
         utl::OConfigurationNode aModeNode(lcl_getCurrentImplConfigNode(xFrame, 
aRoot));
-        aModeNode.setNodeValue( "HasMenubar", toAny<bool>( bShow ) );
+        aModeNode.setNodeValue( u"HasMenubar"_ustr, toAny<bool>( bShow ) );
         aRoot.commit();
     }
 }
diff --git a/sfx2/source/sidebar/ResourceManager.cxx 
b/sfx2/source/sidebar/ResourceManager.cxx
index fc18d0f77d52..0ea442e7a91f 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -329,17 +329,17 @@ void ResourceManager::SaveDeckSettings(const 
DeckDescriptor* pDeckDesc)
     bool bChanged = false;
     if (aTitle != aDeckNode.getNodeValue(u"Title"_ustr))
     {
-        aDeckNode.setNodeValue("Title", aTitle);
+        aDeckNode.setNodeValue(u"Title"_ustr, aTitle);
         bChanged = true;
     }
     if (aOrder != aDeckNode.getNodeValue(u"OrderIndex"_ustr))
     {
-        aDeckNode.setNodeValue("OrderIndex", aOrder);
+        aDeckNode.setNodeValue(u"OrderIndex"_ustr, aOrder);
         bChanged = true;
     }
     if (aContextList != aDeckNode.getNodeValue(u"ContextList"_ustr))
     {
-        aDeckNode.setNodeValue("ContextList", aContextList);
+        aDeckNode.setNodeValue(u"ContextList"_ustr, aContextList);
         bChanged = true;
     }
 
@@ -377,17 +377,17 @@ void ResourceManager::SaveDeckSettings(const 
DeckDescriptor* pDeckDesc)
 
         if (aTitle != aPanelNode.getNodeValue(u"Title"_ustr))
         {
-            aPanelNode.setNodeValue("Title", aTitle);
+            aPanelNode.setNodeValue(u"Title"_ustr, aTitle);
             bChanged = true;
         }
         if (aOrder != aPanelNode.getNodeValue(u"OrderIndex"_ustr))
         {
-            aPanelNode.setNodeValue("OrderIndex", aOrder);
+            aPanelNode.setNodeValue(u"OrderIndex"_ustr, aOrder);
             bChanged = true;
         }
         if (aContextList != aPanelNode.getNodeValue(u"ContextList"_ustr))
         {
-            aPanelNode.setNodeValue("ContextList", aContextList);
+            aPanelNode.setNodeValue(u"ContextList"_ustr, aContextList);
             bChanged = true;
         }
     }

Reply via email to