shell/source/backends/kf5be/kf5access.cxx | 28 ++++++++++++++-------------- shell/source/backends/kf5be/kf5access.hxx | 4 +++- 2 files changed, 17 insertions(+), 15 deletions(-)
New commits: commit e5022a5e5225dca593e0d00ec1eaab903c5065ea Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Nov 30 14:11:42 2020 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Nov 30 16:04:49 2020 +0100 loplugin:stringviewparam (Library_kf5be1) Change-Id: Iaeaca5564f39863343cbb901be87dfd651c241ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106863 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/shell/source/backends/kf5be/kf5access.cxx b/shell/source/backends/kf5be/kf5access.cxx index 27d047d640d1..67056ad5544b 100644 --- a/shell/source/backends/kf5be/kf5access.cxx +++ b/shell/source/backends/kf5be/kf5access.cxx @@ -54,9 +54,9 @@ OUString fromQStringToOUString(QString const& s) } } -css::beans::Optional<css::uno::Any> getValue(OUString const& id) +css::beans::Optional<css::uno::Any> getValue(std::u16string_view id) { - if (id == "ExternalMailer") + if (id == u"ExternalMailer") { KEMailSettings aEmailSettings; QString aClientProgram; @@ -70,27 +70,27 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) sClientProgram = fromQStringToOUString(aClientProgram); return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sClientProgram)); } - else if (id == "SourceViewFontHeight") + else if (id == u"SourceViewFontHeight") { const QFont aFixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); const short nFontHeight = aFixedFont.pointSize(); return css::beans::Optional<css::uno::Any>(true, uno::makeAny(nFontHeight)); } - else if (id == "SourceViewFontName") + else if (id == u"SourceViewFontName") { const QFont aFixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); const QString aFontName = aFixedFont.family(); const OUString sFontName = fromQStringToOUString(aFontName); return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sFontName)); } - else if (id == "EnableATToolSupport") + else if (id == u"EnableATToolSupport") { /* does not make much sense without an accessibility bridge */ bool ATToolSupport = false; return css::beans::Optional<css::uno::Any>(true, uno::makeAny(OUString::boolean(ATToolSupport))); } - else if (id == "WorkPathVariable") + else if (id == u"WorkPathVariable") { QString aDocumentsDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)); if (aDocumentsDir.isEmpty()) @@ -103,7 +103,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) osl_getFileURLFromSystemPath(sDocumentsDir.pData, &sDocumentsURL.pData); return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sDocumentsURL)); } - else if (id == "ooInetFTPProxyName") + else if (id == u"ooInetFTPProxyName") { QString aFTPProxy; switch (KProtocolManager::proxyType()) @@ -130,7 +130,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sProxy)); } } - else if (id == "ooInetFTPProxyPort") + else if (id == u"ooInetFTPProxyPort") { QString aFTPProxy; switch (KProtocolManager::proxyType()) @@ -157,7 +157,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(nPort)); } } - else if (id == "ooInetHTTPProxyName") + else if (id == u"ooInetHTTPProxyName") { QString aHTTPProxy; switch (KProtocolManager::proxyType()) @@ -184,7 +184,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sProxy)); } } - else if (id == "ooInetHTTPProxyPort") + else if (id == u"ooInetHTTPProxyPort") { QString aHTTPProxy; switch (KProtocolManager::proxyType()) @@ -211,7 +211,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(nPort)); } } - else if (id == "ooInetHTTPSProxyName") + else if (id == u"ooInetHTTPSProxyName") { QString aHTTPSProxy; switch (KProtocolManager::proxyType()) @@ -238,7 +238,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sProxy)); } } - else if (id == "ooInetHTTPSProxyPort") + else if (id == u"ooInetHTTPSProxyPort") { QString aHTTPSProxy; switch (KProtocolManager::proxyType()) @@ -265,7 +265,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(nPort)); } } - else if (id == "ooInetNoProxy") + else if (id == u"ooInetNoProxy") { QString aNoProxyFor; switch (KProtocolManager::proxyType()) @@ -288,7 +288,7 @@ css::beans::Optional<css::uno::Any> getValue(OUString const& id) return css::beans::Optional<css::uno::Any>(true, uno::makeAny(sNoProxyFor)); } } - else if (id == "ooInetProxyType") + else if (id == u"ooInetProxyType") { sal_Int32 nProxyType; switch (KProtocolManager::proxyType()) diff --git a/shell/source/backends/kf5be/kf5access.hxx b/shell/source/backends/kf5be/kf5access.hxx index 77e55fad5dda..765d9c706d4e 100644 --- a/shell/source/backends/kf5be/kf5access.hxx +++ b/shell/source/backends/kf5be/kf5access.hxx @@ -22,6 +22,8 @@ #include <sal/config.h> +#include <string_view> + #include <com/sun/star/beans/Optional.hpp> namespace com::sun::star::uno @@ -31,7 +33,7 @@ class Any; namespace kf5access { -css::beans::Optional<css::uno::Any> getValue(OUString const& id); +css::beans::Optional<css::uno::Any> getValue(std::u16string_view id); } #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits