Kaydet (Commit) dcdda1d6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Unfold remainder of add_access_control_entries at call site

Change-Id: I6e1a5a0223c1ea3e1a8c8800fb4cb032719ecf4f
üst e1e308bc
......@@ -68,7 +68,6 @@ $(eval $(call gb_Library_add_exception_objects,cppuhelper,\
cppuhelper/source/paths \
cppuhelper/source/propertysetmixin \
cppuhelper/source/propshlp \
cppuhelper/source/servicefactory \
cppuhelper/source/servicemanager \
cppuhelper/source/shlib \
cppuhelper/source/supportsservice \
......
......@@ -45,7 +45,6 @@
#include "macro_expander.hxx"
#include "paths.hxx"
#include "servicefactory_detail.hxx"
#include "servicemanager.hxx"
#include "typedescriptionprovider.hxx"
......@@ -115,7 +114,16 @@ cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri)
"/singletons/" + i->first,
css::uno::makeAny(i->second[0]->info->name), true));
}
cppu::add_access_control_entries(&context_values);
context_values.push_back(
cppu::ContextEntry_Init(
"/services/com.sun.star.security.AccessController/mode",
css::uno::makeAny(rtl::OUString("off")), false));
context_values.push_back(
cppu::ContextEntry_Init(
"/singletons/com.sun.star.security.theAccessController",
css::uno::makeAny(
rtl::OUString("com.sun.star.security.AccessController")),
true));
assert(!context_values.empty());
css::uno::Reference< css::uno::XComponentContext > context(
createComponentContext(
......
/* -*- 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 <vector>
#include "rtl/bootstrap.hxx"
#include "osl/diagnose.h"
#include "osl/process.h"
#include "cppuhelper/component_context.hxx"
#include "com/sun/star/uno/SecurityException.hpp"
#include "servicefactory_detail.hxx"
#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
using namespace ::rtl;
using namespace ::osl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
namespace cppu
{
void add_access_control_entries( ::std::vector< ContextEntry_Init > * values )
SAL_THROW( (Exception) )
{
ContextEntry_Init entry;
::std::vector< ContextEntry_Init > & context_values = *values;
// - ac prop: mode
// { "off", "on", "dynamic-only", "single-user", "single-default-user" }
entry.bLateInitService = false;
entry.name = OUSTR("/services/com.sun.star.security.AccessController/mode");
entry.value <<= OUSTR("off");
context_values.push_back( entry );
// - ac singleton
entry.bLateInitService = true;
entry.name = OUSTR("/singletons/com.sun.star.security.theAccessController");
entry.value <<= OUSTR("com.sun.star.security.AccessController");
context_values.push_back( entry );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_CPPUHELPER_SOURCE_SERVICEFACTORY_DETAIL_HXX
#define INCLUDED_CPPUHELPER_SOURCE_SERVICEFACTORY_DETAIL_HXX
#include "sal/config.h"
#include <vector>
#include "com/sun/star/uno/Exception.hpp"
#include "sal/types.h"
namespace cppu { struct ContextEntry_Init; }
namespace cppu {
void add_access_control_entries(std::vector< cppu::ContextEntry_Init > * values)
SAL_THROW((com::sun::star::uno::Exception));
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment