summaryrefslogtreecommitdiff
path: root/stoc/source
diff options
context:
space:
mode:
Diffstat (limited to 'stoc/source')
-rw-r--r--stoc/source/security/access_controller.cxx14
-rw-r--r--stoc/source/security/file_policy.cxx4
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(