Simplified some uses of css.configuration.theDefaultProvider.
* Retro-added new-style UNOIDL singleton specification for it, for easy instantiation. * Plus new comphelper::getComponentContext to map from XMultiServiceFactory to XComponentContext.
This commit is contained in:
parent
f72516ed25
commit
8b75883b87
@ -39,6 +39,7 @@
|
|||||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
|
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
||||||
@ -154,9 +155,7 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) :
|
|||||||
{
|
{
|
||||||
// read out configuration for preferred services:
|
// read out configuration for preferred services:
|
||||||
Reference<lang::XMultiServiceFactory> xConfigProvider(
|
Reference<lang::XMultiServiceFactory> xConfigProvider(
|
||||||
m_xContext->getServiceManager()->createInstanceWithContext(
|
configuration::theDefaultProvider::get( m_xContext ) );
|
||||||
OUSTR("com.sun.star.configuration.ConfigurationProvider"),
|
|
||||||
m_xContext ), UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
Any propValue(
|
Any propValue(
|
||||||
makeAny( beans::PropertyValue(
|
makeAny( beans::PropertyValue(
|
||||||
|
@ -75,6 +75,17 @@ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XI
|
|||||||
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs
|
||||||
) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) );
|
) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) );
|
||||||
|
|
||||||
|
/** Tries to obtain a component context from a service factory.
|
||||||
|
|
||||||
|
@param factory may be null
|
||||||
|
@return may be null
|
||||||
|
*/
|
||||||
|
COMPHELPER_DLLPUBLIC
|
||||||
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
|
||||||
|
getComponentContext(
|
||||||
|
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
|
||||||
|
const & factory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function gets the process service factory's default component context.
|
* This function gets the process service factory's default component context.
|
||||||
* If no service factory is set the function returns a null interface.
|
* If no service factory is set the function returns a null interface.
|
||||||
|
@ -32,7 +32,9 @@
|
|||||||
//_______________________________________________
|
//_______________________________________________
|
||||||
// includes
|
// includes
|
||||||
#include <comphelper/configurationhelper.hxx>
|
#include <comphelper/configurationhelper.hxx>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/container/XNameContainer.hpp>
|
#include <com/sun/star/container/XNameContainer.hpp>
|
||||||
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
||||||
@ -53,7 +55,8 @@ css::uno::Reference< css::uno::XInterface > ConfigurationHelper::openConfig(cons
|
|||||||
sal_Int32 eMode )
|
sal_Int32 eMode )
|
||||||
{
|
{
|
||||||
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider(
|
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), css::uno::UNO_QUERY_THROW);
|
css::configuration::theDefaultProvider::get(
|
||||||
|
getComponentContext( xSMGR ) ) );
|
||||||
|
|
||||||
::comphelper::SequenceAsVector< css::uno::Any > lParams;
|
::comphelper::SequenceAsVector< css::uno::Any > lParams;
|
||||||
css::beans::PropertyValue aParam ;
|
css::beans::PropertyValue aParam ;
|
||||||
|
@ -29,11 +29,13 @@
|
|||||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||||
#include "precompiled_comphelper.hxx"
|
#include "precompiled_comphelper.hxx"
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XContainerQuery.hpp>
|
#include <com/sun/star/container/XContainerQuery.hpp>
|
||||||
#include <com/sun/star/document/XTypeDetection.hpp>
|
#include <com/sun/star/document/XTypeDetection.hpp>
|
||||||
|
|
||||||
#include <comphelper/fileformat.h>
|
#include <comphelper/fileformat.h>
|
||||||
#include <comphelper/mimeconfighelper.hxx>
|
#include <comphelper/mimeconfighelper.hxx>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <comphelper/classids.hxx>
|
#include <comphelper/classids.hxx>
|
||||||
#include <comphelper/sequenceashashmap.hxx>
|
#include <comphelper/sequenceashashmap.hxx>
|
||||||
#include <comphelper/documentconstants.hxx>
|
#include <comphelper/documentconstants.hxx>
|
||||||
@ -131,10 +133,8 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( !m_xConfigProvider.is() )
|
if ( !m_xConfigProvider.is() )
|
||||||
m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >(
|
m_xConfigProvider = configuration::theDefaultProvider::get(
|
||||||
m_xFactory->createInstance(
|
getComponentContext( m_xFactory ) );
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" )) ),
|
|
||||||
uno::UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
uno::Sequence< uno::Any > aArgs( 1 );
|
uno::Sequence< uno::Any > aArgs( 1 );
|
||||||
beans::PropertyValue aPathProp;
|
beans::PropertyValue aPathProp;
|
||||||
|
@ -96,11 +96,11 @@ Reference< XInterface > createProcessComponentWithArguments( const ::rtl::OUStri
|
|||||||
return xComponent;
|
return xComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XComponentContext > getProcessComponentContext()
|
Reference< XComponentContext > getComponentContext(
|
||||||
|
Reference< XMultiServiceFactory > const & factory)
|
||||||
{
|
{
|
||||||
Reference< XComponentContext > xRet;
|
Reference< XComponentContext > xRet;
|
||||||
uno::Reference<beans::XPropertySet> const xProps(
|
uno::Reference<beans::XPropertySet> const xProps( factory, uno::UNO_QUERY );
|
||||||
comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
|
|
||||||
if (xProps.is()) {
|
if (xProps.is()) {
|
||||||
try {
|
try {
|
||||||
xRet.set( xProps->getPropertyValue( rtl::OUString(
|
xRet.set( xProps->getPropertyValue( rtl::OUString(
|
||||||
@ -113,6 +113,11 @@ Reference< XComponentContext > getProcessComponentContext()
|
|||||||
return xRet;
|
return xRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference< XComponentContext > getProcessComponentContext()
|
||||||
|
{
|
||||||
|
return getComponentContext( getProcessServiceFactory() );
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace comphelper
|
} // namespace comphelper
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "com/sun/star/beans/XPropertyChangeListener.hpp"
|
#include "com/sun/star/beans/XPropertyChangeListener.hpp"
|
||||||
#include "com/sun/star/beans/XPropertySet.hpp"
|
#include "com/sun/star/beans/XPropertySet.hpp"
|
||||||
#include "com/sun/star/beans/XPropertyState.hpp"
|
#include "com/sun/star/beans/XPropertyState.hpp"
|
||||||
|
#include "com/sun/star/configuration/theDefaultProvider.hpp"
|
||||||
#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
|
#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
|
||||||
#include "com/sun/star/container/XNameReplace.hpp"
|
#include "com/sun/star/container/XNameReplace.hpp"
|
||||||
#include "com/sun/star/container/XNamed.hpp"
|
#include "com/sun/star/container/XNamed.hpp"
|
||||||
@ -371,13 +372,7 @@ void Test::setUp() {
|
|||||||
css::uno::UNO_QUERY_THROW)->getPropertyValue(
|
css::uno::UNO_QUERY_THROW)->getPropertyValue(
|
||||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
|
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
|
||||||
css::uno::UNO_QUERY_THROW);
|
css::uno::UNO_QUERY_THROW);
|
||||||
CPPUNIT_ASSERT(
|
provider_ = css::configuration::theDefaultProvider::get(context_);
|
||||||
context_->getValueByName(
|
|
||||||
rtl::OUString(
|
|
||||||
RTL_CONSTASCII_USTRINGPARAM(
|
|
||||||
"/singletons/"
|
|
||||||
"com.sun.star.configuration.theDefaultProvider"))) >>=
|
|
||||||
provider_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::tearDown() {
|
void Test::tearDown() {
|
||||||
|
@ -31,9 +31,12 @@
|
|||||||
#include "ZPoolCollection.hxx"
|
#include "ZPoolCollection.hxx"
|
||||||
#include "ZDriverWrapper.hxx"
|
#include "ZDriverWrapper.hxx"
|
||||||
#include "ZConnectionPool.hxx"
|
#include "ZConnectionPool.hxx"
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
||||||
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
#include <comphelper/extract.hxx>
|
#include <comphelper/extract.hxx>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include "diagnose_ex.h"
|
#include "diagnose_ex.h"
|
||||||
|
|
||||||
@ -351,71 +354,30 @@ OConnectionPool* OPoolCollection::getConnectionPool(const ::rtl::OUString& _sImp
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
Reference< XInterface > OPoolCollection::createWithServiceFactory(const ::rtl::OUString& _rPath) const
|
Reference< XInterface > OPoolCollection::createWithServiceFactory(const ::rtl::OUString& _rPath) const
|
||||||
{
|
{
|
||||||
Reference< XInterface > xInterface;
|
return createWithProvider(
|
||||||
try
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
{
|
comphelper::getComponentContext(m_xServiceFactory)),
|
||||||
Reference< XInterface > xProvider = m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")));
|
_rPath);
|
||||||
OSL_ENSURE(xProvider.is(), "OConfigurationTreeRoot::createWithServiceFactory: could not instantiate the config provider service!");
|
|
||||||
Reference< XMultiServiceFactory > xProviderAsFac(xProvider, UNO_QUERY);
|
|
||||||
OSL_ENSURE(xProviderAsFac.is() || !xProvider.is(), "OConfigurationTreeRoot::createWithServiceFactory: the provider is missing an interface!");
|
|
||||||
if (xProviderAsFac.is())
|
|
||||||
xInterface = createWithProvider(xProviderAsFac, _rPath);
|
|
||||||
}
|
|
||||||
catch(const Exception&)
|
|
||||||
{
|
|
||||||
OSL_FAIL("createWithServiceFactory: error while instantiating the provider service!");
|
|
||||||
}
|
|
||||||
return xInterface;
|
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
Reference< XInterface > OPoolCollection::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider,
|
Reference< XInterface > OPoolCollection::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider,
|
||||||
const ::rtl::OUString& _rPath) const
|
const ::rtl::OUString& _rPath) const
|
||||||
{
|
{
|
||||||
OSL_ENSURE(_rxConfProvider.is(), "createWithProvider: invalid provider!");
|
OSL_ASSERT(_rxConfProvider.is());
|
||||||
|
Sequence< Any > args(1);
|
||||||
Reference< XInterface > xInterface;
|
args[0] = makeAny(
|
||||||
#ifdef DBG_UTIL
|
NamedValue(
|
||||||
if (_rxConfProvider.is())
|
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
{
|
makeAny(_rPath)));
|
||||||
try
|
Reference< XInterface > xInterface(
|
||||||
{
|
_rxConfProvider->createInstanceWithArguments(
|
||||||
Reference< XServiceInfo > xSI(_rxConfProvider, UNO_QUERY);
|
rtl::OUString(
|
||||||
if (!xSI.is())
|
RTL_CONSTASCII_USTRINGPARAM(
|
||||||
{
|
"com.sun.star.configuration.ConfigurationAccess")),
|
||||||
OSL_FAIL("::createWithProvider: no XServiceInfo interface on the provider!");
|
args));
|
||||||
}
|
OSL_ENSURE(
|
||||||
else
|
xInterface.is(),
|
||||||
{
|
"::createWithProvider: could not create the node access!");
|
||||||
OSL_ENSURE(xSI->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
|
|
||||||
"::createWithProvider: sure this is a provider? Missing the ConfigurationProvider service!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(const Exception&)
|
|
||||||
{
|
|
||||||
OSL_FAIL("::createWithProvider: unable to check the service conformance of the provider given!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_rxConfProvider.is())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Sequence< Any > aCreationArgs(3);
|
|
||||||
aCreationArgs[0] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), 0, makeAny(_rPath), PropertyState_DIRECT_VALUE));
|
|
||||||
aCreationArgs[1] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("depth")), 0, makeAny((sal_Int32)-1), PropertyState_DIRECT_VALUE));
|
|
||||||
aCreationArgs[2] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("lazywrite")), 0, makeAny(sal_True), PropertyState_DIRECT_VALUE));
|
|
||||||
|
|
||||||
static ::rtl::OUString sAccessService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ));
|
|
||||||
|
|
||||||
xInterface = _rxConfProvider->createInstanceWithArguments(sAccessService, aCreationArgs);
|
|
||||||
OSL_ENSURE(xInterface.is(), "::createWithProvider: could not create the node access!");
|
|
||||||
}
|
|
||||||
catch(Exception&)
|
|
||||||
{
|
|
||||||
OSL_FAIL("OConfigurationTreeRoot::createWithProvider: caught an exception while creating the access object!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return xInterface;
|
return xInterface;
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -59,6 +59,7 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
|
|||||||
|
|
||||||
SHL1OBJS=$(SLOFILES)
|
SHL1OBJS=$(SLOFILES)
|
||||||
SHL1STDLIBS=\
|
SHL1STDLIBS=\
|
||||||
|
$(COMPHELPERLIB) \
|
||||||
$(CPPULIB) \
|
$(CPPULIB) \
|
||||||
$(CPPUHELPERLIB) \
|
$(CPPUHELPERLIB) \
|
||||||
$(DBTOOLSLIB) \
|
$(DBTOOLSLIB) \
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "hsqldb/HConnection.hxx"
|
#include "hsqldb/HConnection.hxx"
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
#include "connectivity/dbexception.hxx"
|
#include "connectivity/dbexception.hxx"
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/sdbc/XDriverAccess.hpp>
|
#include <com/sun/star/sdbc/XDriverAccess.hpp>
|
||||||
#include <com/sun/star/sdbc/XResultSet.hpp>
|
#include <com/sun/star/sdbc/XResultSet.hpp>
|
||||||
#include <com/sun/star/sdbc/XRow.hpp>
|
#include <com/sun/star/sdbc/XRow.hpp>
|
||||||
@ -53,6 +54,7 @@
|
|||||||
#include <osl/process.h>
|
#include <osl/process.h>
|
||||||
#include <connectivity/dbexception.hxx>
|
#include <connectivity/dbexception.hxx>
|
||||||
#include <comphelper/namedvaluecollection.hxx>
|
#include <comphelper/namedvaluecollection.hxx>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <comphelper/string.hxx>
|
#include <comphelper/string.hxx>
|
||||||
#include <unotools/confignode.hxx>
|
#include <unotools/confignode.hxx>
|
||||||
#include <unotools/ucbstreamhelper.hxx>
|
#include <unotools/ucbstreamhelper.hxx>
|
||||||
@ -837,13 +839,8 @@ namespace connectivity
|
|||||||
{
|
{
|
||||||
//.........................................................
|
//.........................................................
|
||||||
Reference< XMultiServiceFactory > xConfigProvider(
|
Reference< XMultiServiceFactory > xConfigProvider(
|
||||||
_rxORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ),
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
UNO_QUERY
|
comphelper::getComponentContext( _rxORB ) ) );
|
||||||
);
|
|
||||||
OSL_ENSURE( xConfigProvider.is(), "lcl_getSystemLocale: could not create the config provider!" );
|
|
||||||
|
|
||||||
if ( !xConfigProvider.is() )
|
|
||||||
return sLocaleString;
|
|
||||||
|
|
||||||
//.........................................................
|
//.........................................................
|
||||||
// arguments for creating the config access
|
// arguments for creating the config access
|
||||||
|
@ -35,10 +35,12 @@
|
|||||||
#include "rtl/strbuf.hxx"
|
#include "rtl/strbuf.hxx"
|
||||||
|
|
||||||
/** === begin UNO includes === **/
|
/** === begin UNO includes === **/
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/sdb/SQLContext.hpp>
|
#include <com/sun/star/sdb/SQLContext.hpp>
|
||||||
#include <com/sun/star/lang/NullPointerException.hpp>
|
#include <com/sun/star/lang/NullPointerException.hpp>
|
||||||
#include <com/sun/star/frame/XDesktop.hpp>
|
#include <com/sun/star/frame/XDesktop.hpp>
|
||||||
/** === end UNO includes === **/
|
/** === end UNO includes === **/
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include "resource/kab_res.hrc"
|
#include "resource/kab_res.hrc"
|
||||||
@ -192,8 +194,8 @@ bool KabImplModule::impl_doAllowNewKDEVersion()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Reference< XMultiServiceFactory > xConfigProvider(
|
Reference< XMultiServiceFactory > xConfigProvider(
|
||||||
m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ) ),
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
UNO_QUERY_THROW );
|
comphelper::getComponentContext( m_xORB ) ) );
|
||||||
Sequence< Any > aCreationArgs(1);
|
Sequence< Any > aCreationArgs(1);
|
||||||
aCreationArgs[0] <<= PropertyValue(
|
aCreationArgs[0] <<= PropertyValue(
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ),
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ),
|
||||||
|
@ -69,6 +69,7 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
|
|||||||
SHL1TARGET= $(TARGET)$(KAB_MAJOR)
|
SHL1TARGET= $(TARGET)$(KAB_MAJOR)
|
||||||
SHL1OBJS=$(SLOFILES)
|
SHL1OBJS=$(SLOFILES)
|
||||||
SHL1STDLIBS=\
|
SHL1STDLIBS=\
|
||||||
|
$(COMPHELPERLIB) \
|
||||||
$(CPPULIB) \
|
$(CPPULIB) \
|
||||||
$(CPPUHELPERLIB) \
|
$(CPPUHELPERLIB) \
|
||||||
$(DBTOOLSLIB) \
|
$(DBTOOLSLIB) \
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||||
#include "precompiled_connectivity.hxx"
|
#include "precompiled_connectivity.hxx"
|
||||||
|
|
||||||
|
#include "com/sun/star/configuration/theDefaultProvider.hpp"
|
||||||
|
#include "comphelper/processfactory.hxx"
|
||||||
|
|
||||||
#include "MConfigAccess.hxx"
|
#include "MConfigAccess.hxx"
|
||||||
#include "MExtConfigAccess.hxx"
|
#include "MExtConfigAccess.hxx"
|
||||||
#include "MConnection.hxx"
|
#include "MConnection.hxx"
|
||||||
@ -51,44 +54,39 @@ namespace connectivity
|
|||||||
//=============================================================
|
//=============================================================
|
||||||
// create the config provider
|
// create the config provider
|
||||||
Reference< XMultiServiceFactory > xConfigProvider(
|
Reference< XMultiServiceFactory > xConfigProvider(
|
||||||
_rxORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider" )) ),
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
UNO_QUERY
|
comphelper::getComponentContext( _rxORB ) ) );
|
||||||
|
|
||||||
|
::rtl::OUString sCompleteNodePath(RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/DriverSettings/" ));
|
||||||
|
sCompleteNodePath += OConnection::getDriverImplementationName();
|
||||||
|
|
||||||
|
//=========================================================
|
||||||
|
// arguments for creating the config access
|
||||||
|
Sequence< Any > aArguments(2);
|
||||||
|
// the path to the node to open
|
||||||
|
aArguments[0] <<= PropertyValue(
|
||||||
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
|
0,
|
||||||
|
makeAny( sCompleteNodePath ),
|
||||||
|
PropertyState_DIRECT_VALUE
|
||||||
|
);
|
||||||
|
// the depth: -1 means unlimited
|
||||||
|
aArguments[1] <<= PropertyValue(
|
||||||
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("depth")),
|
||||||
|
0,
|
||||||
|
makeAny( (sal_Int32)-1 ),
|
||||||
|
PropertyState_DIRECT_VALUE
|
||||||
);
|
);
|
||||||
OSL_ENSURE( xConfigProvider.is(), "createDriverConfigNode: could not create the config provider!" );
|
|
||||||
|
|
||||||
if ( xConfigProvider.is() )
|
//=========================================================
|
||||||
{
|
// create the access
|
||||||
::rtl::OUString sCompleteNodePath(RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/DriverSettings/" ));
|
Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
|
||||||
sCompleteNodePath += OConnection::getDriverImplementationName();
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess" )),
|
||||||
|
aArguments
|
||||||
|
);
|
||||||
|
OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
|
||||||
|
|
||||||
//=========================================================
|
xNode = xNode.query( xAccess );
|
||||||
// arguments for creating the config access
|
|
||||||
Sequence< Any > aArguments(2);
|
|
||||||
// the path to the node to open
|
|
||||||
aArguments[0] <<= PropertyValue(
|
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
|
||||||
0,
|
|
||||||
makeAny( sCompleteNodePath ),
|
|
||||||
PropertyState_DIRECT_VALUE
|
|
||||||
);
|
|
||||||
// the depth: -1 means unlimited
|
|
||||||
aArguments[1] <<= PropertyValue(
|
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("depth")),
|
|
||||||
0,
|
|
||||||
makeAny( (sal_Int32)-1 ),
|
|
||||||
PropertyState_DIRECT_VALUE
|
|
||||||
);
|
|
||||||
|
|
||||||
//=========================================================
|
|
||||||
// create the access
|
|
||||||
Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
|
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess" )),
|
|
||||||
aArguments
|
|
||||||
);
|
|
||||||
OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
|
|
||||||
|
|
||||||
xNode = xNode.query( xAccess );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch( const Exception& )
|
catch( const Exception& )
|
||||||
{
|
{
|
||||||
|
@ -32,11 +32,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "mdrivermanager.hxx"
|
#include "mdrivermanager.hxx"
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/sdbc/XDriver.hpp>
|
#include <com/sun/star/sdbc/XDriver.hpp>
|
||||||
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
||||||
#include <com/sun/star/container/ElementExistException.hpp>
|
#include <com/sun/star/container/ElementExistException.hpp>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
|
|
||||||
|
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <comphelper/extract.hxx>
|
#include <comphelper/extract.hxx>
|
||||||
@ -186,16 +186,15 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// some strings we need
|
// some strings we need
|
||||||
const ::rtl::OUString sConfigurationProviderServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ));
|
|
||||||
const ::rtl::OUString sDriverManagerConfigLocation( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.DataAccess/DriverManager" ));
|
const ::rtl::OUString sDriverManagerConfigLocation( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.DataAccess/DriverManager" ));
|
||||||
const ::rtl::OUString sDriverPreferenceLocation( RTL_CONSTASCII_USTRINGPARAM( "DriverPrecedence" ));
|
const ::rtl::OUString sDriverPreferenceLocation( RTL_CONSTASCII_USTRINGPARAM( "DriverPrecedence" ));
|
||||||
const ::rtl::OUString sNodePathArgumentName( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
|
const ::rtl::OUString sNodePathArgumentName( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
|
||||||
const ::rtl::OUString sNodeAccessServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ));
|
const ::rtl::OUString sNodeAccessServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ));
|
||||||
|
|
||||||
// create a configuration provider
|
// create a configuration provider
|
||||||
Reference< XMultiServiceFactory > xConfigurationProvider;
|
Reference< XMultiServiceFactory > xConfigurationProvider(
|
||||||
if ( !_rContext.createComponent( sConfigurationProviderServiceName, xConfigurationProvider ) )
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
throw ServiceNotRegisteredException( sConfigurationProviderServiceName, NULL );
|
_rContext.getUNOContext() ) );
|
||||||
|
|
||||||
// one argument for creating the node access: the path to the configuration node
|
// one argument for creating the node access: the path to the configuration node
|
||||||
Sequence< Any > aCreationArgs(1);
|
Sequence< Any > aCreationArgs(1);
|
||||||
|
@ -77,6 +77,7 @@
|
|||||||
#include <unotools/saveopt.hxx>
|
#include <unotools/saveopt.hxx>
|
||||||
#include <sal/macros.h>
|
#include <sal/macros.h>
|
||||||
|
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/container/XNameReplace.hpp>
|
#include <com/sun/star/container/XNameReplace.hpp>
|
||||||
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
||||||
@ -587,17 +588,14 @@ CanvasSettings::CanvasSettings() :
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
|
|
||||||
Reference<XMultiServiceFactory> xConfigProvider(
|
Reference<XMultiServiceFactory> xConfigProvider(
|
||||||
xFactory->createInstance(
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
|
comphelper::getProcessComponentContext()));
|
||||||
UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
Any propValue(
|
Any propValue(
|
||||||
makeAny( PropertyValue(
|
makeAny( NamedValue(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), -1,
|
OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Canvas")) ),
|
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Canvas")) ) ) ) );
|
||||||
PropertyState_DIRECT_VALUE ) ) );
|
|
||||||
|
|
||||||
mxForceFlagNameAccess.set(
|
mxForceFlagNameAccess.set(
|
||||||
xConfigProvider->createInstanceWithArguments(
|
xConfigProvider->createInstanceWithArguments(
|
||||||
@ -606,10 +604,9 @@ CanvasSettings::CanvasSettings() :
|
|||||||
UNO_QUERY_THROW );
|
UNO_QUERY_THROW );
|
||||||
|
|
||||||
propValue = makeAny(
|
propValue = makeAny(
|
||||||
PropertyValue(
|
NamedValue(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), -1,
|
OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Canvas/CanvasServiceList")) ),
|
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Canvas/CanvasServiceList")) ) ) );
|
||||||
PropertyState_DIRECT_VALUE ) );
|
|
||||||
|
|
||||||
Reference<XNameAccess> xNameAccess(
|
Reference<XNameAccess> xNameAccess(
|
||||||
xConfigProvider->createInstanceWithArguments(
|
xConfigProvider->createInstanceWithArguments(
|
||||||
@ -1230,7 +1227,6 @@ struct LanguageConfig_Impl
|
|||||||
static sal_Bool bLanguageCurrentDoc_Impl = sal_False;
|
static sal_Bool bLanguageCurrentDoc_Impl = sal_False;
|
||||||
|
|
||||||
// some things we'll need...
|
// some things we'll need...
|
||||||
static const OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
|
|
||||||
static const OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess"));
|
static const OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess"));
|
||||||
static const OUString sAccessUpdSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
static const OUString sAccessUpdSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
||||||
static const OUString sInstalledLocalesPath(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office/InstalledLocales"));
|
static const OUString sInstalledLocalesPath(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office/InstalledLocales"));
|
||||||
@ -1293,15 +1289,14 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
|
|||||||
OUString sOfficeLocaleValue;
|
OUString sOfficeLocaleValue;
|
||||||
OUString sSystemLocaleValue;
|
OUString sSystemLocaleValue;
|
||||||
|
|
||||||
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > (
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW);
|
comphelper::getProcessComponentContext()));
|
||||||
Sequence< Any > theArgs(2);
|
Sequence< Any > theArgs(1);
|
||||||
Reference< XNameAccess > theNameAccess;
|
Reference< XNameAccess > theNameAccess;
|
||||||
|
|
||||||
// find out which locales are currently installed and add them to the listbox
|
// find out which locales are currently installed and add them to the listbox
|
||||||
theArgs[0] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")), makeAny(sInstalledLocalesPath)));
|
theArgs[0] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), makeAny(sInstalledLocalesPath)));
|
||||||
theArgs[1] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("reload")), makeAny(sal_True)));
|
|
||||||
theNameAccess = Reference< XNameAccess > (
|
theNameAccess = Reference< XNameAccess > (
|
||||||
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
|
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
|
||||||
seqInstalledLanguages = theNameAccess->getElementNames();
|
seqInstalledLanguages = theNameAccess->getElementNames();
|
||||||
@ -1320,7 +1315,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
|
|||||||
|
|
||||||
// find out whether the user has a specific locale specified
|
// find out whether the user has a specific locale specified
|
||||||
Sequence< Any > theArgs2(1);
|
Sequence< Any > theArgs2(1);
|
||||||
theArgs2[0] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")), makeAny(sUserLocalePath)));
|
theArgs2[0] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), makeAny(sUserLocalePath)));
|
||||||
theNameAccess = Reference< XNameAccess > (
|
theNameAccess = Reference< XNameAccess > (
|
||||||
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
|
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
|
||||||
if (theNameAccess->hasByName(sUserLocaleKey))
|
if (theNameAccess->hasByName(sUserLocaleKey))
|
||||||
@ -1490,11 +1485,11 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
|
|||||||
if( aUserInterfaceLB.GetSelectEntryPos() > 0)
|
if( aUserInterfaceLB.GetSelectEntryPos() > 0)
|
||||||
aLangString = ConvertLanguageToIsoString(aUserInterfaceLB.GetSelectLanguage());
|
aLangString = ConvertLanguageToIsoString(aUserInterfaceLB.GetSelectLanguage());
|
||||||
*/
|
*/
|
||||||
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > (
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW);
|
comphelper::getProcessComponentContext()));
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
theArgs[0] = makeAny(sUserLocalePath);
|
theArgs[0] = makeAny(NamedValue(OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), makeAny(sUserLocalePath)));
|
||||||
Reference< XPropertySet >xProp(
|
Reference< XPropertySet >xProp(
|
||||||
theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
|
theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
|
||||||
if ( !m_sUserLocaleValue.equals(aLangString))
|
if ( !m_sUserLocaleValue.equals(aLangString))
|
||||||
@ -1509,6 +1504,8 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
|
|||||||
|
|
||||||
// tell quickstarter to stop being a veto listener
|
// tell quickstarter to stop being a veto listener
|
||||||
|
|
||||||
|
Reference< XMultiServiceFactory > theMSF(
|
||||||
|
comphelper::getProcessServiceFactory());
|
||||||
Reference< XInitialization > xInit(theMSF->createInstance(
|
Reference< XInitialization > xInit(theMSF->createInstance(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.Quickstart"))), UNO_QUERY);
|
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.Quickstart"))), UNO_QUERY);
|
||||||
if (xInit.is())
|
if (xInit.is())
|
||||||
|
@ -86,9 +86,10 @@
|
|||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <osl/file.hxx>
|
#include <osl/file.hxx>
|
||||||
#include <osl/process.h>
|
#include <osl/process.h>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameReplace.hpp>
|
#include <com/sun/star/container/XNameReplace.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/beans/XPropertyState.hpp>
|
#include <com/sun/star/beans/XPropertyState.hpp>
|
||||||
#include <com/sun/star/util/XChangesBatch.hpp>
|
#include <com/sun/star/util/XChangesBatch.hpp>
|
||||||
@ -224,35 +225,23 @@ SvxProxyTabPage::SvxProxyTabPage(Window* pParent, const SfxItemSet& rSet ) :
|
|||||||
|
|
||||||
aProxyModeLB.SetSelectHdl(LINK( this, SvxProxyTabPage, ProxyHdl_Impl ));
|
aProxyModeLB.SetSelectHdl(LINK( this, SvxProxyTabPage, ProxyHdl_Impl ));
|
||||||
|
|
||||||
Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager(
|
Reference< com::sun::star::lang::XMultiServiceFactory >
|
||||||
::comphelper::getProcessServiceFactory());
|
xConfigurationProvider(
|
||||||
|
configuration::theDefaultProvider::get(
|
||||||
|
comphelper::getProcessComponentContext() ) );
|
||||||
|
|
||||||
if( xServiceManager.is() )
|
OUString aConfigRoot(RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings" ) );
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Reference< com::sun::star::lang::XMultiServiceFactory > xConfigurationProvider =
|
|
||||||
Reference< com::sun::star::lang::XMultiServiceFactory > ( xServiceManager->createInstance( rtl::OUString(
|
|
||||||
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ) ),
|
|
||||||
UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
OUString aConfigRoot(RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings" ) );
|
beans::NamedValue aProperty;
|
||||||
|
aProperty.Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
|
||||||
|
aProperty.Value = makeAny( aConfigRoot );
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
Sequence< Any > aArgumentList( 1 );
|
||||||
aProperty.Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
|
aArgumentList[0] = makeAny( aProperty );
|
||||||
aProperty.Value = makeAny( aConfigRoot );
|
|
||||||
|
|
||||||
Sequence< Any > aArgumentList( 1 );
|
m_xConfigurationUpdateAccess = xConfigurationProvider->createInstanceWithArguments( rtl::OUString(
|
||||||
aArgumentList[0] = makeAny( aProperty );
|
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
|
||||||
|
aArgumentList );
|
||||||
m_xConfigurationUpdateAccess = xConfigurationProvider->createInstanceWithArguments( rtl::OUString(
|
|
||||||
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
|
|
||||||
aArgumentList );
|
|
||||||
}
|
|
||||||
catch ( RuntimeException& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrangeControls_Impl();
|
ArrangeControls_Impl();
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <dialmgr.hxx>
|
#include <dialmgr.hxx>
|
||||||
#include <cuires.hrc>
|
#include <cuires.hrc>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
|
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
|
||||||
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
|
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
|
||||||
@ -342,10 +343,10 @@ IMPL_LINK( SvxOnlineUpdateTabPage, CheckNowHdl_Impl, PushButton *, EMPTYARG )
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xFactory->createInstance( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" )),
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
uno::UNO_QUERY_THROW);
|
comphelper::getProcessComponentContext() ) );
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
beans::NamedValue aProperty;
|
||||||
aProperty.Name = UNISTRING( "nodepath" );
|
aProperty.Name = UNISTRING( "nodepath" );
|
||||||
aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
|
aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
package complex.dbaccess;
|
package complex.dbaccess;
|
||||||
|
|
||||||
|
import com.sun.star.configuration.theDefaultProvider;
|
||||||
import com.sun.star.lang.NotInitializedException;
|
import com.sun.star.lang.NotInitializedException;
|
||||||
import com.sun.star.frame.DoubleInitializationException;
|
import com.sun.star.frame.DoubleInitializationException;
|
||||||
import com.sun.star.awt.XTopWindow;
|
import com.sun.star.awt.XTopWindow;
|
||||||
@ -39,6 +40,7 @@ import com.sun.star.task.XInteractionRequest;
|
|||||||
import com.sun.star.uno.Type;
|
import com.sun.star.uno.Type;
|
||||||
import com.sun.star.uno.UnoRuntime;
|
import com.sun.star.uno.UnoRuntime;
|
||||||
import com.sun.star.frame.XStorable;
|
import com.sun.star.frame.XStorable;
|
||||||
|
import com.sun.star.beans.NamedValue;
|
||||||
import com.sun.star.beans.PropertyValue;
|
import com.sun.star.beans.PropertyValue;
|
||||||
import com.sun.star.beans.XPropertySet;
|
import com.sun.star.beans.XPropertySet;
|
||||||
import com.sun.star.container.XNameContainer;
|
import com.sun.star.container.XNameContainer;
|
||||||
@ -489,11 +491,12 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
|
|||||||
// --------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------
|
||||||
private int impl_setMacroSecurityLevel(int _level) throws Exception
|
private int impl_setMacroSecurityLevel(int _level) throws Exception
|
||||||
{
|
{
|
||||||
final XMultiServiceFactory configProvider = UnoRuntime.queryInterface(XMultiServiceFactory.class, getMSF().createInstance("com.sun.star.configuration.ConfigurationProvider"));
|
final XMultiServiceFactory configProvider = theDefaultProvider.get(
|
||||||
|
getComponentContext());
|
||||||
|
|
||||||
final PropertyValue[] args = new PropertyValue[]
|
final NamedValue[] args = new NamedValue[]
|
||||||
{
|
{
|
||||||
new PropertyValue("nodepath", 0, "/org.openoffice.Office.Common/Security/Scripting", PropertyState.DIRECT_VALUE)
|
new NamedValue("nodepath", "/org.openoffice.Office.Common/Security/Scripting")
|
||||||
};
|
};
|
||||||
|
|
||||||
final XPropertySet securitySettings = UnoRuntime.queryInterface(XPropertySet.class, configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", args));
|
final XPropertySet securitySettings = UnoRuntime.queryInterface(XPropertySet.class, configProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", args));
|
||||||
|
@ -29,7 +29,6 @@ package complex.dbaccess;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import com.sun.star.beans.PropertyValue;
|
import com.sun.star.beans.PropertyValue;
|
||||||
import com.sun.star.beans.XPropertySet;
|
|
||||||
import com.sun.star.frame.XComponentLoader;
|
import com.sun.star.frame.XComponentLoader;
|
||||||
import com.sun.star.frame.XModel;
|
import com.sun.star.frame.XModel;
|
||||||
import com.sun.star.lang.XMultiServiceFactory;
|
import com.sun.star.lang.XMultiServiceFactory;
|
||||||
@ -55,18 +54,7 @@ public abstract class TestCase
|
|||||||
// --------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------
|
||||||
protected final XComponentContext getComponentContext()
|
protected final XComponentContext getComponentContext()
|
||||||
{
|
{
|
||||||
XComponentContext context = null;
|
return connection.getComponentContext();
|
||||||
try
|
|
||||||
{
|
|
||||||
final XPropertySet orbProps = UnoRuntime.queryInterface( XPropertySet.class, getMSF() );
|
|
||||||
context = UnoRuntime.queryInterface( XComponentContext.class,
|
|
||||||
orbProps.getPropertyValue( "DefaultContext" ) );
|
|
||||||
}
|
|
||||||
catch ( Exception ex )
|
|
||||||
{
|
|
||||||
fail( "could not retrieve the ComponentContext" );
|
|
||||||
}
|
|
||||||
return context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------
|
||||||
|
@ -155,7 +155,7 @@ class Desktop : public Application
|
|||||||
void RemoveTemporaryDirectory();
|
void RemoveTemporaryDirectory();
|
||||||
|
|
||||||
sal_Bool InitializeInstallation( const rtl::OUString& rAppFilename );
|
sal_Bool InitializeInstallation( const rtl::OUString& rAppFilename );
|
||||||
sal_Bool InitializeConfiguration();
|
bool InitializeConfiguration();
|
||||||
void FlushConfiguration();
|
void FlushConfiguration();
|
||||||
static sal_Bool shouldLaunchQuickstart();
|
static sal_Bool shouldLaunchQuickstart();
|
||||||
sal_Bool InitializeQuickstartMode( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr );
|
sal_Bool InitializeQuickstartMode( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr );
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
|
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
|
||||||
#include <com/sun/star/document/CorruptedFilterConfigurationException.hpp>
|
#include <com/sun/star/document/CorruptedFilterConfigurationException.hpp>
|
||||||
#include <com/sun/star/configuration/CorruptedConfigurationException.hpp>
|
#include <com/sun/star/configuration/CorruptedConfigurationException.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/frame/XStorable.hpp>
|
#include <com/sun/star/frame/XStorable.hpp>
|
||||||
#include <com/sun/star/util/XModifiable.hpp>
|
#include <com/sun/star/util/XModifiable.hpp>
|
||||||
#include <com/sun/star/util/XFlushable.hpp>
|
#include <com/sun/star/util/XFlushable.hpp>
|
||||||
@ -323,14 +324,6 @@ CommandLineArgs& Desktop::GetCommandLineArgs()
|
|||||||
return theCommandLineArgs::get();
|
return theCommandLineArgs::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool InitConfiguration()
|
|
||||||
{
|
|
||||||
RTL_LOGFILE_CONTEXT( aLog, "desktop (jb99855) ::InitConfiguration" );
|
|
||||||
|
|
||||||
Reference< XMultiServiceFactory > xProvider( CreateApplicationConfigurationProvider( ) );
|
|
||||||
return xProvider.is();
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
struct BrandName
|
struct BrandName
|
||||||
@ -1971,13 +1964,14 @@ IMPL_LINK( Desktop, ImplInitFilterHdl, ConvertData*, pData )
|
|||||||
return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( pData );
|
return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( pData );
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool Desktop::InitializeConfiguration()
|
bool Desktop::InitializeConfiguration()
|
||||||
{
|
{
|
||||||
sal_Bool bOk = sal_False;
|
RTL_LOGFILE_CONTEXT( aLog, "desktop (jb99855) ::InitConfiguration" );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bOk = InitConfiguration();
|
css::configuration::theDefaultProvider::get(
|
||||||
|
comphelper::getProcessComponentContext() );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch( ::com::sun::star::lang::ServiceNotRegisteredException& )
|
catch( ::com::sun::star::lang::ServiceNotRegisteredException& )
|
||||||
{
|
{
|
||||||
@ -2033,19 +2027,14 @@ sal_Bool Desktop::InitializeConfiguration()
|
|||||||
OUString() ));
|
OUString() ));
|
||||||
HandleBootstrapPathErrors( ::utl::Bootstrap::INVALID_BASE_INSTALL, aMsg );
|
HandleBootstrapPathErrors( ::utl::Bootstrap::INVALID_BASE_INSTALL, aMsg );
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
return bOk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Desktop::FlushConfiguration()
|
void Desktop::FlushConfiguration()
|
||||||
{
|
{
|
||||||
css::uno::Reference< css::util::XFlushable >(
|
css::uno::Reference< css::util::XFlushable >(
|
||||||
(css::uno::Reference< css::lang::XMultiServiceFactory >(
|
css::configuration::theDefaultProvider::get(
|
||||||
comphelper::getProcessServiceFactory(), css::uno::UNO_SET_THROW)->
|
comphelper::getProcessComponentContext()),
|
||||||
createInstance(
|
|
||||||
rtl::OUString(
|
|
||||||
RTL_CONSTASCII_USTRINGPARAM(
|
|
||||||
"com.sun.star.configuration.ConfigurationProvider")))),
|
|
||||||
css::uno::UNO_QUERY_THROW)->flush();
|
css::uno::UNO_QUERY_THROW)->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2438,116 +2427,6 @@ void Desktop::PreloadConfigurationData()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
|
|
||||||
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) );
|
|
||||||
|
|
||||||
// get configuration provider
|
|
||||||
Reference< XMultiServiceFactory > xConfigProvider;
|
|
||||||
xConfigProvider = Reference< XMultiServiceFactory > (
|
|
||||||
rFactory->createInstance( sConfigSrvc ),UNO_QUERY );
|
|
||||||
|
|
||||||
if ( xConfigProvider.is() )
|
|
||||||
{
|
|
||||||
// preload writer configuration
|
|
||||||
Sequence< Any > theArgs(1);
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Writer/MailMergeWizard"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriterWeb
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.WriterWeb/Content"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload compatibility
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Compatibility/WriterCompatibilityVersion"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload calc configuration
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Calc/Content"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload impress configuration
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.UI.Effects/UserInterface"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Impress/Layout"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload draw configuration
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Draw/Layout"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload ui configuration
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.UI/FilterClassification"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// preload addons configuration
|
|
||||||
theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Addons/AddonUI"));
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xNameAccess = Reference< XNameAccess >(
|
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY );
|
|
||||||
}
|
|
||||||
catch (::com::sun::star::uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Desktop::OpenClients()
|
void Desktop::OpenClients()
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/util/XChangesBatch.hpp>
|
#include <com/sun/star/util/XChangesBatch.hpp>
|
||||||
|
|
||||||
#include "app.hxx"
|
#include "app.hxx"
|
||||||
@ -46,20 +47,16 @@ using namespace ::desktop;
|
|||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
using namespace ::com::sun::star::beans;
|
using namespace ::com::sun::star::beans;
|
||||||
|
|
||||||
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
|
|
||||||
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
|
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
|
||||||
|
|
||||||
/* Local function - get access to the configuration */
|
/* Local function - get access to the configuration */
|
||||||
static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
|
static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
|
||||||
{
|
{
|
||||||
Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
|
Reference< XMultiServiceFactory > xConfigProvider(
|
||||||
|
configuration::theDefaultProvider::get(
|
||||||
// get configuration provider
|
comphelper::getProcessComponentContext() ) );
|
||||||
Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >(
|
|
||||||
xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
Sequence< Any > aArgs( 1 );
|
Sequence< Any > aArgs( 1 );
|
||||||
NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) );
|
NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ), makeAny( rPath ) );
|
||||||
aArgs[0] <<= aValue;
|
aArgs[0] <<= aValue;
|
||||||
return Reference< XPropertySet >(
|
return Reference< XPropertySet >(
|
||||||
xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
|
xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
|
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include "com/sun/star/deployment/XPackage.hpp"
|
#include "com/sun/star/deployment/XPackage.hpp"
|
||||||
#include "com/sun/star/deployment/ExtensionManager.hpp"
|
#include "com/sun/star/deployment/ExtensionManager.hpp"
|
||||||
#include "com/sun/star/deployment/LicenseException.hpp"
|
#include "com/sun/star/deployment/LicenseException.hpp"
|
||||||
@ -220,7 +221,6 @@ void SilentCommandEnv::pop() throw (uno::RuntimeException)
|
|||||||
} // end namespace
|
} // end namespace
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
|
|
||||||
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
|
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > &xContext )
|
static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > &xContext )
|
||||||
@ -326,13 +326,12 @@ static bool impl_checkDependencies( const uno::Reference< uno::XComponentContext
|
|||||||
static void impl_setNeedsCompatCheck()
|
static void impl_setNeedsCompatCheck()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
// get configuration provider
|
configuration::theDefaultProvider::get(
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
|
comphelper::getProcessComponentContext() ) );
|
||||||
xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")),
|
beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
|
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
|
||||||
theArgs[0] <<= v;
|
theArgs[0] <<= v;
|
||||||
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
|
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
|
||||||
@ -379,13 +378,12 @@ static bool impl_needsCompatCheck()
|
|||||||
rtl::Bootstrap::expandMacros( aCurrentBuildID );
|
rtl::Bootstrap::expandMacros( aCurrentBuildID );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
// get configuration provider
|
configuration::theDefaultProvider::get(
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
|
comphelper::getProcessComponentContext() ) );
|
||||||
xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")),
|
beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
|
||||||
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
|
makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
|
||||||
theArgs[0] <<= v;
|
theArgs[0] <<= v;
|
||||||
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
|
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
|
||||||
|
@ -40,140 +40,24 @@
|
|||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <map>
|
|
||||||
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
|
|
||||||
#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
|
|
||||||
#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
|
|
||||||
#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
|
|
||||||
#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace uno = ::com::sun::star::uno;
|
namespace uno = ::com::sun::star::uno;
|
||||||
namespace lang = ::com::sun::star::lang;
|
namespace lang = ::com::sun::star::lang;
|
||||||
namespace configuration = ::com::sun::star::configuration;
|
|
||||||
namespace backend = ::com::sun::star::configuration::backend;
|
|
||||||
using rtl::OUString;
|
using rtl::OUString;
|
||||||
using uno::UNO_QUERY;
|
using uno::UNO_QUERY;
|
||||||
using desktop::Desktop;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
static char const CONFIGURATION_PROVIDER[] = "com.sun.star.configuration.ConfigurationProvider";
|
|
||||||
|
|
||||||
static char const CONFIGURATION_ERROR_HANDLER[] = "com.sun.star.configuration.backend.InteractionHandler";
|
static char const CONFIGURATION_ERROR_HANDLER[] = "com.sun.star.configuration.backend.InteractionHandler";
|
||||||
|
|
||||||
// must be aligned with configmgr/source/misc/configinteractionhandler
|
// must be aligned with configmgr/source/misc/configinteractionhandler
|
||||||
static char const CONFIG_ERROR_HANDLER[] = "configuration.interaction-handler";
|
static char const CONFIG_ERROR_HANDLER[] = "configuration.interaction-handler";
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
#define arraysize( arr ) ( sizeof (arr)/sizeof *(arr) )
|
|
||||||
|
|
||||||
typedef uno::Reference< lang::XMultiServiceFactory > ConfigurationProvider;
|
|
||||||
|
|
||||||
#define OUSTRING( constascii ) OUString( RTL_CONSTASCII_USTRINGPARAM( constascii ) )
|
#define OUSTRING( constascii ) OUString( RTL_CONSTASCII_USTRINGPARAM( constascii ) )
|
||||||
|
|
||||||
#define OU2O( ustr, enc ) rtl::OUStringToOString( (ustr), RTL_TEXTENCODING_ ## enc )
|
|
||||||
|
|
||||||
#define k_PROVIDER OUSTRING( CONFIGURATION_PROVIDER )
|
|
||||||
#define k_ERRORHANDLER OUSTRING( CONFIGURATION_ERROR_HANDLER )
|
#define k_ERRORHANDLER OUSTRING( CONFIGURATION_ERROR_HANDLER )
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// Get a message string securely. There is a fallback string if the resource
|
|
||||||
// is not available. Adapted from Desktop::GetMsgString()
|
|
||||||
|
|
||||||
OUString getMsgString( sal_uInt16 nId, char const * aFallBackMsg )
|
|
||||||
{
|
|
||||||
ResMgr* pResMgr = Desktop::GetDesktopResManager();
|
|
||||||
if ( !pResMgr || !nId )
|
|
||||||
return OUString::createFromAscii(aFallBackMsg);
|
|
||||||
else
|
|
||||||
return OUString( String(ResId( nId, *pResMgr )));
|
|
||||||
}
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
/** Creates the normal configuration provider.
|
|
||||||
|
|
||||||
*/
|
|
||||||
static
|
|
||||||
ConfigurationProvider createDefaultConfigurationProvider( )
|
|
||||||
{
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
|
|
||||||
|
|
||||||
OSL_ENSURE( xServiceManager.is(),"No ServiceManager set for CreateApplicationConfigurationProvider");
|
|
||||||
|
|
||||||
ConfigurationProvider xProvider;
|
|
||||||
|
|
||||||
if (xServiceManager.is())
|
|
||||||
{
|
|
||||||
|
|
||||||
xProvider.set( xServiceManager->createInstance(k_PROVIDER), UNO_QUERY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!xProvider.is())
|
|
||||||
{
|
|
||||||
OUString const sMsg = OUSTRING("Service \"") + k_PROVIDER +
|
|
||||||
OUSTRING("\" is not available at the service manager.");
|
|
||||||
|
|
||||||
throw lang::ServiceNotRegisteredException(sMsg, xServiceManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
return xProvider;
|
|
||||||
}
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
/// @attention this method must be called from a catch statement!
|
|
||||||
static void handleGeneralException(uno::Exception& aException,
|
|
||||||
const rtl::OUString& aMessage)
|
|
||||||
{
|
|
||||||
aException.Message = aMessage ;
|
|
||||||
throw ;
|
|
||||||
}
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > CreateApplicationConfigurationProvider( )
|
|
||||||
{
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xProvider;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
xProvider = createDefaultConfigurationProvider( );
|
|
||||||
}
|
|
||||||
catch (configuration::InvalidBootstrapFileException & exception)
|
|
||||||
{
|
|
||||||
handleGeneralException(exception,
|
|
||||||
getMsgString( STR_CONFIG_ERR_SETTINGS_INCOMPLETE,
|
|
||||||
"The startup settings for your configuration settings are incomplete. "));
|
|
||||||
}
|
|
||||||
catch (backend::CannotConnectException & exception)
|
|
||||||
{
|
|
||||||
handleGeneralException(exception,
|
|
||||||
getMsgString( STR_CONFIG_ERR_CANNOT_CONNECT,
|
|
||||||
"A connection to your configuration settings could not be established. "));
|
|
||||||
}
|
|
||||||
catch (backend::BackendSetupException & exception)
|
|
||||||
{
|
|
||||||
handleGeneralException(exception,
|
|
||||||
getMsgString( STR_CONFIG_ERR_CANNOT_CONNECT,
|
|
||||||
"A connection to your configuration settings could not be established. "));
|
|
||||||
}
|
|
||||||
catch (configuration::CannotLoadConfigurationException & exception)
|
|
||||||
{
|
|
||||||
handleGeneralException(exception,
|
|
||||||
getMsgString( STR_CONFIG_ERR_CANNOT_CONNECT,
|
|
||||||
"A connection to your configuration settings could not be established. "));
|
|
||||||
}
|
|
||||||
catch (uno::Exception & exception)
|
|
||||||
{
|
|
||||||
handleGeneralException(exception,
|
|
||||||
getMsgString( STR_CONFIG_ERR_ACCESS_GENERAL,
|
|
||||||
"A general error occurred while accessing your configuration settings."));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return xProvider ;
|
|
||||||
}
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// ConfigurationErrorHandler
|
// ConfigurationErrorHandler
|
||||||
|
@ -2,33 +2,8 @@
|
|||||||
#ifndef _DESKTOP_CONFIGINIT_HXX_
|
#ifndef _DESKTOP_CONFIGINIT_HXX_
|
||||||
#define _DESKTOP_CONFIGINIT_HXX_
|
#define _DESKTOP_CONFIGINIT_HXX_
|
||||||
|
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include "sal/config.h"
|
||||||
#include <rtl/ustring.hxx>
|
|
||||||
|
|
||||||
/** creates a ConfigurationProvider instance
|
|
||||||
Important: exceptions thrown from that method will contain a readily
|
|
||||||
displayable message.
|
|
||||||
|
|
||||||
@return
|
|
||||||
The default configuration provider for the application or<br/>
|
|
||||||
<NULL/>, if startup was canceled
|
|
||||||
|
|
||||||
@throw com::sun::star::configuration::CannotLoadConfigurationException
|
|
||||||
if the configuration provider can't be created
|
|
||||||
|
|
||||||
@throw com::sun::star::lang::ServiceNotRegisteredException
|
|
||||||
if the ConfigurationProvider service is unknwon
|
|
||||||
|
|
||||||
@throw com::sun::star::lang::WrappedTargetException
|
|
||||||
if the configuration backend could be created,
|
|
||||||
but incurred a failure later
|
|
||||||
|
|
||||||
*/
|
|
||||||
extern
|
|
||||||
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
|
|
||||||
CreateApplicationConfigurationProvider( );
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
#include <com/sun/star/task/XInteractionHandler.hpp>
|
#include <com/sun/star/task/XInteractionHandler.hpp>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <tools/config.hxx>
|
#include <tools/config.hxx>
|
||||||
#include <i18npool/mslangid.hxx>
|
#include <i18npool/mslangid.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/lang/XComponent.hpp>
|
#include <com/sun/star/lang/XComponent.hpp>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
@ -129,20 +130,10 @@ Locale LanguageSelection::IsoStringToLocale(const OUString& str)
|
|||||||
bool LanguageSelection::prepareLanguage()
|
bool LanguageSelection::prepareLanguage()
|
||||||
{
|
{
|
||||||
m_eStatus = LS_STATUS_OK;
|
m_eStatus = LS_STATUS_OK;
|
||||||
OUString sConfigSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
|
Reference< XLocalizable > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
Reference< XLocalizable > theConfigProvider;
|
comphelper::getProcessComponentContext() ),
|
||||||
try
|
UNO_QUERY_THROW );
|
||||||
{
|
|
||||||
theConfigProvider = Reference< XLocalizable >(theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW );
|
|
||||||
}
|
|
||||||
catch(const Exception&)
|
|
||||||
{
|
|
||||||
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!theConfigProvider.is())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
sal_Bool bSuccess = sal_False;
|
sal_Bool bSuccess = sal_False;
|
||||||
|
|
||||||
@ -225,11 +216,6 @@ bool LanguageSelection::prepareLanguage()
|
|||||||
// this will ensure localized configuration settings to be selected accoring to the
|
// this will ensure localized configuration settings to be selected accoring to the
|
||||||
// UI language.
|
// UI language.
|
||||||
Locale loc = LanguageSelection::IsoStringToLocale(aLocaleString);
|
Locale loc = LanguageSelection::IsoStringToLocale(aLocaleString);
|
||||||
// flush any data already written to the configuration (which
|
|
||||||
// currently uses independent caches for different locales and thus
|
|
||||||
// would ignore data written to another cache):
|
|
||||||
Reference< XFlushable >(theConfigProvider, UNO_QUERY_THROW)->
|
|
||||||
flush();
|
|
||||||
theConfigProvider->setLocale(loc);
|
theConfigProvider->setLocale(loc);
|
||||||
|
|
||||||
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW);
|
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW);
|
||||||
@ -371,7 +357,6 @@ Reference< XNameAccess > LanguageSelection::getConfigAccess(const sal_Char* pPat
|
|||||||
{
|
{
|
||||||
Reference< XNameAccess > xNameAccess;
|
Reference< XNameAccess > xNameAccess;
|
||||||
try{
|
try{
|
||||||
OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
|
|
||||||
OUString sAccessSrvc;
|
OUString sAccessSrvc;
|
||||||
if (bUpdate)
|
if (bUpdate)
|
||||||
sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
||||||
@ -380,19 +365,16 @@ Reference< XNameAccess > LanguageSelection::getConfigAccess(const sal_Char* pPat
|
|||||||
|
|
||||||
OUString sConfigURL = OUString::createFromAscii(pPath);
|
OUString sConfigURL = OUString::createFromAscii(pPath);
|
||||||
|
|
||||||
// get configuration provider
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
if (theMSF.is()) {
|
comphelper::getProcessComponentContext() ) );
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > (
|
|
||||||
theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
// access the provider
|
// access the provider
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
theArgs[ 0 ] <<= sConfigURL;
|
theArgs[ 0 ] <<= sConfigURL;
|
||||||
xNameAccess = Reference< XNameAccess > (
|
xNameAccess = Reference< XNameAccess > (
|
||||||
theConfigProvider->createInstanceWithArguments(
|
theConfigProvider->createInstanceWithArguments(
|
||||||
sAccessSrvc, theArgs ), UNO_QUERY_THROW );
|
sAccessSrvc, theArgs ), UNO_QUERY_THROW );
|
||||||
}
|
|
||||||
} catch (com::sun::star::uno::Exception& e)
|
} catch (com::sun::star::uno::Exception& e)
|
||||||
{
|
{
|
||||||
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
|
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include <svl/languageoptions.hxx>
|
#include <svl/languageoptions.hxx>
|
||||||
#include <unotools/syslocaleoptions.hxx>
|
#include <unotools/syslocaleoptions.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
@ -82,19 +83,13 @@ namespace desktop {
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OUString sConfigSrvc(
|
|
||||||
RTL_CONSTASCII_USTRINGPARAM(
|
|
||||||
"com.sun.star.configuration.ConfigurationProvider" ) );
|
|
||||||
OUString sAccessSrvc(
|
OUString sAccessSrvc(
|
||||||
RTL_CONSTASCII_USTRINGPARAM(
|
RTL_CONSTASCII_USTRINGPARAM(
|
||||||
"com.sun.star.configuration.ConfigurationAccess" ) );
|
"com.sun.star.configuration.ConfigurationAccess" ) );
|
||||||
|
|
||||||
// get configuration provider
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theMSF
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
= comphelper::getProcessServiceFactory();
|
comphelper::getProcessComponentContext() ) );
|
||||||
Reference< XMultiServiceFactory > theConfigProvider
|
|
||||||
= Reference< XMultiServiceFactory >(
|
|
||||||
theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
// localize the provider to user selection
|
// localize the provider to user selection
|
||||||
Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
|
Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
|
||||||
@ -104,7 +99,7 @@ namespace desktop {
|
|||||||
|
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
NamedValue v;
|
NamedValue v;
|
||||||
v.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath"));
|
v.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
|
||||||
v.Value = makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")));
|
v.Value = makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")));
|
||||||
theArgs[0] <<= v;
|
theArgs[0] <<= v;
|
||||||
Reference< XHierarchicalNameAccess> hnacc(
|
Reference< XHierarchicalNameAccess> hnacc(
|
||||||
@ -261,15 +256,13 @@ namespace desktop {
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
|
|
||||||
OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
||||||
|
|
||||||
// get configuration provider
|
Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
|
comphelper::getProcessComponentContext() ) );
|
||||||
theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
|
|
||||||
Sequence< Any > theArgs(1);
|
Sequence< Any > theArgs(1);
|
||||||
NamedValue v(OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")), makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"))));
|
NamedValue v(OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"))));
|
||||||
theArgs[0] <<= v;
|
theArgs[0] <<= v;
|
||||||
Reference< XHierarchicalPropertySet> hpset(
|
Reference< XHierarchicalPropertySet> hpset(
|
||||||
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
|
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "toolkit/helper/vclunohelper.hxx"
|
#include "toolkit/helper/vclunohelper.hxx"
|
||||||
|
|
||||||
#include "com/sun/star/beans/XPropertySet.hpp"
|
#include "com/sun/star/beans/XPropertySet.hpp"
|
||||||
|
#include "com/sun/star/configuration/theDefaultProvider.hpp"
|
||||||
|
|
||||||
#include "dp_gui_dialog2.hxx"
|
#include "dp_gui_dialog2.hxx"
|
||||||
#include "dp_gui_extensioncmdqueue.hxx"
|
#include "dp_gui_extensioncmdqueue.hxx"
|
||||||
@ -75,8 +76,7 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
|
|||||||
m_xExtensionManager->addModifyListener( this );
|
m_xExtensionManager->addModifyListener( this );
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfig(
|
uno::Reference< lang::XMultiServiceFactory > xConfig(
|
||||||
xContext->getServiceManager()->createInstanceWithContext(
|
configuration::theDefaultProvider::get(xContext));
|
||||||
OUSTR("com.sun.star.configuration.ConfigurationProvider"), xContext ), uno::UNO_QUERY_THROW);
|
|
||||||
uno::Any args[1];
|
uno::Any args[1];
|
||||||
beans::PropertyValue aValue( OUSTR("nodepath"), 0, uno::Any( OUSTR("/org.openoffice.Office.OptionsDialog/Nodes") ),
|
beans::PropertyValue aValue( OUSTR("nodepath"), 0, uno::Any( OUSTR("/org.openoffice.Office.OptionsDialog/Nodes") ),
|
||||||
beans::PropertyState_DIRECT_VALUE );
|
beans::PropertyState_DIRECT_VALUE );
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "com/sun/star/beans/Optional.hpp"
|
#include "com/sun/star/beans/Optional.hpp"
|
||||||
#include "com/sun/star/beans/PropertyValue.hpp"
|
#include "com/sun/star/beans/PropertyValue.hpp"
|
||||||
#include "com/sun/star/beans/XPropertySet.hpp"
|
#include "com/sun/star/beans/XPropertySet.hpp"
|
||||||
|
#include "com/sun/star/configuration/theDefaultProvider.hpp"
|
||||||
#include "com/sun/star/container/XNameAccess.hpp"
|
#include "com/sun/star/container/XNameAccess.hpp"
|
||||||
#include "com/sun/star/container/XNameContainer.hpp"
|
#include "com/sun/star/container/XNameContainer.hpp"
|
||||||
#include "com/sun/star/deployment/DeploymentException.hpp"
|
#include "com/sun/star/deployment/DeploymentException.hpp"
|
||||||
@ -845,10 +846,9 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
|
|||||||
// notify update check job
|
// notify update check job
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xFactory->createInstance( OUSTR( "com.sun.star.configuration.ConfigurationProvider" )),
|
configuration::theDefaultProvider::get(
|
||||||
uno::UNO_QUERY_THROW);
|
comphelper::getProcessComponentContext()));
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
beans::PropertyValue aProperty;
|
||||||
aProperty.Name = OUSTR( "nodepath" );
|
aProperty.Name = OUSTR( "nodepath" );
|
||||||
@ -865,6 +865,7 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
|
|||||||
util::URL aURL;
|
util::URL aURL;
|
||||||
xNameAccess->getByName(OUSTR("URL")) >>= aURL.Complete;
|
xNameAccess->getByName(OUSTR("URL")) >>= aURL.Complete;
|
||||||
|
|
||||||
|
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
|
||||||
uno::Reference < util::XURLTransformer > xTransformer( xFactory->createInstance( OUSTR( "com.sun.star.util.URLTransformer" ) ),
|
uno::Reference < util::XURLTransformer > xTransformer( xFactory->createInstance( OUSTR( "com.sun.star.util.URLTransformer" ) ),
|
||||||
uno::UNO_QUERY_THROW );
|
uno::UNO_QUERY_THROW );
|
||||||
|
|
||||||
@ -1082,8 +1083,8 @@ bool UpdateDialog::showDescription( const String& rDescription, bool bWithPublis
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void UpdateDialog::getIgnoredUpdates()
|
void UpdateDialog::getIgnoredUpdates()
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfig( m_context->getServiceManager()->createInstanceWithContext(
|
uno::Reference< lang::XMultiServiceFactory > xConfig(
|
||||||
OUSTR("com.sun.star.configuration.ConfigurationProvider"), m_context ), uno::UNO_QUERY_THROW);
|
configuration::theDefaultProvider::get(m_context));
|
||||||
beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
|
beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
|
||||||
uno::Sequence< uno::Any > args(1);
|
uno::Sequence< uno::Any > args(1);
|
||||||
args[0] <<= aValue;
|
args[0] <<= aValue;
|
||||||
@ -1108,8 +1109,8 @@ void UpdateDialog::storeIgnoredUpdates()
|
|||||||
{
|
{
|
||||||
if ( m_bModified && ( !m_ignoredUpdates.empty() ) )
|
if ( m_bModified && ( !m_ignoredUpdates.empty() ) )
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfig( m_context->getServiceManager()->createInstanceWithContext(
|
uno::Reference< lang::XMultiServiceFactory > xConfig(
|
||||||
OUSTR("com.sun.star.configuration.ConfigurationProvider"), m_context ), uno::UNO_QUERY_THROW );
|
configuration::theDefaultProvider::get(m_context));
|
||||||
beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
|
beans::NamedValue aValue( OUSTR("nodepath"), uno::Any( IGNORED_UPDATES ) );
|
||||||
uno::Sequence< uno::Any > args(1);
|
uno::Sequence< uno::Any > args(1);
|
||||||
args[0] <<= aValue;
|
args[0] <<= aValue;
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include <unotools/configmgr.hxx>
|
#include <unotools/configmgr.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/configuration/Update.hpp>
|
#include <com/sun/star/configuration/Update.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <com/sun/star/task/XJob.hpp>
|
#include <com/sun/star/task/XJob.hpp>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
@ -349,13 +350,10 @@ sal_Bool MigrationImpl::doMigration()
|
|||||||
|
|
||||||
void MigrationImpl::refresh()
|
void MigrationImpl::refresh()
|
||||||
{
|
{
|
||||||
uno::Reference< XRefreshable > xRefresh(m_xFactory->createInstance(
|
uno::Reference< XRefreshable >(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), uno::UNO_QUERY);
|
configuration::theDefaultProvider::get(
|
||||||
if (xRefresh.is())
|
comphelper::getComponentContext(m_xFactory)),
|
||||||
xRefresh->refresh();
|
uno::UNO_QUERY_THROW)->refresh();
|
||||||
else
|
|
||||||
OSL_FAIL("could not get XRefresh interface from default config provider. No refresh done.");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MigrationImpl::setMigrationCompleted()
|
void MigrationImpl::setMigrationCompleted()
|
||||||
@ -854,7 +852,6 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa
|
|||||||
{
|
{
|
||||||
uno::Reference< XNameAccess > xNameAccess;
|
uno::Reference< XNameAccess > xNameAccess;
|
||||||
try{
|
try{
|
||||||
OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
|
|
||||||
OUString sAccessSrvc;
|
OUString sAccessSrvc;
|
||||||
if (bUpdate)
|
if (bUpdate)
|
||||||
sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
|
||||||
@ -863,10 +860,9 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa
|
|||||||
|
|
||||||
OUString sConfigURL = OUString::createFromAscii(pPath);
|
OUString sConfigURL = OUString::createFromAscii(pPath);
|
||||||
|
|
||||||
// get configuration provider
|
uno::Reference< XMultiServiceFactory > theConfigProvider(
|
||||||
uno::Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
|
configuration::theDefaultProvider::get(
|
||||||
uno::Reference< XMultiServiceFactory > theConfigProvider = uno::Reference< XMultiServiceFactory > (
|
comphelper::getProcessComponentContext()));
|
||||||
theMSF->createInstance( sConfigSrvc ),uno::UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
// access the provider
|
// access the provider
|
||||||
uno::Sequence< uno::Any > theArgs(1);
|
uno::Sequence< uno::Any > theArgs(1);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
package com.sun.star.comp.extensionoptions;
|
package com.sun.star.comp.extensionoptions;
|
||||||
|
|
||||||
|
import com.sun.star.configuration.theDefaultProvider;
|
||||||
import com.sun.star.lib.uno.helper.Factory;
|
import com.sun.star.lib.uno.helper.Factory;
|
||||||
import com.sun.star.lib.uno.helper.WeakBase;
|
import com.sun.star.lib.uno.helper.WeakBase;
|
||||||
import com.sun.star.lang.XMultiComponentFactory;
|
import com.sun.star.lang.XMultiComponentFactory;
|
||||||
@ -49,8 +50,7 @@ import com.sun.star.awt.XControlModel;
|
|||||||
import com.sun.star.awt.XControlContainer;
|
import com.sun.star.awt.XControlContainer;
|
||||||
import com.sun.star.container.XNameAccess;
|
import com.sun.star.container.XNameAccess;
|
||||||
import com.sun.star.container.NoSuchElementException;
|
import com.sun.star.container.NoSuchElementException;
|
||||||
import com.sun.star.beans.PropertyValue;
|
import com.sun.star.beans.NamedValue;
|
||||||
import com.sun.star.beans.PropertyState;
|
|
||||||
import com.sun.star.beans.XPropertySet;
|
import com.sun.star.beans.XPropertySet;
|
||||||
import com.sun.star.beans.UnknownPropertyException;
|
import com.sun.star.beans.UnknownPropertyException;
|
||||||
import com.sun.star.beans.PropertyVetoException;
|
import com.sun.star.beans.PropertyVetoException;
|
||||||
@ -93,24 +93,15 @@ public class OptionsEventHandler {
|
|||||||
//Create the com.sun.star.configuration.ConfigurationUpdateAccess
|
//Create the com.sun.star.configuration.ConfigurationUpdateAccess
|
||||||
//for the registry node which contains the data for our option
|
//for the registry node which contains the data for our option
|
||||||
//pages.
|
//pages.
|
||||||
XMultiServiceFactory xConfig;
|
XMultiServiceFactory xConfig = theDefaultProvider.get(m_cmpCtx);
|
||||||
try {
|
|
||||||
xConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(
|
|
||||||
XMultiServiceFactory.class,
|
|
||||||
m_cmpCtx.getServiceManager().createInstanceWithContext(
|
|
||||||
"com.sun.star.configuration.ConfigurationProvider", m_cmpCtx));
|
|
||||||
} catch (com.sun.star.uno.Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//One argument for creating the ConfigurationUpdateAccess is the "nodepath".
|
//One argument for creating the ConfigurationUpdateAccess is the "nodepath".
|
||||||
//Our nodepath point to the node of which the direct subnodes represent the
|
//Our nodepath point to the node of which the direct subnodes represent the
|
||||||
//different options pages.
|
//different options pages.
|
||||||
Object[] args = new Object[1];
|
Object[] args = new Object[1];
|
||||||
args[0] = new PropertyValue(
|
args[0] = new NamedValue(
|
||||||
"nodepath", 0, "/org.openoffice.desktop.deployment.options.ExtensionData/Leaves",
|
"nodepath",
|
||||||
PropertyState.DIRECT_VALUE);
|
"/org.openoffice.desktop.deployment.options.ExtensionData/Leaves");
|
||||||
|
|
||||||
//We get the com.sun.star.container.XNameAccess from the instance of
|
//We get the com.sun.star.container.XNameAccess from the instance of
|
||||||
//ConfigurationUpdateAccess and save it for later use.
|
//ConfigurationUpdateAccess and save it for later use.
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include <rtl/instance.hxx>
|
#include <rtl/instance.hxx>
|
||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/beans/Optional.hpp>
|
#include <com/sun/star/beans/Optional.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <osl/security.hxx>
|
#include <osl/security.hxx>
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@ -68,10 +69,7 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex
|
|||||||
{
|
{
|
||||||
bReentrantCall = true ;
|
bReentrantCall = true ;
|
||||||
if (!readLdapConfiguration(
|
if (!readLdapConfiguration(
|
||||||
css::uno::Reference< css::lang::XMultiServiceFactory >(
|
xContext, &aDefinition, &loggedOnUser))
|
||||||
xContext->getServiceManager(),
|
|
||||||
css::uno::UNO_QUERY_THROW),
|
|
||||||
&aDefinition, &loggedOnUser))
|
|
||||||
{
|
{
|
||||||
throw css::uno::RuntimeException(
|
throw css::uno::RuntimeException(
|
||||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LdapUserProfileBe- LDAP not configured")),
|
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LdapUserProfileBe- LDAP not configured")),
|
||||||
@ -100,11 +98,10 @@ LdapUserProfileBe::~LdapUserProfileBe()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool LdapUserProfileBe::readLdapConfiguration(
|
bool LdapUserProfileBe::readLdapConfiguration(
|
||||||
css::uno::Reference< css::lang::XMultiServiceFactory > const & factory,
|
css::uno::Reference< css::uno::XComponentContext > const & context,
|
||||||
LdapDefinition * definition, rtl::OUString * loggedOnUser)
|
LdapDefinition * definition, rtl::OUString * loggedOnUser)
|
||||||
{
|
{
|
||||||
OSL_ASSERT(factory.is() && definition != 0 && loggedOnUser != 0);
|
OSL_ASSERT(context.is() && definition != 0 && loggedOnUser != 0);
|
||||||
const rtl::OUString kConfigurationProviderService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ;
|
|
||||||
const rtl::OUString kReadOnlyViewService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")) ;
|
const rtl::OUString kReadOnlyViewService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")) ;
|
||||||
const rtl::OUString kComponent( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.LDAP/UserDirectory"));
|
const rtl::OUString kComponent( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.LDAP/UserDirectory"));
|
||||||
const rtl::OUString kServerDefiniton(RTL_CONSTASCII_USTRINGPARAM ("ServerDefinition"));
|
const rtl::OUString kServerDefiniton(RTL_CONSTASCII_USTRINGPARAM ("ServerDefinition"));
|
||||||
@ -120,11 +117,7 @@ bool LdapUserProfileBe::readLdapConfiguration(
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xCfgProvider(
|
uno::Reference< lang::XMultiServiceFactory > xCfgProvider(
|
||||||
factory->createInstance(kConfigurationProviderService),
|
css::configuration::theDefaultProvider::get(context));
|
||||||
uno::UNO_QUERY);
|
|
||||||
OSL_ENSURE(xCfgProvider.is(),"LdapUserProfileBe: could not create the configuration provider");
|
|
||||||
if (!xCfgProvider.is())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
css::beans::NamedValue aPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), uno::makeAny(kComponent) );
|
css::beans::NamedValue aPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), uno::makeAny(kComponent) );
|
||||||
|
|
||||||
|
@ -31,15 +31,17 @@
|
|||||||
|
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/lang/IllegalArgumentException.hpp>
|
#include <com/sun/star/lang/IllegalArgumentException.hpp>
|
||||||
#include <cppuhelper/compbase2.hxx>
|
#include <cppuhelper/compbase2.hxx>
|
||||||
|
|
||||||
#include "ldapaccess.hxx"
|
#include "ldapaccess.hxx"
|
||||||
|
|
||||||
|
namespace com { namespace sun { namespace star { namespace uno {
|
||||||
|
class XComponentContext;
|
||||||
|
} } } }
|
||||||
|
|
||||||
namespace extensions { namespace config { namespace ldap {
|
namespace extensions { namespace config { namespace ldap {
|
||||||
|
|
||||||
namespace css = com::sun::star ;
|
namespace css = com::sun::star ;
|
||||||
@ -144,7 +146,7 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
|
|||||||
private:
|
private:
|
||||||
/** Check if LDAP is configured */
|
/** Check if LDAP is configured */
|
||||||
bool readLdapConfiguration(
|
bool readLdapConfiguration(
|
||||||
uno::Reference<lang::XMultiServiceFactory> const & factory,
|
uno::Reference<uno::XComponentContext> const & context,
|
||||||
LdapDefinition * definition, rtl::OUString * loggedOnUser);
|
LdapDefinition * definition, rtl::OUString * loggedOnUser);
|
||||||
|
|
||||||
bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess,
|
bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess,
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "loggerconfig.hxx"
|
#include "loggerconfig.hxx"
|
||||||
|
|
||||||
/** === begin UNO includes === **/
|
/** === begin UNO includes === **/
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <com/sun/star/container/XNameContainer.hpp>
|
#include <com/sun/star/container/XNameContainer.hpp>
|
||||||
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
||||||
@ -214,11 +215,9 @@ namespace logging
|
|||||||
if ( !_rxLogger.is() )
|
if ( !_rxLogger.is() )
|
||||||
throw NullPointerException();
|
throw NullPointerException();
|
||||||
|
|
||||||
// the configuration provider
|
Reference< XMultiServiceFactory > xConfigProvider(
|
||||||
Reference< XMultiServiceFactory > xConfigProvider;
|
com::sun::star::configuration::theDefaultProvider::get(
|
||||||
::rtl::OUString sConfigProvServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
|
_rContext.getUNOContext()));
|
||||||
if ( !_rContext.createComponent( sConfigProvServiceName, xConfigProvider ) )
|
|
||||||
throw ServiceNotRegisteredException( sConfigProvServiceName, _rxLogger );
|
|
||||||
|
|
||||||
// write access to the "Settings" node (which includes settings for all loggers)
|
// write access to the "Settings" node (which includes settings for all loggers)
|
||||||
Sequence< Any > aArguments(1);
|
Sequence< Any > aArguments(1);
|
||||||
|
@ -60,6 +60,7 @@ SLOFILES= \
|
|||||||
$(SLO)$/soapsender.obj \
|
$(SLO)$/soapsender.obj \
|
||||||
|
|
||||||
SHL1STDLIBS= \
|
SHL1STDLIBS= \
|
||||||
|
$(COMPHELPERLIB) \
|
||||||
$(CPPUHELPERLIB) \
|
$(CPPUHELPERLIB) \
|
||||||
$(CPPULIB) \
|
$(CPPULIB) \
|
||||||
$(SALLIB) \
|
$(SALLIB) \
|
||||||
|
@ -30,32 +30,23 @@
|
|||||||
#include "precompiled_extensions.hxx"
|
#include "precompiled_extensions.hxx"
|
||||||
|
|
||||||
#include "myconfigurationhelper.hxx"
|
#include "myconfigurationhelper.hxx"
|
||||||
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/container/XNameContainer.hpp>
|
#include <com/sun/star/container/XNameContainer.hpp>
|
||||||
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
namespace css = ::com::sun::star;
|
namespace css = ::com::sun::star;
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
using ::rtl::OUString;
|
using ::rtl::OUString;
|
||||||
using ::rtl::OUStringBuffer;
|
using ::rtl::OUStringBuffer;
|
||||||
using ::std::vector;
|
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
static const Sequence<Any> sequenceFromVector(const vector<Any>& vec)
|
|
||||||
{
|
|
||||||
Sequence<Any> result(vec.size());
|
|
||||||
for(size_t idx = 0; idx < vec.size(); ++idx)
|
|
||||||
result[idx] = vec[idx];
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
static const OUString noSuchElement(const OUString& path)
|
static const OUString noSuchElement(const OUString& path)
|
||||||
{
|
{
|
||||||
OUStringBuffer buf(256);
|
OUStringBuffer buf(256);
|
||||||
@ -74,30 +65,16 @@ namespace oooimprovement
|
|||||||
sal_Int32 eMode)
|
sal_Int32 eMode)
|
||||||
{
|
{
|
||||||
Reference<XMultiServiceFactory> xConfigProvider(
|
Reference<XMultiServiceFactory> xConfigProvider(
|
||||||
xSMGR->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
|
css::configuration::theDefaultProvider::get(
|
||||||
UNO_QUERY_THROW);
|
comphelper::getComponentContext(xSMGR)));
|
||||||
|
|
||||||
vector<Any> lParams;
|
css::uno::Sequence<Any> lParams(1);
|
||||||
css::beans::PropertyValue aParam;
|
css::beans::NamedValue aParam;
|
||||||
|
|
||||||
// set root path
|
// set root path
|
||||||
aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
|
aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
|
||||||
aParam.Value <<= sPackage;
|
aParam.Value <<= sPackage;
|
||||||
lParams.push_back(makeAny(aParam));
|
lParams[0] = makeAny(aParam);
|
||||||
|
|
||||||
// enable all locales mode
|
|
||||||
if ((eMode & MyConfigurationHelper::E_ALL_LOCALES)==MyConfigurationHelper::E_ALL_LOCALES)
|
|
||||||
{
|
|
||||||
aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("locale"));
|
|
||||||
aParam.Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
|
|
||||||
lParams.push_back(makeAny(aParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
// enable lazy writing
|
|
||||||
sal_Bool bLazy = ((eMode & MyConfigurationHelper::E_LAZY_WRITE)==MyConfigurationHelper::E_LAZY_WRITE);
|
|
||||||
aParam.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("lazywrite"));
|
|
||||||
aParam.Value = makeAny(bLazy);
|
|
||||||
lParams.push_back(makeAny(aParam));
|
|
||||||
|
|
||||||
// open it
|
// open it
|
||||||
Reference<XInterface> xCFG;
|
Reference<XInterface> xCFG;
|
||||||
@ -106,11 +83,11 @@ namespace oooimprovement
|
|||||||
if (bReadOnly)
|
if (bReadOnly)
|
||||||
xCFG = xConfigProvider->createInstanceWithArguments(
|
xCFG = xConfigProvider->createInstanceWithArguments(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
|
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
|
||||||
sequenceFromVector(lParams));
|
lParams);
|
||||||
else
|
else
|
||||||
xCFG = xConfigProvider->createInstanceWithArguments(
|
xCFG = xConfigProvider->createInstanceWithArguments(
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")),
|
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")),
|
||||||
sequenceFromVector(lParams));
|
lParams);
|
||||||
return xCFG;
|
return xCFG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,10 +61,6 @@ namespace oooimprovement
|
|||||||
E_STANDARD = 0,
|
E_STANDARD = 0,
|
||||||
/// configuration will be opened readonly
|
/// configuration will be opened readonly
|
||||||
E_READONLY = 1,
|
E_READONLY = 1,
|
||||||
/// all localized nodes will be interpreted as css::uno::XInterface instead of interpreting it as atomic value nodes
|
|
||||||
E_ALL_LOCALES = 2,
|
|
||||||
/// enable lazy writing
|
|
||||||
E_LAZY_WRITE = 4
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
|
|
||||||
@ -194,21 +195,8 @@ progress_callback( void *clientp, double dltotal, double dlnow, double ultotal,
|
|||||||
void
|
void
|
||||||
Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int32& rPort) const
|
Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int32& rPort) const
|
||||||
{
|
{
|
||||||
if( !m_xContext.is() )
|
|
||||||
throw uno::RuntimeException(
|
|
||||||
UNISTRING( "Download: empty component context" ),
|
|
||||||
uno::Reference< uno::XInterface >() );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiComponentFactory > xServiceManager(m_xContext->getServiceManager());
|
|
||||||
|
|
||||||
if( !xServiceManager.is() )
|
|
||||||
throw uno::RuntimeException(
|
|
||||||
UNISTRING( "Download: unable to obtain service manager from component context" ),
|
|
||||||
uno::Reference< uno::XInterface >() );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), m_xContext ),
|
com::sun::star::configuration::theDefaultProvider::get( m_xContext ) );
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
beans::PropertyValue aProperty;
|
||||||
aProperty.Name = UNISTRING( "nodepath" );
|
aProperty.Name = UNISTRING( "nodepath" );
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
#include <com/sun/star/beans/XPropertyState.hpp>
|
#include <com/sun/star/beans/XPropertyState.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
||||||
#include <osl/security.hxx>
|
#include <osl/security.hxx>
|
||||||
#include <osl/time.h>
|
#include <osl/time.h>
|
||||||
@ -269,21 +270,8 @@ UpdateCheckConfig::get(
|
|||||||
const uno::Reference<uno::XComponentContext>& xContext,
|
const uno::Reference<uno::XComponentContext>& xContext,
|
||||||
const ::rtl::Reference< UpdateCheckConfigListener >& rListener)
|
const ::rtl::Reference< UpdateCheckConfigListener >& rListener)
|
||||||
{
|
{
|
||||||
if( !xContext.is() )
|
|
||||||
throw uno::RuntimeException(
|
|
||||||
UNISTRING( "UpdateCheckConfig: empty component context" ),
|
|
||||||
uno::Reference< uno::XInterface >() );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager());
|
|
||||||
|
|
||||||
if( !xServiceManager.is() )
|
|
||||||
throw uno::RuntimeException(
|
|
||||||
UNISTRING( "UpdateCheckConfig: unable to obtain service manager from component context" ),
|
|
||||||
uno::Reference< uno::XInterface >() );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), xContext ),
|
com::sun::star::configuration::theDefaultProvider::get( xContext ) );
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
beans::PropertyValue aProperty;
|
||||||
aProperty.Name = UNISTRING( "nodepath" );
|
aProperty.Name = UNISTRING( "nodepath" );
|
||||||
|
@ -60,6 +60,8 @@
|
|||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
#include "com/sun/star/beans/XPropertySet.hpp"
|
#include "com/sun/star/beans/XPropertySet.hpp"
|
||||||
|
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
|
|
||||||
#include "com/sun/star/container/XNameContainer.hpp"
|
#include "com/sun/star/container/XNameContainer.hpp"
|
||||||
|
|
||||||
#include "com/sun/star/frame/XDesktop.hpp"
|
#include "com/sun/star/frame/XDesktop.hpp"
|
||||||
@ -861,17 +863,8 @@ void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > & r
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void UpdateHandler::setFullVersion( rtl::OUString& rString )
|
void UpdateHandler::setFullVersion( rtl::OUString& rString )
|
||||||
{
|
{
|
||||||
if( !mxContext.is() )
|
|
||||||
throw uno::RuntimeException( UNISTRING( "getProductName: empty component context" ), *this );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() );
|
|
||||||
|
|
||||||
if( !xServiceManager.is() )
|
|
||||||
throw uno::RuntimeException( UNISTRING( "getProductName: unable to obtain service manager from component context" ), *this );
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider(
|
||||||
xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" ), mxContext ),
|
com::sun::star::configuration::theDefaultProvider::get( mxContext ) );
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
beans::PropertyValue aProperty;
|
beans::PropertyValue aProperty;
|
||||||
aProperty.Name = UNISTRING( "nodepath" );
|
aProperty.Name = UNISTRING( "nodepath" );
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
#include <cppuhelper/implementationentry.hxx>
|
#include <cppuhelper/implementationentry.hxx>
|
||||||
#include <com/sun/star/beans/Property.hpp>
|
#include <com/sun/star/beans/Property.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/deployment/UpdateInformationEntry.hpp>
|
#include <com/sun/star/deployment/UpdateInformationEntry.hpp>
|
||||||
#include <com/sun/star/deployment/UpdateInformationProvider.hpp>
|
#include <com/sun/star/deployment/UpdateInformationProvider.hpp>
|
||||||
@ -338,17 +339,8 @@ UpdateInformationProvider::UpdateInformationProvider(
|
|||||||
m_xContentProvider(xContentProvider), m_xDocumentBuilder(xDocumentBuilder),
|
m_xContentProvider(xContentProvider), m_xDocumentBuilder(xDocumentBuilder),
|
||||||
m_xXPathAPI(xXPathAPI), m_aRequestHeaderList(1)
|
m_xXPathAPI(xXPathAPI), m_aRequestHeaderList(1)
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager());
|
|
||||||
if( !xServiceManager.is() )
|
|
||||||
throw uno::RuntimeException(
|
|
||||||
UNISTRING("unable to obtain service manager from component context"),
|
|
||||||
uno::Reference< uno::XInterface >());
|
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider(
|
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider(
|
||||||
xServiceManager->createInstanceWithContext(
|
com::sun::star::configuration::theDefaultProvider::get(xContext));
|
||||||
UNISTRING("com.sun.star.configuration.ConfigurationProvider"),
|
|
||||||
xContext ),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
|
|
||||||
rtl::OUStringBuffer buf;
|
rtl::OUStringBuffer buf;
|
||||||
rtl::OUString name;
|
rtl::OUString name;
|
||||||
@ -448,7 +440,7 @@ UpdateInformationProvider::~UpdateInformationProvider()
|
|||||||
uno::Any
|
uno::Any
|
||||||
UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServiceFactory> const & configurationProvider, rtl::OUString const & node, rtl::OUString const & item)
|
UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServiceFactory> const & configurationProvider, rtl::OUString const & node, rtl::OUString const & item)
|
||||||
{
|
{
|
||||||
beans::PropertyValue aProperty;
|
beans::NamedValue aProperty;
|
||||||
aProperty.Name = UNISTRING("nodepath");
|
aProperty.Name = UNISTRING("nodepath");
|
||||||
aProperty.Value = uno::makeAny(node);
|
aProperty.Value = uno::makeAny(node);
|
||||||
|
|
||||||
|
1
filter/source/config/cache/constant.hxx
vendored
1
filter/source/config/cache/constant.hxx
vendored
@ -182,7 +182,6 @@ extern rtl::OUString pFilterStrings[];
|
|||||||
|
|
||||||
/** @short some uno service names.
|
/** @short some uno service names.
|
||||||
*/
|
*/
|
||||||
#define SERVICE_CONFIGURATIONPROVIDER _FILTER_CONFIG_FROM_ASCII_("com.sun.star.configuration.ConfigurationProvider" )
|
|
||||||
#define SERVICE_CONFIGURATIONUPDATEACCESS _FILTER_CONFIG_FROM_ASCII_("com.sun.star.configuration.ConfigurationUpdateAccess" )
|
#define SERVICE_CONFIGURATIONUPDATEACCESS _FILTER_CONFIG_FROM_ASCII_("com.sun.star.configuration.ConfigurationUpdateAccess" )
|
||||||
#define SERVICE_CONFIGURATIONACCESS _FILTER_CONFIG_FROM_ASCII_("com.sun.star.configuration.ConfigurationAccess" )
|
#define SERVICE_CONFIGURATIONACCESS _FILTER_CONFIG_FROM_ASCII_("com.sun.star.configuration.ConfigurationAccess" )
|
||||||
#define SERVICE_URLTRANSFORMER _FILTER_CONFIG_FROM_ASCII_("com.sun.star.util.URLTransformer" )
|
#define SERVICE_URLTRANSFORMER _FILTER_CONFIG_FROM_ASCII_("com.sun.star.util.URLTransformer" )
|
||||||
|
10
filter/source/config/cache/filtercache.cxx
vendored
10
filter/source/config/cache/filtercache.cxx
vendored
@ -41,9 +41,11 @@
|
|||||||
|
|
||||||
//_______________________________________________
|
//_______________________________________________
|
||||||
// includes
|
// includes
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/util/XChangesBatch.hpp>
|
#include <com/sun/star/util/XChangesBatch.hpp>
|
||||||
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
||||||
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
||||||
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/beans/XProperty.hpp>
|
#include <com/sun/star/beans/XProperty.hpp>
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
@ -962,13 +964,11 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_createConfigAccess
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider(
|
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider(
|
||||||
m_xSMGR->createInstance(SERVICE_CONFIGURATIONPROVIDER), css::uno::UNO_QUERY);
|
css::configuration::theDefaultProvider::get(
|
||||||
|
comphelper::getComponentContext(m_xSMGR)));
|
||||||
if (!xConfigProvider.is())
|
|
||||||
return css::uno::Reference< css::uno::XInterface >();
|
|
||||||
|
|
||||||
::comphelper::SequenceAsVector< css::uno::Any > lParams;
|
::comphelper::SequenceAsVector< css::uno::Any > lParams;
|
||||||
css::beans::PropertyValue aParam ;
|
css::beans::NamedValue aParam;
|
||||||
|
|
||||||
// set root path
|
// set root path
|
||||||
aParam.Name = _FILTER_CONFIG_FROM_ASCII_("nodepath");
|
aParam.Name = _FILTER_CONFIG_FROM_ASCII_("nodepath");
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
#include <com/sun/star/uno/Any.hxx>
|
#include <com/sun/star/uno/Any.hxx>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
|
#include <com/sun/star/configuration/theDefaultProvider.hpp>
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
||||||
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
|
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
|
||||||
@ -97,38 +98,30 @@ String GetStorageType( const SvGlobalName& aEmbName )
|
|||||||
|
|
||||||
sal_Bool UseOldMSExport()
|
sal_Bool UseOldMSExport()
|
||||||
{
|
{
|
||||||
uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
|
uno::Reference< lang::XMultiServiceFactory > xProvider(
|
||||||
|
configuration::theDefaultProvider::get(
|
||||||
if ( xFactory.is() )
|
comphelper::getProcessComponentContext()));
|
||||||
{
|
try {
|
||||||
uno::Reference< lang::XMultiServiceFactory > xProvider( xFactory->createInstance(
|
uno::Sequence< uno::Any > aArg( 1 );
|
||||||
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider"))),
|
aArg[0] <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/InternalMSExport") );
|
||||||
uno::UNO_QUERY);
|
uno::Reference< container::XNameAccess > xNameAccess(
|
||||||
if ( xProvider.is() )
|
xProvider->createInstanceWithArguments(
|
||||||
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
|
||||||
|
aArg ),
|
||||||
|
uno::UNO_QUERY );
|
||||||
|
if ( xNameAccess.is() )
|
||||||
{
|
{
|
||||||
try {
|
uno::Any aResult = xNameAccess->getByName(
|
||||||
uno::Sequence< uno::Any > aArg( 1 );
|
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOldExport" ) ) );
|
||||||
aArg[0] <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/InternalMSExport") );
|
|
||||||
uno::Reference< container::XNameAccess > xNameAccess(
|
|
||||||
xProvider->createInstanceWithArguments(
|
|
||||||
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
|
|
||||||
aArg ),
|
|
||||||
uno::UNO_QUERY );
|
|
||||||
if ( xNameAccess.is() )
|
|
||||||
{
|
|
||||||
uno::Any aResult = xNameAccess->getByName(
|
|
||||||
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOldExport" ) ) );
|
|
||||||
|
|
||||||
sal_Bool bResult = sal_Bool();
|
sal_Bool bResult = sal_Bool();
|
||||||
if ( aResult >>= bResult )
|
if ( aResult >>= bResult )
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
|
||||||
}
|
|
||||||
catch( uno::Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch( uno::Exception& )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
OSL_FAIL( "Could not get access to configuration entry!\n" );
|
OSL_FAIL( "Could not get access to configuration entry!\n" );
|
||||||
return sal_False;
|
return sal_False;
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
#include "vcl/graphictools.hxx"
|
#include "vcl/graphictools.hxx"
|
||||||
#include "com/sun/star/beans/XPropertySet.hpp"
|
#include "com/sun/star/beans/XPropertySet.hpp"
|
||||||
|
#include "com/sun/star/configuration/theDefaultProvider.hpp"
|
||||||
#include "com/sun/star/awt/Rectangle.hpp"
|
#include "com/sun/star/awt/Rectangle.hpp"
|
||||||
#include "com/sun/star/awt/XDevice.hpp"
|
#include "com/sun/star/awt/XDevice.hpp"
|
||||||
#include "com/sun/star/util/MeasureUnit.hpp"
|
#include "com/sun/star/util/MeasureUnit.hpp"
|
||||||
@ -325,55 +326,51 @@ static OUString getMimetypeForDocument( const Reference< XMultiServiceFactory >&
|
|||||||
// get the actual filter name
|
// get the actual filter name
|
||||||
OUString aFilterName;
|
OUString aFilterName;
|
||||||
Reference< lang::XMultiServiceFactory > xConfigProvider(
|
Reference< lang::XMultiServiceFactory > xConfigProvider(
|
||||||
xFactory->createInstance(
|
configuration::theDefaultProvider::get(
|
||||||
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ) ),
|
comphelper::getComponentContext( xFactory ) ) );
|
||||||
uno::UNO_QUERY );
|
uno::Sequence< uno::Any > aArgs( 1 );
|
||||||
if( xConfigProvider.is() )
|
beans::NamedValue aPathProp;
|
||||||
|
aPathProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
|
||||||
|
aPathProp.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Setup/Office/Factories/" ) );
|
||||||
|
aArgs[0] <<= aPathProp;
|
||||||
|
|
||||||
|
Reference< container::XNameAccess > xSOFConfig(
|
||||||
|
xConfigProvider->createInstanceWithArguments(
|
||||||
|
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) ),
|
||||||
|
aArgs ),
|
||||||
|
uno::UNO_QUERY );
|
||||||
|
|
||||||
|
Reference< container::XNameAccess > xApplConfig;
|
||||||
|
xSOFConfig->getByName( aDocServiceName ) >>= xApplConfig;
|
||||||
|
if ( xApplConfig.is() )
|
||||||
{
|
{
|
||||||
uno::Sequence< uno::Any > aArgs( 1 );
|
xApplConfig->getByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualFilter" ) ) ) >>= aFilterName;
|
||||||
beans::PropertyValue aPathProp;
|
if( aFilterName.getLength() )
|
||||||
aPathProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
|
{
|
||||||
aPathProp.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Setup/Office/Factories/" ) );
|
// find the related type name
|
||||||
aArgs[0] <<= aPathProp;
|
OUString aTypeName;
|
||||||
|
Reference< container::XNameAccess > xFilterFactory(
|
||||||
Reference< container::XNameAccess > xSOFConfig(
|
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" )) ),
|
||||||
xConfigProvider->createInstanceWithArguments(
|
|
||||||
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) ),
|
|
||||||
aArgs ),
|
|
||||||
uno::UNO_QUERY );
|
uno::UNO_QUERY );
|
||||||
|
|
||||||
Reference< container::XNameAccess > xApplConfig;
|
Sequence< beans::PropertyValue > aFilterData;
|
||||||
xSOFConfig->getByName( aDocServiceName ) >>= xApplConfig;
|
xFilterFactory->getByName( aFilterName ) >>= aFilterData;
|
||||||
if ( xApplConfig.is() )
|
for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ )
|
||||||
{
|
if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) )
|
||||||
xApplConfig->getByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualFilter" ) ) ) >>= aFilterName;
|
aFilterData[nInd].Value >>= aTypeName;
|
||||||
if( aFilterName.getLength() )
|
|
||||||
|
if ( aTypeName.getLength() )
|
||||||
{
|
{
|
||||||
// find the related type name
|
// find the mediatype
|
||||||
OUString aTypeName;
|
Reference< container::XNameAccess > xTypeDetection(
|
||||||
Reference< container::XNameAccess > xFilterFactory(
|
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" )) ),
|
||||||
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" )) ),
|
UNO_QUERY );
|
||||||
uno::UNO_QUERY );
|
|
||||||
|
|
||||||
Sequence< beans::PropertyValue > aFilterData;
|
Sequence< beans::PropertyValue > aTypeData;
|
||||||
xFilterFactory->getByName( aFilterName ) >>= aFilterData;
|
xTypeDetection->getByName( aTypeName ) >>= aTypeData;
|
||||||
for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ )
|
for ( sal_Int32 nInd = 0; nInd < aTypeData.getLength(); nInd++ )
|
||||||
if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) )
|
if ( aTypeData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) )
|
||||||
aFilterData[nInd].Value >>= aTypeName;
|
aTypeData[nInd].Value >>= aDocMimetype;
|
||||||
|
|
||||||
if ( aTypeName.getLength() )
|
|
||||||
{
|
|
||||||
// find the mediatype
|
|
||||||
Reference< container::XNameAccess > xTypeDetection(
|
|
||||||
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" )) ),
|
|
||||||
UNO_QUERY );
|
|
||||||
|
|
||||||
Sequence< beans::PropertyValue > aTypeData;
|
|
||||||
xTypeDetection->getByName( aTypeName ) >>= aTypeData;
|
|
||||||
for ( sal_Int32 nInd = 0; nInd < aTypeData.getLength(); nInd++ )
|
|
||||||
if ( aTypeData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) )
|
|
||||||
aTypeData[nInd].Value >>= aDocMimetype;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ import com.sun.star.awt.XMessageBoxFactory;
|
|||||||
import com.sun.star.awt.XWindowPeer;
|
import com.sun.star.awt.XWindowPeer;
|
||||||
import com.sun.star.beans.NamedValue;
|
import com.sun.star.beans.NamedValue;
|
||||||
import com.sun.star.beans.XPropertySet;
|
import com.sun.star.beans.XPropertySet;
|
||||||
|
import com.sun.star.configuration.theDefaultProvider;
|
||||||
import com.sun.star.container.XNameAccess;
|
import com.sun.star.container.XNameAccess;
|
||||||
import com.sun.star.frame.XModel;
|
import com.sun.star.frame.XModel;
|
||||||
import com.sun.star.lang.XComponent;
|
import com.sun.star.lang.XComponent;
|
||||||
@ -410,8 +411,7 @@ public class Inspector{
|
|||||||
sAccess = "com.sun.star.configuration.ConfigurationAccess";
|
sAccess = "com.sun.star.configuration.ConfigurationAccess";
|
||||||
}
|
}
|
||||||
XMultiComponentFactory xMCF = m_xComponentContext.getServiceManager();
|
XMultiComponentFactory xMCF = m_xComponentContext.getServiceManager();
|
||||||
Object oDefaultProvider = xMCF.createInstanceWithContext("com.sun.star.configuration.DefaultProvider", this.getXComponentContext());
|
XMultiServiceFactory xMSFCfg = theDefaultProvider.get(this.getXComponentContext());
|
||||||
XMultiServiceFactory xMSFCfg = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDefaultProvider);
|
|
||||||
Object oAccess = xMSFCfg.createInstanceWithArguments(sAccess, new Object[]{new NamedValue("nodepath", _sNodePath)});
|
Object oAccess = xMSFCfg.createInstanceWithArguments(sAccess, new Object[]{new NamedValue("nodepath", _sNodePath)});
|
||||||
xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oAccess);
|
xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oAccess);
|
||||||
} catch (com.sun.star.uno.Exception e) {
|
} catch (com.sun.star.uno.Exception e) {
|
||||||
|
@ -66,6 +66,7 @@ $(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,offapi,offapi/com/sun/star/char
|
|||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,offapi,offapi/com/sun/star/configuration,\
|
$(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,offapi,offapi/com/sun/star/configuration,\
|
||||||
Update \
|
Update \
|
||||||
|
theDefaultProvider \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment,\
|
$(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment,\
|
||||||
ExtensionManager \
|
ExtensionManager \
|
||||||
|
@ -44,7 +44,8 @@ module com { module sun { module star { module configuration {
|
|||||||
the default <type>ConfigurationProvider</type> for its
|
the default <type>ConfigurationProvider</type> for its
|
||||||
<type scope="com::sun::star::uno">XComponentContext</type>.
|
<type scope="com::sun::star::uno">XComponentContext</type>.
|
||||||
|
|
||||||
<p>This object is accessible as singleton within the context</p>.
|
<p>This object is accessible as singleton
|
||||||
|
<type>theDefaultProvider</type></p>.
|
||||||
|
|
||||||
@since OOo 1.1.2
|
@since OOo 1.1.2
|
||||||
*/
|
*/
|
||||||
|
54
offapi/com/sun/star/configuration/theDefaultProvider.idl
Normal file
54
offapi/com/sun/star/configuration/theDefaultProvider.idl
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License or as specified alternatively below. You may obtain a copy of
|
||||||
|
* the License at http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* Major Contributor(s):
|
||||||
|
* [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman@redhat.com> (initial
|
||||||
|
* developer) ]
|
||||||
|
*
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
* For minor contributions see the git repository.
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
|
||||||
|
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
|
||||||
|
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
|
||||||
|
* instead of those above.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDED_COM_SUN_STAR_CONFIGURATION_THEDEFAULTPROVIDER_IDL
|
||||||
|
#define INCLUDED_COM_SUN_STAR_CONFIGURATION_THEDEFAULTPROVIDER_IDL
|
||||||
|
|
||||||
|
module com { module sun { module star { module lang {
|
||||||
|
published interface XMultiServiceFactory;
|
||||||
|
}; }; }; };
|
||||||
|
|
||||||
|
module com { module sun { module star { module configuration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
The default <type>ConfigurationProvider</type>.
|
||||||
|
|
||||||
|
<p>This singleton somewhat arbitrarily makes available the
|
||||||
|
<type scope="com::sun::star::lang">XMultiServiceFactory</type> interface of
|
||||||
|
the (old-style) <type>DefaultProvider</type> service, as it is the most
|
||||||
|
frequently used one. See the <type>DefaultProvider</type> service for
|
||||||
|
details.</p>
|
||||||
|
|
||||||
|
@since OOo 1.1.2
|
||||||
|
*/
|
||||||
|
published singleton theDefaultProvider:
|
||||||
|
com::sun::star::lang::XMultiServiceFactory;
|
||||||
|
|
||||||
|
}; }; }; };
|
||||||
|
|
||||||
|
#endif
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
package mod._configmgr;
|
package mod._configmgr;
|
||||||
|
|
||||||
|
import com.sun.star.configuration.theDefaultProvider;
|
||||||
import com.sun.star.uno.AnyConverter;
|
import com.sun.star.uno.AnyConverter;
|
||||||
import com.sun.star.uno.XInterface;
|
import com.sun.star.uno.XInterface;
|
||||||
import lib.TestCase;
|
import lib.TestCase;
|
||||||
@ -44,9 +45,7 @@ public final class DefaultProvider extends TestCase {
|
|||||||
return ProviderTestEnvironment.create(
|
return ProviderTestEnvironment.create(
|
||||||
AnyConverter.toObject(
|
AnyConverter.toObject(
|
||||||
XInterface.class,
|
XInterface.class,
|
||||||
tParam.getComponentContext().getValueByName(
|
theDefaultProvider.get(tParam.getComponentContext())));
|
||||||
"/singletons/" +
|
|
||||||
"com.sun.star.configuration.theDefaultProvider")));
|
|
||||||
} catch (com.sun.star.lang.IllegalArgumentException e) {
|
} catch (com.sun.star.lang.IllegalArgumentException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -650,7 +650,7 @@ function fgetL10Nvalue() as string
|
|||||||
dim args(0) as new com.sun.star.beans.NamedValue
|
dim args(0) as new com.sun.star.beans.NamedValue
|
||||||
args(0).Name = "nodepath"
|
args(0).Name = "nodepath"
|
||||||
args(0).Value = "/org.openoffice.Setup/L10N"
|
args(0).Value = "/org.openoffice.Setup/L10N"
|
||||||
fgetL10Nvalue = hGetUNOService().createInstance("com.sun.star.configuration.DefaultProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args()).getByName("ooLocale")
|
fgetL10Nvalue = com.sun.star.configuration.theDefaultProvider.get.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args()).getByName("ooLocale")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
'-------------------------------------------------------------------------
|
'-------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user