toolkit/Library_tk.mk                                 |    1 
 toolkit/inc/helper/servicenames.hxx                   |    4 -
 toolkit/source/controls/controlmodelcontainerbase.cxx |    2 
 toolkit/source/controls/dialogcontrol.cxx             |    2 
 toolkit/source/helper/servicenames.cxx                |   24 -------
 unotools/source/config/eventcfg.cxx                   |   60 +++++++++---------
 6 files changed, 35 insertions(+), 58 deletions(-)

New commits:
commit 293ef452f2f0f398bea5f422a4dcff777d768e0b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 15:40:58 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 4 20:12:15 2024 +0200

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

diff --git a/unotools/source/config/eventcfg.cxx 
b/unotools/source/config/eventcfg.cxx
index c6c0f63e42a6..f9c2b2722ba7 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -45,36 +45,36 @@ using namespace ::com::sun::star;
 #define SETNODE_BINDINGS "Bindings"
 #define PROPERTYNAME_BINDINGURL "BindingURL"
 
-static o3tl::enumarray<GlobalEventId, const char*> pEventAsciiNames =
+constexpr o3tl::enumarray<GlobalEventId, OUString> pEventAsciiNames =
 {
-"OnStartApp",
-"OnCloseApp",
-"OnCreate",
-"OnNew",
-"OnLoadFinished",
-"OnLoad",
-"OnPrepareUnload",
-"OnUnload",
-"OnSave",
-"OnSaveDone",
-"OnSaveFailed",
-"OnSaveAs",
-"OnSaveAsDone",
-"OnSaveAsFailed",
-"OnCopyTo",
-"OnCopyToDone",
-"OnCopyToFailed",
-"OnFocus",
-"OnUnfocus",
-"OnPrint",
-"OnViewCreated",
-"OnPrepareViewClosing",
-"OnViewClosed",
-"OnModifyChanged",
-"OnTitleChanged",
-"OnVisAreaChanged",
-"OnModeChanged",
-"OnStorageChanged"
+u"OnStartApp"_ustr,
+u"OnCloseApp"_ustr,
+u"OnCreate"_ustr,
+u"OnNew"_ustr,
+u"OnLoadFinished"_ustr,
+u"OnLoad"_ustr,
+u"OnPrepareUnload"_ustr,
+u"OnUnload"_ustr,
+u"OnSave"_ustr,
+u"OnSaveDone"_ustr,
+u"OnSaveFailed"_ustr,
+u"OnSaveAs"_ustr,
+u"OnSaveAsDone"_ustr,
+u"OnSaveAsFailed"_ustr,
+u"OnCopyTo"_ustr,
+u"OnCopyToDone"_ustr,
+u"OnCopyToFailed"_ustr,
+u"OnFocus"_ustr,
+u"OnUnfocus"_ustr,
+u"OnPrint"_ustr,
+u"OnViewCreated"_ustr,
+u"OnPrepareViewClosing"_ustr,
+u"OnViewClosed"_ustr,
+u"OnModifyChanged"_ustr,
+u"OnTitleChanged"_ustr,
+u"OnVisAreaChanged"_ustr,
+u"OnModeChanged"_ustr,
+u"OnStorageChanged"_ustr
 };
 
 typedef std::unordered_map< OUString, OUString > EventBindingHash;
@@ -128,7 +128,7 @@ GlobalEventConfig_Impl::GlobalEventConfig_Impl()
 {
     // the supported event names
     for (const GlobalEventId id : o3tl::enumrange<GlobalEventId>())
-        m_supportedEvents[id] = OUString::createFromAscii( 
pEventAsciiNames[id] );
+        m_supportedEvents[id] = pEventAsciiNames[id];
 
     initBindingInfo();
 
commit f221ccd6dc5340038daa024bb4384b0a3f8e7259
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 2 15:34:30 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 4 20:12:03 2024 +0200

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

diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
index 15029b8a0996..cfdd3ce9a371 100644
--- a/toolkit/Library_tk.mk
+++ b/toolkit/Library_tk.mk
@@ -126,7 +126,6 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
     toolkit/source/helper/imagealign \
     toolkit/source/helper/listenermultiplexer \
     toolkit/source/helper/property \
-    toolkit/source/helper/servicenames \
     toolkit/source/helper/tkresmgr \
     toolkit/source/helper/unopropertyarrayhelper \
     toolkit/source/helper/unowrapper \
diff --git a/toolkit/inc/helper/servicenames.hxx 
b/toolkit/inc/helper/servicenames.hxx
index 7fb7ab2a573c..07a372d48494 100644
--- a/toolkit/inc/helper/servicenames.hxx
+++ b/toolkit/inc/helper/servicenames.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
-extern const char szServiceName_UnoControlDialog[];
+#include <rtl/ustring.hxx>
+
+inline constexpr OUString sServiceName_UnoControlDialog = 
u"stardiv.vcl.control.Dialog"_ustr;
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx 
b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 8c9bba0890de..882d78dbfadf 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -165,7 +165,7 @@ Any ControlModelContainerBase::ImplGetDefaultValue( 
sal_uInt16 nPropId ) const
     switch ( nPropId )
     {
         case BASEPROPERTY_DEFAULTCONTROL:
-            aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog 
);
+            aAny <<= sServiceName_UnoControlDialog;
             break;
         default:
             aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
diff --git a/toolkit/source/controls/dialogcontrol.cxx 
b/toolkit/source/controls/dialogcontrol.cxx
index 8adc7af9c41b..29dba64dcfc0 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -239,7 +239,7 @@ Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 
nPropId ) const
     switch ( nPropId )
     {
         case BASEPROPERTY_DEFAULTCONTROL:
-            aAny <<= OUString::createFromAscii( szServiceName_UnoControlDialog 
);
+            aAny <<= sServiceName_UnoControlDialog;
             break;
         case BASEPROPERTY_SCROLLWIDTH:
         case BASEPROPERTY_SCROLLHEIGHT:
diff --git a/toolkit/source/helper/servicenames.cxx 
b/toolkit/source/helper/servicenames.cxx
deleted file mode 100644
index 825672fd20a1..000000000000
--- a/toolkit/source/helper/servicenames.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <helper/servicenames.hxx>
-
-const char szServiceName_UnoControlDialog[] = "stardiv.vcl.control.Dialog";
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to