diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-26 11:23:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-26 13:55:07 +0100 |
commit | 547cb22e1a4ad5c39f116eb74b74baf7a729d2e9 (patch) | |
tree | 41b3259aa5e487aa27aac1ba72d4e72762d8c844 /stoc | |
parent | 91ce3455cfe1c850dd9780c41e6253cb940af1e9 (diff) |
loplugin:stringliteraldefine in stoc,svtools
Change-Id: Ifd583582fa7bf7366a1f8d482eefd64b30228ca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125867
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/security/access_controller.cxx | 14 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 485b3cf1512d..aaefd5dc39c7 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -48,8 +48,8 @@ #include <memory> -#define SERVICE_NAME "com.sun.star.security.AccessController" -#define USER_CREDS "access-control.user-credentials" +constexpr OUStringLiteral SERVICE_NAME = u"com.sun.star.security.AccessController"; +constexpr OUStringLiteral USER_CREDS = u"access-control.user-credentials.id"; using namespace ::std; @@ -350,7 +350,7 @@ AccessController::AccessController( Reference< XComponentContext > const & xComp // to something other than "off" depending on various UNO_AC* bootstrap // variables that are no longer supported, so this is mostly dead code now: OUString mode; - if (m_xComponentContext->getValueByName( "/services/" SERVICE_NAME "/mode" ) >>= mode) + if (m_xComponentContext->getValueByName( "/services/" + SERVICE_NAME + "/mode" ) >>= mode) { if ( mode == "off" ) { @@ -367,12 +367,12 @@ AccessController::AccessController( Reference< XComponentContext > const & xComp else if ( mode == "single-user" ) { m_xComponentContext->getValueByName( - "/services/" SERVICE_NAME "/single-user-id" ) >>= m_singleUserId; + "/services/" + SERVICE_NAME + "/single-user-id" ) >>= m_singleUserId; if (m_singleUserId.isEmpty()) { throw RuntimeException( "expected a user id in component context entry " - "\"/services/" SERVICE_NAME "/single-user-id\"!", + "\"/services/" + SERVICE_NAME + "/single-user-id\"!", static_cast<OWeakObject *>(this) ); } m_mode = Mode::SingleUser; @@ -389,7 +389,7 @@ AccessController::AccessController( Reference< XComponentContext > const & xComp sal_Int32 cacheSize = 0; // multi-user cache size if (! (m_xComponentContext->getValueByName( - "/services/" SERVICE_NAME "/user-cache-size" ) >>= cacheSize)) + "/services/" + SERVICE_NAME + "/user-cache-size" ) >>= cacheSize)) { cacheSize = 128; // reasonable default? } @@ -574,7 +574,7 @@ PermissionCollection AccessController::getEffectivePermissions( { if (xContext.is()) { - xContext->getValueByName( USER_CREDS ".id" ) >>= userId; + xContext->getValueByName( USER_CREDS ) >>= userId; } if ( userId.isEmpty() ) { diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 11c54444adef..293e2c44c4c9 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -38,7 +38,7 @@ #include <string_view> #include <unordered_map> -#define IMPL_NAME "com.sun.star.security.comp.stoc.FilePolicy" +constexpr OUStringLiteral IMPL_NAME = u"com.sun.star.security.comp.stoc.FilePolicy"; using namespace ::osl; using namespace ::cppu; @@ -371,7 +371,7 @@ void FilePolicy::refresh() // supported, so this is effectively dead code): OUString fileName; m_xComponentContext->getValueByName( - "/implementations/" IMPL_NAME "/file-name" ) >>= fileName; + "/implementations/" + IMPL_NAME + "/file-name" ) >>= fileName; if ( fileName.isEmpty() ) { throw RuntimeException( |